Codeforces Round 353 (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
675 Codeforces Round 353 (Div. 2) FINISHED False 7200 268406699 May 16, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3661 ) C Money Transfers PROGRAMMING constructive algorithms data structures greedy sortings 2000

B"There are n banks in the city where Vasya lives, they are located in a circle, such that any two banks are neighbouring if their indices differ by no more than 1. Also, bank 1 and bank n are neighbours if n xe2 x80 x89> xe2 x80 x891. No bank is a neighbour of itself. Vasya has an account in each bank. Its balance may be negative, meaning Vasya owes some money to this bank. There is only one type of operations available: transfer some amount of money from any bank to account in any neighbouring bank. There are no restrictions on the size of the sum being transferred or balance requirements to perform this operation. Vasya doesn't like to deal with large numbers, so he asks you to determine the minimum number of operations required to change the balance of each bank account to zero. It's guaranteed, that this is possible to achieve, that is, the total balance of Vasya in all banks is equal to zero. 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 banks. The second line contains n integers ai ( xe2 x80 x89- xe2 x80 x89109 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109), the i-th of them is equal to the initial balance of the account in the i-th bank. It's guaranteed that the sum of all ai is equal to 0. Print the minimum number of operations required to change balance in each bank to zero. In the first sample, Vasya may transfer 5 from the first bank to the third. In the second sample, Vasya may first transfer 1 from the third bank to the second, and then 1 from the second to the first. In the third sample, the following sequence provides the optimal answer: "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
21409770 StarScreamOwl C Oct. 13, 2016, 6:08 p.m. OK Delphi TESTS 41 155 4096000 2000
32788982 TShT C Nov. 29, 2017, 7:26 p.m. OK FPC TESTS 41 46 2457600 2000
18021077 Ahriman C May 21, 2016, 3:50 p.m. OK FPC TESTS 41 46 2560000 2000
17994837 truongtop14 C May 19, 2016, 4:58 p.m. OK FPC TESTS 41 46 2560000 2000
19051053 qbao_asdasd C July 12, 2016, 12:37 p.m. OK FPC TESTS 41 46 7987200 2000
20660880 dxtpc C Sept. 16, 2016, 1:32 p.m. OK FPC TESTS 41 46 8192000 2000
18167208 lkmcfj C May 31, 2016, 10:54 a.m. OK FPC TESTS 41 46 17817600 2000
22207967 WalkingDeade C Nov. 14, 2016, 1:24 p.m. OK FPC TESTS 41 46 32153600 2000
21176844 unnamed_04 C Oct. 4, 2016, 2:28 a.m. OK FPC TESTS 41 62 819200 2000
21176719 unnamed_04 C Oct. 4, 2016, 2:19 a.m. OK FPC TESTS 41 62 819200 2000
43288802 chaorenhaha C Sept. 23, 2018, 9:37 a.m. OK FPC TESTS 41 62 1638400 2000
19161510 ekrem C July 15, 2016, 8:33 p.m. OK GNU C TESTS 41 46 1638400 2000
18382375 ekrem C June 11, 2016, 11:10 p.m. OK GNU C TESTS 41 46 3686400 2000
18652659 Chipe1 C June 22, 2016, 8:24 p.m. OK GNU C TESTS 41 61 1638400 2000
18035352 rmtgh C May 22, 2016, 7:20 p.m. OK GNU C TESTS 41 62 5632000 2000
18212963 Phoenix_Galaxy C June 2, 2016, 8:28 a.m. OK GNU C TESTS 41 327 118272000 2000
21401163 ws_syx C Oct. 13, 2016, 11:05 a.m. OK GNU C++ TESTS 41 31 6451200 2000
32553536 vjudge2 C Nov. 22, 2017, 2:29 p.m. OK GNU C++ TESTS 41 46 614400 2000
22469761 vjudge1 C Nov. 24, 2016, 3:03 p.m. OK GNU C++ TESTS 41 46 819200 2000
18545210 chinmay2 C June 17, 2016, 2:49 p.m. OK GNU C++ TESTS 41 46 819200 2000
19226790 cyand1317 C July 19, 2016, 7:59 a.m. OK GNU C++ TESTS 41 46 1024000 2000
26968138 raghav_19 C May 9, 2017, 6:02 a.m. OK GNU C++ TESTS 41 46 2048000 2000
24519620 vjudge3 C Feb. 8, 2017, 6:40 a.m. OK GNU C++ TESTS 41 46 2662400 2000
18253087 Wolf_Zheng C June 5, 2016, 6:51 a.m. OK GNU C++ TESTS 41 46 2662400 2000
18253492 lzwings C June 5, 2016, 7:28 a.m. OK GNU C++ TESTS 41 46 2867200 2000
29377614 vjudge5 C Aug. 12, 2017, 12:48 p.m. OK GNU C++ TESTS 41 46 2867200 2000
57102395 rainboy C July 15, 2019, 2:13 p.m. OK GNU C11 TESTS 41 62 819200 2000
32554597 wangcwc C Nov. 22, 2017, 3:07 p.m. OK GNU C++11 TESTS 41 31 2048000 2000
25453920 ls4154 C March 13, 2017, 12:46 p.m. OK GNU C++11 TESTS 41 31 2662400 2000
21556432 iplockers C Oct. 18, 2016, 3:44 a.m. OK GNU C++11 TESTS 41 31 3276800 2000
27613306 plokmijn C June 6, 2017, 12:19 p.m. OK GNU C++11 TESTS 41 31 4096000 2000
26535273 buctacm2 C April 21, 2017, 10:28 a.m. OK GNU C++11 TESTS 41 31 6144000 2000
18169284 VAVAvile C May 31, 2016, 1:30 p.m. OK GNU C++11 TESTS 41 31 6348800 2000
20473454 lzw4896s C Sept. 9, 2016, 7:14 a.m. OK GNU C++11 TESTS 41 46 819200 2000
32554015 vjudge2 C Nov. 22, 2017, 2:45 p.m. OK GNU C++11 TESTS 41 46 2048000 2000
32995342 zpx C Dec. 7, 2017, 8:16 a.m. OK GNU C++11 TESTS 41 46 2662400 2000
23390279 cokamu C Dec. 29, 2016, 4:42 a.m. OK GNU C++11 TESTS 41 46 2867200 2000
32245683 corneliu.dcv C Nov. 12, 2017, 2:11 p.m. OK GNU C++14 TESTS 41 46 819200 2000
31786167 Bogdanisar C Oct. 27, 2017, 7:09 a.m. OK GNU C++14 TESTS 41 46 921600 2000
31832993 SniffesTheRose C Oct. 28, 2017, 10:55 a.m. OK GNU C++14 TESTS 41 46 1228800 2000
29524478 Beryls C Aug. 17, 2017, 10:59 a.m. OK GNU C++14 TESTS 41 46 1638400 2000
31786036 Malig C Oct. 27, 2017, 7:04 a.m. OK GNU C++14 TESTS 41 46 2457600 2000
28185692 Megumi_ C July 1, 2017, 6:59 a.m. OK GNU C++14 TESTS 41 46 2867200 2000
35779323 AndreiS C Feb. 28, 2018, 9:03 a.m. OK GNU C++14 TESTS 41 46 4403200 2000
32070812 Malig C Nov. 5, 2017, 8:07 a.m. OK GNU C++14 TESTS 41 46 7987200 2000
33662699 _S1MPLE_ C Dec. 27, 2017, 6:57 a.m. OK GNU C++14 TESTS 41 46 9728000 2000
24798940 AMnu C Feb. 19, 2017, 9:50 a.m. OK GNU C++14 TESTS 41 61 2764800 2000
45443879 Ashishgup C Nov. 8, 2018, 12:27 p.m. OK GNU C++17 TESTS 41 61 5017600 2000
40667078 vjudge1 C July 23, 2018, 10:28 a.m. OK GNU C++17 TESTS 41 62 819200 2000
54696715 ak_96 C May 26, 2019, 7:30 p.m. OK GNU C++17 TESTS 41 62 819200 2000
60479277 TD06 C Sept. 13, 2019, 9:39 a.m. OK GNU C++17 TESTS 41 62 1638400 2000
54934900 vjudge1 C June 1, 2019, 3:47 p.m. OK GNU C++17 TESTS 41 62 1638400 2000
50535912 ivan100sic C Feb. 26, 2019, 3:41 p.m. OK GNU C++17 TESTS 41 62 1638400 2000
46573115 caheman C Dec. 4, 2018, 7:07 a.m. OK GNU C++17 TESTS 41 62 1638400 2000
67754341 m.hasan01 C Dec. 27, 2019, 6:55 p.m. OK GNU C++17 TESTS 41 62 4198400 2000
66478825 Anji C Dec. 7, 2019, 11:20 p.m. OK GNU C++17 TESTS 41 62 4198400 2000
69230563 Alchemist0 C Jan. 21, 2020, 9:18 a.m. OK GNU C++17 TESTS 41 62 4198400 2000
18291169 behzad.nouri C June 7, 2016, 10:37 p.m. OK Haskell TESTS 41 295 80896000 2000
18291074 behzad.nouri C June 7, 2016, 10:25 p.m. OK Haskell TESTS 41 296 76492800 2000
18152795 yan_lazy C May 30, 2016, 4:24 a.m. OK Java 7 TESTS 41 155 39731200 2000
18861581 228 C July 3, 2016, 2:24 a.m. OK Java 7 TESTS 41 186 5529600 2000
18238308 ya_rb C June 4, 2016, 1:35 a.m. OK Java 7 TESTS 41 187 40140800 2000
17991240 mochuo C May 19, 2016, 12:52 p.m. OK Java 7 TESTS 41 374 39424000 2000
18231148 shrutitomer C June 3, 2016, 12:34 p.m. OK Java 7 TESTS 41 389 39424000 2000
18066401 HarrisonFang C May 25, 2016, 5:28 a.m. OK Java 7 TESTS 41 389 43724800 2000
18284765 ankushjindal278 C June 7, 2016, 1:15 p.m. OK Java 7 TESTS 41 405 39424000 2000
18070575 qiuyu8290 C May 25, 2016, 11:55 a.m. OK Java 7 TESTS 41 421 39526400 2000
18013984 robine C May 21, 2016, 5:58 a.m. OK Java 7 TESTS 41 421 39526400 2000
18771952 mkirsche C June 28, 2016, 6:25 p.m. OK Java 7 TESTS 41 920 0 2000
19881649 sanket407 C Aug. 15, 2016, 6:42 a.m. OK Java 8 TESTS 41 140 20889600 2000
69593188 adarsh000321 C Jan. 27, 2020, 2:24 a.m. OK Java 8 TESTS 41 155 0 2000
69560301 vjudge3 C Jan. 26, 2020, 10:20 a.m. OK Java 8 TESTS 41 155 0 2000
27190336 Maulik_Patel C May 18, 2017, 5:13 a.m. OK Java 8 TESTS 41 155 0 2000
17996050 niks.guitarist C May 19, 2016, 6:39 p.m. OK Java 8 TESTS 41 155 20582400 2000
40914548 amolpratap007 C July 29, 2018, 10:55 a.m. OK Java 8 TESTS 41 171 13516800 2000
18257973 keijiyoshida C June 5, 2016, 2:17 p.m. OK Java 8 TESTS 41 171 20582400 2000
18036951 megaspazz C May 23, 2016, 1:22 a.m. OK Java 8 TESTS 41 171 20582400 2000
23400164 ppppppppppppppp C Dec. 29, 2016, 1:44 p.m. OK Java 8 TESTS 41 171 20889600 2000
17989596 GoodDok C May 19, 2016, 11:01 a.m. OK Java 8 TESTS 41 171 20992000 2000
18117729 JS_Lighter C May 27, 2016, 12:05 p.m. OK JavaScript TESTS 41 233 28876800 2000
18117869 JS_Lighter C May 27, 2016, 12:14 p.m. OK JavaScript TESTS 41 249 31129600 2000
18107347 kuzAnatoliy C May 26, 2016, 4:34 p.m. OK MS C# TESTS 41 109 27852800 2000
18146492 DigitalArtistKz C May 29, 2016, 12:04 p.m. OK MS C# TESTS 41 109 30310400 2000
17987925 fr0st C May 19, 2016, 8:27 a.m. OK MS C# TESTS 41 124 34099200 2000
18008760 og.kostya C May 20, 2016, 5:32 p.m. OK MS C# TESTS 41 155 19353600 2000
22921557 vjudge1 C Dec. 13, 2016, 7:41 a.m. OK MS C++ TESTS 41 46 819200 2000
22921199 vjudge5 C Dec. 13, 2016, 7:14 a.m. OK MS C++ TESTS 41 46 4812800 2000
18105066 vjudge2 C May 26, 2016, 1:46 p.m. OK MS C++ TESTS 41 46 6860800 2000
19780515 vjudge2 C Aug. 11, 2016, 9:09 a.m. OK MS C++ TESTS 41 46 7270400 2000
18013743 jongjong123 C May 21, 2016, 5:33 a.m. OK MS C++ TESTS 41 46 7270400 2000
18026354 dipendra C May 22, 2016, 5:33 a.m. OK MS C++ TESTS 41 46 7782400 2000
18174018 vanvector C May 31, 2016, 7:38 p.m. OK MS C++ TESTS 41 46 8499200 2000
27672432 vjudge4 C June 8, 2017, 1:36 p.m. OK MS C++ TESTS 41 61 5222400 2000
56674699 vjudge4 C July 7, 2019, 2:52 p.m. OK MS C++ TESTS 41 62 4812800 2000
41210080 vjudge3 C Aug. 4, 2018, 10:03 a.m. OK MS C++ TESTS 41 62 4812800 2000
54366214 zhuiyi C May 19, 2019, 3:03 a.m. OK MS C++ 2017 TESTS 41 78 4096000 2000
69565936 vjudge1 C Jan. 26, 2020, 12:25 p.m. OK MS C++ 2017 TESTS 41 140 4300800 2000
18166411 s_p C May 31, 2016, 9:34 a.m. OK Perl TESTS 41 498 32358400 2000
24594960 har_vi C Feb. 11, 2017, 6:07 p.m. OK PyPy 2 TESTS 41 140 35737600 2000
18063343 zzz1322 C May 24, 2016, 7:28 p.m. OK PyPy 2 TESTS 41 155 36966400 2000
18017405 pr4j C May 21, 2016, 11:04 a.m. OK PyPy 2 TESTS 41 155 39321600 2000
18836534 Yash_ C July 1, 2016, 7:54 a.m. OK PyPy 2 TESTS 41 171 13414400 2000
18004655 andreamaf C May 20, 2016, 12:29 p.m. OK PyPy 2 TESTS 41 171 37376000 2000
18033905 m7mdbadawy C May 22, 2016, 4:20 p.m. OK PyPy 2 TESTS 41 186 43110400 2000
17984957 ogo C May 18, 2016, 8:12 p.m. OK PyPy 3 TESTS 41 312 38912000 2000
18043124 michelebg C May 23, 2016, 12:03 p.m. OK PyPy 3 TESTS 41 342 38092800 2000
18103819 house1993 C May 26, 2016, 12:14 p.m. OK Python 2 TESTS 41 156 13619200 2000
18039551 ScreamingJesus C May 23, 2016, 5:58 a.m. OK Python 2 TESTS 41 171 13414400 2000
17984049 maiquynhtruong C May 18, 2016, 6:40 p.m. OK Python 2 TESTS 41 171 13516800 2000
18251735 catTom C June 5, 2016, 4:43 a.m. OK Python 2 TESTS 41 187 13414400 2000
19298094 yuto C July 21, 2016, 8:57 a.m. OK Python 2 TESTS 41 202 10752000 2000
18150215 Crescendo_vk C May 29, 2016, 6:32 p.m. OK Python 2 TESTS 41 202 13414400 2000
18064882 mihassan C May 25, 2016, 12:16 a.m. OK Python 2 TESTS 41 217 14438400 2000
18068493 sys7emshock C May 25, 2016, 9:15 a.m. OK Python 2 TESTS 41 218 13721600 2000
18001545 buzzvil C May 20, 2016, 8:10 a.m. OK Python 2 TESTS 41 218 15667200 2000
17999570 riser00 C May 20, 2016, 4:53 a.m. OK Python 2 TESTS 41 233 13414400 2000
19615409 yinxiaoyu C Aug. 4, 2016, 12:56 p.m. OK Python 3 TESTS 41 124 11264000 2000
18990549 Math76 C July 9, 2016, 6:46 p.m. OK Python 3 TESTS 41 140 12800000 2000
26412739 YazanRi C April 16, 2017, 12:34 p.m. OK Python 3 TESTS 41 155 16384000 2000
19938344 ScanNorOne C Aug. 18, 2016, 2:34 a.m. OK Python 3 TESTS 41 155 16588800 2000
18225806 Vasiliy_48 C June 3, 2016, 4:56 a.m. OK Python 3 TESTS 41 156 16076800 2000
18040688 orailly C May 23, 2016, 8:01 a.m. OK Python 3 TESTS 41 171 18329600 2000
18064901 mihassan C May 25, 2016, 12:21 a.m. OK Python 3 TESTS 41 171 18534400 2000
36881762 petiteteaparty C April 2, 2018, 2:55 p.m. OK Python 3 TESTS 41 171 18841600 2000
18163219 Ginkgobiloba C May 31, 2016, 3:24 a.m. OK Python 3 TESTS 41 186 16076800 2000
18020272 MZI1234 C May 21, 2016, 2:51 p.m. OK Python 3 TESTS 41 187 17817600 2000
18406030 MoOfMo C June 13, 2016, 5:08 a.m. OK Ruby TESTS 41 327 26931200 2000
17985787 frigidrain C May 19, 2016, 3:24 a.m. OK Scala TESTS 41 358 44544000 2000
17985944 frigidrain C May 19, 2016, 4:06 a.m. OK Scala TESTS 41 358 47001600 2000
17985870 frigidrain C May 19, 2016, 3:47 a.m. OK Scala TESTS 41 374 47104000 2000
18055613 dr.ikros C May 24, 2016, 12:57 p.m. OK Scala TESTS 41 467 47104000 2000

remove filters

Back to search problems