Codeforces Round 784 (Div. 4)

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
1669 Codeforces Round 784 (Div. 4) FINISHED False 7200 81271499 April 21, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26549 ) F Eating Candies PROGRAMMING binary search data structures greedy two pointers 1100

B"There are n candies put from left to right on a table. The candies are numbered from left to right. The i -th candy has weight w_i . Alice and Bob eat candies. Alice can eat any number of candies from the left (she can't skip candies, she eats them in a row). Bob can eat any number of candies from the right (he can't skip candies, he eats them in a row). Of course, if Alice ate a candy, Bob can't eat it (and vice versa). They want to be fair. Their goal is to eat the same total weight of candies. What is the most number of candies they can eat in total? The first line contains an integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The first line of each test case contains an integer n ( 1 <= q n <= q 2 cdot10^5 ) -- the number of candies on the table. The second line of each test case contains n integers w_1, w_2, ... , w_n ( 1 <= q w_i <= q 10^4 ) -- the weights of candies from left to right. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot10^5 . For each test case, print a single integer -- the maximum number of candies Alice and Bob can eat in total while satisfying the condition. For the first test case, Alice will eat one candy from the left and Bob will eat one candy from the right. There is no better way for them to eat the same total amount of weight. The answer is 2 because they eat two candies in total. For the second test case, Alice will eat the first three candies from the left (with total weight 7 ) and Bob will eat the first three candies from the right (with total weight 7 ). They cannot eat more candies since all the candies have been eaten, so the answer is 6 (because they eat six candies in total). For the third test case, there is no way Alice and Bob will eat the same non-zero weight so the answer is 0 . For the fourth test case, Alice will eat candies with weights [7, 3, 20] and Bob will ea"...

Tutorials

102101

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154831953 harsh6732 F April 24, 2022, 9:26 a.m. OK Clang++17 Diagnostics TESTS 15 733 819200 1100
154657191 chenbxxx F April 23, 2022, 12:35 p.m. OK Clang++17 Diagnostics TESTS 15 748 14745600 1100
154844490 newbie_314 F April 24, 2022, 11:39 a.m. OK Clang++17 Diagnostics TESTS 15 841 819200 1100
154827169 vjudge3 F April 24, 2022, 8:35 a.m. OK Clang++17 Diagnostics TESTS 15 889 819200 1100
154505711 GTrigger F April 22, 2022, 2:04 p.m. OK GNU C11 TESTS 14 46 819200 1100
154854119 luogu_bot5 F April 24, 2022, 1:06 p.m. OK GNU C11 TESTS 15 62 819200 1100
154563670 drfahim F April 22, 2022, 4:02 p.m. OK GNU C11 TESTS 14 62 819200 1100
154503308 I_AM_LIGHTENING F April 22, 2022, 1:38 p.m. OK GNU C11 TESTS 14 77 819200 1100
154813376 cloned F April 24, 2022, 5:57 a.m. OK GNU C11 TESTS 15 78 819200 1100
154560022 Rayhanul_Amin_Tanvir F April 22, 2022, 3:53 p.m. OK GNU C11 TESTS 14 93 819200 1100
154693396 Afterglow. F April 23, 2022, 1:56 p.m. OK GNU C++14 TESTS 15 15 2867200 1100
154817801 cunzai_zsy0531 F April 24, 2022, 6:53 a.m. OK GNU C++14 TESTS 15 30 3379200 1100
154847894 luogu_bot5 F April 24, 2022, 12:07 p.m. OK GNU C++14 TESTS 15 31 819200 1100
154507450 P1_ras2002 F April 22, 2022, 2:23 p.m. OK GNU C++14 TESTS 14 31 921600 1100
154557736 MinhNguyen546 F April 22, 2022, 3:48 p.m. OK GNU C++14 TESTS 14 31 2457600 1100
154892104 3AGWA_79 F April 24, 2022, 9:40 p.m. OK GNU C++14 TESTS 15 46 819200 1100
154852336 luogu_bot4 F April 24, 2022, 12:49 p.m. OK GNU C++14 TESTS 15 46 819200 1100
154810294 POYE F April 24, 2022, 5:16 a.m. OK GNU C++14 TESTS 15 46 819200 1100
154790760 Tjofil F April 23, 2022, 9:23 p.m. OK GNU C++14 TESTS 15 46 819200 1100
154904988 bingzhihuihen F April 25, 2022, 5:06 a.m. OK GNU C++14 TESTS 15 46 819200 1100
154809884 surajmisal18 F April 24, 2022, 5:10 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154795708 longbendy F April 23, 2022, 11:24 p.m. OK GNU C++17 TESTS 15 46 819200 1100
154770816 bade_bhaiya F April 23, 2022, 5:01 p.m. OK GNU C++17 TESTS 15 46 819200 1100
154643541 kunwar44 F April 23, 2022, 10:09 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154642373 singhsv13 F April 23, 2022, 9:55 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154905833 Raahaat F April 25, 2022, 5:24 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154824547 vjudge3 F April 24, 2022, 8:06 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154847174 caolima F April 24, 2022, 12:01 p.m. OK GNU C++17 TESTS 15 46 819200 1100
154884695 ehsan1618 F April 24, 2022, 7:18 p.m. OK GNU C++17 TESTS 15 46 819200 1100
154813077 Code_Chef06 F April 24, 2022, 5:54 a.m. OK GNU C++17 TESTS 15 46 819200 1100
154599486 ChairmanFMao F April 22, 2022, 9:28 p.m. OK GNU C++17 (64) TESTS 15 31 819200 1100
154769291 Razum_nik F April 23, 2022, 4:56 p.m. OK GNU C++17 (64) TESTS 15 31 819200 1100
154627074 pointN F April 23, 2022, 7:01 a.m. OK GNU C++17 (64) TESTS 15 31 819200 1100
154564674 brunomont F April 22, 2022, 4:05 p.m. OK GNU C++17 (64) TESTS 14 31 819200 1100
154507396 Kirill22 F April 22, 2022, 2:23 p.m. OK GNU C++17 (64) TESTS 14 31 819200 1100
154499710 Soonic F April 22, 2022, 1 p.m. OK GNU C++17 (64) TESTS 14 31 819200 1100
154495750 Kevin_pbw F April 22, 2022, 12:22 p.m. OK GNU C++17 (64) TESTS 14 31 819200 1100
154503689 bkifhr8 F April 22, 2022, 1:43 p.m. OK GNU C++17 (64) TESTS 14 31 1024000 1100
154877770 photosynthesis F April 24, 2022, 5:25 p.m. OK GNU C++17 (64) TESTS 15 31 1638400 1100
154904177 Peal_Mazumder F April 25, 2022, 4:50 a.m. OK GNU C++17 (64) TESTS 15 31 1638400 1100
154802311 nanchen F April 24, 2022, 2:37 a.m. OK GNU C++20 (64) TESTS 15 30 819200 1100
154815626 Bitmaskman F April 24, 2022, 6:26 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154808080 Dingovinaa F April 24, 2022, 4:40 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154806290 YENGOYAN F April 24, 2022, 4:04 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154802397 nanchen F April 24, 2022, 2:39 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154901982 baby._.shadow F April 25, 2022, 4 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154896501 Mo_Ashraf22 F April 25, 2022, 1:25 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154884043 aryannewyork F April 24, 2022, 7:06 p.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154866575 p_321052 F April 24, 2022, 3:14 p.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154821551 bpz F April 24, 2022, 7:33 a.m. OK GNU C++20 (64) TESTS 15 31 819200 1100
154864517 ytripathi891 F April 24, 2022, 2:51 p.m. OK Java 11 TESTS 15 171 0 1100
154618812 Tharun0102 F April 23, 2022, 5:25 a.m. OK Java 11 TESTS 15 187 0 1100
154501023 dhruvil8804 F April 22, 2022, 1:15 p.m. OK Java 11 TESTS 14 187 0 1100
154585333 SanskarxRawat F April 22, 2022, 5:56 p.m. OK Java 11 TESTS 15 187 204800 1100
154579950 UttamS F April 22, 2022, 4:56 p.m. OK Java 11 TESTS 15 202 0 1100
154635081 mayank.singh19 F April 23, 2022, 8:39 a.m. OK Java 11 TESTS 15 202 0 1100
154641376 Aaryendra F April 23, 2022, 9:45 a.m. OK Java 11 TESTS 15 218 0 1100
154644186 immortalfox F April 23, 2022, 10:17 a.m. OK Java 11 TESTS 15 218 921600 1100
154677053 Akash151101 F April 23, 2022, 1:05 p.m. OK Java 11 TESTS 15 218 3072000 1100
154649782 bdomokos F April 23, 2022, 11:19 a.m. OK Java 11 TESTS 15 233 0 1100
154590202 leonlian F April 22, 2022, 7:01 p.m. OK Java 8 TESTS 15 124 1843200 1100
154691293 Hivilsm F April 23, 2022, 1:31 p.m. OK Java 8 TESTS 15 124 1843200 1100
154799132 ssingh0271 F April 24, 2022, 1:12 a.m. OK Java 8 TESTS 15 124 17408000 1100
154717128 AbdelrahmanFathy F April 23, 2022, 2:32 p.m. OK Java 8 TESTS 15 156 77721600 1100
154868315 AxelrodAdil F April 24, 2022, 3:33 p.m. OK Java 8 TESTS 15 187 2150400 1100
154692212 handle007 F April 23, 2022, 1:42 p.m. OK Java 8 TESTS 15 187 2150400 1100
154648062 ak_ankit F April 23, 2022, 10:59 a.m. OK Java 8 TESTS 15 187 2457600 1100
154719366 omarosama2114 F April 23, 2022, 2:36 p.m. OK Java 8 TESTS 15 217 2764800 1100
154898508 Spike_S F April 25, 2022, 2:42 a.m. OK Java 8 TESTS 15 218 11673600 1100
154627483 ND_ F April 23, 2022, 7:06 a.m. OK Java 8 TESTS 15 280 16281600 1100
154874914 wbars F April 24, 2022, 4:41 p.m. OK Kotlin 1.5 TESTS 15 545 2560000 1100
154616577 RealStarlight F April 23, 2022, 4:50 a.m. OK MS C++ 2017 TESTS 15 124 1638400 1100
154603570 emailam F April 22, 2022, 11:20 p.m. OK MS C++ 2017 TESTS 15 124 1843200 1100
154498936 mikasamikoto F April 22, 2022, 12:52 p.m. OK MS C++ 2017 TESTS 14 140 819200 1100
154655761 Tangerine F April 23, 2022, 12:27 p.m. OK MS C++ 2017 TESTS 15 155 1638400 1100
154601219 tree123 F April 22, 2022, 10:08 p.m. OK MS C++ 2017 TESTS 15 171 819200 1100
154799090 Dakericy F April 24, 2022, 1:10 a.m. OK MS C++ 2017 TESTS 15 171 3993600 1100
154789180 theinvasian F April 23, 2022, 8:54 p.m. OK MS C++ 2017 TESTS 15 187 1638400 1100
154653406 edge555 F April 23, 2022, noon OK .NET Core C# TESTS 15 171 28876800 1100
154580420 mayakin F April 22, 2022, 5 p.m. OK PHP TESTS 15 109 16793600 1100
154790247 acorn11 F April 23, 2022, 9:13 p.m. OK PyPy 2 TESTS 15 358 12185600 1100
154500448 NAVI_Perfecto F April 22, 2022, 1:08 p.m. OK PyPy 3 TESTS 14 217 18329600 1100
154881249 Samoed F April 24, 2022, 6:18 p.m. OK PyPy 3 TESTS 15 436 17817600 1100
154615477 Midhilesh F April 23, 2022, 4:29 a.m. OK PyPy 3 TESTS 15 436 20582400 1100
154622726 divyamkakkar24 F April 23, 2022, 6:15 a.m. OK PyPy 3 TESTS 15 452 17612800 1100
154651274 sepa38 F April 23, 2022, 11:35 a.m. OK PyPy 3 TESTS 15 452 22732800 1100
154654701 swapnilsingh421 F April 23, 2022, 12:15 p.m. OK PyPy 3 TESTS 15 514 25497600 1100
154633375 seraph14 F April 23, 2022, 8:19 a.m. OK PyPy 3 TESTS 15 530 31846400 1100
154702479 osama_a_rehman F April 23, 2022, 2:15 p.m. OK PyPy 3 TESTS 15 561 25702400 1100
154773160 Andrei_Kuz F April 23, 2022, 5:21 p.m. OK PyPy 3-64 TESTS 15 124 23142400 1100
154693325 ikzzi F April 23, 2022, 1:55 p.m. OK PyPy 3-64 TESTS 15 187 28876800 1100
154644954 De-Bug F April 23, 2022, 10:25 a.m. OK PyPy 3-64 TESTS 15 202 24985600 1100
154602681 MistaAsh F April 22, 2022, 10:51 p.m. OK PyPy 3-64 TESTS 15 202 29388800 1100
154677351 HannibalLectar F April 23, 2022, 1:09 p.m. OK PyPy 3-64 TESTS 15 217 24576000 1100
154502010 nitish420 F April 22, 2022, 1:25 p.m. OK PyPy 3-64 TESTS 14 217 31846400 1100
154609268 EDCTY F April 23, 2022, 2:10 a.m. OK PyPy 3-64 TESTS 15 249 25088000 1100
154507125 tushar26427 F April 22, 2022, 2:19 p.m. OK PyPy 3-64 TESTS 14 296 36556800 1100
154820679 brimstone F April 24, 2022, 7:23 a.m. OK PyPy 3-64 TESTS 15 311 35532800 1100
154505685 Abdelrahim303 F April 22, 2022, 2:03 p.m. OK PyPy 3-64 TESTS 14 404 25088000 1100
154647520 axe98 F April 23, 2022, 10:53 a.m. OK Python 3 TESTS 15 202 13516800 1100
154615853 hnton211 F April 23, 2022, 4:37 a.m. OK Python 3 TESTS 15 218 13516800 1100
154906648 Rainmaker2627 F April 25, 2022, 5:41 a.m. OK Python 3 TESTS 15 218 15257600 1100
154622676 divyamkakkar24 F April 23, 2022, 6:14 a.m. OK Python 3 TESTS 15 233 14336000 1100
154570283 eugalt F April 22, 2022, 4:20 p.m. OK Python 3 TESTS 15 233 15257600 1100
154651065 nutsjamie F April 23, 2022, 11:33 a.m. OK Python 3 TESTS 15 249 13107200 1100
154792073 marcis.vijups F April 23, 2022, 9:49 p.m. OK Python 3 TESTS 15 249 13516800 1100
154608474 sushanthgrandhi F April 23, 2022, 1:49 a.m. OK Python 3 TESTS 15 249 13516800 1100
154648326 shailshah6011 F April 23, 2022, 11:02 a.m. OK Python 3 TESTS 15 264 14336000 1100
154548731 Anadi F April 22, 2022, 3:29 p.m. OK Python 3 TESTS 14 280 13107200 1100
154863595 mocobeta F April 24, 2022, 2:42 p.m. OK Rust 2021 TESTS 15 31 6348800 1100
154594080 DeadFox F April 22, 2022, 8:02 p.m. OK Rust 2021 TESTS 15 46 10752000 1100
154786487 RunGood F April 23, 2022, 8:08 p.m. OK Rust 2021 TESTS 15 62 17100800 1100

remove filters

Back to search problems