Codeforces Round 936 (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
1946 Codeforces Round 936 (Div. 2) FINISHED False 7200 26061863 March 22, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4890 ) D Birthday Gift PROGRAMMING bitmasks brute force constructive algorithms greedy implementation

B"Yarik's birthday is coming soon, and Mark decided to give him an array a of length n . Mark knows that Yarik loves bitwise operations very much, and he also has a favorite number x , so Mark wants to find the maximum number k such that it is possible to select pairs of numbers [ l_1, r_1 ], [ l_2, r_2 ], ldots [ l_k, r_k ], such that: If such k does not exist, then output -1 . Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The following lines contain the descriptions of the test cases. The first line of each test case contains two integers n and x ( 1 <= n <= 10^5, 0 <= x < 2^{30} ) -- the length of the array a and the number x respectively. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= a_i < 2^{30} ) -- the array a itself. It is guaranteed that the sum of the values of n across all test cases does not exceed 10^5 . For each test case, output a single integer on a separate line -- the maximum suitable number k , and -1 if such k does not exist. In the first test case, you can take k equal to 2 and choose two segments [ 1, 1 ] and [ 2, 3 ], (1) | (2 oplus 3) = 1 . It can be shown that 2 is the maximum possible answer. In the second test case, the segments [ 1, 1 ] and [ 2, 2 ] are suitable, (1) | (1) = 1 . It is not possible to make more segments. In the third test case, it is not possible to choose 2 segments, as (1) | (3) = 3 > 2 , so the optimal answer is 1 . "...

Tutorials

Codeforces Round #936 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
252850320 OIDragon D March 23, 2024, 1:48 a.m. OK C++14 (GCC 6-32) TESTS 23 46 409600
252847357 masonpop D March 23, 2024, 12:48 a.m. OK C++14 (GCC 6-32) TESTS 23 46 409600
252800851 AnosVoldigoad D March 22, 2024, 4:20 p.m. OK C++14 (GCC 6-32) TESTS 23 46 409600
252864253 moon100_fan D March 23, 2024, 5:05 a.m. OK C++14 (GCC 6-32) TESTS 23 46 819200
252831163 RaghavWadhwa D March 22, 2024, 8:27 p.m. OK C++14 (GCC 6-32) TESTS 23 46 819200
252825426 chouhui D March 22, 2024, 7:26 p.m. OK C++14 (GCC 6-32) TESTS 23 46 819200
252814395 wangmarui D March 22, 2024, 5:44 p.m. OK C++14 (GCC 6-32) TESTS 23 46 819200
252821008 Shammo D March 22, 2024, 6:41 p.m. OK C++14 (GCC 6-32) TESTS 23 46 2048000
252850650 561206ma D March 23, 2024, 1:55 a.m. OK C++14 (GCC 6-32) TESTS 23 46 2457600
252854008 ruclion D March 23, 2024, 2:47 a.m. OK C++14 (GCC 6-32) TESTS 23 46 2662400
252817331 robert.barbu27 D March 22, 2024, 6:08 p.m. OK C++17 (GCC 7-32) TESTS 23 31 409600
252804242 thawin.ice D March 22, 2024, 4:29 p.m. OK C++17 (GCC 7-32) TESTS 23 31 921600
252854787 SecondWave D March 23, 2024, 3 a.m. OK C++17 (GCC 7-32) TESTS 23 31 2457600
252856546 yz114514 D March 23, 2024, 3:22 a.m. OK C++17 (GCC 7-32) TESTS 23 46 0
252870253 heartfire2005 D March 23, 2024, 5:56 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252869616 wlgh7407 D March 23, 2024, 5:51 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252867700 trung0612 D March 23, 2024, 5:35 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252866356 xty001 D March 23, 2024, 5:25 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252865708 Hruish D March 23, 2024, 5:19 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252865315 ventusliberum D March 23, 2024, 5:16 a.m. OK C++17 (GCC 7-32) TESTS 23 46 409600
252858137 Huangyf D March 23, 2024, 3:42 a.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252845222 algohary D March 23, 2024, 12:01 a.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252845181 algohary D March 23, 2024, midnight OK C++20 (GCC 13-64) TESTS 23 31 409600
252840332 leovl48 D March 22, 2024, 10:25 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252836892 _Mahmoud_Ayman D March 22, 2024, 9:34 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252830127 not-ian D March 22, 2024, 8:16 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252828855 nandhagk1729 D March 22, 2024, 8:03 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252821205 pop_back D March 22, 2024, 6:43 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252816045 kjhhjki D March 22, 2024, 5:57 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252811975 Urtusea D March 22, 2024, 5:28 p.m. OK C++20 (GCC 13-64) TESTS 23 31 409600
252803713 nguyenquocthao00 D March 22, 2024, 4:27 p.m. OK Go TESTS 23 61 6758400
252826321 nguyenquocthao00 D March 22, 2024, 7:35 p.m. OK Go TESTS 23 61 7270400
252821736 profchi D March 22, 2024, 6:48 p.m. OK Java 21 TESTS 23 342 1433600
252815707 Utsav82 D March 22, 2024, 5:54 p.m. OK Java 21 TESTS 23 342 8499200
252809565 Eslam_Ahmed D March 22, 2024, 5:19 p.m. OK Java 21 TESTS 23 405 204800
252802709 dzhi D March 22, 2024, 4:25 p.m. OK Java 21 TESTS 23 420 0
252861953 Shiva1102 D March 23, 2024, 4:35 a.m. OK Java 21 TESTS 23 530 819200
252851000 lyongwolf D March 23, 2024, 2:01 a.m. OK Java 8 TESTS 23 139 0
252853705 fyseus D March 23, 2024, 2:42 a.m. OK Java 8 TESTS 23 155 0
252847851 cjtoribio D March 23, 2024, 12:57 a.m. OK Kotlin 1.9 TESTS 23 265 512000
252824567 codicon D March 22, 2024, 7:18 p.m. OK PyPy 3-64 TESTS 23 170 15769600
252858955 bigJ D March 23, 2024, 3:52 a.m. OK PyPy 3-64 TESTS 23 171 20275200
252854662 RobinFromTheHood D March 23, 2024, 2:58 a.m. OK PyPy 3-64 TESTS 23 218 15872000
252857497 Shri_874 D March 23, 2024, 3:33 a.m. OK PyPy 3-64 TESTS 23 218 18022400
252816374 iN_siDious D March 22, 2024, 5:59 p.m. OK PyPy 3-64 TESTS 23 234 20889600
252801919 Taymyr D March 22, 2024, 4:23 p.m. OK PyPy 3-64 TESTS 23 249 14131200
252800491 googlweknoall D March 22, 2024, 4:19 p.m. OK PyPy 3-64 TESTS 23 280 20480000
252863188 cy171 D March 23, 2024, 4:51 a.m. OK PyPy 3-64 TESTS 23 311 13414400
252803801 skhan_org D March 22, 2024, 4:28 p.m. OK PyPy 3-64 TESTS 23 343 19148800
252800295 VitaLemonTea D March 22, 2024, 4:18 p.m. OK PyPy 3-64 TESTS 23 373 20582400
252824715 OLOGY D March 22, 2024, 7:19 p.m. OK Python 2 TESTS 23 249 6758400
252810537 OLOGY D March 22, 2024, 5:22 p.m. OK Python 2 TESTS 23 295 6656000
252805254 Swordelf D March 22, 2024, 4:32 p.m. OK Rust 2021 TESTS 23 31 8704000

remove filters

Back to search problems