I - Prime Difference Graph
CodeChefOpen on judge ↗
An array $A$ consisting of $N$ integers is said to be *good* if it satisfies each of the following conditions: - All elements are positive integers, i.e. $A_i > 0$ for all $1 \le i \le N$. - The array is strictly increasing, i.e. $A_i > A_{i - 1}$ for all $2 \le i \le N$. - Consider an undirected graph $G$ on $N$ nodes, where we add an edge between $X$ and $Y$ ($X \ne Y$) if and only if $|A_X -
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