Codeforces Round 841 (Div. 2) and Divide by Zero 2022

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
1731 Codeforces Round 841 (Div. 2) and Divide by Zero 2022 FINISHED False 7200 65028263 Dec. 27, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9924 ) C Even Subarrays PROGRAMMING bitmasks brute force hashing math number theory

B"You are given an integer array a_1, a_2, ... , a_n ( 1 <= a_i <= n ). Find the number of subarrays of a whose operatorname{XOR} has an even number of divisors. In other words, find all pairs of indices (i, j) ( i <= j ) such that a_i oplus a_{i + 1} oplus ... oplus a_j has an even number of divisors. For example, numbers 2 , 3 , 5 or 6 have an even number of divisors, while 1 and 4 -- odd. Consider that 0 has an odd number of divisors in this task. Here operatorname{XOR} (or oplus ) denotes the bitwise XOR operation. Print the number of subarrays but multiplied by 2022... Okay, let's stop. Just print the actual answer. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= q n <= q 2 cdot 10^5 ) -- the length of the array a . The second line contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q n ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print the number of subarrays, whose operatorname{XOR} has an even number of divisors. In the first test case, there are 4 subarrays whose operatorname{XOR} has an even number of divisors: [3] , [3,1] , [1,2] , [2] . In the second test case, there are 11 subarrays whose operatorname{XOR} has an even number of divisors: [4,2] , [4,2,1] , [4,2,1,5] , [2] , [2,1] , [2,1,5] , [2,1,5,3] , [1,5,3] , [5] , [5,3] , [3] . In the third test case, there is no subarray whose operatorname{XOR} has an even number of divisors since operatorname{XOR} of any subarray is either 4 or 0 . "...

Tutorials

Codeforces Round #841 (Div. 2) and Divide By Zero 2022 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
187058241 nvllable C Dec. 28, 2022, 4:33 p.m. OK GNU C11 TESTS 38 499 2457600
187028222 shubh2727gupta C Dec. 28, 2022, 11:22 a.m. OK GNU C++14 TESTS 38 171 4812800
187064515 Tahsin13 C Dec. 28, 2022, 5:37 p.m. OK GNU C++14 TESTS 38 186 1843200
187042224 ninano C Dec. 28, 2022, 1:53 p.m. OK GNU C++14 TESTS 38 187 1843200
187417059 sourav_suku C Dec. 31, 2022, 7:08 a.m. OK GNU C++14 TESTS 39 187 1843200
187123995 robinyqc C Dec. 29, 2022, 10:05 a.m. OK GNU C++14 TESTS 38 187 7987200
187032059 star_road_xyz C Dec. 28, 2022, 12:03 p.m. OK GNU C++14 TESTS 38 187 17100800
187168447 TEoS C Dec. 29, 2022, 5:06 p.m. OK GNU C++14 TESTS 38 202 3481600
187034176 Homura_jar C Dec. 28, 2022, 12:24 p.m. OK GNU C++14 TESTS 38 217 3379200
187228164 02Darling C Dec. 30, 2022, 10:07 a.m. OK GNU C++14 TESTS 39 218 3174400
187041465 piyush0120 C Dec. 28, 2022, 1:46 p.m. OK GNU C++14 TESTS 38 218 3993600
187115388 Shailabh10989 C Dec. 29, 2022, 8:30 a.m. OK GNU C++17 TESTS 38 187 1843200
187202265 code_struck C Dec. 30, 2022, 4:22 a.m. OK GNU C++17 TESTS 39 187 2150400
187217294 TrivialMan C Dec. 30, 2022, 8:01 a.m. OK GNU C++17 TESTS 39 187 2457600
187085241 CrocHold C Dec. 28, 2022, 10:11 p.m. OK GNU C++17 TESTS 38 187 2867200
187088340 karamkontar C Dec. 28, 2022, 11:30 p.m. OK GNU C++17 TESTS 38 187 3174400
187150816 cr1515 C Dec. 29, 2022, 2:25 p.m. OK GNU C++17 TESTS 38 187 5939200
187054390 in_the_wilderness C Dec. 28, 2022, 3:52 p.m. OK GNU C++17 TESTS 38 202 1843200
187436500 yqq C Dec. 31, 2022, 10:53 a.m. OK GNU C++17 TESTS 39 202 3891200
187067164 HimanShu09 C Dec. 28, 2022, 6:02 p.m. OK GNU C++17 TESTS 38 217 3686400
187463099 mutharib C Dec. 31, 2022, 4:04 p.m. OK GNU C++17 TESTS 39 218 1843200
187091780 ExplodingKonjac C Dec. 29, 2022, 1:45 a.m. OK GNU C++17 (64) TESTS 38 78 7270400
187082801 lucasxia01 C Dec. 28, 2022, 9:26 p.m. OK GNU C++17 (64) TESTS 38 156 3686400
187059947 van_hoang C Dec. 28, 2022, 4:50 p.m. OK GNU C++17 (64) TESTS 38 171 1024000
187053661 OpiumCat C Dec. 28, 2022, 3:44 p.m. OK GNU C++17 (64) TESTS 38 171 2969600
187175774 sriganeshiiits C Dec. 29, 2022, 6:15 p.m. OK GNU C++17 (64) TESTS 38 171 3481600
187133380 Monir C Dec. 29, 2022, 11:40 a.m. OK GNU C++17 (64) TESTS 38 171 3686400
187249805 ye_bhi_mahfooz_hai C Dec. 30, 2022, 2:04 p.m. OK GNU C++17 (64) TESTS 39 171 3686400
187064448 kunal_rai C Dec. 28, 2022, 5:36 p.m. OK GNU C++17 (64) TESTS 38 171 3686400
187082472 urBCI C Dec. 28, 2022, 9:21 p.m. OK GNU C++17 (64) TESTS 38 171 3993600
187207972 Indiaverse C Dec. 30, 2022, 6:01 a.m. OK GNU C++17 (64) TESTS 39 187 2457600
187032983 -Fainted- C Dec. 28, 2022, 12:12 p.m. OK GNU C++20 (64) TESTS 38 140 1843200
187030181 Bugman C Dec. 28, 2022, 11:43 a.m. OK GNU C++20 (64) TESTS 38 155 3481600
187199134 Ohto_Ai C Dec. 30, 2022, 3:05 a.m. OK GNU C++20 (64) TESTS 39 156 1843200
187198696 eee C Dec. 30, 2022, 2:53 a.m. OK GNU C++20 (64) TESTS 39 156 1843200
187196137 LLGM C Dec. 30, 2022, 1:34 a.m. OK GNU C++20 (64) TESTS 39 156 1843200
187143565 ykpcx C Dec. 29, 2022, 1:22 p.m. OK GNU C++20 (64) TESTS 38 156 1843200
187125942 high_chills C Dec. 29, 2022, 10:26 a.m. OK GNU C++20 (64) TESTS 38 156 1843200
187066626 esmay_hridoy C Dec. 28, 2022, 5:57 p.m. OK GNU C++20 (64) TESTS 38 156 1843200
187055038 wuming C Dec. 28, 2022, 3:58 p.m. OK GNU C++20 (64) TESTS 38 156 1843200
187220642 sunfall C Dec. 30, 2022, 8:41 a.m. OK GNU C++20 (64) TESTS 39 156 1843200
187086550 daftdove C Dec. 28, 2022, 10:43 p.m. OK Java 11 TESTS 38 420 0
187155115 NewbiePupil C Dec. 29, 2022, 3:01 p.m. OK Java 11 TESTS 38 421 0
187133008 deepakanto C Dec. 29, 2022, 11:36 a.m. OK Java 11 TESTS 38 452 1536000
187124781 dinosparton_013 C Dec. 29, 2022, 10:13 a.m. OK Java 11 TESTS 38 467 0
187141345 vermadv2000 C Dec. 29, 2022, 1:01 p.m. OK Java 11 TESTS 38 482 0
187114599 uttaran_das C Dec. 29, 2022, 8:20 a.m. OK Java 11 TESTS 38 483 13414400
187161791 djrfrn C Dec. 29, 2022, 4:03 p.m. OK Java 11 TESTS 38 545 2150400
187143669 rounakchauhan70 C Dec. 29, 2022, 1:23 p.m. OK Java 11 TESTS 38 624 0
187157475 amanraj01 C Dec. 29, 2022, 3:22 p.m. OK Java 11 TESTS 38 748 0
187040375 __Serendipity C Dec. 28, 2022, 1:36 p.m. OK Java 11 TESTS 38 873 0
187188078 mareshkau C Dec. 29, 2022, 9:13 p.m. OK Java 17 TESTS 39 421 409600
187187592 mareshkau C Dec. 29, 2022, 9:03 p.m. OK Java 17 TESTS 39 436 614400
187227156 tbs-jyy C Dec. 30, 2022, 9:56 a.m. OK Java 17 TESTS 39 483 716800
187124244 mareshkau C Dec. 29, 2022, 10:07 a.m. OK Java 17 TESTS 38 732 0
187194657 CCS_Covenant C Dec. 30, 2022, 12:41 a.m. OK Java 17 TESTS 39 2136 921600
187122742 mareshkau C Dec. 29, 2022, 9:50 a.m. OK Java 17 TESTS 38 2246 5529600
187123214 mareshkau C Dec. 29, 2022, 9:56 a.m. OK Java 17 TESTS 38 2261 3379200
187122025 mareshkau C Dec. 29, 2022, 9:42 a.m. OK Java 17 TESTS 38 2292 716800
187124069 mareshkau C Dec. 29, 2022, 10:05 a.m. OK Java 17 TESTS 38 2339 614400
187123341 mareshkau C Dec. 29, 2022, 9:57 a.m. OK Java 17 TESTS 38 2355 3584000
187200835 SilveryZz C Dec. 30, 2022, 3:48 a.m. OK Java 8 TESTS 39 358 13516800
187073041 ansh6575 C Dec. 28, 2022, 7:11 p.m. OK Java 8 TESTS 38 374 2764800
187100398 maneeshnarayan1 C Dec. 29, 2022, 5:16 a.m. OK Java 8 TESTS 38 389 2764800
187072984 ansh6575 C Dec. 28, 2022, 7:10 p.m. OK Java 8 TESTS 38 389 2764800
187153441 1091857051 C Dec. 29, 2022, 2:47 p.m. OK Java 8 TESTS 38 405 0
187240424 Mohamed308 C Dec. 30, 2022, 12:29 p.m. OK Java 8 TESTS 39 420 2764800
187117057 aditya888 C Dec. 29, 2022, 8:48 a.m. OK Java 8 TESTS 38 561 0
187116186 aditya888 C Dec. 29, 2022, 8:38 a.m. OK Java 8 TESTS 38 561 0
187117210 aditya888 C Dec. 29, 2022, 8:50 a.m. OK Java 8 TESTS 38 576 0
187113389 rational_fool C Dec. 29, 2022, 8:04 a.m. OK Java 8 TESTS 38 811 2764800
187238313 duckladydinh C Dec. 30, 2022, 12:07 p.m. OK Kotlin 1.7 TESTS 39 1044 101068800
187238235 duckladydinh C Dec. 30, 2022, 12:07 p.m. OK Kotlin 1.7 TESTS 39 1092 103014400
187238131 duckladydinh C Dec. 30, 2022, 12:05 p.m. OK Kotlin 1.7 TESTS 39 1185 107008000
187386302 dallas0518 C Dec. 30, 2022, 8:01 p.m. OK MS C++ 2017 TESTS 39 530 3174400
187175160 Kway88 C Dec. 29, 2022, 6:09 p.m. OK MS C++ 2017 TESTS 38 546 3174400
187151626 hacastle C Dec. 29, 2022, 2:31 p.m. OK MS C++ 2017 TESTS 38 592 7987200
187385682 dallas0518 C Dec. 30, 2022, 7:52 p.m. OK MS C++ 2017 TESTS 39 780 9625600
187385967 dallas0518 C Dec. 30, 2022, 7:56 p.m. OK MS C++ 2017 TESTS 39 841 9625600
187386151 dallas0518 C Dec. 30, 2022, 7:59 p.m. OK MS C++ 2017 TESTS 39 1014 9625600
187385490 dallas0518 C Dec. 30, 2022, 7:50 p.m. OK MS C++ 2017 TESTS 39 1216 9625600
187385990 dallas0518 C Dec. 30, 2022, 7:57 p.m. OK MS C++ 2017 TESTS 39 1372 6451200
187394537 Alex239 C Dec. 30, 2022, 11:21 p.m. OK PyPy 2 TESTS 39 1840 13107200
187047207 rio100466 C Dec. 28, 2022, 2:37 p.m. OK PyPy 3 TESTS 38 904 17305600
187470515 monu_dixit C Dec. 31, 2022, 5:35 p.m. OK PyPy 3 TESTS 39 982 19353600
187190144 1_2_3_4_5_9 C Dec. 29, 2022, 10:02 p.m. OK PyPy 3 TESTS 39 1154 25190400
187075132 saikotha2407 C Dec. 28, 2022, 7:37 p.m. OK PyPy 3 TESTS 38 1263 17305600
187034101 mnkp C Dec. 28, 2022, 12:23 p.m. OK PyPy 3 TESTS 38 1263 17305600
187034182 mnkp C Dec. 28, 2022, 12:25 p.m. OK PyPy 3 TESTS 38 1294 17305600
187034734 mnkp C Dec. 28, 2022, 12:29 p.m. OK PyPy 3 TESTS 38 1372 19353600
187394383 Alex239 C Dec. 30, 2022, 11:15 p.m. OK PyPy 3 TESTS 39 1606 18432000
187394450 Alex239 C Dec. 30, 2022, 11:17 p.m. OK PyPy 3 TESTS 39 2120 17920000
187235844 Noureldin C Dec. 30, 2022, 11:38 a.m. OK PyPy 3 TESTS 39 2152 19148800
187252581 ankit_x C Dec. 30, 2022, 2:32 p.m. OK PyPy 3-64 TESTS 39 327 26214400
187187410 mareshkau C Dec. 29, 2022, 9 p.m. OK PyPy 3-64 TESTS 39 343 20992000
187094270 ankit_x C Dec. 29, 2022, 3 a.m. OK PyPy 3-64 TESTS 38 358 26214400
187093333 ankit_x C Dec. 29, 2022, 2:35 a.m. OK PyPy 3-64 TESTS 38 373 28672000
187049524 DeathIsAwe C Dec. 28, 2022, 3 p.m. OK PyPy 3-64 TESTS 38 420 22835200
187394516 Alex239 C Dec. 30, 2022, 11:20 p.m. OK PyPy 3-64 TESTS 39 436 25907200
187090691 DarkTemplarDrop C Dec. 29, 2022, 1:06 a.m. OK PyPy 3-64 TESTS 38 467 22016000
187252519 ankit_x C Dec. 30, 2022, 2:31 p.m. OK PyPy 3-64 TESTS 39 467 27648000
187090683 DarkTemplarDrop C Dec. 29, 2022, 1:06 a.m. OK PyPy 3-64 TESTS 38 483 22118400
187090657 DarkTemplarDrop C Dec. 29, 2022, 1:05 a.m. OK PyPy 3-64 TESTS 38 498 22118400
187229648 cottoncotton C Dec. 30, 2022, 10:25 a.m. OK Rust 2021 TESTS 39 202 69939200
187116974 Spheniscine C Dec. 29, 2022, 8:47 a.m. OK Rust 2021 TESTS 38 218 2252800
187199992 Benq C Dec. 30, 2022, 3:28 a.m. OK Rust 2021 TESTS 39 218 14848000
187076637 coffee-addict C Dec. 28, 2022, 7:55 p.m. OK Rust 2021 TESTS 38 295 9318400

remove filters

Back to search problems