Codeforces Round 1063 (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
2163 Codeforces Round 1063 (Div. 2) FINISHED False 7200 13618523 Nov. 10, 2025, 3:05 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 2712 ) D1 Diadrash (Easy Version) PROGRAMMING binary search divide and conquer interactive

This is the Easy version of the problem. The difference between the versions is that in this version, you can make at most (\max(300, \lceil\frac{n}{2}\rceil+2)) queries. You can hack only if you solved all versions of this problem. This problem is interactive. There is a permutation(^{\text{∗}}) (p) of the integers from (0) to (n-1) hidden from you. Additionally, you are given (q) ranges (l_1, r_1, l_2, r_2, \ldots, l_q, r_q) where (1 \le l_i \le r_i \le n). You need to discover the maximum (\operatorname{MEX}) among the values of (p) in the (q) ranges that are given to you in the input. Formally, you must discover the value of (\max _{i=1}^q {\operatorname{MEX}(p_{l_i}, p_{l_i+1}, \ldots, p_{r_i})})(^{\text{†}}). To do this, you may make at most (\max(300, \lceil\frac{n}{2}\rceil+2)) queries of the following form: Choose any two integers (1 \le l \le r \le n) and you will receive the value (\operatorname{MEX}(p_{l}, p_{l+1}, \ldots, p_{r})). (^{\text{∗}})A permutation of the integers from (0) to (n-1) is a sequence of (n) elements where every integer from (0) to (n-1) appears exactly once. For example, the sequence (0, 3, 1, 2) is a permutation, but the sequence (0, 0, 2, 1) is not. (^{\text{†}})The (\operatorname{MEX}) of a sequence is defined as the smallest non-negative integer that does not appear in that sequence. For example, (\operatorname{MEX}(0, 0, 1, 3) = 2) and (\operatorname{MEX}(1, 2, 2) = 0.) Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 100)). The description of the test cases follows. The first line of each test case contains exactly two integers (n) and (q) ((4 \le n \le 10^4), (1 \le q \le 3 \cdot 10^5)) — the size of the permutation and the number of ranges, respectively. The (i)-th of the next (q) lines contains two

Tutorials

Codeforces Round 1063 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
348413368 TangBin_A_Liverpool_Fan D1 Nov. 11, 2025, 3:38 a.m. OK C++17 (GCC 7-32) TESTS 27 249 0
348362281 codecrushr D1 Nov. 10, 2025, 4:53 p.m. OK C++17 (GCC 7-32) TESTS 25 265 1024000
348362565 cwl769 D1 Nov. 10, 2025, 4:54 p.m. OK C++17 (GCC 7-32) TESTS 25 265 2457600
348364537 ClosetNarcissist D1 Nov. 10, 2025, 4:58 p.m. OK C++17 (GCC 7-32) TESTS 25 280 0
348362158 Eason_He D1 Nov. 10, 2025, 4:53 p.m. OK C++17 (GCC 7-32) TESTS 25 280 0
348360201 with_care D1 Nov. 10, 2025, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 25 280 0
348363521 Lemansky D1 Nov. 10, 2025, 4:56 p.m. OK C++17 (GCC 7-32) TESTS 25 281 0
348363262 ylf_cat D1 Nov. 10, 2025, 4:55 p.m. OK C++17 (GCC 7-32) TESTS 25 281 1024000
348365370 Surge568 D1 Nov. 10, 2025, 4:59 p.m. OK C++17 (GCC 7-32) TESTS 25 281 7987200
348402500 xiaoshu2010 D1 Nov. 11, 2025, 12:14 a.m. OK C++17 (GCC 7-32) TESTS 27 296 2457600
348367115 Vectors_Master D1 Nov. 10, 2025, 5:02 p.m. OK C++20 (GCC 13-64) TESTS 25 187 0
348364328 G.Y D1 Nov. 10, 2025, 4:57 p.m. OK C++20 (GCC 13-64) TESTS 25 202 4300800
348365715 Anon_chan D1 Nov. 10, 2025, 5 p.m. OK C++20 (GCC 13-64) TESTS 25 202 4915200
348407976 NotOnlySuccess D1 Nov. 11, 2025, 2:28 a.m. OK C++20 (GCC 13-64) TESTS 27 218 0
348367152 potati D1 Nov. 10, 2025, 5:02 p.m. OK C++20 (GCC 13-64) TESTS 25 218 0
348362345 PetaLinGer. D1 Nov. 10, 2025, 4:53 p.m. OK C++20 (GCC 13-64) TESTS 25 218 0
348362616 xorman D1 Nov. 10, 2025, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 25 234 0
348362405 naresh1 D1 Nov. 10, 2025, 4:54 p.m. OK C++20 (GCC 13-64) TESTS 25 234 0
348359589 crispy-tofu D1 Nov. 10, 2025, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 25 234 3481600
348364222 melonseeds D1 Nov. 10, 2025, 4:57 p.m. OK C++20 (GCC 13-64) TESTS 25 249 0
348362183 naitik_agrawal D1 Nov. 10, 2025, 4:53 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 203 102400
348364043 ghoul_SSS D1 Nov. 10, 2025, 4:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 218 0
348359662 isagi_yaichki D1 Nov. 10, 2025, 4:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 218 0
348364574 ZOD D1 Nov. 10, 2025, 4:58 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 218 102400
348359417 ICPC_BNU D1 Nov. 10, 2025, 4:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 218 102400
348367360 Pocochuk D1 Nov. 10, 2025, 5:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 233 1024000
348362935 Harsh_kunwar D1 Nov. 10, 2025, 4:55 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 233 1126400
348364972 polosatic D1 Nov. 10, 2025, 4:59 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 233 32153600
348366033 MaroonCoder21 D1 Nov. 10, 2025, 5:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 234 0
348365608 lucky__389 D1 Nov. 10, 2025, 5 p.m. OK C++23 (GCC 14-64, msys2) TESTS 25 234 0
348361776 AnimeshT1008 D1 Nov. 10, 2025, 4:52 p.m. OK Java 21 TESTS 25 624 7577600
348364752 Samyajit125 D1 Nov. 10, 2025, 4:58 p.m. OK Java 21 TESTS 25 780 7168000
348374390 Power_Rangers_ D1 Nov. 10, 2025, 5:58 p.m. OK Java 21 TESTS 25 780 7987200
348374778 Power_Rangers_ D1 Nov. 10, 2025, 6:01 p.m. OK Java 21 TESTS 25 781 7680000
348375081 Yousef_Badr D1 Nov. 10, 2025, 6:03 p.m. OK Java 21 TESTS 25 796 7782400
348389096 WrongAnswerOnTestCase2 D1 Nov. 10, 2025, 8:06 p.m. OK Java 21 TESTS 27 1171 1126400
348363884 sheleftme D1 Nov. 10, 2025, 4:57 p.m. OK Java 21 TESTS 25 1390 11878400
348421512 ironman263 D1 Nov. 11, 2025, 5:26 a.m. OK Java 21 TESTS 28 1624 7884800
348382603 xmjlove D1 Nov. 10, 2025, 7:05 p.m. OK Java 8 TESTS 26 811 6348800
348373887 Shri_874 D1 Nov. 10, 2025, 5:55 p.m. OK PyPy 3-64 TESTS 25 453 6451200
348397377 VaHiX D1 Nov. 10, 2025, 9:58 p.m. OK PyPy 3-64 TESTS 27 530 6348800
348374953 sushmanth.dampur8780 D1 Nov. 10, 2025, 6:02 p.m. OK PyPy 3-64 TESTS 25 561 37785600
348381777 mosaab20111 D1 Nov. 10, 2025, 6:57 p.m. OK PyPy 3-64 TESTS 26 562 4096000
348372467 monocrap D1 Nov. 10, 2025, 5:46 p.m. OK PyPy 3-64 TESTS 25 562 4812800
348424315 liar3743 D1 Nov. 11, 2025, 5:36 a.m. OK PyPy 3-64 TESTS 28 577 5734400
348387148 Om_Singh_ D1 Nov. 10, 2025, 7:53 p.m. OK PyPy 3-64 TESTS 27 624 5734400
348374040 V3k0r D1 Nov. 10, 2025, 5:56 p.m. OK PyPy 3-64 TESTS 25 640 7987200
348377301 shadow4720 D1 Nov. 10, 2025, 6:19 p.m. OK PyPy 3-64 TESTS 26 640 45465600
348382309 IcyGirl D1 Nov. 10, 2025, 7:02 p.m. OK PyPy 3-64 TESTS 26 671 40140800
348380675 Ab_hoga_real_Cumback D1 Nov. 10, 2025, 6:47 p.m. OK Python 3 TESTS 26 577 1433600

remove filters

Back to search problems