Codeforces Global Round 31 (Div. 1 + Div. 2)

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
2180 Codeforces Global Round 31 (Div. 1 + Div. 2) FINISHED False 9000 10250722 Dec. 19, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 4218 ) D Insolvable Disks PROGRAMMING greedy math

You are given (n) different integer points (x_1 < x_2 < \ldots < x_n) on the X-axis of the plane. For each (1 \le i \le n), you have to pick a real value (r_i > 0) and draw a disk with radius (r_i) and center (x_i) such that no two disks overlap. You want to choose values (r_i) in such a way that the number of tangent pairs of disks is maximized, and you have to find this maximum value. We say that two disks overlap if the area of their intersection is positive. In particular, two outer tangent disks do not overlap. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1 \le n \le 2\cdot10^6)) — the number of points in that test case. The second line of each test case contains (n) integers (x_1, x_2, \ldots x_n) ((0 \le x_1 < x_2 < \ldots < x_n \le 10^9)) — the coordinates of the points in that test case. It's also guaranteed that the sum of (n) over all test cases is at most (2\cdot10^6). For each test case, print a single integer denoting the maximum number of tangent pairs of disks in that test case. In the first test case, you can let (r_1 = r_3 = 0.25) and (r_2 = 0.75) so the 1-st and 2-nd disks and the 2-nd and 3-rd disks will be pairwise tangent. In the second test case, you can let (r_1 = 0.4), (r_2 = 0.6), (r_3 = 0.2), and (r_4 = 0.8) so the 1-st and 2-nd disks and 3-rd and 4-th disks will be pairwise tangent. The best solution in the third test case is to set (r_i = 0.5) for each (1 \le i \le 6) so the 1-st and 2-nd disks, 3-rd and 4-th disks, and 5-th and 6-th disks will be pairwise tangent. Link to the visualizer

Tutorials

Codeforces Global Round 31

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
354212913 fleamoted_16 D Dec. 19, 2025, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 22 125 4300800
354216182 alonso284 D Dec. 19, 2025, 5:02 p.m. OK C++17 (GCC 7-32) TESTS 22 390 8089600
354252678 Nicolas125841 D Dec. 20, 2025, 2:58 a.m. OK C++17 (GCC 7-32) TESTS 22 421 4096000
354229628 mxnuj_ D Dec. 19, 2025, 6:48 p.m. OK C++17 (GCC 7-32) TESTS 22 421 4096000
354250193 j.e14 D Dec. 20, 2025, 2:01 a.m. OK C++17 (GCC 7-32) TESTS 22 421 8089600
354249652 ___PatrickChen___ D Dec. 20, 2025, 1:48 a.m. OK C++17 (GCC 7-32) TESTS 22 421 8089600
354215741 znfifuncduqjklvmx D Dec. 19, 2025, 5:01 p.m. OK C++17 (GCC 7-32) TESTS 22 421 12185600
354260165 indranil_d D Dec. 20, 2025, 4:56 a.m. OK C++17 (GCC 7-32) TESTS 22 421 16691200
354207405 CezarForces D Dec. 19, 2025, 4:43 p.m. OK C++17 (GCC 7-32) TESTS 22 421 28160000
354265810 vivek_kushwah9387 D Dec. 20, 2025, 5:57 a.m. OK C++17 (GCC 7-32) TESTS 22 437 4096000
354250055 2745518585 D Dec. 20, 2025, 1:58 a.m. OK C++20 (GCC 13-64) TESTS 22 93 24166400
354210906 MYJBCHX D Dec. 19, 2025, 4:51 p.m. OK C++20 (GCC 13-64) TESTS 22 93 25702400
354231336 guptaparth1911 D Dec. 19, 2025, 7:07 p.m. OK C++20 (GCC 13-64) TESTS 22 328 8089600
354256373 yxl1 D Dec. 20, 2025, 4:04 a.m. OK C++20 (GCC 13-64) TESTS 22 328 12185600
354232834 nikhil_thogaru D Dec. 19, 2025, 7:25 p.m. OK C++20 (GCC 13-64) TESTS 22 343 4198400
354242818 melonseeds D Dec. 19, 2025, 10:05 p.m. OK C++20 (GCC 13-64) TESTS 22 343 8089600
354231921 fanhuaxingyu D Dec. 19, 2025, 7:15 p.m. OK C++20 (GCC 13-64) TESTS 22 343 8089600
354253197 anya_Cf D Dec. 20, 2025, 3:08 a.m. OK C++20 (GCC 13-64) TESTS 22 343 12185600
354228572 Siddhesh_24 D Dec. 19, 2025, 6:38 p.m. OK C++20 (GCC 13-64) TESTS 22 343 12185600
354214555 amrDOTk D Dec. 19, 2025, 4:59 p.m. OK C++20 (GCC 13-64) TESTS 22 343 12185600

remove filters

Back to search problems