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 |
---|---|---|---|---|---|---|
1270 | Good Bye 2019 | FINISHED | False | 10800 | 154194899 | Dec. 29, 2019, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2301 ) | G | Subset with Zero Sum | PROGRAMMING | constructive algorithms dfs and similar graphs math | 2700 |
B'You are given n integers a_1, a_2, ... , a_n , such that for each 1 <= i <= n holds i-n <= a_i <= i-1 . Find some nonempty subset of these integers, whose sum is equal to 0 . It can be shown that such a subset exists under given constraints. If there are several possible subsets with zero-sum, you can find any of them. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^6 ). The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 10^6 ). The second line of each test case contains n integers a_1, a_2, ... , a_n ( i-n <= a_i <= i-1 ). It is guaranteed that the sum of n over all test cases does not exceed 10^6 . For each test case, output two lines. In the first line, output s ( 1 <= s <= n ) -- the number of elements in your subset. In the second line, output s integers i_1, i_2, ... , i_s ( 1 <= i_k <= n ). All integers have to be pairwise different, and a_{i_1} + a_{i_2} + ... + a_{i_s} has to be equal to 0 . If there are several possible subsets with zero-sum, you can find any of them. In the first example, we get sum is a_1 = 0 . In the second example, we get sum is a_1 + a_4 + a_3 + a_2 = 0 . '... |
Разбор Goodbye 2019 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
68060869 | uenoku | G | Jan. 2, 2020, 3:48 a.m. | OK | Clang++17 Diagnostics | TESTS | 31 | 1232 | 9728000 | 2700 | |
67979882 | ruban | G | Dec. 30, 2019, 6:41 p.m. | OK | Delphi | TESTS | 31 | 701 | 152883200 | 2700 | |
67936301 | okwedook | G | Dec. 29, 2019, 8:27 p.m. | OK | GNU C++11 | TESTS | 28 | 93 | 9011200 | 2700 | |
67936272 | okwedook | G | Dec. 29, 2019, 8:26 p.m. | OK | GNU C++11 | TESTS | 28 | 93 | 9011200 | 2700 | |
68328942 | luogu_bot4 | G | Jan. 6, 2020, 5:57 p.m. | OK | GNU C++11 | TESTS | 32 | 108 | 18329600 | 2700 | |
67936238 | okwedook | G | Dec. 29, 2019, 8:25 p.m. | OK | GNU C++11 | TESTS | 28 | 109 | 9011200 | 2700 | |
67932534 | LJC00118 | G | Dec. 29, 2019, 6:34 p.m. | OK | GNU C++11 | TESTS | 28 | 139 | 18329600 | 2700 | |
67968119 | Binary_Search_Tree | G | Dec. 30, 2019, 2:02 p.m. | OK | GNU C++11 | TESTS | 31 | 140 | 9011200 | 2700 | |
69531437 | PresHerobrine | G | Jan. 25, 2020, 5:15 p.m. | OK | GNU C++11 | TESTS | 32 | 155 | 9011200 | 2700 | |
68698930 | AyoAyowei | G | Jan. 13, 2020, 8:49 a.m. | OK | GNU C++11 | TESTS | 32 | 155 | 11980800 | 2700 | |
67947356 | cmwqf | G | Dec. 30, 2019, 6:02 a.m. | OK | GNU C++11 | TESTS | 28 | 155 | 13004800 | 2700 | |
68400052 | luogu_bot5 | G | Jan. 8, 2020, 12:49 p.m. | OK | GNU C++11 | TESTS | 32 | 155 | 28057600 | 2700 | |
68022702 | MagicSpark | G | Jan. 1, 2020, 1:44 a.m. | OK | GNU C++14 | TESTS | 31 | 202 | 70758400 | 2700 | |
67926393 | MegaOwIer | G | Dec. 29, 2019, 4:52 p.m. | OK | GNU C++14 | TESTS | 28 | 311 | 16384000 | 2700 | |
67942295 | FE40536 | G | Dec. 30, 2019, 2:24 a.m. | OK | GNU C++14 | TESTS | 28 | 436 | 11980800 | 2700 | |
67942274 | FE40536 | G | Dec. 30, 2019, 2:23 a.m. | OK | GNU C++14 | TESTS | 28 | 436 | 11980800 | 2700 | |
67945314 | yan-zp | G | Dec. 30, 2019, 4:54 a.m. | OK | GNU C++14 | TESTS | 28 | 436 | 14643200 | 2700 | |
67973454 | Franklyn_W | G | Dec. 30, 2019, 3:56 p.m. | OK | GNU C++14 | TESTS | 31 | 452 | 11366400 | 2700 | |
68133371 | AlexanderL | G | Jan. 3, 2020, 5:49 p.m. | OK | GNU C++14 | TESTS | 32 | 498 | 4198400 | 2700 | |
67971935 | tmwilliamlin168 | G | Dec. 30, 2019, 3:22 p.m. | OK | GNU C++14 | TESTS | 31 | 498 | 11366400 | 2700 | |
67944679 | Retro3014 | G | Dec. 30, 2019, 4:28 a.m. | OK | GNU C++14 | TESTS | 28 | 498 | 11571200 | 2700 | |
68147763 | ragen | G | Jan. 4, 2020, 5:26 a.m. | OK | GNU C++14 | TESTS | 32 | 498 | 14336000 | 2700 | |
67943599 | user202729_ | G | Dec. 30, 2019, 3:36 a.m. | OK | GNU C++17 | TESTS | 28 | 140 | 3993600 | 2700 | |
67943411 | user202729_ | G | Dec. 30, 2019, 3:27 a.m. | OK | GNU C++17 | TESTS | 28 | 140 | 3993600 | 2700 | |
67943495 | user202729_ | G | Dec. 30, 2019, 3:32 a.m. | OK | GNU C++17 | TESTS | 28 | 155 | 5017600 | 2700 | |
67923138 | lk_ZeroMaker | G | Dec. 29, 2019, 4:31 p.m. | OK | GNU C++17 | TESTS | 28 | 155 | 16281600 | 2700 | |
67997404 | xht37 | G | Dec. 31, 2019, 8:56 a.m. | OK | GNU C++17 | TESTS | 31 | 155 | 18534400 | 2700 | |
67980080 | WindCry1 | G | Dec. 30, 2019, 6:47 p.m. | OK | GNU C++17 | TESTS | 31 | 171 | 74240000 | 2700 | |
67979321 | WindCry1 | G | Dec. 30, 2019, 6:26 p.m. | OK | GNU C++17 | TESTS | 31 | 171 | 93491200 | 2700 | |
67917208 | user202729_ | G | Dec. 29, 2019, 3:55 p.m. | OK | GNU C++17 | TESTS | 28 | 186 | 3993600 | 2700 | |
67979349 | WindCry1 | G | Dec. 30, 2019, 6:26 p.m. | OK | GNU C++17 | TESTS | 31 | 186 | 97689600 | 2700 | |
67979081 | WindCry1 | G | Dec. 30, 2019, 6:18 p.m. | OK | GNU C++17 | TESTS | 31 | 187 | 109465600 | 2700 | |
67934096 | TadijaSebez | G | Dec. 29, 2019, 7:17 p.m. | OK | Go | TESTS | 28 | 1279 | 14438400 | 2700 | |
67928317 | mikit | G | Dec. 29, 2019, 5:02 p.m. | OK | Java 11 | TESTS | 28 | 467 | 35328000 | 2700 | |
68043577 | TheSawan | G | Jan. 1, 2020, 3:24 p.m. | OK | Java 11 | TESTS | 31 | 592 | 29798400 | 2700 | |
67917733 | eatmore | G | Dec. 29, 2019, 3:58 p.m. | OK | Java 11 | TESTS | 28 | 608 | 19148800 | 2700 | |
68049476 | BaZ_ | G | Jan. 1, 2020, 6:04 p.m. | OK | Java 8 | TESTS | 31 | 264 | 43417600 | 2700 | |
68031699 | SpargelTarzan | G | Jan. 1, 2020, 9:41 a.m. | OK | Java 8 | TESTS | 31 | 592 | 59904000 | 2700 | |
67943669 | Xylenox | G | Dec. 30, 2019, 3:39 a.m. | OK | Java 8 | TESTS | 28 | 608 | 74649600 | 2700 | |
68163810 | gulshan7 | G | Jan. 4, 2020, 12:01 p.m. | OK | Java 8 | TESTS | 32 | 624 | 59904000 | 2700 | |
67913237 | AkshajK | G | Dec. 29, 2019, 3:35 p.m. | OK | Java 8 | TESTS | 28 | 716 | 52224000 | 2700 | |
69432360 | horseprabhat625 | G | Jan. 23, 2020, 5:45 p.m. | OK | Java 8 | TESTS | 32 | 717 | 71372800 | 2700 | |
67947064 | dalt | G | Dec. 30, 2019, 5:54 a.m. | OK | Java 8 | TESTS | 28 | 763 | 233164800 | 2700 | |
68729934 | polyakoff | G | Jan. 13, 2020, 7:33 p.m. | OK | Java 8 | TESTS | 32 | 1606 | 205824000 | 2700 | |
68729915 | polyakoff | G | Jan. 13, 2020, 7:33 p.m. | OK | Java 8 | TESTS | 32 | 1622 | 205619200 | 2700 | |
68447747 | godxpunk | G | Jan. 9, 2020, 1:18 p.m. | OK | Java 8 | TESTS | 32 | 1934 | 3993600 | 2700 | |
68448057 | godxpunk | G | Jan. 9, 2020, 1:23 p.m. | OK | Kotlin | TESTS | 32 | 1903 | 5017600 | 2700 | |
68654379 | vjudge4 | G | Jan. 12, 2020, 11:46 a.m. | OK | MS C++ | TESTS | 32 | 514 | 19046400 | 2700 | |
68697892 | vjudge5 | G | Jan. 13, 2020, 8:30 a.m. | OK | MS C++ | TESTS | 32 | 592 | 20377600 | 2700 | |
67915718 | math957963 | G | Dec. 29, 2019, 3:48 p.m. | OK | MS C++ | TESTS | 28 | 624 | 27033600 | 2700 | |
68683540 | vjudge4 | G | Jan. 13, 2020, 1:28 a.m. | OK | MS C++ | TESTS | 32 | 748 | 104140800 | 2700 | |
67948030 | Gleb_Dubosarskii | G | Dec. 30, 2019, 6:23 a.m. | OK | MS C++ | TESTS | 31 | 1201 | 19148800 | 2700 | |
67970155 | efyjef | G | Dec. 30, 2019, 2:43 p.m. | OK | MS C++ 2017 | TESTS | 31 | 826 | 53043200 | 2700 | |
67972549 | beemax | G | Dec. 30, 2019, 3:34 p.m. | OK | MS C++ 2017 | TESTS | 31 | 1996 | 12288000 | 2700 | |
67971956 | beemax | G | Dec. 30, 2019, 3:22 p.m. | OK | MS C++ 2017 | TESTS | 31 | 1996 | 24064000 | 2700 | |
67931038 | YESMAths | G | Dec. 29, 2019, 6 p.m. | OK | PyPy 2 | TESTS | 28 | 920 | 114278400 | 2700 | |
67970646 | pajenegod | G | Dec. 30, 2019, 2:54 p.m. | OK | PyPy 2 | TESTS | 31 | 1013 | 128000000 | 2700 | |
67976927 | zdbtxdy | G | Dec. 30, 2019, 5:19 p.m. | OK | PyPy 2 | TESTS | 31 | 1091 | 145100800 | 2700 | |
67980491 | titia | G | Dec. 30, 2019, 6:59 p.m. | OK | PyPy 3 | TESTS | 31 | 1996 | 91340800 | 2700 |
Back to search problems