Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round)

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
1654 Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round) FINISHED False 8100 84047099 March 20, 2022, 11:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 13563 ) C Alice and the Cake PROGRAMMING constructive algorithms data structures greedy sortings 1400

B"Alice has a cake, and she is going to cut it. She will perform the following operation n-1 times: choose a piece of the cake (initially, the cake is all one piece) with weight w ge 2 and cut it into two smaller pieces of weight lfloor frac{w}{2} rfloor and lceil frac{w}{2} rceil ( lfloor x rfloor and lceil x rceil denote floor and ceiling functions, respectively). After cutting the cake in n pieces, she will line up these n pieces on a table in an arbitrary order. Let a_i be the weight of the i -th piece in the line. You are given the array a . Determine whether there exists an initial weight and sequence of operations which results in a . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of n for all test cases does not exceed 2 cdot 10^5 . For each test case, print a single line: print YES if the array a could have resulted from Alice's operations, otherwise print NO. You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer). In the first test case, it's possible to get the array a by performing 0 operations on a cake with weight 327 . In the second test case, it's not possible to get the array a . In the third test case, it's possible to get the array a by performing 1 operation on a cake with weight 1 ,970 ,429 ,473 : In the fourth test case, it's possible to get the array a by performing 2 operations on a cake with weight 6 : "...

Tutorials

Editorial of Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
150317116 1287971889 C March 21, 2022, 3:18 a.m. OK Clang++17 Diagnostics TESTS 21 1591 32051200 1400
150310714 1435730 C March 20, 2022, 11:56 p.m. OK GNU C11 TESTS 21 62 3174400 1400
150313067 1435730 C March 21, 2022, 1:14 a.m. OK GNU C11 TESTS 21 62 3174400 1400
150307652 1435730 C March 20, 2022, 10:18 p.m. OK GNU C11 TESTS 21 62 8908800 1400
150318300 Akshay162000 C March 21, 2022, 3:49 a.m. OK GNU C++14 TESTS 21 46 4710400 1400
150268605 shubham_garg16 C March 20, 2022, 1:39 p.m. OK GNU C++14 TESTS 20 62 204800 1400
150264418 ChenJunyu C March 20, 2022, 1:20 p.m. OK GNU C++14 TESTS 20 62 819200 1400
150268198 shikhar2k01 C March 20, 2022, 1:37 p.m. OK GNU C++14 TESTS 20 62 2048000 1400
150285476 SCODER13 C March 20, 2022, 4:29 p.m. OK GNU C++14 TESTS 20 62 3584000 1400
150261419 _jhq C March 20, 2022, 1:05 p.m. OK GNU C++14 TESTS 20 62 8704000 1400
150283553 itzashish135ranjan C March 20, 2022, 4:07 p.m. OK GNU C++14 TESTS 20 77 102400 1400
150312229 ladderplayer C March 21, 2022, 12:45 a.m. OK GNU C++14 TESTS 21 77 614400 1400
150265873 huaruoji C March 20, 2022, 1:27 p.m. OK GNU C++14 TESTS 20 77 921600 1400
150282892 demonstrator C March 20, 2022, 4 p.m. OK GNU C++14 TESTS 20 77 1740800 1400
150278016 pooty C March 20, 2022, 3:12 p.m. OK GNU C++17 TESTS 20 62 102400 1400
150288313 parmarshashank11 C March 20, 2022, 5:01 p.m. OK GNU C++17 TESTS 20 62 102400 1400
150315169 Chao_zi C March 21, 2022, 2:26 a.m. OK GNU C++17 TESTS 21 62 716800 1400
150315638 Xiaomo C March 21, 2022, 2:39 a.m. OK GNU C++17 TESTS 21 62 1433600 1400
150298696 Vijay2706 C March 20, 2022, 7:15 p.m. OK GNU C++17 TESTS 21 62 1740800 1400
150304947 Nairy_a30 C March 20, 2022, 9:09 p.m. OK GNU C++17 TESTS 21 62 1843200 1400
150281269 rishab.ladha C March 20, 2022, 3:43 p.m. OK GNU C++17 TESTS 20 62 1843200 1400
150276223 nikhilgrewal121 C March 20, 2022, 2:57 p.m. OK GNU C++17 TESTS 20 62 1843200 1400
150314458 DingZhen C March 21, 2022, 2:04 a.m. OK GNU C++17 TESTS 21 62 1843200 1400
150324730 abhuman C March 21, 2022, 5:33 a.m. OK GNU C++17 TESTS 21 62 3993600 1400
150326106 Misaka_No.19614 C March 21, 2022, 5:56 a.m. OK GNU C++17 (64) TESTS 21 31 6041600 1400
150261950 Inzam_Z C March 20, 2022, 1:08 p.m. OK GNU C++17 (64) TESTS 20 31 6041600 1400
150274919 NuclearWinter C March 20, 2022, 2:49 p.m. OK GNU C++17 (64) TESTS 20 46 1228800 1400
150312432 XHYU61 C March 21, 2022, 12:52 a.m. OK GNU C++17 (64) TESTS 21 46 4198400 1400
150312272 Ninym61 C March 21, 2022, 12:46 a.m. OK GNU C++17 (64) TESTS 21 46 4198400 1400
150294407 prasant21 C March 20, 2022, 6:14 p.m. OK GNU C++17 (64) TESTS 20 46 4812800 1400
150311540 no-0445 C March 21, 2022, 12:22 a.m. OK GNU C++17 (64) TESTS 21 46 5017600 1400
150313285 Artemis_Bow C March 21, 2022, 1:22 a.m. OK GNU C++17 (64) TESTS 21 46 5836800 1400
150277512 BalasaRadu C March 20, 2022, 3:07 p.m. OK GNU C++17 (64) TESTS 20 46 5836800 1400
150296593 dufresne_1949 C March 20, 2022, 6:44 p.m. OK GNU C++17 (64) TESTS 21 46 5836800 1400
150276296 FaYuHo C March 20, 2022, 2:57 p.m. OK GNU C++20 (64) TESTS 20 46 0 1400
150288895 rafaelka C March 20, 2022, 5:08 p.m. OK GNU C++20 (64) TESTS 20 46 102400 1400
150322594 needRemake C March 21, 2022, 5:20 a.m. OK GNU C++20 (64) TESTS 21 46 921600 1400
150277842 Ashish4563 C March 20, 2022, 3:10 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150293802 ranaadarsh C March 20, 2022, 6:06 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150284978 Mutant_23 C March 20, 2022, 4:23 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150283611 cosenza C March 20, 2022, 4:08 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150282050 XiFaN1999 C March 20, 2022, 3:51 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150280986 boyviptb197 C March 20, 2022, 3:41 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150266566 0mniking C March 20, 2022, 1:30 p.m. OK GNU C++20 (64) TESTS 20 46 1638400 1400
150289359 tushar19280 C March 20, 2022, 5:13 p.m. OK Java 11 TESTS 20 264 2764800 1400
150295386 _ryan18_ C March 20, 2022, 6:27 p.m. OK Java 11 TESTS 20 265 0 1400
150268163 renn C March 20, 2022, 1:37 p.m. OK Java 11 TESTS 20 265 0 1400
150326394 kamal_20 C March 21, 2022, 6:01 a.m. OK Java 11 TESTS 21 265 0 1400
150277506 eshan18.09 C March 20, 2022, 3:07 p.m. OK Java 11 TESTS 20 280 0 1400
150266060 saikat021 C March 20, 2022, 1:28 p.m. OK Java 11 TESTS 20 280 0 1400
150326087 MindSlayer C March 21, 2022, 5:56 a.m. OK Java 11 TESTS 21 280 0 1400
150311832 codingIsFun1234 C March 21, 2022, 12:31 a.m. OK Java 11 TESTS 21 280 0 1400
150318382 Wuya C March 21, 2022, 3:51 a.m. OK Java 11 TESTS 21 280 11059200 1400
150295139 _ryan18_ C March 20, 2022, 6:24 p.m. OK Java 11 TESTS 20 295 0 1400
150261201 Main.Thread C March 20, 2022, 1:04 p.m. OK Java 8 TESTS 20 171 0 1400
150298851 CrinklyGolem C March 20, 2022, 7:18 p.m. OK Java 8 TESTS 21 171 0 1400
150308080 dkj C March 20, 2022, 10:30 p.m. OK Java 8 TESTS 21 186 0 1400
150299966 Omar_Mohammad C March 20, 2022, 7:35 p.m. OK Java 8 TESTS 21 233 0 1400
150323347 RR2000 C March 21, 2022, 5:32 a.m. OK Java 8 TESTS 21 233 0 1400
150316429 govindrajput C March 21, 2022, 3 a.m. OK Java 8 TESTS 21 249 307200 1400
150270422 Daly105 C March 20, 2022, 1:46 p.m. OK Java 8 TESTS 20 249 2048000 1400
150265176 kkkkush C March 20, 2022, 1:24 p.m. OK Java 8 TESTS 20 249 2355200 1400
150263693 NatInTheHat C March 20, 2022, 1:16 p.m. OK Java 8 TESTS 20 249 2457600 1400
150268426 KhadijaBadrawy C March 20, 2022, 1:38 p.m. OK Java 8 TESTS 20 249 3174400 1400
150265598 Sparky_Master_WCH1226 C March 20, 2022, 1:25 p.m. OK Kotlin 1.4 TESTS 20 264 1024000 1400
150284090 Timoniche C March 20, 2022, 4:13 p.m. OK Kotlin 1.5 TESTS 20 420 14643200 1400
150299041 darkl0rd C March 20, 2022, 7:20 p.m. OK Kotlin 1.5 TESTS 21 499 16896000 1400
150280139 fragilistic C March 20, 2022, 3:32 p.m. OK Mono C# TESTS 20 202 14336000 1400
150265429 AIdancer C March 20, 2022, 1:25 p.m. OK MS C++ 2017 TESTS 20 109 3276800 1400
150263303 machine_solution C March 20, 2022, 1:14 p.m. OK MS C++ 2017 TESTS 20 187 1740800 1400
150271131 ItamarNir C March 20, 2022, 1:48 p.m. OK MS C++ 2017 TESTS 20 187 4915200 1400
150275637 suis C March 20, 2022, 2:53 p.m. OK MS C++ 2017 TESTS 20 217 1638400 1400
150276731 Kanata369 C March 20, 2022, 3:01 p.m. OK MS C++ 2017 TESTS 20 218 6451200 1400
150291206 mahmoud_saad C March 20, 2022, 5:33 p.m. OK MS C++ 2017 TESTS 20 233 819200 1400
150279711 Andreeeew C March 20, 2022, 3:28 p.m. OK MS C++ 2017 TESTS 20 233 1638400 1400
150278503 _Rimjhim_36 C March 20, 2022, 3:16 p.m. OK MS C++ 2017 TESTS 20 248 819200 1400
150281676 karim.elsa3d100 C March 20, 2022, 3:48 p.m. OK MS C++ 2017 TESTS 20 248 1638400 1400
150296557 M7md3sam070 C March 20, 2022, 6:44 p.m. OK MS C++ 2017 TESTS 21 249 6553600 1400
150298689 suraj C March 20, 2022, 7:15 p.m. OK .NET Core C# TESTS 21 155 15155200 1400
150321866 ravinem1 C March 21, 2022, 5:08 a.m. OK .NET Core C# TESTS 21 156 15155200 1400
150282593 MrDrogon C March 20, 2022, 3:57 p.m. OK PyPy 3 TESTS 20 264 16384000 1400
150279577 akshitm16 C March 20, 2022, 3:26 p.m. OK PyPy 3 TESTS 20 358 16691200 1400
150299952 A_M__T C March 20, 2022, 7:34 p.m. OK PyPy 3 TESTS 21 374 24883200 1400
150269568 ambs_ C March 20, 2022, 1:43 p.m. OK PyPy 3 TESTS 20 420 15360000 1400
150301109 abhaumik24 C March 20, 2022, 7:53 p.m. OK PyPy 3 TESTS 21 468 21299200 1400
150320478 stand_by C March 21, 2022, 4:41 a.m. OK PyPy 3 TESTS 21 514 16588800 1400
150295570 YashNandwana C March 20, 2022, 6:29 p.m. OK PyPy 3 TESTS 21 545 17100800 1400
150290483 Ayushman_123 C March 20, 2022, 5:26 p.m. OK PyPy 3 TESTS 20 546 19558400 1400
150288146 Ayushman_123 C March 20, 2022, 4:59 p.m. OK PyPy 3 TESTS 20 592 21299200 1400
150277526 Mansurbek C March 20, 2022, 3:08 p.m. OK PyPy 3 TESTS 20 623 16384000 1400
150281104 manish.17 C March 20, 2022, 3:42 p.m. OK PyPy 3-64 TESTS 20 170 30515200 1400
150261021 RishabhVarshney C March 20, 2022, 1:03 p.m. OK PyPy 3-64 TESTS 20 171 29081600 1400
150293286 nitin4184 C March 20, 2022, 5:59 p.m. OK PyPy 3-64 TESTS 20 187 25497600 1400
150294561 nitish420 C March 20, 2022, 6:15 p.m. OK PyPy 3-64 TESTS 20 249 31539200 1400
150316917 yjgwak.cs C March 21, 2022, 3:13 a.m. OK PyPy 3-64 TESTS 21 265 26828800 1400
150290543 majay1638 C March 20, 2022, 5:26 p.m. OK PyPy 3-64 TESTS 20 295 24678400 1400
150288447 del-user-774348 C March 20, 2022, 5:03 p.m. OK PyPy 3-64 TESTS 20 327 18739200 1400
150294434 mnkp C March 20, 2022, 6:14 p.m. OK PyPy 3-64 TESTS 20 327 26521600 1400
150262156 sunny_kr C March 20, 2022, 1:09 p.m. OK PyPy 3-64 TESTS 20 327 27955200 1400
150283663 dvaravind C March 20, 2022, 4:08 p.m. OK PyPy 3-64 TESTS 20 358 21811200 1400
150294387 shivang257 C March 20, 2022, 6:13 p.m. OK Python 3 TESTS 20 451 13824000 1400
150319829 sahil45 C March 21, 2022, 4:28 a.m. OK Python 3 TESTS 21 452 13824000 1400
150280734 cuesta C March 20, 2022, 3:38 p.m. OK Python 3 TESTS 20 467 13824000 1400
150286712 deepak19 C March 20, 2022, 4:42 p.m. OK Python 3 TESTS 20 468 14131200 1400
150268730 brorica C March 20, 2022, 1:39 p.m. OK Python 3 TESTS 20 499 13824000 1400
150284170 rbamhore20 C March 20, 2022, 4:14 p.m. OK Python 3 TESTS 20 545 14131200 1400
150294971 Ele_1 C March 20, 2022, 6:21 p.m. OK Python 3 TESTS 20 576 13926400 1400
150267245 Sasi123 C March 20, 2022, 1:33 p.m. OK Python 3 TESTS 20 655 13824000 1400
150290509 sasidhar_reddy_18 C March 20, 2022, 5:26 p.m. OK Python 3 TESTS 20 702 13926400 1400
150294089 Ele_1 C March 20, 2022, 6:10 p.m. OK Python 3 TESTS 20 857 13926400 1400

remove filters

Back to search problems