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 |
---|---|---|---|---|---|---|
1985 | Codeforces Round 952 (Div. 4) | FINISHED | False | 9000 | 13706699 | June 11, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 32381 ) | C | Good Prefixes | PROGRAMMING | greedy implementation |
B'Alex thinks some array is good if there exists some element that can be represented as the sum of all other elements (the sum of all other elements is 0 if there are no other elements). For example, the array [1,6,3,2] is good since 1+3+2=6 . Furthermore, the array [0] is also good. However, the arrays [1,2,3,4] and [1] are not good. Alex has an array a_1,a_2, ldots,a_n . Help him count the number of good non-empty prefixes of the array a . In other words, count the number of integers i ( 1 <= i <= n ) such that the length i prefix (i.e. a_1,a_2, ldots,a_i ) is good. The first line of the input contains a single integer t ( 1 <= q t <= q 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 number of elements in the array. The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 0 <= a_i <= 10^9 ) -- the elements of the array. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the number of good non-empty prefixes of the array a . In the fourth test case, the array has five prefixes: As you can see, three of them are good, so the answer is 3 . '... |
Codeforces Round 952 (Div. 4) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
265417021 | KevinTorres01 | C | June 11, 2024, 11:07 p.m. | OK | C# 10 | TESTS | 6 | 108 | 16588800 | ||
265404433 | Lismar | C | June 11, 2024, 7:33 p.m. | OK | C# 10 | TESTS | 6 | 140 | 15667200 | ||
265428503 | Kindershiuo | C | June 12, 2024, 3:03 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 61 | 0 | ||
265430195 | Md-Mahatabul-Islam | C | June 12, 2024, 3:26 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 62 | 4198400 | ||
265418832 | Zhang_Wenjie | C | June 11, 2024, 11:57 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 62 | 7372800 | ||
265422367 | SonYeuNuoc | C | June 12, 2024, 1:22 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 62 | 24064000 | ||
265411552 | Pepe_Roni | C | June 11, 2024, 9:03 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265440733 | John_PN | C | June 12, 2024, 5:30 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265438213 | apurvoj_23 | C | June 12, 2024, 5:04 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265437574 | Ruthvik2835 | C | June 12, 2024, 4:57 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265416323 | stoinis | C | June 11, 2024, 10:49 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265406137 | jcai972 | C | June 11, 2024, 7:53 p.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 77 | 0 | ||
265391974 | mohmednasser011 | C | June 11, 2024, 5:43 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 61 | 0 | ||
265406883 | Eslam_saeed_298 | C | June 11, 2024, 8:03 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 61 | 0 | ||
265397830 | lasyas | C | June 11, 2024, 6:24 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 61 | 0 | ||
265397336 | Jen94kA_isMy_WAIFU | C | June 11, 2024, 6:19 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 61 | 0 | ||
265418815 | SpadeA261 | C | June 11, 2024, 11:56 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 61 | 4198400 | ||
265430713 | HarshalHolkar | C | June 12, 2024, 3:33 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
265438998 | Md_Rizabul | C | June 12, 2024, 5:13 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
265437920 | PenguinSupremacy | C | June 12, 2024, 5:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
265436397 | lakshay7 | C | June 12, 2024, 4:43 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
265431043 | ddixit552 | C | June 12, 2024, 3:37 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 62 | 0 | ||
265428039 | N_z__ | C | June 12, 2024, 2:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 204800 | ||
265428121 | N_z__ | C | June 12, 2024, 2:58 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 46 | 4198400 | ||
265431960 | junyi118 | C | June 12, 2024, 3:49 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265443863 | khos | C | June 12, 2024, 6 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265442948 | XeNAf_I | C | June 12, 2024, 5:51 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265438244 | tan_inverse | C | June 12, 2024, 5:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265437936 | guangong | C | June 12, 2024, 5:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265436273 | with_aryan | C | June 12, 2024, 4:42 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265435812 | lan_10 | C | June 12, 2024, 4:36 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265435402 | AS23 | C | June 12, 2024, 4:31 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 61 | 0 | ||
265421179 | bluemegane | C | June 12, 2024, 12:55 a.m. | OK | C# 8 | TESTS | 6 | 171 | 17408000 | ||
265393680 | NenadDapic | C | June 11, 2024, 5:50 p.m. | OK | FPC | TESTS | 6 | 171 | 4812800 | ||
265422474 | eugalt | C | June 12, 2024, 1:24 a.m. | OK | GNU C11 | TESTS | 6 | 62 | 102400 | ||
265431951 | AKOvinno | C | June 12, 2024, 3:49 a.m. | OK | GNU C11 | TESTS | 6 | 62 | 921600 | ||
265398946 | Fuad_Shahriar | C | June 11, 2024, 6:34 p.m. | OK | GNU C11 | TESTS | 6 | 77 | 819200 | ||
265410651 | L3002 | C | June 11, 2024, 8:48 p.m. | OK | GNU C11 | TESTS | 6 | 77 | 1638400 | ||
265400210 | NightWING2435 | C | June 11, 2024, 6:48 p.m. | OK | GNU C11 | TESTS | 6 | 92 | 1638400 | ||
265434948 | xylu | C | June 12, 2024, 4:26 a.m. | OK | Go | TESTS | 6 | 93 | 9523200 | ||
265417353 | crapcode | C | June 11, 2024, 11:15 p.m. | OK | Go | TESTS | 6 | 124 | 4198400 | ||
265413952 | Emvy | C | June 11, 2024, 9:50 p.m. | OK | Go | TESTS | 6 | 1436 | 4710400 | ||
265413751 | 1936557 | C | June 11, 2024, 9:45 p.m. | OK | Haskell | TESTS | 6 | 77 | 5222400 | ||
265426501 | Freedom_lifelong | C | June 12, 2024, 2:36 a.m. | OK | Java 21 | TESTS | 6 | 249 | 102400 | ||
265390939 | OsamaNassar | C | June 11, 2024, 5:36 p.m. | OK | Java 21 | TESTS | 6 | 249 | 512000 | ||
265402298 | nabendu1 | C | June 11, 2024, 7:09 p.m. | OK | Java 21 | TESTS | 6 | 249 | 2150400 | ||
265426126 | echo-hope | C | June 12, 2024, 2:31 a.m. | OK | Java 21 | TESTS | 6 | 264 | 0 | ||
265413763 | mashurov2028 | C | June 11, 2024, 9:45 p.m. | OK | Java 21 | TESTS | 6 | 264 | 307200 | ||
265406287 | Required | C | June 11, 2024, 7:55 p.m. | OK | Java 21 | TESTS | 6 | 265 | 819200 | ||
265429468 | IrhamMA | C | June 12, 2024, 3:16 a.m. | OK | Java 21 | TESTS | 6 | 265 | 1740800 | ||
265413007 | nithin_bharathi | C | June 11, 2024, 9:30 p.m. | OK | Java 21 | TESTS | 6 | 280 | 0 | ||
265395050 | anubhavRoy_1305 | C | June 11, 2024, 6:01 p.m. | OK | Java 21 | TESTS | 6 | 280 | 921600 | ||
265418463 | Andelupe | C | June 11, 2024, 11:46 p.m. | OK | Java 21 | TESTS | 6 | 281 | 0 | ||
265436983 | coderman2004 | C | June 12, 2024, 4:50 a.m. | OK | Java 8 | TESTS | 6 | 171 | 3276800 | ||
265419372 | hoffrj | C | June 12, 2024, 12:11 a.m. | OK | Java 8 | TESTS | 6 | 171 | 3481600 | ||
265441775 | p_r_a_k_h_a_r | C | June 12, 2024, 5:40 a.m. | OK | Java 8 | TESTS | 6 | 171 | 33894400 | ||
265401080 | Sarthak_Kharka | C | June 11, 2024, 6:56 p.m. | OK | Java 8 | TESTS | 6 | 187 | 3481600 | ||
265415935 | ramywafa | C | June 11, 2024, 10:39 p.m. | OK | Java 8 | TESTS | 6 | 217 | 16076800 | ||
265390841 | lavender_me | C | June 11, 2024, 5:35 p.m. | OK | Java 8 | TESTS | 6 | 312 | 12902400 | ||
265396644 | flying_garuda | C | June 11, 2024, 6:14 p.m. | OK | Java 8 | TESTS | 6 | 358 | 0 | ||
265417413 | Anshima | C | June 11, 2024, 11:17 p.m. | OK | Java 8 | TESTS | 6 | 374 | 0 | ||
265425511 | rocean07 | C | June 12, 2024, 2:21 a.m. | OK | Java 8 | TESTS | 6 | 389 | 0 | ||
265394526 | darshanjk | C | June 11, 2024, 5:57 p.m. | OK | Java 8 | TESTS | 6 | 389 | 0 | ||
265391631 | smilegupta | C | June 11, 2024, 5:41 p.m. | OK | JavaScript | TESTS | 6 | 155 | 30617600 | ||
265404932 | LightYagami674 | C | June 11, 2024, 7:39 p.m. | OK | Kotlin 1.9 | TESTS | 6 | 296 | 15052800 | ||
265421777 | gouravasdeo11 | C | June 12, 2024, 1:09 a.m. | OK | Kotlin 1.9 | TESTS | 6 | 389 | 0 | ||
265394857 | kshitij__18 | C | June 11, 2024, 6 p.m. | OK | Node.js | TESTS | 6 | 218 | 28364800 | ||
265403681 | perfect_dash | C | June 11, 2024, 7:25 p.m. | OK | PyPy 3 | TESTS | 6 | 265 | 17715200 | ||
265401383 | Kefrov | C | June 11, 2024, 6:59 p.m. | OK | PyPy 3 | TESTS | 6 | 265 | 19046400 | ||
265403901 | DAGGERWRATH | C | June 11, 2024, 7:27 p.m. | OK | PyPy 3 | TESTS | 6 | 280 | 18227200 | ||
265395611 | MDSPro | C | June 11, 2024, 6:05 p.m. | OK | PyPy 3 | TESTS | 6 | 311 | 17612800 | ||
265413422 | debashish_1 | C | June 11, 2024, 9:38 p.m. | OK | PyPy 3 | TESTS | 6 | 311 | 21708800 | ||
265397649 | aditya.pusalkar | C | June 11, 2024, 6:22 p.m. | OK | PyPy 3 | TESTS | 6 | 312 | 19251200 | ||
265402354 | itachi_157 | C | June 11, 2024, 7:10 p.m. | OK | PyPy 3 | TESTS | 6 | 390 | 24678400 | ||
265417827 | snowythecat | C | June 11, 2024, 11:29 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 19763200 | ||
265409355 | rmr | C | June 11, 2024, 8:29 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 24166400 | ||
265391237 | AyuAnchor | C | June 11, 2024, 5:38 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 27340800 | ||
265404430 | Ysb04 | C | June 11, 2024, 7:33 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 24985600 | ||
265398778 | _PD_ | C | June 11, 2024, 6:32 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 26214400 | ||
265394349 | aayush249 | C | June 11, 2024, 5:56 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 26521600 | ||
265442170 | ProCoder12 | C | June 12, 2024, 5:44 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 26931200 | ||
265425877 | onebookhi | C | June 12, 2024, 2:27 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 26931200 | ||
265416339 | NitroSpear | C | June 11, 2024, 10:49 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 27033600 | ||
265401017 | gardengnome | C | June 11, 2024, 6:56 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 27033600 | ||
265399210 | xxanuj | C | June 11, 2024, 6:37 p.m. | OK | Python 3 | TESTS | 6 | 124 | 25907200 | ||
265398755 | xxanuj | C | June 11, 2024, 6:32 p.m. | OK | Python 3 | TESTS | 6 | 140 | 25088000 | ||
265414473 | CaffeineCompiler | C | June 11, 2024, 10:01 p.m. | OK | Python 3 | TESTS | 6 | 140 | 25804800 | ||
265439897 | LOST. | C | June 12, 2024, 5:22 a.m. | OK | Python 3 | TESTS | 6 | 140 | 25907200 | ||
265439178 | mmhaxor1 | C | June 12, 2024, 5:15 a.m. | OK | Python 3 | TESTS | 6 | 140 | 25907200 | ||
265399406 | Hassaan_SundarSTEM | C | June 11, 2024, 6:39 p.m. | OK | Python 3 | TESTS | 6 | 155 | 25190400 | ||
265435508 | UltimateDecider | C | June 12, 2024, 4:32 a.m. | OK | Python 3 | TESTS | 6 | 156 | 25088000 | ||
265400066 | Garvit_01 | C | June 11, 2024, 6:46 p.m. | OK | Python 3 | TESTS | 6 | 156 | 25088000 | ||
265441254 | kirtiabhinav00 | C | June 12, 2024, 5:35 a.m. | OK | Python 3 | TESTS | 6 | 156 | 27033600 | ||
265396375 | Yeasir10967 | C | June 11, 2024, 6:11 p.m. | OK | Python 3 | TESTS | 6 | 171 | 25804800 | ||
265438047 | 10000 | C | June 12, 2024, 5:02 a.m. | OK | Rust 2021 | TESTS | 6 | 46 | 0 | ||
265400537 | SmithWesson | C | June 11, 2024, 6:51 p.m. | OK | Rust 2021 | TESTS | 6 | 61 | 2560000 | ||
265400732 | vstiff | C | June 11, 2024, 6:53 p.m. | OK | Rust 2021 | TESTS | 6 | 62 | 2969600 | ||
265391244 | fieubat2x | C | June 11, 2024, 5:38 p.m. | OK | Rust 2021 | TESTS | 6 | 62 | 15155200 | ||
265419638 | DreadedHippy | C | June 12, 2024, 12:18 a.m. | OK | Rust 2021 | TESTS | 6 | 77 | 2560000 |
Back to search problems