Codeforces Round 830 (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
1732 Codeforces Round 830 (Div. 2) FINISHED False 7200 65303699 Oct. 23, 2022, 10:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5984 ) C1 Sheikh (Easy version) PROGRAMMING binary search bitmasks greedy two pointers 1800

B'This is the easy version of the problem. The only difference is that in this version q = 1 . You are given an array of integers a_1, a_2, ldots, a_n . The cost of a subsegment of the array [l, r] , 1 <= q l <= q r <= q n , is the value f(l, r) = operatorname{sum}(l, r) - operatorname{xor}(l, r) , where operatorname{sum}(l, r) = a_l + a_{l+1} + ldots + a_r , and operatorname{xor}(l, r) = a_l oplus a_{l+1} oplus ldots oplus a_r ( oplus stands for bitwise XOR). You will have q = 1 query. Each query is given by a pair of numbers L_i , R_i , where 1 <= q L_i <= q R_i <= q n . You need to find the subsegment [l, r] , L_i <= q l <= q r <= q R_i , with maximum value f(l, r) . If there are several answers, then among them you need to find a subsegment with the minimum length, that is, the minimum value of r - l + 1 . Each test consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n and q ( 1 <= q n <= q 10^5 , q = 1 ) -- the length of the array and the number of queries. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 0 <= q a_i <= q 10^9 ) -- array elements. i -th of the next q lines of each test case contains two integers L_i and R_i ( 1 <= q L_i <= q R_i <= q n ) -- the boundaries in which we need to find the segment. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . It is guaranteed that L_1 = 1 and R_1 = n . For each test case print q pairs of numbers L_i <= q l <= q r <= q R_i such that the value f(l, r) is maximum and among such the length r - l + 1 is minimum. If there are several correct answers, print any of them. In t'...

Tutorials

108327

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
177714855 mban259 C1 Oct. 24, 2022, 3:44 a.m. OK C# 10 TESTS 54 124 23244800 1800
177634587 Tdyx C1 Oct. 23, 2022, 11:37 a.m. OK C# 8 TESTS 54 124 17510400 1800
177681080 Tdyx C1 Oct. 23, 2022, 5:46 p.m. OK C# 8 TESTS 54 124 21913600 1800
177651768 MonkeyGoesCoding C1 Oct. 23, 2022, 1:44 p.m. OK GNU C11 TESTS 54 62 2355200 1800
177639013 liang_cheng C1 Oct. 23, 2022, 11:53 a.m. OK GNU C++14 TESTS 54 31 6656000 1800
177707840 mxy C1 Oct. 24, 2022, 1:34 a.m. OK GNU C++14 TESTS 54 31 7372800 1800
177707860 mxy C1 Oct. 24, 2022, 1:34 a.m. OK GNU C++14 TESTS 54 31 7372800 1800
177633169 2019wangminxiao C1 Oct. 23, 2022, 11:32 a.m. OK GNU C++14 TESTS 54 46 1536000 1800
177718560 QwQr2 C1 Oct. 24, 2022, 4:54 a.m. OK GNU C++14 TESTS 54 61 18022400 1800
177632568 howtouse C1 Oct. 23, 2022, 11:30 a.m. OK GNU C++14 TESTS 54 62 409600 1800
177658666 Land_ER C1 Oct. 23, 2022, 2:32 p.m. OK GNU C++14 TESTS 54 62 409600 1800
177637720 CoDeveRse_07 C1 Oct. 23, 2022, 11:49 a.m. OK GNU C++14 TESTS 54 62 614400 1800
177633030 Hanriver C1 Oct. 23, 2022, 11:31 a.m. OK GNU C++14 TESTS 54 62 819200 1800
177666381 harryb17 C1 Oct. 23, 2022, 3:33 p.m. OK GNU C++14 TESTS 54 62 1024000 1800
177684704 emirhanogul16 C1 Oct. 23, 2022, 6:22 p.m. OK GNU C++17 TESTS 54 62 614400 1800
177684465 Priyanshu_trivedi C1 Oct. 23, 2022, 6:19 p.m. OK GNU C++17 TESTS 54 62 1228800 1800
177670918 Kahou C1 Oct. 23, 2022, 4:11 p.m. OK GNU C++17 TESTS 54 62 1228800 1800
177666109 Kahou C1 Oct. 23, 2022, 3:31 p.m. OK GNU C++17 TESTS 54 62 1228800 1800
177629951 zwu2020015020 C1 Oct. 23, 2022, 11:21 a.m. OK GNU C++17 TESTS 54 62 1638400 1800
177711038 happycrazzy C1 Oct. 24, 2022, 2:38 a.m. OK GNU C++17 TESTS 54 62 1638400 1800
177706975 closed_doors C1 Oct. 24, 2022, 1:12 a.m. OK GNU C++17 TESTS 54 62 1638400 1800
177653560 hututu-7 C1 Oct. 23, 2022, 1:55 p.m. OK GNU C++17 TESTS 54 62 1638400 1800
177632855 HimaLotus C1 Oct. 23, 2022, 11:31 a.m. OK GNU C++17 TESTS 54 62 1638400 1800
177713025 nianheng233 C1 Oct. 24, 2022, 3:13 a.m. OK GNU C++17 TESTS 54 62 1945600 1800
177634203 Y_LX C1 Oct. 23, 2022, 11:36 a.m. OK GNU C++17 (64) TESTS 54 31 4096000 1800
177632113 HLxhh C1 Oct. 23, 2022, 11:28 a.m. OK GNU C++17 (64) TESTS 54 31 5324800 1800
177631837 NorthAutumn C1 Oct. 23, 2022, 11:27 a.m. OK GNU C++17 (64) TESTS 54 31 12185600 1800
177638299 coder__op C1 Oct. 23, 2022, 11:51 a.m. OK GNU C++17 (64) TESTS 54 46 1228800 1800
177632967 Ghassane C1 Oct. 23, 2022, 11:31 a.m. OK GNU C++17 (64) TESTS 54 46 1228800 1800
177653742 strange14 C1 Oct. 23, 2022, 1:57 p.m. OK GNU C++17 (64) TESTS 54 46 1228800 1800
177636845 xuhaoming C1 Oct. 23, 2022, 11:45 a.m. OK GNU C++17 (64) TESTS 54 46 1536000 1800
177710359 User_Carrot C1 Oct. 24, 2022, 2:27 a.m. OK GNU C++17 (64) TESTS 54 46 1638400 1800
177676309 akifpathan C1 Oct. 23, 2022, 5:01 p.m. OK GNU C++17 (64) TESTS 54 46 2048000 1800
177715337 KazamaHoang C1 Oct. 24, 2022, 3:53 a.m. OK GNU C++17 (64) TESTS 54 46 2048000 1800
177641623 c20231020__ C1 Oct. 23, 2022, 12:02 p.m. OK GNU C++20 (64) TESTS 54 30 4505600 1800
177665176 mzh C1 Oct. 23, 2022, 3:23 p.m. OK GNU C++20 (64) TESTS 54 31 614400 1800
177641607 __MOUGOUPAN_22 C1 Oct. 23, 2022, 12:02 p.m. OK GNU C++20 (64) TESTS 54 31 2662400 1800
177632296 forever03 C1 Oct. 23, 2022, 11:29 a.m. OK GNU C++20 (64) TESTS 54 31 2969600 1800
177715988 enola C1 Oct. 24, 2022, 4:06 a.m. OK GNU C++20 (64) TESTS 54 31 4505600 1800
177722945 adriancm C1 Oct. 24, 2022, 6 a.m. OK GNU C++20 (64) TESTS 54 31 5529600 1800
177704454 OotoriEmu C1 Oct. 23, 2022, 11:56 p.m. OK GNU C++20 (64) TESTS 54 31 6041600 1800
177636393 Fangs C1 Oct. 23, 2022, 11:43 a.m. OK GNU C++20 (64) TESTS 54 31 14540800 1800
177663485 Ankit_132 C1 Oct. 23, 2022, 3:10 p.m. OK GNU C++20 (64) TESTS 54 46 409600 1800
177636388 hect123 C1 Oct. 23, 2022, 11:43 a.m. OK GNU C++20 (64) TESTS 54 46 409600 1800
177629814 0x3F C1 Oct. 23, 2022, 11:20 a.m. OK Go TESTS 54 124 5120000 1800
177686221 profchi C1 Oct. 23, 2022, 6:39 p.m. OK Java 11 TESTS 54 296 0 1800
177629407 merlin_ C1 Oct. 23, 2022, 11:19 a.m. OK Java 11 TESTS 54 296 8499200 1800
177633027 profchi C1 Oct. 23, 2022, 11:31 a.m. OK Java 11 TESTS 54 327 0 1800
177720218 dikshant_19 C1 Oct. 24, 2022, 5:21 a.m. OK Java 11 TESTS 54 514 0 1800
177637053 LonggHuynh C1 Oct. 23, 2022, 11:46 a.m. OK Java 17 TESTS 54 233 102400 1800
177632061 Mamimi C1 Oct. 23, 2022, 11:28 a.m. OK Java 17 TESTS 54 249 1024000 1800
177659358 dusty.and.rusty C1 Oct. 23, 2022, 2:37 p.m. OK Java 17 TESTS 54 405 6553600 1800
177685979 Mohamed308 C1 Oct. 23, 2022, 6:36 p.m. OK Java 8 TESTS 54 140 0 1800
177656907 youtsuha C1 Oct. 23, 2022, 2:18 p.m. OK Java 8 TESTS 54 140 0 1800
177630137 megaspazz C1 Oct. 23, 2022, 11:21 a.m. OK Java 8 TESTS 54 140 0 1800
177639785 r1cky C1 Oct. 23, 2022, 11:56 a.m. OK Java 8 TESTS 54 156 12595200 1800
177721370 ND_ C1 Oct. 24, 2022, 5:39 a.m. OK Java 8 TESTS 54 170 0 1800
177667352 ketangupta12 C1 Oct. 23, 2022, 3:40 p.m. OK Java 8 TESTS 54 171 1024000 1800
177666878 Java_Programmer C1 Oct. 23, 2022, 3:37 p.m. OK Java 8 TESTS 54 186 1024000 1800
177686300 pakkapapad C1 Oct. 23, 2022, 6:40 p.m. OK Java 8 TESTS 54 202 0 1800
177658228 invincible777 C1 Oct. 23, 2022, 2:29 p.m. OK Java 8 TESTS 54 217 13107200 1800
177634585 Aabhas99 C1 Oct. 23, 2022, 11:37 a.m. OK Java 8 TESTS 54 624 30924800 1800
177636635 ItamarNir C1 Oct. 23, 2022, 11:44 a.m. OK MS C++ 2017 TESTS 54 202 3276800 1800
177663978 zouyu9631 C1 Oct. 23, 2022, 3:14 p.m. OK PyPy 3 TESTS 54 358 23961600 1800
177639692 akshitm16 C1 Oct. 23, 2022, 11:56 a.m. OK PyPy 3 TESTS 54 530 23552000 1800
177708553 tonyu0 C1 Oct. 24, 2022, 1:51 a.m. OK PyPy 3 TESTS 54 670 24473600 1800
177631474 wkoo C1 Oct. 23, 2022, 11:26 a.m. OK PyPy 3 TESTS 54 717 24576000 1800
177658342 zouyu9631 C1 Oct. 23, 2022, 2:30 p.m. OK PyPy 3-64 TESTS 54 156 26112000 1800
177702277 biglunchdude C1 Oct. 23, 2022, 10:44 p.m. OK PyPy 3-64 TESTS 54 187 23552000 1800
177658596 zouyu9631 C1 Oct. 23, 2022, 2:31 p.m. OK PyPy 3-64 TESTS 54 202 23961600 1800
177658492 zouyu9631 C1 Oct. 23, 2022, 2:31 p.m. OK PyPy 3-64 TESTS 54 202 25395200 1800
177662979 parthtotalfun C1 Oct. 23, 2022, 3:06 p.m. OK PyPy 3-64 TESTS 54 202 29286400 1800
177683847 parthtotalfun C1 Oct. 23, 2022, 6:13 p.m. OK PyPy 3-64 TESTS 54 202 29491200 1800
177651966 sushmanth.dampur8780 C1 Oct. 23, 2022, 1:45 p.m. OK PyPy 3-64 TESTS 54 218 20787200 1800
177662795 mikeac C1 Oct. 23, 2022, 3:05 p.m. OK PyPy 3-64 TESTS 54 233 25804800 1800
177657546 zhenfisher C1 Oct. 23, 2022, 2:23 p.m. OK PyPy 3-64 TESTS 54 234 30003200 1800
177630416 Alex239 C1 Oct. 23, 2022, 11:22 a.m. OK PyPy 3-64 TESTS 54 264 36352000 1800
177655411 r57shell C1 Oct. 23, 2022, 2:08 p.m. OK Python 3 TESTS 54 577 8601600 1800
177660733 parthtotalfun C1 Oct. 23, 2022, 2:48 p.m. OK Python 3 TESTS 54 2807 15052800 1800
177662875 parthtotalfun C1 Oct. 23, 2022, 3:05 p.m. OK Python 3 TESTS 54 2947 17203200 1800
177636038 Shinonome_Ena C1 Oct. 23, 2022, 11:42 a.m. OK Rust 2021 TESTS 54 31 5529600 1800
177705792 avnyu C1 Oct. 24, 2022, 12:37 a.m. OK Rust 2021 TESTS 54 46 15667200 1800
177633021 zeronosu77108_ C1 Oct. 23, 2022, 11:31 a.m. OK Rust 2021 TESTS 54 46 15667200 1800

remove filters

Back to search problems