Codeforces Round 451 (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
898 Codeforces Round 451 (Div. 2) FINISHED False 7200 218399099 Dec. 16, 2017, 11:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4602 ) E Squares and not squares PROGRAMMING constructive algorithms greedy 1600

B"Ann and Borya have n piles with candies and n is even number. There are ai candies in pile with number i. Ann likes numbers which are square of some integer and Borya doesn't like numbers which are square of any integer. During one move guys can select some pile with candies and add one candy to it (this candy is new and doesn't belong to any other pile) or remove one candy (if there is at least one candy in this pile). Find out minimal number of moves that is required to make exactly n xe2 x80 x89/ xe2 x80 x892 piles contain number of candies that is a square of some integer and exactly n xe2 x80 x89/ xe2 x80 x892 piles contain number of candies that is not a square of any integer. First line contains one even integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000) -- number of piles with candies. Second line contains sequence of integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- amounts of candies in each pile. Output minimal number of steps required to make exactly n xe2 x80 x89/ xe2 x80 x892 piles contain number of candies that is a square of some integer and exactly n xe2 x80 x89/ xe2 x80 x892 piles contain number of candies that is not a square of any integer. If condition is already satisfied output 0. In first example you can satisfy condition in two moves. During each move you should add one candy to second pile. After it size of second pile becomes 16. After that Borya and Ann will have two piles with number of candies which is a square of integer (second and fourth pile) and two piles with number of candies which is not a square of any integer (first and third pile). In second example you should add two candies to any three piles. "...

Tutorials

Codeforces Round #451 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
62441090 LaSWeeG E Oct. 12, 2019, 7:29 p.m. OK Delphi TESTS 51 78 1638400 1600
33309454 ruban E Dec. 16, 2017, 1:30 p.m. OK Delphi TESTS 51 124 61849600 1600
33303760 ConCuCayCu E Dec. 16, 2017, 12:53 p.m. OK FPC TESTS 51 77 4915200 1600
42778992 TShT E Sept. 11, 2018, 7:31 p.m. OK FPC TESTS 51 108 40038400 1600
55352831 bin9638 E June 9, 2019, 3:16 p.m. OK FPC TESTS 51 826 4915200 1600
55351716 bin9638 E June 9, 2019, 3:12 p.m. OK FPC TESTS 51 826 4915200 1600
55350766 bin9638 E June 9, 2019, 3:09 p.m. OK FPC TESTS 51 826 4915200 1600
55352378 bin9638 E June 9, 2019, 3:15 p.m. OK FPC TESTS 51 842 4915200 1600
55416705 biabeogo147 E June 11, 2019, 3:05 a.m. OK FPC TESTS 51 858 3276800 1600
33325559 ayush19 E Dec. 17, 2017, 12:49 a.m. OK GNU C TESTS 51 78 33894400 1600
33312546 codemart786 E Dec. 16, 2017, 3:35 p.m. OK GNU C TESTS 51 109 5836800 1600
33313025 codemart786 E Dec. 16, 2017, 3:50 p.m. OK GNU C TESTS 51 124 5836800 1600
33311894 codemart786 E Dec. 16, 2017, 3:21 p.m. OK GNU C TESTS 51 124 5836800 1600
33321665 night_fury208 E Dec. 16, 2017, 7:50 p.m. OK GNU C TESTS 51 1575 13824000 1600
34190639 Scut82 E Jan. 15, 2018, 7:19 a.m. OK GNU C++ TESTS 51 31 3686400 1600
34191585 Scut82 E Jan. 15, 2018, 8:12 a.m. OK GNU C++ TESTS 51 31 3891200 1600
33301576 goldgenius E Dec. 16, 2017, 12:39 p.m. OK GNU C++ TESTS 51 31 5324800 1600
33307078 DoveChild E Dec. 16, 2017, 1:15 p.m. OK GNU C++ TESTS 51 31 18124800 1600
40762461 vjudge1 E July 26, 2018, 4:41 a.m. OK GNU C++ TESTS 51 46 1638400 1600
40762961 vjudge5 E July 26, 2018, 4:58 a.m. OK GNU C++ TESTS 51 46 1843200 1600
34513262 KOH E Jan. 24, 2018, 10:41 a.m. OK GNU C++ TESTS 51 46 2867200 1600
33313956 ZaakDov E Dec. 16, 2017, 4:16 p.m. OK GNU C++ TESTS 51 46 4300800 1600
33325774 Fugtemypt E Dec. 17, 2017, 1:15 a.m. OK GNU C++ TESTS 51 46 4505600 1600
33303813 Lhtie E Dec. 16, 2017, 12:53 p.m. OK GNU C++ TESTS 51 46 4608000 1600
33498202 alohamora E Dec. 22, 2017, 8:27 a.m. OK GNU C11 TESTS 51 78 2662400 1600
33304057 Steaunk E Dec. 16, 2017, 12:55 p.m. OK GNU C++11 TESTS 51 31 3481600 1600
33305666 NJ_hzs E Dec. 16, 2017, 1:06 p.m. OK GNU C++11 TESTS 51 31 4505600 1600
33303540 wfj_2048 E Dec. 16, 2017, 12:51 p.m. OK GNU C++11 TESTS 51 31 5324800 1600
33370548 Joker1010123 E Dec. 18, 2017, 6:54 a.m. OK GNU C++11 TESTS 51 31 10035200 1600
33306995 Kloze E Dec. 16, 2017, 1:15 p.m. OK GNU C++11 TESTS 51 31 42188800 1600
33303163 flower E Dec. 16, 2017, 12:49 p.m. OK GNU C++11 TESTS 51 46 3584000 1600
33302754 lzr_010506 E Dec. 16, 2017, 12:46 p.m. OK GNU C++11 TESTS 51 46 3686400 1600
33401606 samjia2000 E Dec. 19, 2017, 8:29 a.m. OK GNU C++11 TESTS 51 46 3788800 1600
33303394 xy20130630 E Dec. 16, 2017, 12:50 p.m. OK GNU C++11 TESTS 51 46 4505600 1600
33302443 Dreamless_Dreams E Dec. 16, 2017, 12:44 p.m. OK GNU C++11 TESTS 51 46 4505600 1600
33307483 froghramar E Dec. 16, 2017, 1:18 p.m. OK GNU C++14 TESTS 51 46 3481600 1600
33313990 Linkus E Dec. 16, 2017, 4:16 p.m. OK GNU C++14 TESTS 51 46 5734400 1600
33304111 NEU20133823 E Dec. 16, 2017, 12:55 p.m. OK GNU C++14 TESTS 51 62 3481600 1600
33326919 kinssang E Dec. 17, 2017, 2:54 a.m. OK GNU C++14 TESTS 51 62 4300800 1600
35143986 ez_zkj E Feb. 11, 2018, 6:25 a.m. OK GNU C++14 TESTS 51 62 4300800 1600
33318507 kmjp E Dec. 16, 2017, 6:07 p.m. OK GNU C++14 TESTS 51 62 4812800 1600
33304190 Roka E Dec. 16, 2017, 12:56 p.m. OK GNU C++14 TESTS 51 62 5120000 1600
33327263 Kaneki_04 E Dec. 17, 2017, 3:19 a.m. OK GNU C++14 TESTS 51 62 5324800 1600
33480414 Protap_Ghose E Dec. 21, 2017, 1:01 p.m. OK GNU C++14 TESTS 51 62 5632000 1600
33324755 asif98 E Dec. 16, 2017, 11:09 p.m. OK GNU C++14 TESTS 51 62 6656000 1600
41647481 TheRedLegend E Aug. 16, 2018, 9:31 a.m. OK GNU C++17 TESTS 51 62 1536000 1600
49195018 aesth E Jan. 30, 2019, 10 a.m. OK GNU C++17 TESTS 51 77 1024000 1600
68633388 vjudge2 E Jan. 12, 2020, 4:29 a.m. OK GNU C++17 TESTS 51 77 1638400 1600
56988974 hardikdua E July 13, 2019, 5:11 p.m. OK GNU C++17 TESTS 51 77 3174400 1600
50567924 supremeyu E Feb. 27, 2019, 1:58 p.m. OK GNU C++17 TESTS 51 77 3174400 1600
68748545 ytxupw E Jan. 14, 2020, 5:49 a.m. OK GNU C++17 TESTS 51 78 819200 1600
51266846 klimoza E March 13, 2019, 3:57 p.m. OK GNU C++17 TESTS 51 78 819200 1600
50557421 vjudge5 E Feb. 27, 2019, 8:50 a.m. OK GNU C++17 TESTS 51 78 819200 1600
39772594 JustInCase E June 29, 2018, 3:45 p.m. OK GNU C++17 TESTS 51 78 1638400 1600
68717371 Rahul_cpp E Jan. 13, 2020, 2:57 p.m. OK GNU C++17 TESTS 51 78 1638400 1600
33308717 SonTungMtp E Dec. 16, 2017, 1:26 p.m. OK Go TESTS 51 108 30515200 1600
33368933 stczhc E Dec. 18, 2017, 5:22 a.m. OK Haskell TESTS 51 358 72294400 1600
33313865 kunalk E Dec. 16, 2017, 4:14 p.m. OK Java 8 TESTS 51 140 21094400 1600
43424728 LAKOUAM_IMAD E Sept. 25, 2018, 7:22 p.m. OK Java 8 TESTS 51 156 0 1600
68693394 sakt_coder E Jan. 13, 2020, 7:05 a.m. OK Java 8 TESTS 51 171 11673600 1600
59257601 zmurzagaliev E Aug. 22, 2019, 7:15 a.m. OK Java 8 TESTS 51 171 11673600 1600
47005722 kusomushi E Dec. 14, 2018, 1:48 p.m. OK Java 8 TESTS 51 171 11673600 1600
33307715 StayAwayFromBitches E Dec. 16, 2017, 1:19 p.m. OK Java 8 TESTS 51 171 20684800 1600
34714471 amolpratap007 E Jan. 30, 2018, 3:52 p.m. OK Java 8 TESTS 51 171 20787200 1600
33310390 sorahjy E Dec. 16, 2017, 1:34 p.m. OK Java 8 TESTS 51 187 20889600 1600
33309583 Psp_98 E Dec. 16, 2017, 1:31 p.m. OK Java 8 TESTS 51 187 22323200 1600
33322375 Meet.Sinojia E Dec. 16, 2017, 8:24 p.m. OK Java 8 TESTS 51 187 34304000 1600
33362260 tea E Dec. 17, 2017, 7:47 p.m. OK JavaScript TESTS 51 343 40243200 1600
33844217 og.kostya E Jan. 1, 2018, 9:14 a.m. OK MS C# TESTS 51 93 12288000 1600
33357147 artsin666 E Dec. 17, 2017, 3:33 p.m. OK MS C# TESTS 51 187 40857600 1600
33411700 Kirundel E Dec. 19, 2017, 2:49 p.m. OK MS C# TESTS 51 265 52940800 1600
34016685 scorpiowf E Jan. 8, 2018, 3:15 p.m. OK MS C++ TESTS 51 46 3788800 1600
33408181 vjudge3 E Dec. 19, 2017, 12:45 p.m. OK MS C++ TESTS 51 46 4608000 1600
58324051 vjudge3 E Aug. 5, 2019, 7:04 a.m. OK MS C++ TESTS 51 61 2457600 1600
58324161 vjudge2 E Aug. 5, 2019, 7:06 a.m. OK MS C++ TESTS 51 62 2457600 1600
33468894 pfh.hbq E Dec. 21, 2017, 2:24 a.m. OK MS C++ TESTS 51 62 3686400 1600
33308140 Feigenbaum E Dec. 16, 2017, 1:22 p.m. OK MS C++ TESTS 51 62 4198400 1600
33493006 Gleb_Dubosarskii E Dec. 22, 2017, 1:22 a.m. OK MS C++ TESTS 51 62 4403200 1600
33408094 ys1468362286 E Dec. 19, 2017, 12:42 p.m. OK MS C++ TESTS 51 62 4608000 1600
49685454 vjudge2 E Feb. 10, 2019, 6:49 a.m. OK MS C++ TESTS 51 62 7987200 1600
33480288 D_0000000000 E Dec. 21, 2017, 12:54 p.m. OK MS C++ TESTS 51 77 5427200 1600
64639456 showstopper E Nov. 10, 2019, 12:37 p.m. OK MS C++ 2017 TESTS 51 233 1638400 1600
64639697 showstopper E Nov. 10, 2019, 12:42 p.m. OK MS C++ 2017 TESTS 51 233 1843200 1600
50988032 Partizan E March 7, 2019, 8:27 p.m. OK MS C++ 2017 TESTS 51 358 12902400 1600
33708663 polnikola E Dec. 28, 2017, 12:02 p.m. OK PascalABC.NET TESTS 51 187 31846400 1600
42697123 Brovko E Sept. 9, 2018, 8:02 a.m. OK PascalABC.NET TESTS 51 202 6144000 1600
33872168 FeedDestroyer E Jan. 2, 2018, 6:56 p.m. OK PascalABC.NET TESTS 51 202 31744000 1600
33311476 Akulyat E Dec. 16, 2017, 3:16 p.m. OK PascalABC.NET TESTS 51 218 21811200 1600
33453907 mayakin E Dec. 20, 2017, 11:35 a.m. OK PHP TESTS 51 280 34816000 1600
33626034 nealzane E Dec. 25, 2017, 5:54 p.m. OK PyPy 2 TESTS 51 187 35532800 1600
33305569 latsyrc1123 E Dec. 16, 2017, 1:05 p.m. OK PyPy 2 TESTS 51 187 39219200 1600
41622858 Onesh0t E Aug. 15, 2018, 12:50 p.m. OK PyPy 2 TESTS 51 233 18022400 1600
33321157 arpantarkas E Dec. 16, 2017, 7:30 p.m. OK PyPy 2 TESTS 51 264 41676800 1600
33307452 dbhrockzz E Dec. 16, 2017, 1:18 p.m. OK PyPy 2 TESTS 51 404 40960000 1600
33306616 ManasG E Dec. 16, 2017, 1:12 p.m. OK PyPy 2 TESTS 51 468 42393600 1600
39694652 pavankatta E June 27, 2018, 7:47 a.m. OK PyPy 2 TESTS 51 841 16793600 1600
69654375 Katushechka E Jan. 28, 2020, 6:47 a.m. OK PyPy 3 TESTS 51 343 20889600 1600
33318994 SarasDeras E Dec. 16, 2017, 6:21 p.m. OK PyPy 3 TESTS 51 358 43212800 1600
69497173 lowoncode E Jan. 25, 2020, 4:48 a.m. OK PyPy 3 TESTS 51 389 19660800 1600
33329178 StinsonOvO E Dec. 17, 2017, 5:30 a.m. OK PyPy 3 TESTS 51 389 43008000 1600
33315771 madn E Dec. 16, 2017, 4:52 p.m. OK PyPy 3 TESTS 51 389 43212800 1600
33495224 Mephistopheies E Dec. 22, 2017, 5:03 a.m. OK PyPy 3 TESTS 51 514 49971200 1600
33304686 Ferume E Dec. 16, 2017, 12:59 p.m. OK PyPy 3 TESTS 51 514 55193600 1600
57861299 brosucks E July 27, 2019, 6 p.m. OK PyPy 3 TESTS 51 670 17817600 1600
62423316 ashok123 E Oct. 12, 2019, 1:34 p.m. OK PyPy 3 TESTS 51 733 22118400 1600
33317333 inishchith. E Dec. 16, 2017, 5:32 p.m. OK PyPy 3 TESTS 51 810 43008000 1600
45150871 johndoe87 E Oct. 31, 2018, 7:46 p.m. OK Python 2 TESTS 51 452 11161600 1600
33319316 asfd221 E Dec. 16, 2017, 6:32 p.m. OK Python 2 TESTS 51 467 15872000 1600
38572799 Ali_Pi E May 23, 2018, 10:08 p.m. OK Python 2 TESTS 51 483 11059200 1600
33314853 ytz123 E Dec. 16, 2017, 4:33 p.m. OK Python 2 TESTS 51 483 15769600 1600
33303640 nwi E Dec. 16, 2017, 12:52 p.m. OK Python 2 TESTS 51 529 15974400 1600
33306150 recurze E Dec. 16, 2017, 1:09 p.m. OK Python 2 TESTS 51 577 15769600 1600
36304723 Sehs E March 15, 2018, 2:36 p.m. OK Python 2 TESTS 51 623 15667200 1600
33306699 aniket3167 E Dec. 16, 2017, 1:13 p.m. OK Python 2 TESTS 51 623 15769600 1600
33455689 SR421 E Dec. 20, 2017, 12:59 p.m. OK Python 2 TESTS 51 623 18227200 1600
33355727 Sabareeshk E Dec. 17, 2017, 2:18 p.m. OK Python 2 TESTS 51 654 24780800 1600
34506902 vikas_1997 E Jan. 24, 2018, 7:15 a.m. OK Python 3 TESTS 51 467 23859200 1600
33321178 atryapa E Dec. 16, 2017, 7:31 p.m. OK Python 3 TESTS 51 483 21811200 1600
33315759 madn E Dec. 16, 2017, 4:52 p.m. OK Python 3 TESTS 51 499 23040000 1600
33317082 atryapa E Dec. 16, 2017, 5:26 p.m. OK Python 3 TESTS 51 514 24166400 1600
62895020 IngaleAnkur10 E Oct. 18, 2019, 11:04 p.m. OK Python 3 TESTS 51 529 18022400 1600
33515834 manhphamnguyen E Dec. 22, 2017, 5:28 p.m. OK Python 3 TESTS 51 530 23859200 1600
35531005 Qumeric E Feb. 20, 2018, 6:53 p.m. OK Python 3 TESTS 51 576 23347200 1600
54386451 DICS E May 19, 2019, 1:39 p.m. OK Python 3 TESTS 51 623 16486400 1600
33324260 and800 E Dec. 16, 2017, 10:19 p.m. OK Python 3 TESTS 51 639 21504000 1600
33394424 Smurf1 E Dec. 19, 2017, 12:32 a.m. OK Python 3 TESTS 51 654 23040000 1600
33526917 Ahmed_Salama E Dec. 23, 2017, 6:13 a.m. OK Scala TESTS 51 1481 60825600 1600
33527093 Ahmed_Salama E Dec. 23, 2017, 6:20 a.m. OK Scala TESTS 51 1497 60006400 1600
33526980 Ahmed_Salama E Dec. 23, 2017, 6:15 a.m. OK Scala TESTS 51 1512 60006400 1600

remove filters

Back to search problems