← All problemsSign in

Colorful Tree (Easy Version)

CodeChefRating 1568Open on judge ↗

**This is the easy version of the problem. The difference with the hard version is highlighted in bold.** You are given a [tree](https://en.wikipedia.org/wiki/Tree_(graph_theory)) containing $N$ vertices and $N-1$ undirected edges. You have to color each vertex of the tree either red, blue, or green. Each vertex must receive exactly one color, and there should also be at least one vertex having

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start