← All problemsSign in

Sudesh and Graphs

Sudesh found a simple connected graph. The vertices are numbered 1 through n. The i-th edge connects Vertex ui and vi, and has a fixed integer i . Sudesh is trying to write a positive integer in each vertex so that the following condition is satisfied: For every edge i, the sum of the positive integers written in Vertex ui and vi is equal to si . Find the number of such ways to write positive int

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