Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopbinary-search
The organizer’s problem statement is available at the official source link.
sample trace
Minimum Cost Paths: binary search walkthrough
Minimum Cost Paths: use the linked editorial?s binary search idea on the published sample, then verify the displayed output.
Published input5 4
1 100 100 20
20
1 1
2 1
3 1
4 1
5 1
1 2
2 2
3 2
4 2
5 2
1 3
2 3
3 3
4 3
5 3
1 4
2 4
3 4
4 4
5 4modelAlgorithm ideaSearch a monotone boundary by repeatedly testing a midpoint with the editorial?s feasibility condition.task resultExpected output0
1
2
3
4
1
5
11
19
29
2
9
20
35
54
3
13
29
49
69
- 1
Range
Set the candidate interval for the quantity the task asks to minimize or maximize. - 2
Test
Evaluate the task?s feasibility condition at the midpoint. - 3
Narrow
Keep the half containing the true boundary until the answer is determined. - 4
Verify the sample
Use the published sample output to check the result of this idea on the displayed input.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.