Codeforces Round 373 (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
719 Codeforces Round 373 (Div. 2) FINISHED False 7200 262976104 Sept. 23, 2016, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8534 ) B Anatoly and Cockroaches PROGRAMMING greedy 1400

B"Anatoly lives in the university dorm as many other students do. As you know, cockroaches are also living there together with students. Cockroaches might be of two colors: black and red. There are n cockroaches living in Anatoly's room. Anatoly just made all his cockroaches to form a single line. As he is a perfectionist, he would like the colors of cockroaches in the line to alternate. He has a can of black paint and a can of red paint. In one turn he can either swap any two cockroaches, or take any single cockroach and change it's color. Help Anatoly find out the minimum number of turns he needs to make the colors of cockroaches in the line alternate. The first line of the input contains a single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- the number of cockroaches. The second line contains a string of length n, consisting of characters 'b' and 'r' that denote black cockroach and red cockroach respectively. Print one integer -- the minimum number of moves Anatoly has to perform in order to make the colors of cockroaches in the line to alternate. In the first sample, Anatoly has to swap third and fourth cockroaches. He needs 1 turn to do this. In the second sample, the optimum answer is to paint the second and the fourth cockroaches red. This requires 2 turns. In the third sample, the colors of cockroaches in the line are alternating already, thus the answer is 0."...

Tutorials

Codeforces Round #373 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
58128486 saivardhan18 B Aug. 1, 2019, 1:25 p.m. OK Clang++17 Diagnostics TESTS 46 77 14745600 1400
33923516 sonya123 B Jan. 5, 2018, 2:18 p.m. OK D TESTS 46 15 7168000 1400
22252313 DanLys B Nov. 15, 2016, 8:56 p.m. OK Delphi TESTS 46 15 102400 1400
21129000 Vadim B Oct. 3, 2016, 5:27 a.m. OK FPC TESTS 46 15 102400 1400
20944634 k2nt B Sept. 27, 2016, 11:43 a.m. OK FPC TESTS 46 15 409600 1400
21989749 NikeVas B Nov. 2, 2016, 11:40 a.m. OK FPC TESTS 46 15 512000 1400
28818709 hlly B July 24, 2017, 8:11 a.m. OK FPC TESTS 46 15 2252800 1400
21254824 trungdotran98 B Oct. 7, 2016, 10:15 a.m. OK FPC TESTS 46 15 2355200 1400
20899486 FRIENDLY B Sept. 25, 2016, 2:13 a.m. OK FPC TESTS 46 30 0 1400
20882318 Pavel-svinticki B Sept. 24, 2016, 6:43 a.m. OK FPC TESTS 46 30 0 1400
20896539 Daryusz B Sept. 24, 2016, 7:59 p.m. OK FPC TESTS 46 30 307200 1400
20887222 Zeron B Sept. 24, 2016, 12:02 p.m. OK FPC TESTS 46 30 307200 1400
20883662 pavudaloy B Sept. 24, 2016, 9:09 a.m. OK FPC TESTS 46 30 409600 1400
22067077 nir123 B Nov. 6, 2016, 2:24 a.m. OK GNU C TESTS 46 15 102400 1400
23025253 Broly_05_06_98 B Dec. 16, 2016, 8:51 a.m. OK GNU C TESTS 46 15 102400 1400
22136261 numb1 B Nov. 9, 2016, 5:42 p.m. OK GNU C TESTS 46 15 102400 1400
22123651 Thishandleiscurrent B Nov. 9, 2016, 4:57 a.m. OK GNU C TESTS 46 15 102400 1400
21847435 pratik0509 B Oct. 28, 2016, 1:05 p.m. OK GNU C TESTS 46 15 102400 1400
21633902 GT_18 B Oct. 21, 2016, 6:13 a.m. OK GNU C TESTS 46 15 102400 1400
20931440 repeater99 B Sept. 26, 2016, 5:51 p.m. OK GNU C TESTS 46 15 102400 1400
20883827 hsniper B Sept. 24, 2016, 9:29 a.m. OK GNU C TESTS 46 15 102400 1400
20878369 yigezhe B Sept. 24, 2016, 1:35 a.m. OK GNU C TESTS 46 15 102400 1400
20871581 vandana B Sept. 23, 2016, 6:08 p.m. OK GNU C TESTS 46 15 102400 1400
32141213 zezzez B Nov. 8, 2017, 1:45 p.m. OK GNU C++ TESTS 46 15 0 1400
32140929 vjudge3 B Nov. 8, 2017, 1:26 p.m. OK GNU C++ TESTS 46 15 0 1400
31996692 vjudge4 B Nov. 3, 2017, 3:02 a.m. OK GNU C++ TESTS 46 15 0 1400
31854433 vjudge1 B Oct. 29, 2017, 3 a.m. OK GNU C++ TESTS 46 15 0 1400
29701959 vjudge1 B Aug. 23, 2017, 8:41 a.m. OK GNU C++ TESTS 46 15 0 1400
22853561 DatVu B Dec. 10, 2016, 11:18 a.m. OK GNU C++ TESTS 46 15 0 1400
22614735 challengers B Nov. 30, 2016, 5:55 a.m. OK GNU C++ TESTS 46 15 0 1400
22284947 C1inkz B Nov. 17, 2016, 10:09 a.m. OK GNU C++ TESTS 46 15 0 1400
22217395 vjudge4 B Nov. 15, 2016, 6:17 a.m. OK GNU C++ TESTS 46 15 0 1400
22161425 pkien B Nov. 11, 2016, 11:09 a.m. OK GNU C++ TESTS 46 15 0 1400
20982609 kishore_kumar B Sept. 29, 2016, 3:21 a.m. OK GNU C11 TESTS 46 15 102400 1400
20937786 tanmiiti B Sept. 27, 2016, 4:40 a.m. OK GNU C11 TESTS 46 15 102400 1400
20967774 FBD B Sept. 28, 2016, 1:11 p.m. OK GNU C11 TESTS 46 15 102400 1400
23391133 pikachucoding B Dec. 29, 2016, 6:11 a.m. OK GNU C11 TESTS 46 15 1945600 1400
26464570 vjudge2 B April 17, 2017, 9:20 p.m. OK GNU C11 TESTS 46 15 1945600 1400
23482689 Maanik B Jan. 1, 2017, 11:54 a.m. OK GNU C11 TESTS 46 15 1945600 1400
23199531 nayem_097 B Dec. 21, 2016, 12:56 p.m. OK GNU C11 TESTS 46 15 1945600 1400
20868305 jianhua623 B Sept. 23, 2016, 4:50 p.m. OK GNU C11 TESTS 46 30 102400 1400
63697994 vjudge3 B Oct. 29, 2019, 6:15 a.m. OK GNU C11 TESTS 46 30 102400 1400
63699149 luogu_bot4 B Oct. 29, 2019, 6:41 a.m. OK GNU C11 TESTS 46 31 102400 1400
20969670 zhrt B Sept. 28, 2016, 2:21 p.m. OK GNU C++11 TESTS 46 15 0 1400
20964159 abhishekx300 B Sept. 28, 2016, 10:01 a.m. OK GNU C++11 TESTS 46 15 0 1400
26974196 SegmentationRight B May 9, 2017, 1:01 p.m. OK GNU C++11 TESTS 46 15 0 1400
20977218 nyan101 B Sept. 28, 2016, 7:01 p.m. OK GNU C++11 TESTS 46 15 0 1400
20957781 dejmas B Sept. 27, 2016, 11:23 p.m. OK GNU C++11 TESTS 46 15 0 1400
20947310 928688134 B Sept. 27, 2016, 1:36 p.m. OK GNU C++11 TESTS 46 15 0 1400
20928203 dpppBR B Sept. 26, 2016, 3:03 p.m. OK GNU C++11 TESTS 46 15 0 1400
20908360 bruno.iljazovic B Sept. 25, 2016, 1 p.m. OK GNU C++11 TESTS 46 15 0 1400
20907562 RiHL B Sept. 25, 2016, 12:17 p.m. OK GNU C++11 TESTS 46 15 0 1400
20891262 madboy B Sept. 24, 2016, 3:11 p.m. OK GNU C++11 TESTS 46 15 0 1400
31699629 yashar_sb_sb B Oct. 25, 2017, 5:42 a.m. OK GNU C++14 TESTS 46 15 0 1400
30387872 sd_non B Sept. 16, 2017, 4:16 p.m. OK GNU C++14 TESTS 46 15 0 1400
27869936 deepak096 B June 17, 2017, 7:49 p.m. OK GNU C++14 TESTS 46 15 0 1400
21172890 Amores B Oct. 3, 2016, 8:18 p.m. OK GNU C++14 TESTS 46 15 0 1400
20935184 markun B Sept. 26, 2016, 10:04 p.m. OK GNU C++14 TESTS 46 15 0 1400
20935130 markun B Sept. 26, 2016, 9:58 p.m. OK GNU C++14 TESTS 46 15 0 1400
20929596 EoinDavey B Sept. 26, 2016, 4:18 p.m. OK GNU C++14 TESTS 46 15 0 1400
45378151 vjudge1 B Nov. 6, 2018, 1:22 p.m. OK GNU C++14 TESTS 46 15 102400 1400
26835595 hzcong B May 4, 2017, 1:28 p.m. OK GNU C++14 TESTS 46 15 102400 1400
26835489 hzcong B May 4, 2017, 1:23 p.m. OK GNU C++14 TESTS 46 15 102400 1400
47799234 JonathanR B Dec. 31, 2018, 8:10 p.m. OK GNU C++17 TESTS 46 15 307200 1400
58362261 vjudge3 B Aug. 6, 2019, 1:33 a.m. OK GNU C++17 TESTS 46 15 307200 1400
52242206 vjudge2 B April 2, 2019, 4:26 p.m. OK GNU C++17 TESTS 46 30 102400 1400
41607944 vjudge2 B Aug. 15, 2018, 4:25 a.m. OK GNU C++17 TESTS 46 30 102400 1400
59253424 monggo1995 B Aug. 22, 2019, 5:22 a.m. OK GNU C++17 TESTS 46 30 102400 1400
44151564 great05 B Oct. 11, 2018, 4:49 p.m. OK GNU C++17 TESTS 46 30 204800 1400
57252902 vjudge2 B July 18, 2019, 12:51 a.m. OK GNU C++17 TESTS 46 30 307200 1400
65239102 Hoooly B Nov. 17, 2019, 8:17 a.m. OK GNU C++17 TESTS 46 30 307200 1400
52257977 VictorDW B April 3, 2019, 7:03 a.m. OK GNU C++17 TESTS 46 30 307200 1400
56245063 Homeless_Demon B June 28, 2019, 8:32 p.m. OK GNU C++17 TESTS 46 30 307200 1400
21276501 goC B Oct. 8, 2016, 9:24 a.m. OK Go TESTS 46 30 6041600 1400
20868689 orb B Sept. 23, 2016, 4:57 p.m. OK Go TESTS 46 31 1126400 1400
27227209 yuliang B May 20, 2017, 3:21 a.m. OK Go TESTS 46 31 19251200 1400
20879385 dblokhin B Sept. 24, 2016, 2:49 a.m. OK Go TESTS 46 62 0 1400
51159584 abod.hi.5 B March 11, 2019, 11:45 a.m. OK Java 8 TESTS 46 108 0 1400
54071283 lebaur B May 13, 2019, 4:23 p.m. OK Java 8 TESTS 46 109 0 1400
30238502 zodiacleo B Sept. 10, 2017, 5:51 a.m. OK Java 8 TESTS 46 109 0 1400
27826124 parth_1 B June 16, 2017, 1:29 p.m. OK Java 8 TESTS 46 109 0 1400
27718215 Alexxx B June 11, 2017, 9:13 a.m. OK Java 8 TESTS 46 109 0 1400
27292158 Bibhuti B May 23, 2017, 12:46 a.m. OK Java 8 TESTS 46 109 0 1400
22723883 Abdullah_Abu_Alrish B Dec. 6, 2016, 6:10 a.m. OK Java 8 TESTS 46 109 0 1400
23668143 VerticesEdge B Jan. 9, 2017, 5:35 p.m. OK Java 8 TESTS 46 109 20377600 1400
29195629 Omegaxis213 B Aug. 4, 2017, 1:54 p.m. OK Java 8 TESTS 46 109 20582400 1400
67407799 thisbeit B Dec. 22, 2019, 7:07 a.m. OK Java 8 TESTS 46 124 0 1400
21109658 sapir.merzel B Oct. 2, 2016, 8:47 a.m. OK JavaScript TESTS 46 31 102400 1400
21164933 georgemichal1234 B Oct. 3, 2016, 3:27 p.m. OK JavaScript TESTS 46 31 102400 1400
21302497 inbarking B Oct. 8, 2016, 5:51 p.m. OK JavaScript TESTS 46 31 5939200 1400
21109536 oferwald B Oct. 2, 2016, 8:42 a.m. OK JavaScript TESTS 46 46 102400 1400
62435711 david_varela B Oct. 12, 2019, 5:25 p.m. OK Kotlin TESTS 46 155 0 1400
59696989 XinLoiNguoi B Aug. 30, 2019, 8:59 a.m. OK Kotlin TESTS 46 155 921600 1400
21015364 Arthur B Sept. 30, 2016, 1:29 p.m. OK Kotlin TESTS 46 202 512000 1400
21277979 Fermath B Oct. 8, 2016, 10:45 a.m. OK Mono C# TESTS 46 46 9523200 1400
21277288 Fermath B Oct. 8, 2016, 10:07 a.m. OK Mono C# TESTS 46 61 9523200 1400
45469941 Skndr801 B Nov. 9, 2018, 8:55 a.m. OK Mono C# TESTS 46 62 921600 1400
21208059 TRR B Oct. 5, 2016, 12:25 p.m. OK Mono C# TESTS 46 77 819200 1400
21730810 bfiedler B Oct. 23, 2016, 11:24 p.m. OK Mono C# TESTS 46 77 2969600 1400
44521236 nemars B Oct. 18, 2018, 8:44 p.m. OK Mono C# TESTS 46 77 6860800 1400
21334788 Fermath B Oct. 10, 2016, 9:31 a.m. OK Mono C# TESTS 46 77 9523200 1400
20879421 pomjuice B Sept. 24, 2016, 2:51 a.m. OK Mono C# TESTS 46 78 3584000 1400
21010114 halka B Sept. 30, 2016, 8:12 a.m. OK MS C# TESTS 46 46 409600 1400
27461187 ilya22877 B May 31, 2017, 7:28 a.m. OK MS C# TESTS 46 46 512000 1400
27461587 napoleonit B May 31, 2017, 7:54 a.m. OK MS C# TESTS 46 46 512000 1400
29524252 Skndr B Aug. 17, 2017, 10:44 a.m. OK MS C# TESTS 46 46 1228800 1400
23683364 Alexandr_TS B Jan. 10, 2017, 3:11 p.m. OK MS C# TESTS 46 46 9216000 1400
20944732 Chubcheg B Sept. 27, 2016, 11:48 a.m. OK MS C# TESTS 46 61 409600 1400
20867434 AnatolyTolstobrov B Sept. 23, 2016, 4:35 p.m. OK MS C# TESTS 46 62 512000 1400
20941819 azukun B Sept. 27, 2016, 9:28 a.m. OK MS C# TESTS 46 62 1024000 1400
20940458 nrvg B Sept. 27, 2016, 8:25 a.m. OK MS C# TESTS 46 62 3481600 1400
21327996 DanilaMaestro B Oct. 9, 2016, 10:44 p.m. OK MS C# TESTS 46 62 9318400 1400
20953760 Iriskinn B Sept. 27, 2016, 6:21 p.m. OK MS C++ TESTS 46 15 0 1400
20987713 Liangfj B Sept. 29, 2016, 9:27 a.m. OK MS C++ TESTS 46 15 102400 1400
20961972 armand B Sept. 28, 2016, 7:36 a.m. OK MS C++ TESTS 46 15 102400 1400
20950967 lxga B Sept. 27, 2016, 4:11 p.m. OK MS C++ TESTS 46 15 102400 1400
20899954 helloww B Sept. 25, 2016, 3:15 a.m. OK MS C++ TESTS 46 15 102400 1400
20889452 Ariescc B Sept. 24, 2016, 1:50 p.m. OK MS C++ TESTS 46 15 102400 1400
20868122 Isaac_wjl B Sept. 23, 2016, 4:47 p.m. OK MS C++ TESTS 46 15 102400 1400
44022624 sdibt5 B Oct. 9, 2018, 5:38 a.m. OK MS C++ TESTS 46 15 102400 1400
20908887 Ally0729 B Sept. 25, 2016, 1:33 p.m. OK MS C++ TESTS 46 15 204800 1400
29700342 vjudge5 B Aug. 23, 2017, 7:25 a.m. OK MS C++ TESTS 46 15 204800 1400
58362258 vjudge4 B Aug. 6, 2019, 1:33 a.m. OK MS C++ 2017 TESTS 46 31 204800 1400
64638265 vjudge5 B Nov. 10, 2019, 12:16 p.m. OK MS C++ 2017 TESTS 46 31 307200 1400
64795567 Mad112233 B Nov. 13, 2019, 12:45 p.m. OK MS C++ 2017 TESTS 46 31 307200 1400
56100331 felix412441 B June 26, 2019, 3:27 p.m. OK MS C++ 2017 TESTS 46 31 307200 1400
68344586 immortal_luo B Jan. 7, 2020, 6:26 a.m. OK MS C++ 2017 TESTS 46 31 512000 1400
59131603 CtrlAlt B Aug. 20, 2019, 11:13 a.m. OK MS C++ 2017 TESTS 46 31 512000 1400
20873246 rsFalse B Sept. 23, 2016, 7:13 p.m. OK Perl TESTS 46 93 0 1400
20897232 mayakin B Sept. 24, 2016, 8:48 p.m. OK PHP TESTS 46 62 307200 1400
21590638 skamz B Oct. 19, 2016, 11:56 a.m. OK PHP TESTS 46 62 5017600 1400
20874336 Eeyore B Sept. 23, 2016, 8:02 p.m. OK PyPy 2 TESTS 46 93 307200 1400
25214242 Unlenin B March 4, 2017, 1:24 p.m. OK PyPy 2 TESTS 46 93 27545600 1400
20911263 abhigupta4 B Sept. 25, 2016, 3:57 p.m. OK PyPy 2 TESTS 46 109 307200 1400
20882008 boombastic B Sept. 24, 2016, 6:11 a.m. OK PyPy 2 TESTS 46 109 614400 1400
45347943 soumyasarkar1998 B Nov. 6, 2018, 5:16 a.m. OK PyPy 2 TESTS 46 187 716800 1400
26896498 zalioos B May 6, 2017, 8:29 a.m. OK PyPy 3 TESTS 46 124 2252800 1400
29439066 Qumeric B Aug. 13, 2017, 4:31 p.m. OK PyPy 3 TESTS 46 124 24166400 1400
32061582 nonis B Nov. 4, 2017, 7:01 p.m. OK PyPy 3 TESTS 46 139 4812800 1400
27982604 _AUR_ B June 23, 2017, 10:32 a.m. OK PyPy 3 TESTS 46 139 24371200 1400
63511384 kchau B Oct. 26, 2019, 8:45 p.m. OK PyPy 3 TESTS 46 155 2150400 1400
57260451 vjudge3 B July 18, 2019, 4:51 a.m. OK PyPy 3 TESTS 46 155 2150400 1400
61399025 lIn_nIl B Sept. 28, 2019, 4:14 a.m. OK PyPy 3 TESTS 46 155 5222400 1400
69084954 vishwesh18 B Jan. 19, 2020, 7:56 a.m. OK PyPy 3 TESTS 46 155 6041600 1400
20869325 ivangood67 B Sept. 23, 2016, 5:09 p.m. OK PyPy 3 TESTS 46 156 1536000 1400
67984161 galim665 B Dec. 30, 2019, 9:07 p.m. OK PyPy 3 TESTS 46 156 4710400 1400
20908463 PlamenDuchev B Sept. 25, 2016, 1:07 p.m. OK Python 2 TESTS 46 62 307200 1400
33753337 laoliumang B Dec. 29, 2017, 7:22 a.m. OK Python 2 TESTS 46 62 4915200 1400
33748957 laoliumang B Dec. 29, 2017, 2:49 a.m. OK Python 2 TESTS 46 62 4915200 1400
20910027 k.koukiou B Sept. 25, 2016, 2:36 p.m. OK Python 2 TESTS 46 77 204800 1400
20895090 elistark B Sept. 24, 2016, 6:21 p.m. OK Python 2 TESTS 46 77 204800 1400
21771962 xxdxx B Oct. 25, 2016, 1:26 p.m. OK Python 2 TESTS 46 78 1740800 1400
21376739 gahou B Oct. 12, 2016, 8:34 a.m. OK Python 2 TESTS 46 78 5222400 1400
20925311 starry_tales B Sept. 26, 2016, 12:43 p.m. OK Python 2 TESTS 46 92 1740800 1400
31224515 wwz B Oct. 11, 2017, 5:57 p.m. OK Python 2 TESTS 46 93 204800 1400
22393777 Nicolas-Zon B Nov. 21, 2016, 11:43 p.m. OK Python 2 TESTS 46 93 204800 1400
22717281 merolish B Dec. 5, 2016, 6:14 p.m. OK Python 3 TESTS 46 62 307200 1400
20930787 orailly B Sept. 26, 2016, 5:21 p.m. OK Python 3 TESTS 46 62 307200 1400
34582699 Mahdi_Shokoufi B Jan. 26, 2018, 4:58 p.m. OK Python 3 TESTS 46 62 5836800 1400
20889221 a_really_cool_handle B Sept. 24, 2016, 1:36 p.m. OK Python 3 TESTS 46 77 307200 1400
29286168 dranikpg B Aug. 8, 2017, 1:31 p.m. OK Python 3 TESTS 46 78 4915200 1400
27813649 Christopher-Perkins B June 15, 2017, 11:24 p.m. OK Python 3 TESTS 46 93 204800 1400
27390175 PAPICHbogdoti2 B May 27, 2017, 1:44 p.m. OK Python 3 TESTS 46 93 307200 1400
22565734 bencheung8506 B Nov. 28, 2016, 6:35 a.m. OK Python 3 TESTS 46 93 307200 1400
22427668 Koi_ga_umareru B Nov. 23, 2016, 4:28 p.m. OK Python 3 TESTS 46 93 307200 1400
20911676 bjtuzpf007 B Sept. 25, 2016, 4:27 p.m. OK Python 3 TESTS 46 93 307200 1400
20893402 cielavenir B Sept. 24, 2016, 4:55 p.m. OK Ruby TESTS 46 124 204800 1400
20900698 kei742 B Sept. 25, 2016, 5:06 a.m. OK Ruby TESTS 46 124 307200 1400
23549449 dione B Jan. 5, 2017, 7:09 a.m. OK Ruby TESTS 46 140 6656000 1400
20948609 hogeover30 B Sept. 27, 2016, 2:23 p.m. OK Ruby TESTS 46 155 307200 1400
20895372 Danil B Sept. 24, 2016, 6:41 p.m. OK Ruby TESTS 46 155 15564800 1400
20948719 hogeover30 B Sept. 27, 2016, 2:27 p.m. OK Ruby TESTS 46 171 307200 1400
20870363 Lumin B Sept. 23, 2016, 5:32 p.m. OK Ruby TESTS 46 186 16384000 1400
28276029 jiangzhijie B July 4, 2017, 8:57 a.m. OK Rust TESTS 46 31 54374400 1400
22500115 xzhao B Nov. 26, 2016, 2:42 a.m. OK Rust TESTS 46 46 921600 1400
21630869 reldan B Oct. 21, 2016, 12:56 a.m. OK Scala TESTS 46 311 0 1400
20979187 byte B Sept. 28, 2016, 9:01 p.m. OK Scala TESTS 46 358 0 1400

remove filters

Back to search problems