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 |
---|---|---|---|---|---|---|
1984 | Codeforces Global Round 26 | FINISHED | False | 10800 | 13879499 | June 9, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 7415 ) | C2 | Magnitude (Hard Version) | PROGRAMMING | combinatorics dp greedy |
B"The two versions of the problem are different. You may want to read both versions. You can make hacks only if both versions are solved. You are given an array a of length n . Start with c = 0 . Then, for each i from 1 to n (in increasing order) do exactly one of the following: Let the maximum final value of c after the procedure described above be equal to k . Find the number of unique procedures that result in c = k . Two procedures are different if at any index i , one procedure chose option 1 and another chose option 2 , even if the value of c is equal for both procedures after that turn. Since the answer may be large, output it modulo 998 ,244 ,353 . The first line 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 ( 2 <= q n <= q 2 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( -10^9 <= q a_i <= q 10^9 ). The sum of n over all test cases does not exceed 3 cdot 10^5 . For each test case, output a single integer -- the number of unique procedures that result in c = k , modulo 998 ,244 ,353 . In the first test case, it can be shown that our maximal final value of c is 3 . There are 12 ways to achieve this because in order to get 3 , we have to take absolute value at indices 2 or 4 , or both, resulting in 3 ways. For the other two indices, it doesn't change the value whether we take absolute value or not, so we have 2 cdot 2 = 4 ways for them. In total, we have 3 cdot 4 = 12 ways. In the second test case, taking the absolute value will never change anything, so we can either take absolute value or not, for every index. This gives us 2^8 = 256 possible ways. "... |
Codeforces Global Round 26 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
264952887 | DmitriyAnikeyev | C2 | June 9, 2024, 5:02 p.m. | OK | C# 10 | TESTS | 19 | 171 | 25907200 | ||
264956793 | mmmm5 | C2 | June 9, 2024, 5:15 p.m. | OK | C# 10 | TESTS | 19 | 202 | 27955200 | ||
264969561 | Maxi2721 | C2 | June 9, 2024, 7:07 p.m. | OK | C++14 (GCC 6-32) | TESTS | 19 | 109 | 716800 | ||
264980889 | Anurag2004 | C2 | June 9, 2024, 9:55 p.m. | OK | C++14 (GCC 6-32) | TESTS | 19 | 109 | 4608000 | ||
264998429 | Icyecho | C2 | June 10, 2024, 4:17 a.m. | OK | C++14 (GCC 6-32) | TESTS | 24 | 124 | 20889600 | ||
264992326 | jyttoby | C2 | June 10, 2024, 2:44 a.m. | OK | C++14 (GCC 6-32) | TESTS | 24 | 125 | 0 | ||
264984037 | lzh999 | C2 | June 9, 2024, 11:24 p.m. | OK | C++14 (GCC 6-32) | TESTS | 19 | 140 | 40140800 | ||
264956183 | Ebhu | C2 | June 9, 2024, 5:13 p.m. | OK | C++14 (GCC 6-32) | TESTS | 19 | 140 | 44236800 | ||
265006700 | Sirazul116 | C2 | June 10, 2024, 5:55 a.m. | OK | C++14 (GCC 6-32) | TESTS | 24 | 155 | 3276800 | ||
264954033 | GIVE_UP | C2 | June 9, 2024, 5:05 p.m. | OK | C++14 (GCC 6-32) | TESTS | 19 | 155 | 16076800 | ||
265001625 | shu_900 | C2 | June 10, 2024, 4:58 a.m. | OK | C++14 (GCC 6-32) | TESTS | 24 | 156 | 5836800 | ||
264992839 | Sin_Watt | C2 | June 10, 2024, 2:52 a.m. | OK | C++14 (GCC 6-32) | TESTS | 24 | 171 | 0 | ||
264997020 | C_c-c_C | C2 | June 10, 2024, 3:57 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 109 | 0 | ||
264979003 | aks_332 | C2 | June 9, 2024, 9:18 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 109 | 0 | ||
265003094 | borolesarvesh54 | C2 | June 10, 2024, 5:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 109 | 716800 | ||
264985773 | simonmysun | C2 | June 10, 2024, 12:20 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 109 | 716800 | ||
264979760 | salvini_god | C2 | June 9, 2024, 9:32 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 109 | 6656000 | ||
265003450 | Anand-Bharti | C2 | June 10, 2024, 5:20 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 109 | 9216000 | ||
264984555 | ankitlal | C2 | June 9, 2024, 11:41 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 109 | 15155200 | ||
264999410 | RexVx77 | C2 | June 10, 2024, 4:30 a.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 124 | 0 | ||
264986329 | saipranaydeep | C2 | June 10, 2024, 12:36 a.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 124 | 0 | ||
264983947 | RomanYakunin | C2 | June 9, 2024, 11:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 19 | 124 | 0 | ||
265006351 | Master32WSP | C2 | June 10, 2024, 5:51 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 6963200 | ||
264995765 | xuyiluo | C2 | June 10, 2024, 3:38 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 62 | 49561600 | ||
264989248 | tothanhdat1421 | C2 | June 10, 2024, 1:48 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 78 | 2457600 | ||
264989891 | SpongeBob_ | C2 | June 10, 2024, 2:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 20 | 93 | 0 | ||
264986919 | Aspergillus | C2 | June 10, 2024, 12:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 0 | ||
264976802 | Shuishui_0921 | C2 | June 9, 2024, 8:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 0 | ||
264971147 | xyktyjayket | C2 | June 9, 2024, 7:27 p.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 0 | ||
264999710 | pm_2 | C2 | June 10, 2024, 4:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 93 | 102400 | ||
264992036 | SpongeBob_ | C2 | June 10, 2024, 2:39 a.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 93 | 102400 | ||
264985496 | nanoblob | C2 | June 10, 2024, 12:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 19 | 93 | 102400 | ||
264959428 | NenadDapic | C2 | June 9, 2024, 5:25 p.m. | OK | FPC | TESTS | 19 | 139 | 11161600 | ||
264995073 | dhruv0902 | C2 | June 10, 2024, 3:27 a.m. | OK | Java 21 | TESTS | 24 | 358 | 4505600 | ||
264955146 | Quasicoherent | C2 | June 9, 2024, 5:09 p.m. | OK | Java 21 | TESTS | 19 | 374 | 1126400 | ||
264970466 | sg2themax | C2 | June 9, 2024, 7:18 p.m. | OK | Java 21 | TESTS | 19 | 406 | 25497600 | ||
264961303 | nathanballman | C2 | June 9, 2024, 5:31 p.m. | OK | Java 21 | TESTS | 19 | 421 | 4300800 | ||
264953471 | fomo_demod | C2 | June 9, 2024, 5:04 p.m. | OK | Java 21 | TESTS | 19 | 421 | 13004800 | ||
264962604 | ved_226 | C2 | June 9, 2024, 5:34 p.m. | OK | Java 21 | TESTS | 19 | 421 | 78233600 | ||
264978754 | Manjot1151 | C2 | June 9, 2024, 9:14 p.m. | OK | Java 21 | TESTS | 19 | 436 | 512000 | ||
264957480 | sagar.kapoor.myproject | C2 | June 9, 2024, 5:18 p.m. | OK | Java 21 | TESTS | 19 | 467 | 11878400 | ||
265007143 | frey4 | C2 | June 10, 2024, 5:59 a.m. | OK | Java 21 | TESTS | 24 | 468 | 1638400 | ||
264982408 | sahasrad | C2 | June 9, 2024, 10:33 p.m. | OK | Java 21 | TESTS | 19 | 828 | 1331200 | ||
264973215 | Lakshay429 | C2 | June 9, 2024, 7:53 p.m. | OK | Java 8 | TESTS | 19 | 203 | 0 | ||
264979129 | PlayDate | C2 | June 9, 2024, 9:21 p.m. | OK | Java 8 | TESTS | 19 | 562 | 0 | ||
264961416 | shubham22488 | C2 | June 9, 2024, 5:31 p.m. | OK | Java 8 | TESTS | 19 | 702 | 4403200 | ||
264955268 | arnav023 | C2 | June 9, 2024, 5:10 p.m. | OK | Java 8 | TESTS | 19 | 703 | 39731200 | ||
264956517 | dauletomarov1130 | C2 | June 9, 2024, 5:14 p.m. | OK | Java 8 | TESTS | 19 | 733 | 0 | ||
264955492 | ronitjena09 | C2 | June 9, 2024, 5:11 p.m. | OK | Java 8 | TESTS | 19 | 733 | 6963200 | ||
264954774 | pchel | C2 | June 9, 2024, 5:08 p.m. | OK | Kotlin 1.9 | TESTS | 19 | 484 | 21606400 | ||
264966767 | ahtoh_ | C2 | June 9, 2024, 6:42 p.m. | OK | Node.js | TESTS | 19 | 249 | 47820800 | ||
265004652 | rishinandhav | C2 | June 10, 2024, 5:33 a.m. | OK | PyPy 3 | TESTS | 24 | 468 | 14438400 | ||
265003260 | Samaritan02 | C2 | June 10, 2024, 5:18 a.m. | OK | PyPy 3 | TESTS | 24 | 562 | 17920000 | ||
264969880 | sai-17 | C2 | June 9, 2024, 7:11 p.m. | OK | PyPy 3 | TESTS | 19 | 796 | 18124800 | ||
264953764 | xxx.ego | C2 | June 9, 2024, 5:05 p.m. | OK | PyPy 3 | TESTS | 19 | 921 | 29798400 | ||
264962310 | gsomani | C2 | June 9, 2024, 5:34 p.m. | OK | PyPy 3-64 | TESTS | 19 | 187 | 27136000 | ||
264957729 | rijulbhat01 | C2 | June 9, 2024, 5:19 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 22220800 | ||
264973083 | bronze_coder | C2 | June 9, 2024, 7:51 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 27033600 | ||
264960564 | indra_015u | C2 | June 9, 2024, 5:29 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 36761600 | ||
264960960 | Poricf | C2 | June 9, 2024, 5:30 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 41164800 | ||
264982165 | DeadMan69 | C2 | June 9, 2024, 10:28 p.m. | OK | PyPy 3-64 | TESTS | 19 | 218 | 44134400 | ||
264971245 | kibr | C2 | June 9, 2024, 7:28 p.m. | OK | PyPy 3-64 | TESTS | 19 | 233 | 25190400 | ||
264961931 | kibrnew | C2 | June 9, 2024, 5:33 p.m. | OK | PyPy 3-64 | TESTS | 19 | 233 | 25190400 | ||
264973212 | a-rn-va27 | C2 | June 9, 2024, 7:53 p.m. | OK | PyPy 3-64 | TESTS | 19 | 233 | 32768000 | ||
264993052 | LightHouse1 | C2 | June 10, 2024, 2:55 a.m. | OK | PyPy 3-64 | TESTS | 24 | 234 | 33075200 | ||
264995255 | marszhanghaoliang | C2 | June 10, 2024, 3:30 a.m. | OK | Python 3 | TESTS | 24 | 546 | 25907200 | ||
264972046 | zyasserd | C2 | June 9, 2024, 7:38 p.m. | OK | Python 3 | TESTS | 19 | 640 | 25907200 | ||
264953772 | bcryptic | C2 | June 9, 2024, 5:05 p.m. | OK | Python 3 | TESTS | 19 | 686 | 27136000 | ||
264954074 | soos2908 | C2 | June 9, 2024, 5:06 p.m. | OK | Python 3 | TESTS | 19 | 687 | 45772800 | ||
264974619 | MehraSaurav | C2 | June 9, 2024, 8:12 p.m. | OK | Python 3 | TESTS | 19 | 702 | 25907200 | ||
264956396 | tayari | C2 | June 9, 2024, 5:14 p.m. | OK | Python 3 | TESTS | 19 | 921 | 46387200 | ||
264954697 | koraghav | C2 | June 9, 2024, 5:08 p.m. | OK | Python 3 | TESTS | 19 | 936 | 26009600 | ||
264952871 | AdityaGupta55 | C2 | June 9, 2024, 5:02 p.m. | OK | Python 3 | TESTS | 19 | 1077 | 27238400 | ||
264960337 | whu_yx | C2 | June 9, 2024, 5:28 p.m. | OK | Python 3 | TESTS | 19 | 1171 | 25907200 | ||
264959670 | Itzmine | C2 | June 9, 2024, 5:25 p.m. | OK | Python 3 | TESTS | 19 | 1171 | 58982400 | ||
264954514 | hurse | C2 | June 9, 2024, 5:07 p.m. | OK | Ruby 3 | TESTS | 19 | 1812 | 69324800 | ||
264953573 | tonysingh20052003 | C2 | June 9, 2024, 5:04 p.m. | OK | Ruby 3 | TESTS | 19 | 1999 | 52940800 | ||
264955489 | paugh1612 | C2 | June 9, 2024, 5:10 p.m. | OK | Rust 2021 | TESTS | 19 | 77 | 4198400 | ||
264984961 | PlaceOrientedProgrammer | C2 | June 9, 2024, 11:53 p.m. | OK | Rust 2021 | TESTS | 19 | 77 | 5836800 | ||
265006151 | M1ngXu | C2 | June 10, 2024, 5:49 a.m. | OK | Rust 2021 | TESTS | 24 | 139 | 4198400 |
Back to search problems