Colorful Triangles
CodeChefOpen on judge ↗
Fluffy has a graph of n vertices and m edges. Each edge has a color ci. Three vertices a, b, c form a triangle if and only if there is an edge connecting a and b, b and c, a and c respectively. A triangle is called colorful if all three of its edges are of pairwise distinct colors. Fluffy wants to find all colorful triangles in the graph. Can you help him? Input The first line contains 3 space
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.
Sign in to chat with the tutor and save your progress.
Sign in to start