Codeforces Round 326 (Div. 1)

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
587 Codeforces Round 326 (Div. 1) FINISHED False 9000 286896599 Oct. 15, 2015, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7601 ) A Duff and Weight Lifting PROGRAMMING greedy 1500

B"Recently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of i-th of them is 2wi pounds. In each step, Duff can lift some of the remaining weights and throw them away. She does this until there's no more weight left. Malek asked her to minimize the number of steps. Duff is a competitive programming fan. That's why in each step, she can only lift and throw away a sequence of weights 2a1, xe2 x80 x89..., xe2 x80 x892ak if and only if there exists a non-negative integer x such that 2a1 xe2 x80 x89+ xe2 x80 x892a2 xe2 x80 x89+ xe2 x80 x89... xe2 x80 x89+ xe2 x80 x892ak xe2 x80 x89= xe2 x80 x892x, i. e. the sum of those numbers is a power of two. Duff is a competitive programming fan, but not a programmer. That's why she asked for your help. Help her minimize the number of steps. The first line of input contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106), the number of weights. The second line contains n integers w1, xe2 x80 x89..., xe2 x80 x89wn separated by spaces (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89wi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106 for each 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), the powers of two forming the weights values. Print the minimum number of steps in a single line. In the first sample case: One optimal way would be to throw away the first three in the first step and the rest in the second step. Also, it's not possible to do it in one step because their sum is not a power of two. In the second sample case: The only optimal way is to throw away one weight in each step. It's not possible to do it in less than 4 steps because there's no subset of weights with more than one weight and sum equal to a power of two."...

Tutorials

Codeforces Round #326 (Editorial)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
13639387 Gassa A Oct. 15, 2015, 5:30 p.m. OK D TESTS 46 296 37171200 1500
13783748 miltonbw A Oct. 22, 2015, 2:50 a.m. OK FPC TESTS 46 155 3993600 1500
13711484 durashka A Oct. 18, 2015, 11:17 a.m. OK FPC TESTS 46 155 6041600 1500
14219773 Jicote A Nov. 12, 2015, 9:35 p.m. OK FPC TESTS 46 155 7987200 1500
13724585 Andrey15253545 A Oct. 19, 2015, 9:22 a.m. OK FPC TESTS 46 156 7987200 1500
13908622 Jori A Oct. 28, 2015, 5:22 a.m. OK FPC TESTS 46 171 3993600 1500
14219841 Jicote A Nov. 12, 2015, 9:45 p.m. OK FPC TESTS 46 171 7987200 1500
13961996 yan_lazy A Oct. 30, 2015, 11:11 p.m. OK FPC TESTS 46 187 11980800 1500
20330888 ice_tea A Sept. 1, 2016, 8:37 p.m. OK FPC TESTS 46 264 16076800 1500
13972373 kostantinaras A Oct. 31, 2015, 2:26 p.m. OK GNU C TESTS 46 61 3993600 1500
13972731 kostantinaras A Oct. 31, 2015, 2:50 p.m. OK GNU C TESTS 46 61 3993600 1500
13724001 graceoflives A Oct. 19, 2015, 8:36 a.m. OK GNU C TESTS 46 187 3993600 1500
13651817 sgtlaugh A Oct. 15, 2015, 7:44 p.m. OK GNU C TESTS 46 187 7987200 1500
16272422 GusztavSzmolik A Feb. 22, 2016, 6:58 a.m. OK GNU C TESTS 46 202 3993600 1500
13971945 kostantinaras A Oct. 31, 2015, 2:01 p.m. OK GNU C TESTS 46 202 3993600 1500
16586970 cang A March 7, 2016, 3:45 p.m. OK GNU C TESTS 46 202 5017600 1500
16553196 hagc2812 A March 6, 2016, 1:54 p.m. OK GNU C TESTS 46 202 5017600 1500
40068546 vjudge1 A July 7, 2018, 7 p.m. OK GNU C TESTS 46 217 3993600 1500
13795789 dsotelo A Oct. 22, 2015, 4:13 p.m. OK GNU C TESTS 46 217 3993600 1500
19964001 vjudge5 A Aug. 19, 2016, 12:42 p.m. OK GNU C++ TESTS 46 46 6553600 1500
32137978 Blue233333 A Nov. 8, 2017, 11:40 a.m. OK GNU C++ TESTS 46 46 15872000 1500
13723181 definer A Oct. 19, 2015, 7:24 a.m. OK GNU C++ TESTS 46 61 3993600 1500
26447614 songyiqun A April 17, 2017, 6:48 a.m. OK GNU C++ TESTS 46 61 10137600 1500
32285726 yylidiw A Nov. 13, 2017, 1:39 p.m. OK GNU C++ TESTS 46 62 3993600 1500
13723189 definer A Oct. 19, 2015, 7:25 a.m. OK GNU C++ TESTS 46 62 3993600 1500
13628219 zxozxo4 A Oct. 15, 2015, 4:37 p.m. OK GNU C++ TESTS 46 62 3993600 1500
24622423 huanghc A Feb. 13, 2017, 6:44 a.m. OK GNU C++ TESTS 46 62 5939200 1500
20005400 stonepage A Aug. 20, 2016, 4:06 p.m. OK GNU C++ TESTS 46 62 6553600 1500
24465251 boyfaceone A Feb. 6, 2017, 8:49 a.m. OK GNU C++ TESTS 46 62 7065600 1500
57150444 rainboy A July 16, 2019, 2:33 p.m. OK GNU C11 TESTS 46 187 3993600 1500
44401366 vjudge2 A Oct. 16, 2018, 12:55 p.m. OK GNU C11 TESTS 46 187 3993600 1500
13723127 shashwattrivedi A Oct. 19, 2015, 7:17 a.m. OK GNU C11 TESTS 46 218 7987200 1500
40068885 vjudge4 A July 7, 2018, 7:20 p.m. OK GNU C11 TESTS 46 218 11980800 1500
28709181 vjudge5 A July 20, 2017, 2:47 a.m. OK GNU C11 TESTS 46 233 6348800 1500
28708253 vjudge3 A July 20, 2017, 1:58 a.m. OK GNU C11 TESTS 46 249 6348800 1500
28708093 vjudge2 A July 20, 2017, 1:50 a.m. OK GNU C11 TESTS 46 249 6348800 1500
18962639 Manstein A July 8, 2016, 6:18 a.m. OK GNU C11 TESTS 46 280 3993600 1500
30610827 ditoly A Sept. 22, 2017, 9:53 a.m. OK GNU C++11 TESTS 46 61 3891200 1500
27874511 Umi A June 18, 2017, 2:19 a.m. OK GNU C++11 TESTS 46 62 3993600 1500
13626651 __math A Oct. 15, 2015, 4:32 p.m. OK GNU C++11 TESTS 46 62 3993600 1500
13728187 AcrossTheSky A Oct. 19, 2015, 12:45 p.m. OK GNU C++11 TESTS 46 62 3993600 1500
13655660 Maravich johann_wang IzumiKonata A Oct. 16, 2015, 12:49 a.m. OK GNU C++11 TESTS 46 62 4505600 1500
34464820 shinimashzi A Jan. 23, 2018, 1:54 a.m. OK GNU C++11 TESTS 46 62 6041600 1500
13627647 a654889339 A Oct. 15, 2015, 4:36 p.m. OK GNU C++11 TESTS 46 62 7987200 1500
40985962 ReaLNero1 A July 30, 2018, 8:16 p.m. OK GNU C++11 TESTS 46 62 7987200 1500
13652296 FatalEagle A Oct. 15, 2015, 7:53 p.m. OK GNU C++11 TESTS 46 62 7987200 1500
13627821 ExfJoe A Oct. 15, 2015, 4:36 p.m. OK GNU C++11 TESTS 46 62 7987200 1500
50680748 tokitsukaze A March 2, 2019, 11:21 a.m. OK GNU C++14 TESTS 46 61 8089600 1500
28390462 LiChenKoh A July 9, 2017, 3:59 p.m. OK GNU C++14 TESTS 46 62 9932800 1500
28363343 tianmaoxia A July 8, 2017, 7:36 a.m. OK GNU C++14 TESTS 46 187 6041600 1500
22710328 Omi12 A Dec. 5, 2016, 11:42 a.m. OK GNU C++14 TESTS 46 202 7987200 1500
51279631 garou A March 14, 2019, 2:23 a.m. OK GNU C++14 TESTS 46 234 3993600 1500
55588074 vjudge1 A June 15, 2019, 10:46 a.m. OK GNU C++14 TESTS 46 234 3993600 1500
46997704 orbitingflea A Dec. 14, 2018, 9:34 a.m. OK GNU C++14 TESTS 46 234 4198400 1500
24408574 Mishors A Feb. 3, 2017, 11:27 a.m. OK GNU C++14 TESTS 46 234 5939200 1500
28682242 vjudge2 A July 19, 2017, 2:52 a.m. OK GNU C++14 TESTS 46 234 9932800 1500
64565910 Tanvir_Rasel A Nov. 9, 2019, 7:40 a.m. OK GNU C++14 TESTS 46 248 3993600 1500
57880409 ws42 A July 28, 2019, 7:31 a.m. OK GNU C++17 TESTS 46 187 3993600 1500
40205874 lukagvritishvili A July 11, 2018, 3:29 p.m. OK GNU C++17 TESTS 46 202 4403200 1500
40309841 Mike-ZY A July 14, 2018, 7:32 a.m. OK GNU C++17 TESTS 46 218 3993600 1500
64143699 Tasfia_13 A Nov. 3, 2019, 9:14 a.m. OK GNU C++17 TESTS 46 249 3993600 1500
40501344 vjudge4 A July 18, 2018, 6:23 a.m. OK GNU C++17 TESTS 46 249 3993600 1500
55335103 MrOkasha A June 9, 2019, 1:18 p.m. OK GNU C++17 TESTS 46 249 3993600 1500
58791543 sdibt5 A Aug. 14, 2019, 2:40 a.m. OK GNU C++17 TESTS 46 249 3993600 1500
59932877 rohan537 A Sept. 3, 2019, 8:07 a.m. OK GNU C++17 TESTS 46 249 3993600 1500
50672782 CFish A March 2, 2019, 7:52 a.m. OK GNU C++17 TESTS 46 249 4403200 1500
58802241 balle A Aug. 14, 2019, 7:46 a.m. OK GNU C++17 TESTS 46 249 4505600 1500
17181786 ramesh.baskaran A April 6, 2016, 7:51 a.m. OK Haskell TESTS 46 343 114380800 1500
13785316 DukeOfYork A Oct. 22, 2015, 6:01 a.m. OK Java 7 TESTS 46 140 0 1500
13771904 DukeOfYork A Oct. 21, 2015, 1:12 p.m. OK Java 7 TESTS 46 156 0 1500
17081440 stolis A March 31, 2016, 8:35 p.m. OK Java 7 TESTS 46 170 38912000 1500
13629558 Wertle A Oct. 15, 2015, 4:42 p.m. OK Java 7 TESTS 46 312 49561600 1500
13816078 foumani A Oct. 23, 2015, 10:30 p.m. OK Java 7 TESTS 46 327 59904000 1500
15830690 Lightless A Feb. 5, 2016, 5:52 p.m. OK Java 7 TESTS 46 342 42496000 1500
15610057 hadrianang A Jan. 27, 2016, 11:08 a.m. OK Java 7 TESTS 46 342 65126400 1500
18630209 anuj64 A June 21, 2016, 12:41 p.m. OK Java 7 TESTS 46 358 38195200 1500
13628547 cvm A Oct. 15, 2015, 4:38 p.m. OK Java 7 TESTS 46 358 41984000 1500
13634805 pi37 A Oct. 15, 2015, 5:04 p.m. OK Java 7 TESTS 46 358 45363200 1500
57150525 Dukkha A July 16, 2019, 2:35 p.m. OK Java 8 TESTS 46 140 0 1500
16067165 poikniok A Feb. 17, 2016, 7:25 a.m. OK Java 8 TESTS 46 171 0 1500
50761257 ExplodingFreeze A March 3, 2019, 7:35 p.m. OK Java 8 TESTS 46 171 0 1500
54898810 thisbeit A June 1, 2019, 5:15 a.m. OK Java 8 TESTS 46 171 2457600 1500
16067188 poikniok A Feb. 17, 2016, 7:27 a.m. OK Java 8 TESTS 46 186 0 1500
13762858 rahulkhairwar A Oct. 20, 2015, 9:23 p.m. OK Java 8 TESTS 46 186 0 1500
16067248 poikniok A Feb. 17, 2016, 7:33 a.m. OK Java 8 TESTS 46 187 0 1500
13704496 QQwind A Oct. 17, 2015, 9:19 p.m. OK Java 8 TESTS 46 202 0 1500
13673724 hama-du A Oct. 17, 2015, 2:52 a.m. OK Java 8 TESTS 46 202 0 1500
36868344 Golmol A April 2, 2018, 4:45 a.m. OK Java 8 TESTS 46 217 61337600 1500
50898602 nemars A March 6, 2019, 4:16 p.m. OK Mono C# TESTS 46 545 100249600 1500
13638545 og.kostya A Oct. 15, 2015, 5:25 p.m. OK MS C# TESTS 46 109 4096000 1500
13628367 AnatolyTolstobrov A Oct. 15, 2015, 4:38 p.m. OK MS C# TESTS 46 139 8294400 1500
16414466 zerenopus A Feb. 28, 2016, 7:42 p.m. OK MS C# TESTS 46 358 96051200 1500
13628221 freepvps A Oct. 15, 2015, 4:37 p.m. OK MS C# TESTS 46 373 44441600 1500
16412094 zerenopus A Feb. 28, 2016, 7:06 p.m. OK MS C# TESTS 46 389 96051200 1500
16873784 Arcey A March 22, 2016, 3:54 p.m. OK MS C# TESTS 46 389 102400000 1500
16413988 zerenopus A Feb. 28, 2016, 7:35 p.m. OK MS C# TESTS 46 405 95948800 1500
13628054 azukun A Oct. 15, 2015, 4:37 p.m. OK MS C# TESTS 46 421 101990400 1500
13763432 lpm A Oct. 20, 2015, 10:32 p.m. OK MS C# TESTS 46 436 86732800 1500
20393505 Chubcheg A Sept. 5, 2016, 5:14 a.m. OK MS C# TESTS 46 530 229990400 1500
57771433 vjudge2 A July 26, 2019, 1:04 a.m. OK MS C++ TESTS 46 156 7987200 1500
28672165 vjudge1 A July 18, 2017, 3:19 p.m. OK MS C++ TESTS 46 171 5939200 1500
28668561 vjudge1 A July 18, 2017, 12:56 p.m. OK MS C++ TESTS 46 171 6041600 1500
26044022 vjudge4 A April 1, 2017, 5:55 a.m. OK MS C++ TESTS 46 171 6656000 1500
58420513 vjudge5 A Aug. 7, 2019, 7:31 a.m. OK MS C++ TESTS 46 171 12083200 1500
28687755 vjudge4 A July 19, 2017, 7:09 a.m. OK MS C++ TESTS 46 186 6553600 1500
13664097 AleksanderBalobanov A Oct. 16, 2015, 11:47 a.m. OK MS C++ TESTS 46 186 24064000 1500
13723438 piotrus69 A Oct. 19, 2015, 7:48 a.m. OK MS C++ TESTS 46 187 3993600 1500
14805022 hhuuson97 A Dec. 14, 2015, 4 p.m. OK MS C++ TESTS 46 187 3993600 1500
13781642 xuanyangge A Oct. 21, 2015, 10:37 p.m. OK MS C++ TESTS 46 187 3993600 1500
50672968 eyesofgod123 A March 2, 2019, 7:57 a.m. OK MS C++ 2017 TESTS 46 265 7987200 1500
54338335 Dragostan A May 18, 2019, 9:09 a.m. OK MS C++ 2017 TESTS 46 280 3993600 1500
54338255 Dragostan A May 18, 2019, 9:07 a.m. OK MS C++ 2017 TESTS 46 280 7987200 1500
64038441 vladnoov A Nov. 1, 2019, 5:21 p.m. OK MS C++ 2017 TESTS 46 858 4300800 1500
59563704 CtrlAlt A Aug. 27, 2019, 9:46 a.m. OK MS C++ 2017 TESTS 46 858 7987200 1500
64624723 yuanyuan2048 A Nov. 10, 2019, 8:10 a.m. OK MS C++ 2017 TESTS 46 873 4300800 1500
61878036 Boryan07 A Oct. 4, 2019, 9:12 p.m. OK MS C++ 2017 TESTS 46 919 32051200 1500
61878028 Boryan07 A Oct. 4, 2019, 9:12 p.m. OK MS C++ 2017 TESTS 46 951 32051200 1500
13653188 ikatanic A Oct. 15, 2015, 8:22 p.m. OK Ocaml TESTS 46 358 7372800 1500
13721762 DarthShrine A Oct. 19, 2015, 4:51 a.m. OK Ocaml TESTS 46 405 21811200 1500
13669065 out_of_theblue A Oct. 16, 2015, 5:04 p.m. OK Ocaml TESTS 46 420 7372800 1500
13669041 out_of_theblue A Oct. 16, 2015, 5:03 p.m. OK Ocaml TESTS 46 452 7372800 1500
13633392 alexey.shchepin A Oct. 15, 2015, 4:58 p.m. OK Ocaml TESTS 46 842 14643200 1500
33875975 laoliumang A Jan. 3, 2018, 2:41 a.m. OK PyPy 2 TESTS 46 265 89702400 1500
13719411 nealzane A Oct. 18, 2015, 8:47 p.m. OK PyPy 2 TESTS 46 295 57856000 1500
13830577 stas_sl A Oct. 24, 2015, 8:12 p.m. OK PyPy 2 TESTS 46 296 56320000 1500
13775385 chiehmin A Oct. 21, 2015, 4:48 p.m. OK PyPy 2 TESTS 46 296 57651200 1500
35894853 _____k_____ A March 3, 2018, 4:30 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
35894122 ______n______ A March 3, 2018, 4:13 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
35894057 ______u______ A March 3, 2018, 4:13 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
35893838 _____i_____ A March 3, 2018, 4:07 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
35885040 ______h______ A March 3, 2018, 1:21 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
35884735 ______k______ A March 3, 2018, 1:16 p.m. OK PyPy 2 TESTS 46 296 82022400 1500
53491656 LevinLMKwong A April 29, 2019, 9:04 a.m. OK PyPy 3 TESTS 46 717 59392000 1500
48409876 xumouyi A Jan. 15, 2019, 7:03 a.m. OK PyPy 3 TESTS 46 732 83353600 1500
47010594 Silky_Littleraisin A Dec. 14, 2018, 4:15 p.m. OK PyPy 3 TESTS 46 733 80998400 1500
69199326 vjudge3 A Jan. 20, 2020, 3:58 p.m. OK PyPy 3 TESTS 46 810 59289600 1500
66301056 manish.17 A Dec. 5, 2019, 7:14 a.m. OK PyPy 3 TESTS 46 842 69120000 1500
56692806 nayan21garg A July 8, 2019, 5:16 a.m. OK PyPy 3 TESTS 46 951 66355200 1500
63119204 D_J_Z A Oct. 22, 2019, 10:36 a.m. OK PyPy 3 TESTS 46 982 66355200 1500
14014350 Rell9e A Nov. 1, 2015, 7:59 p.m. OK PyPy 3 TESTS 46 982 73420800 1500
14014256 Rell9e A Nov. 1, 2015, 7:50 p.m. OK PyPy 3 TESTS 46 997 71475200 1500
15504795 orailly A Jan. 22, 2016, 9:50 p.m. OK PyPy 3 TESTS 46 998 70656000 1500
13627750 nwi A Oct. 15, 2015, 4:36 p.m. OK Python 2 TESTS 46 639 53862400 1500
13654503 AlfredZien A Oct. 15, 2015, 9:48 p.m. OK Python 2 TESTS 46 655 53862400 1500
13654500 AlfredZien A Oct. 15, 2015, 9:48 p.m. OK Python 2 TESTS 46 873 53657600 1500
19056279 SilverVoo A July 12, 2016, 6:04 p.m. OK Python 3 TESTS 46 670 61644800 1500
13942210 SteelRaven A Oct. 30, 2015, 1:08 a.m. OK Python 3 TESTS 46 951 63283200 1500
42108479 Mk_Python_v1 A Aug. 26, 2018, 3:38 a.m. OK Python 3 TESTS 46 967 51609600 1500
28734093 Christopher-Perkins A July 20, 2017, 9:17 p.m. OK Python 3 TESTS 46 967 52838400 1500
25797948 pimukthee A March 25, 2017, 12:48 p.m. OK Python 3 TESTS 46 982 56524800 1500
56672007 Mohamed_Ayman A July 7, 2019, 1:33 p.m. OK Python 3 TESTS 46 997 61644800 1500
56672105 Mohamed_Ayman A July 7, 2019, 1:36 p.m. OK Python 3 TESTS 46 998 61542400 1500
13633806 limed A Oct. 15, 2015, 4:59 p.m. OK Scala TESTS 46 530 45977600 1500
13695424 limed A Oct. 17, 2015, 2:47 p.m. OK Scala TESTS 46 733 41984000 1500
13666463 reldan A Oct. 16, 2015, 2:27 p.m. OK Scala TESTS 46 748 155033600 1500

remove filters

Back to search problems