Codeforces Round 1092 (Unrated, Div. 1, Based on THUPC 2026 — Finals)

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
2215 Codeforces Round 1092 (Unrated, Div. 1, Based on THUPC 2026 — Finals) FINISHED False 10800 4494296 April 12, 2026, 5:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 193 ) E Star Map PROGRAMMING constructive algorithms data structures geometry greedy

Funni-chan loves watching stars. There are (n) stars in the sky, which can be regarded as points on a plane with Cartesian coordinates. The coordinates of the (i)-th star are ((x_i, y_i)). It is guaranteed that all (x_1, x_2, \ldots, x_n) are pairwise distinct, and all (y_1, y_2, \ldots, y_n) are pairwise distinct. The stars are numbered from (1) to (n) in the order they are given in the input. Funni-chan wants to connect some pairs of these stars to form a constellation. She defines the basic unit of a constellation as a triangle formed by three stars connected pairwise. A triangle is called harmonious if there exists an axis-aligned rectangle such that all three vertices of the triangle lie on the boundary of the rectangle. Funni-chan imposes the following constraints on the constellation: Every triangle in the constellation must be harmonious . The interiors of any two triangles in the constellation must be disjoint. Note that the boundary of a triangle is not considered part of its interior. Under these constraints, Funni-chan wants her constellation to contain the maximum possible number of triangles. Your task is to find this maximum number and construct a valid constellation that achieves it. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 2\cdot 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((3 \le n \le 2 \cdot 10^5)) — the number of stars. Each of the next (n) lines contains two integers (x_i) and (y_i) ((-10^9\le x_i, y_i \le 10^9)) — the coordinates of the (i)-th star. It is guaranteed that all (x_i)-s are pairwise distinct, and all (y_i)-s are pairwise distinct. It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). In the first line of each test case, you should print a single integer (m) ($$$0\le m\le

Tutorials

152930

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
370791674 rlakkh E April 12, 2026, 8:09 a.m. OK C++17 (GCC 7-32) TESTS 49 296 14643200
370792213 temporary1 E April 12, 2026, 8:13 a.m. OK C++17 (GCC 7-32) TESTS 49 328 10342400
370785266 potato167 E April 12, 2026, 7:25 a.m. OK C++17 (GCC 7-32) TESTS 49 343 11468800
370785710 RockyYue E April 12, 2026, 7:28 a.m. OK C++17 (GCC 7-32) TESTS 49 359 17408000
370827980 lagrange_i_f E April 12, 2026, 1:25 p.m. OK C++17 (GCC 7-32) TESTS 49 437 20684800
370771719 HBPlayer E April 12, 2026, 6:13 a.m. OK C++17 (GCC 7-32) TESTS 49 437 68300800
370783665 keisuke6 E April 12, 2026, 7:15 a.m. OK C++17 (GCC 7-32) TESTS 49 515 23142400
370822460 superyijin E April 12, 2026, 12:38 p.m. OK C++17 (GCC 7-32) TESTS 49 1000 6144000
370878419 qqqaaazzz E April 13, 2026, 12:47 a.m. OK C++17 (GCC 7-32) TESTS 49 1203 45977600
370789949 Weiqu0852 E April 12, 2026, 7:57 a.m. OK C++20 (GCC 13-64) TESTS 49 109 8908800
370817499 xvtianze E April 12, 2026, 11:56 a.m. OK C++20 (GCC 13-64) TESTS 49 187 43212800
370872847 teraqqq E April 12, 2026, 9:44 p.m. OK C++20 (GCC 13-64) TESTS 49 203 10035200
370810095 SATSKY_2025target_LGM E April 12, 2026, 10:49 a.m. OK C++20 (GCC 13-64) TESTS 49 218 11264000
370835200 yxl1 E April 12, 2026, 2:28 p.m. OK C++20 (GCC 13-64) TESTS 49 234 11264000
370818025 Wonter E April 12, 2026, noon OK C++20 (GCC 13-64) TESTS 49 234 14028800
370786055 Rubikun E April 12, 2026, 7:30 a.m. OK C++20 (GCC 13-64) TESTS 49 250 9830400
370807569 Wonter E April 12, 2026, 10:26 a.m. OK C++20 (GCC 13-64) TESTS 49 250 27033600
370782884 NanYan E April 12, 2026, 7:10 a.m. OK C++20 (GCC 13-64) TESTS 49 250 29593600
370858446 RaresPoinaru E April 12, 2026, 6:08 p.m. OK C++20 (GCC 13-64) TESTS 49 281 21401600
370782664 masy2011 E April 12, 2026, 7:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 125 23552000
370831623 ttamx E April 12, 2026, 1:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 203 8294400
370792849 Yuichiro17 E April 12, 2026, 8:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 203 9625600
370847034 darheb E April 12, 2026, 4:15 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 203 9728000
370845550 Behrad. E April 12, 2026, 4:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 49 203 9728000
370782232 rgnerdplayer E April 12, 2026, 7:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 203 9728000
370784848 Network_Error E April 12, 2026, 7:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 218 21504000
370787563 cuom1999 E April 12, 2026, 7:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 250 12595200
370770127 LLI_E_P_JI_O_K E April 12, 2026, 6:07 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 250 13824000
370790749 El_Matador55 E April 12, 2026, 8:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 49 250 21606400
370793164 im_xRayVN E April 12, 2026, 8:20 a.m. OK PyPy 3-64 TESTS 49 1203 96358400
370781710 harurun4635 E April 12, 2026, 7:03 a.m. OK PyPy 3-64 TESTS 49 1671 104857600

remove filters

Back to search problems