← All problemsSign in

At least One

CodeChefRating 2400Open on judge ↗

We define $f(A)$ as the minimum positive integer $X$ such that the following condition holds: - For each $i$ ($1 \le i \le |A|$), there exists $j \ne i$ ($1 \le j \le |A|$), such that $|A_i - A_j| \le X$. For arrays of size $1$, i.e. $|A| = 1$, we define $f(A) = 0$. For other arrays, it can be proven there exists at least one such integer. --- You are given an integer $N$. Let $B = [1, 2, 3, \

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