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 107191463 Aug. 26, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2161 ) D2 Two Hundred Twenty One (hard version) PROGRAMMING binary search constructive algorithms data structures dp math

B"This is the hard version of the problem. The difference between the versions is that the hard version does require you to output the numbers of the rods to be removed. You can make hacks only if all versions of the problem are solved. Stitch likes experimenting with different machines with his friend Sparky. Today they built another machine. The main element of this machine are n rods arranged along one straight line and numbered from 1 to n inclusive. Each of these rods must carry an electric charge quantitatively equal to either 1 or -1 (otherwise the machine will not work). Another condition for this machine to work is that the sign-variable sum of the charge on all rods must be zero. More formally, the rods can be represented as an array of n numbers characterizing the charge: either 1 or -1 . Then the condition must hold: a_1 - a_2 + a_3 - a_4 + ldots = 0 , or sum limits_{i=1}^n (-1)^{i-1} cdot a_i = 0 . Sparky charged all n rods with an electric current, but unfortunately it happened that the rods were not charged correctly (the sign-variable sum of the charge is not zero). The friends decided to leave only some of the rods in the machine. Sparky has q questions. In the i th question Sparky asks: if the machine consisted only of rods with numbers l_i to r_i inclusive, what minimal number of rods could be removed from the machine so that the sign-variable sum of charges on the remaining ones would be zero? Also Sparky wants to know the numbers of these rods. Perhaps the friends got something wrong, and the sign-variable sum is already zero. In that case, you don't have to remove the rods at all. If the number of rods is zero, we will assume that the sign-variable sum of charges is zero, that is, we can always remove all rods. Help your friends and answer all of Sparky's questions! Each test contains multiple test cases. The first line contains one positive integer"...

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
127154547 ympc2005 D2 Aug. 27, 2021, 3:29 a.m. OK GNU C++14 TESTS 48 280 5222400
127147929 dottle D2 Aug. 27, 2021, 1:17 a.m. OK GNU C++14 TESTS 48 296 6246400
127122063 realbe D2 Aug. 26, 2021, 4:41 p.m. OK GNU C++14 TESTS 48 311 5222400
127151052 Dzhao D2 Aug. 27, 2021, 2:25 a.m. OK GNU C++14 TESTS 48 311 25907200
127156177 93wilsonlu D2 Aug. 27, 2021, 3:57 a.m. OK GNU C++14 TESTS 48 327 5939200
127162198 ConferenceCall D2 Aug. 27, 2021, 5:32 a.m. OK GNU C++14 TESTS 48 327 6451200
127124791 Larry0101 D2 Aug. 26, 2021, 4:47 p.m. OK GNU C++14 TESTS 48 327 23961600
127124825 tien05062004 D2 Aug. 26, 2021, 4:48 p.m. OK GNU C++14 TESTS 48 327 24985600
127160903 invaded D2 Aug. 27, 2021, 5:13 a.m. OK GNU C++14 TESTS 48 342 6451200
127130492 dagexiangdani D2 Aug. 26, 2021, 5:56 p.m. OK GNU C++14 TESTS 48 342 24678400
127152088 qinghua D2 Aug. 27, 2021, 2:46 a.m. OK GNU C++17 TESTS 48 295 5222400
127153992 jiuzhe123456789 D2 Aug. 27, 2021, 3:21 a.m. OK GNU C++17 TESTS 48 296 5222400
127158890 forverss D2 Aug. 27, 2021, 4:44 a.m. OK GNU C++17 TESTS 48 296 17715200
127147600 065583 D2 Aug. 27, 2021, 1:09 a.m. OK GNU C++17 TESTS 48 311 5222400
127162748 NinjaDoggy D2 Aug. 27, 2021, 5:41 a.m. OK GNU C++17 TESTS 48 311 18841600
127131952 cakewalk_nahi_hota D2 Aug. 26, 2021, 6:08 p.m. OK GNU C++17 TESTS 48 312 24883200
127132579 KULIKOLD D2 Aug. 26, 2021, 6:14 p.m. OK GNU C++17 TESTS 48 326 18329600
127152468 Yang_Lin D2 Aug. 27, 2021, 2:53 a.m. OK GNU C++17 TESTS 48 326 50790400
127154052 _horizon_ D2 Aug. 27, 2021, 3:22 a.m. OK GNU C++17 TESTS 48 326 53350400
127163461 Superme.. D2 Aug. 27, 2021, 5:51 a.m. OK GNU C++17 TESTS 48 327 5222400
127151018 linxd D2 Aug. 27, 2021, 2:24 a.m. OK GNU C++17 (64) TESTS 48 218 7065600
127151669 yangjz D2 Aug. 27, 2021, 2:38 a.m. OK GNU C++17 (64) TESTS 48 249 6758400
127123196 kulmak41 D2 Aug. 26, 2021, 4:44 p.m. OK GNU C++17 (64) TESTS 48 265 6758400
127160163 mysteri0us7 D2 Aug. 27, 2021, 5:03 a.m. OK GNU C++17 (64) TESTS 48 265 25088000
127147915 ha15 D2 Aug. 27, 2021, 1:17 a.m. OK GNU C++17 (64) TESTS 48 280 6553600
127134218 twoslowaf D2 Aug. 26, 2021, 6:34 p.m. OK GNU C++17 (64) TESTS 48 280 10137600
127162006 dakansa D2 Aug. 27, 2021, 5:29 a.m. OK GNU C++17 (64) TESTS 48 280 39731200
127154267 duyuxuan_0117 D2 Aug. 27, 2021, 3:25 a.m. OK GNU C++17 (64) TESTS 48 295 16691200
127153114 CookieHCl D2 Aug. 27, 2021, 3:05 a.m. OK GNU C++17 (64) TESTS 48 295 25292800
127155823 duyuxuan0117 D2 Aug. 27, 2021, 3:51 a.m. OK GNU C++17 (64) TESTS 48 296 16691200
127155160 pili D2 Aug. 27, 2021, 3:40 a.m. OK Java 11 TESTS 48 998 111718400
127131116 The_Apurv_Rathore D2 Aug. 26, 2021, 6:01 p.m. OK PyPy 3 TESTS 48 764 55091200
127124664 silentone D2 Aug. 26, 2021, 4:47 p.m. OK PyPy 3 TESTS 48 764 55091200
127133677 hxu10 D2 Aug. 26, 2021, 6:27 p.m. OK PyPy 3 TESTS 48 1185 77824000
127128995 hxu10 D2 Aug. 26, 2021, 5:45 p.m. OK PyPy 3 TESTS 48 1310 77414400
127150586 codicon D2 Aug. 27, 2021, 2:15 a.m. OK PyPy 3 TESTS 48 1419 94822400
127150483 codicon D2 Aug. 27, 2021, 2:12 a.m. OK PyPy 3 TESTS 48 1496 95027200
127134751 hxu10 D2 Aug. 26, 2021, 6:41 p.m. OK PyPy 3 TESTS 48 1699 85504000
127139313 titia D2 Aug. 26, 2021, 7:57 p.m. OK PyPy 3 TESTS 48 1856 98816000
127148892 myotra D2 Aug. 27, 2021, 1:38 a.m. OK PyPy 3 TESTS 48 1887 85196800
127127819 taiga0629 D2 Aug. 26, 2021, 5:40 p.m. OK PyPy 3 TESTS 48 1902 74240000
127127678 apilat D2 Aug. 26, 2021, 5:40 p.m. OK Rust TESTS 48 358 14233600

remove filters

Back to search problems