Codeforces Round 1098 (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
2228 Codeforces Round 1098 (Div. 2) FINISHED False 8100 1437887 May 16, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2364 ) D Sanae, Cross and Color PROGRAMMING data structures implementation

Upon the mountain, Sanae gazes at the stars. Faith, for her, is where winds encounter one another and choices diverge, and it is the point where all directions meet. For the glory of the Holy Cross, let us trace the sign of faith together. There are (n) distinct integer points in the plane, where the (i)-th point is located at ((x_i,y_i)). To color the points, choose two integers (k_1) and (k_2) such that each of the four regions divided by the lines (x=k_1+0.5) and (y=k_2+0.5) contains at least one point . Each point ((x,y)) is colored according to the region it lies in: Top-left ((x\leq k_1) and (y \gt k_2)): the point is colored red. Top-right ((x \gt k_1) and (y \gt k_2)): the point is colored green. Bottom-left ((x\leq k_1) and (y\leq k_2)): the point is colored blue. Bottom-right ((x \gt k_1) and (y\leq k_2)): the point is colored yellow. Find the number of distinct colorings, where two colorings are considered distinct if and only if there exists at least one point colored differently, regardless of the choice of (k_1) and (k_2). 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 an integer (n) ((4 \leq n \leq 2 \cdot 10^6)). The following (n) lines each contain two integers (x_i), (y_i) ((1 \leq x_i, y_i \leq n)), representing the coordinates of the (i)-th point. It is guaranteed that the points are pairwise distinct in each test case. It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^6). For each test case, output the number of distinct colorings. In the first test case, no valid cross exists. In the second test case, choosing (x = y = 2) yields a valid coloring. It can be proved that this coloring is unique. In the third test case, a valid coloring

Tutorials

Codeforces Round 1098 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
374869996 magikrap D May 16, 2026, 7:56 p.m. OK C++17 (GCC 7-32) TESTS 30 437 42188800
374846889 hi_anonym D May 16, 2026, 4:35 p.m. OK C++17 (GCC 7-32) TESTS 30 828 111513600
374901021 W_Franklin D May 17, 2026, 5:29 a.m. OK C++17 (GCC 7-32) TESTS 30 843 64204800
374898878 CosmoRied D May 17, 2026, 5:06 a.m. OK C++17 (GCC 7-32) TESTS 30 859 51404800
374901121 W_Franklin D May 17, 2026, 5:30 a.m. OK C++17 (GCC 7-32) TESTS 30 859 64204800
374869450 magikrap D May 16, 2026, 7:49 p.m. OK C++17 (GCC 7-32) TESTS 30 906 50176000
374901659 nikh_prians D May 17, 2026, 5:36 a.m. OK C++17 (GCC 7-32) TESTS 30 906 61132800
374849639 2-qiym D May 16, 2026, 4:40 p.m. OK C++17 (GCC 7-32) TESTS 30 937 70963200
374874427 rafaeLL D May 16, 2026, 9:04 p.m. OK C++17 (GCC 7-32) TESTS 30 953 67276800
374850820 pranavvj123 D May 16, 2026, 4:42 p.m. OK C++17 (GCC 7-32) TESTS 30 953 69222400
374855413 sriv0310 D May 16, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 30 218 40140800
374864876 SATSKY_2025target_LGM D May 16, 2026, 7:05 p.m. OK C++20 (GCC 13-64) TESTS 30 687 28979200
374848027 aakashtarang D May 16, 2026, 4:37 p.m. OK C++20 (GCC 13-64) TESTS 30 734 70144000
374846715 repmann D May 16, 2026, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 30 750 83968000
374852005 minus_M1 D May 16, 2026, 4:44 p.m. OK C++20 (GCC 13-64) TESTS 30 750 144179200
374846388 MannyHeffley D May 16, 2026, 4:34 p.m. OK C++20 (GCC 13-64) TESTS 30 781 51404800
374903086 KatsuXD D May 17, 2026, 5:50 a.m. OK C++20 (GCC 13-64) TESTS 30 796 51404800
374853387 arnavrana07 D May 16, 2026, 4:47 p.m. OK C++20 (GCC 13-64) TESTS 30 796 51404800
374854183 AbdulAlim D May 16, 2026, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 30 812 51404800
374846173 durduryu_one D May 16, 2026, 4:33 p.m. OK C++20 (GCC 13-64) TESTS 30 828 42188800
374854794 nestor48956 D May 16, 2026, 4:49 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 296 151654400
374848803 xiaoming111 D May 16, 2026, 4:38 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 437 41881600
374889256 y_himanshu D May 17, 2026, 3:31 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 468 56320000
374865327 424479543 D May 16, 2026, 7:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 546 77312000
374900906 darrenhp D May 17, 2026, 5:28 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 609 59494400
374888124 DreamChaser D May 17, 2026, 3:13 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 656 48128000
374900636 darrenhp D May 17, 2026, 5:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 30 656 51507200
374852446 zcz0263 D May 16, 2026, 4:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 656 129126400
374847438 wulukana D May 16, 2026, 4:36 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 671 74752000
374851865 El_Matador55 D May 16, 2026, 4:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 30 718 79052800
374854774 bipashabiswas D May 16, 2026, 4:49 p.m. OK GNU C11 TESTS 30 1656 32153600
374865395 daniel.glabai D May 16, 2026, 7:09 p.m. OK Java 21 TESTS 30 1359 44748800
374850568 MohitRajKashyap D May 16, 2026, 4:42 p.m. OK Java 21 TESTS 30 1593 54476800
374880521 gizellelimangan12 D May 16, 2026, 11:46 p.m. OK Java 21 TESTS 30 1921 102604800
374847327 Raunak02 D May 16, 2026, 4:36 p.m. OK Java 21 TESTS 30 2000 72806400
374874100 harsh08 D May 16, 2026, 8:58 p.m. OK Java 8 TESTS 30 1000 55603200
374901871 eigen_loop D May 17, 2026, 5:38 a.m. OK PyPy 3 TESTS 30 1750 100249600
374893407 Mula_Wang D May 17, 2026, 3:57 a.m. OK PyPy 3-64 TESTS 30 687 112844800
374872011 golomb D May 16, 2026, 8:25 p.m. OK PyPy 3-64 TESTS 30 906 127283200
374845871 mikelou D May 16, 2026, 4:33 p.m. OK PyPy 3-64 TESTS 30 1015 100761600
374850618 Doflaming0 D May 16, 2026, 4:42 p.m. OK PyPy 3-64 TESTS 30 1078 98918400
374846125 34z12000 D May 16, 2026, 4:33 p.m. OK PyPy 3-64 TESTS 30 1109 204288000
374883757 s-ahmad461 D May 17, 2026, 1:45 a.m. OK PyPy 3-64 TESTS 30 1562 56934400
374854154 harishk22267 D May 16, 2026, 4:48 p.m. OK PyPy 3-64 TESTS 30 1765 243404800
374848490 amanv2 D May 16, 2026, 4:38 p.m. OK PyPy 3-64 TESTS 30 1937 122265600

remove filters

Back to search problems