Codeforces Round 741 (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
1562 Codeforces Round 741 (Div. 2) FINISHED False 8100 101834699 Aug. 26, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13369 ) C Rings PROGRAMMING constructive algorithms math

B'"How am I to tell which is the One?!" the mage howled. "Throw them one by one into the Cracks of Doom and watch when Mordor falls!" Somewhere in a parallel Middle-earth, when Saruman caught Frodo, he only found n rings. And the i -th ring was either gold or silver. For convenience Saruman wrote down a binary string s of n characters, where the i -th character was 0 if the i -th ring was gold, and 1 if it was silver. Saruman has a magic function f , which takes a binary string and returns a number obtained by converting the string into a binary number and then converting the binary number into a decimal number. For example, f(001010) = 10, f(111) = 7, f(11011101) = 221 . Saruman, however, thinks that the order of the rings plays some important role. He wants to find 2 pairs of integers (l_1, r_1), (l_2, r_2) , such that: Here substring s[l:r] denotes s_ls_{l+1} ldots s_{r-1}s_r , and lfloor x rfloor denotes rounding the number down to the nearest integer. Help Saruman solve this problem! It is guaranteed that under the constraints of the problem at least one solution exists. Each test contains multiple test cases. The first line contains one positive integer t ( 1 <= t <= 10^3 ), denoting the number of test cases. Description of the test cases follows. The first line of each test case contains one positive integer n ( 2 <= n <= 2 cdot 10^4 ) -- length of the string. The second line of each test case contains a non-empty binary string of length n . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For every test case print four integers l_1 , r_1 , l_2 , r_2 , which denote the beginning of the first substring, the end of the first substring, the beginning of the second substring, and the end of the second substring, respectively. If there are multiple solutions, print any. In the first testcase $'...

Tutorials

Editorial of Codeforces Round 741 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
127139878 ssvb C Aug. 26, 2021, 8:10 p.m. OK D TESTS 35 31 8908800
127156456 milan_s1 C Aug. 27, 2021, 4:01 a.m. OK GNU C11 TESTS 35 30 3686400
127152957 yycyyc C Aug. 27, 2021, 3:02 a.m. OK GNU C11 TESTS 35 31 3686400
127150924 Youarenotgood C Aug. 27, 2021, 2:22 a.m. OK GNU C11 TESTS 35 31 3686400
127148028 BugLeave C Aug. 27, 2021, 1:19 a.m. OK GNU C11 TESTS 35 31 3686400
127148662 Leasier C Aug. 27, 2021, 1:34 a.m. OK GNU C11 TESTS 35 46 3788800
127147243 Capitalist_Wang C Aug. 27, 2021, 12:59 a.m. OK GNU C++14 TESTS 35 15 3788800
127138256 darshandusad1234 C Aug. 26, 2021, 7:36 p.m. OK GNU C++14 TESTS 35 15 3891200
127154038 jo_nikhilesh15 C Aug. 27, 2021, 3:21 a.m. OK GNU C++14 TESTS 35 15 3891200
127153704 kundusuraj06 C Aug. 27, 2021, 3:16 a.m. OK GNU C++14 TESTS 35 15 3891200
127141709 rijusougata13 C Aug. 26, 2021, 9:02 p.m. OK GNU C++14 TESTS 35 15 3891200
127145928 leapfrog C Aug. 27, 2021, 12:09 a.m. OK GNU C++14 TESTS 35 15 4300800
127149607 iamone C Aug. 27, 2021, 1:55 a.m. OK GNU C++14 TESTS 35 30 3788800
127145923 C20211711LJS C Aug. 27, 2021, 12:09 a.m. OK GNU C++14 TESTS 35 30 3788800
127147604 Sham_Devour C Aug. 27, 2021, 1:09 a.m. OK GNU C++14 TESTS 35 30 3788800
127147871 doinbgdx C Aug. 27, 2021, 1:16 a.m. OK GNU C++14 TESTS 35 30 3788800
127125057 ZI_MA C Aug. 26, 2021, 4:48 p.m. OK GNU C++17 TESTS 35 15 3788800
127137031 akshat2806 C Aug. 26, 2021, 7:14 p.m. OK GNU C++17 TESTS 35 15 3891200
127136807 skyline417 C Aug. 26, 2021, 7:10 p.m. OK GNU C++17 TESTS 35 15 3891200
127136143 sourav_MU6529 C Aug. 26, 2021, 7 p.m. OK GNU C++17 TESTS 35 15 3891200
127133424 Kahawala C Aug. 26, 2021, 6:24 p.m. OK GNU C++17 TESTS 35 15 3891200
127150188 akdon1198 C Aug. 27, 2021, 2:07 a.m. OK GNU C++17 TESTS 35 15 3891200
127150735 Bone_breaker C Aug. 27, 2021, 2:18 a.m. OK GNU C++17 TESTS 35 15 3891200
127151855 Target_CM C Aug. 27, 2021, 2:42 a.m. OK GNU C++17 TESTS 35 15 3891200
127161241 codenin24 C Aug. 27, 2021, 5:18 a.m. OK GNU C++17 TESTS 35 15 3891200
127162601 Tushar.3010 C Aug. 27, 2021, 5:39 a.m. OK GNU C++17 TESTS 35 15 3891200
127135773 NoNameLeha C Aug. 26, 2021, 6:54 p.m. OK GNU C++17 (64) TESTS 35 15 4403200
127156801 tejpratapp468 C Aug. 27, 2021, 4:07 a.m. OK GNU C++17 (64) TESTS 35 15 4403200
127154954 digishek C Aug. 27, 2021, 3:36 a.m. OK GNU C++17 (64) TESTS 35 15 4403200
127141520 mukim C Aug. 26, 2021, 8:56 p.m. OK GNU C++17 (64) TESTS 35 15 4403200
127139494 teruel C Aug. 26, 2021, 8:01 p.m. OK GNU C++17 (64) TESTS 35 15 4403200
127139232 __TLE__ C Aug. 26, 2021, 7:56 p.m. OK GNU C++17 (64) TESTS 35 15 4403200
127123509 TheNerd06 C Aug. 26, 2021, 4:45 p.m. OK GNU C++17 (64) TESTS 35 15 4710400
127128173 m.hasan01 C Aug. 26, 2021, 5:41 p.m. OK GNU C++17 (64) TESTS 35 30 4300800
127159151 ED_is_best C Aug. 27, 2021, 4:49 a.m. OK GNU C++17 (64) TESTS 35 30 4300800
127162923 Fantasy_T C Aug. 27, 2021, 5:43 a.m. OK GNU C++17 (64) TESTS 35 30 4403200
127148473 mphillotry C Aug. 27, 2021, 1:30 a.m. OK Java 11 TESTS 35 202 23756800
127132085 mareshkau C Aug. 26, 2021, 6:09 p.m. OK Java 11 TESTS 35 202 24268800
127157411 SaberXpro C Aug. 27, 2021, 4:18 a.m. OK Java 11 TESTS 35 218 24371200
127145420 codicon wizwilzo C Aug. 26, 2021, 11:45 p.m. OK Java 11 TESTS 35 218 24473600
127135842 sakethsriram19 C Aug. 26, 2021, 6:55 p.m. OK Java 11 TESTS 35 218 24473600
127152878 DedsecKnight C Aug. 27, 2021, 3:01 a.m. OK Java 11 TESTS 35 233 24166400
127134638 Nicolas125841 C Aug. 26, 2021, 6:39 p.m. OK Java 11 TESTS 35 233 24473600
127140009 pravin_as C Aug. 26, 2021, 8:13 p.m. OK Java 11 TESTS 35 233 24576000
127134560 Henlo_Fraands C Aug. 26, 2021, 6:38 p.m. OK Java 11 TESTS 35 233 24576000
127132615 reennn C Aug. 26, 2021, 6:15 p.m. OK Java 11 TESTS 35 233 25395200
127162351 BruteForcee C Aug. 27, 2021, 5:35 a.m. OK Java 8 TESTS 35 109 20480000
127159155 _robindhankhar C Aug. 27, 2021, 4:49 a.m. OK Java 8 TESTS 35 109 20480000
127156830 SubhaniSk7 C Aug. 27, 2021, 4:07 a.m. OK Java 8 TESTS 35 109 20480000
127132034 medude C Aug. 26, 2021, 6:09 p.m. OK Java 8 TESTS 35 109 20480000
127130394 medude C Aug. 26, 2021, 5:55 p.m. OK Java 8 TESTS 35 109 20480000
127125058 anton_h C Aug. 26, 2021, 4:48 p.m. OK Java 8 TESTS 35 109 20480000
127157555 aggarwalanshul01 C Aug. 27, 2021, 4:20 a.m. OK Java 8 TESTS 35 124 20480000
127157331 smahajan54842 C Aug. 27, 2021, 4:16 a.m. OK Java 8 TESTS 35 124 20480000
127149107 amit_roy C Aug. 27, 2021, 1:43 a.m. OK Java 8 TESTS 35 124 20480000
127141146 FlameFire C Aug. 26, 2021, 8:44 p.m. OK Java 8 TESTS 35 124 20480000
127134704 WUT_ZJL C Aug. 26, 2021, 6:40 p.m. OK MS C++ 2017 TESTS 35 30 3788800
127163354 LeterCall C Aug. 27, 2021, 5:49 a.m. OK MS C++ 2017 TESTS 35 31 3788800
127159277 utsavm C Aug. 27, 2021, 4:50 a.m. OK MS C++ 2017 TESTS 35 31 3788800
127148601 whatcan1say C Aug. 27, 2021, 1:32 a.m. OK MS C++ 2017 TESTS 35 31 3788800
127147407 James_Lee C Aug. 27, 2021, 1:04 a.m. OK MS C++ 2017 TESTS 35 31 3788800
127129945 Tangerine C Aug. 26, 2021, 5:51 p.m. OK MS C++ 2017 TESTS 35 31 3788800
127127899 chika10 C Aug. 26, 2021, 5:40 p.m. OK MS C++ 2017 TESTS 35 31 3788800
127155755 Score12122 C Aug. 27, 2021, 3:49 a.m. OK MS C++ 2017 TESTS 35 46 3788800
127163146 TcherM1023 C Aug. 27, 2021, 5:47 a.m. OK MS C++ 2017 TESTS 35 62 3788800
127149557 guanghechen C Aug. 27, 2021, 1:54 a.m. OK Node.js TESTS 35 77 29900800
127141630 the_distortion C Aug. 26, 2021, 8:59 p.m. OK PyPy 3 TESTS 35 108 22220800
127163172 codicon C Aug. 27, 2021, 5:47 a.m. OK PyPy 3 TESTS 35 109 22937600
127125980 sahilrox C Aug. 26, 2021, 4:49 p.m. OK PyPy 3 TESTS 35 124 22835200
127133251 Igrmi C Aug. 26, 2021, 6:22 p.m. OK PyPy 3 TESTS 35 124 23142400
127134982 akshitm16 C Aug. 26, 2021, 6:44 p.m. OK PyPy 3 TESTS 35 124 23961600
127135102 akshitm16 C Aug. 26, 2021, 6:45 p.m. OK PyPy 3 TESTS 35 139 24166400
127158218 kboi C Aug. 27, 2021, 4:33 a.m. OK PyPy 3 TESTS 35 140 22323200
127139195 vaibhav_india C Aug. 26, 2021, 7:55 p.m. OK PyPy 3 TESTS 35 140 23654400
127142803 deepanshu_pali C Aug. 26, 2021, 9:40 p.m. OK PyPy 3 TESTS 35 140 23961600
127131451 silvertint C Aug. 26, 2021, 6:04 p.m. OK PyPy 3 TESTS 35 140 23961600
127150770 ta2612 C Aug. 27, 2021, 2:19 a.m. OK Python 3 TESTS 35 62 7065600
127162442 brogrammer_24 C Aug. 27, 2021, 5:36 a.m. OK Python 3 TESTS 35 62 7270400
127134385 DoTran C Aug. 26, 2021, 6:36 p.m. OK Python 3 TESTS 35 62 7270400
127154793 blzhu0823 C Aug. 27, 2021, 3:33 a.m. OK Python 3 TESTS 35 77 7065600
127154531 swapnilvc C Aug. 27, 2021, 3:29 a.m. OK Python 3 TESTS 35 77 7372800
127154466 swapnilvc C Aug. 27, 2021, 3:28 a.m. OK Python 3 TESTS 35 77 7372800
127136510 andr14142 C Aug. 26, 2021, 7:06 p.m. OK Python 3 TESTS 35 77 7372800
127131808 shivambhagat02 C Aug. 26, 2021, 6:07 p.m. OK Python 3 TESTS 35 77 7577600
127150840 SF-Manman C Aug. 27, 2021, 2:20 a.m. OK Python 3 TESTS 35 78 7372800
127150241 adityaa_27 C Aug. 27, 2021, 2:08 a.m. OK Python 3 TESTS 35 78 7372800
127149228 bqn C Aug. 27, 2021, 1:46 a.m. OK Rust TESTS 35 31 3993600

remove filters

Back to search problems