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 |
---|---|---|---|---|---|---|
1774 | Polynomial Round 2022 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 9000 | 65978663 | Dec. 17, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 8154 ) | D | Same Count One | PROGRAMMING | brute force constructive algorithms implementation two pointers |
B"ChthollyNotaSeniorious received a special gift from AquaMoon: n binary arrays of length m . AquaMoon tells him that in one operation, he can choose any two arrays and any position pos from 1 to m , and swap the elements at positions pos in these arrays. He is fascinated with this game, and he wants to find the minimum number of operations needed to make the numbers of 1 s in all arrays the same. He has invited you to participate in this interesting game, so please try to find it! If it is possible, please output specific exchange steps in the format described in the output section. Otherwise, please output -1 . The first line of the input contains a single integer t ( 1 <= q t <= q 2 cdot 10^4 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains two integers n and m ( 2 <= q n <= q 10^5 , 2 <= q m <= q 10^5 ). The i -th of the following n lines contains m integers a_{i, 1}, a_{i, 2}, ldots, a_{i, m} (0 <= a_{i, j} <= 1) -- the elements of the i -th array. It is guaranteed that the sum of n cdot m over all test cases does not exceed 10^6 . For each test case, if the objective is not achievable, output -1 . Otherwise, in the first line output k (0 <= k <= mn) -- the minimum number of operations required. The i -th of the following k lines should contain 3 integers, x_i, y_i, z_i (1 <= x_i, y_i <= n, 1 <= z_i <= m) , which describe an operation that swap a_{x_i, z_i}, a_{y_i, z_i} : swap the z_i -th number of the x_i -th and y_i -th arrays. In the first test case, it's enough to do a single operation: to swap the first element in the second and the first rows. The arrays will become [0, 1, 1, 0], [1, 0, 1, 0], [1, 0, 0, 1] , each of them contains exactly two 1 s. "... |
Polynomial Round 2022 (Div. 1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
185704421 | MyEighthName | D | Dec. 17, 2022, 4:50 p.m. | OK | C# 8 | TESTS | 91 | 1279 | 30924800 | ||
185720687 | rainboy | D | Dec. 17, 2022, 7:07 p.m. | OK | GNU C11 | TESTS | 91 | 405 | 17203200 | ||
185745776 | baiABC | D | Dec. 18, 2022, 4:20 a.m. | OK | GNU C++14 | TESTS | 91 | 93 | 12697600 | ||
185737950 | Mikazuki_Munechika | D | Dec. 18, 2022, 12:54 a.m. | OK | GNU C++14 | TESTS | 91 | 156 | 8396800 | ||
185740858 | steven144 | D | Dec. 18, 2022, 2:25 a.m. | OK | GNU C++14 | TESTS | 91 | 156 | 9318400 | ||
185702689 | Tahsin13 | D | Dec. 17, 2022, 4:45 p.m. | OK | GNU C++14 | TESTS | 91 | 187 | 8294400 | ||
185701397 | IldarKA | D | Dec. 17, 2022, 4:42 p.m. | OK | GNU C++14 | TESTS | 91 | 187 | 9011200 | ||
185717041 | peeeeeer | D | Dec. 17, 2022, 6:36 p.m. | OK | GNU C++14 | TESTS | 91 | 187 | 9830400 | ||
185717335 | OrazB | D | Dec. 17, 2022, 6:38 p.m. | OK | GNU C++14 | TESTS | 91 | 187 | 9830400 | ||
185737592 | conexposys | D | Dec. 18, 2022, 12:39 a.m. | OK | GNU C++14 | TESTS | 91 | 202 | 9011200 | ||
185706105 | BBang3 | D | Dec. 17, 2022, 4:55 p.m. | OK | GNU C++14 | TESTS | 91 | 202 | 9216000 | ||
185703261 | abdosaad2 | D | Dec. 17, 2022, 4:47 p.m. | OK | GNU C++14 | TESTS | 91 | 202 | 9318400 | ||
185724463 | mehrunesartem | D | Dec. 17, 2022, 7:47 p.m. | OK | GNU C++17 | TESTS | 91 | 77 | 8601600 | ||
185706016 | v_Dolgoprudny | D | Dec. 17, 2022, 4:55 p.m. | OK | GNU C++17 | TESTS | 91 | 93 | 6246400 | ||
185743074 | xianggui1 | D | Dec. 18, 2022, 3:21 a.m. | OK | GNU C++17 | TESTS | 91 | 139 | 7065600 | ||
185704614 | yottabot | D | Dec. 17, 2022, 4:51 p.m. | OK | GNU C++17 | TESTS | 91 | 156 | 4403200 | ||
185745417 | hefengchen | D | Dec. 18, 2022, 4:13 a.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8294400 | ||
185738546 | RDkL | D | Dec. 18, 2022, 1:17 a.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8294400 | ||
185731264 | tasja | D | Dec. 17, 2022, 9:27 p.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8294400 | ||
185721579 | A_Nafees | D | Dec. 17, 2022, 7:15 p.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8294400 | ||
185751452 | Ahmed_Allawati | D | Dec. 18, 2022, 5:51 a.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8294400 | ||
185744004 | js7317749 | D | Dec. 18, 2022, 3:42 a.m. | OK | GNU C++17 | TESTS | 91 | 171 | 8601600 | ||
185724481 | mehrunesartem | D | Dec. 17, 2022, 7:47 p.m. | OK | GNU C++17 (64) | TESTS | 91 | 77 | 9216000 | ||
185739816 | pursuit_of_happiness | D | Dec. 18, 2022, 1:57 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 140 | 6451200 | ||
185739869 | pursuit_of_happiness | D | Dec. 18, 2022, 1:59 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 140 | 6860800 | ||
185718244 | Rick_GT | D | Dec. 17, 2022, 6:44 p.m. | OK | GNU C++17 (64) | TESTS | 91 | 140 | 9728000 | ||
185742598 | Alex_Wei | D | Dec. 18, 2022, 3:09 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 140 | 11264000 | ||
185748717 | jaikhatri9827 | D | Dec. 18, 2022, 5:14 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 155 | 11468800 | ||
185744453 | Superposition | D | Dec. 18, 2022, 3:53 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 155 | 12288000 | ||
185742841 | drdilyor | D | Dec. 18, 2022, 3:15 a.m. | OK | GNU C++17 (64) | TESTS | 91 | 156 | 9625600 | ||
185709188 | aditya_108 | D | Dec. 17, 2022, 5:02 p.m. | OK | GNU C++17 (64) | TESTS | 91 | 156 | 13926400 | ||
185710518 | shahed_ahmed | D | Dec. 17, 2022, 5:04 p.m. | OK | GNU C++17 (64) | TESTS | 91 | 156 | 13926400 | ||
185725557 | magnus.hegdahl | D | Dec. 17, 2022, 8 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 31 | 2764800 | ||
185728670 | mehrunesartem | D | Dec. 17, 2022, 8:43 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 31 | 4403200 | ||
185727605 | mehrunesartem | D | Dec. 17, 2022, 8:28 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 4198400 | ||
185723620 | mehrunesartem | D | Dec. 17, 2022, 7:36 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 6246400 | ||
185725412 | magnus.hegdahl | D | Dec. 17, 2022, 7:58 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 6348800 | ||
185723550 | mehrunesartem | D | Dec. 17, 2022, 7:36 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 6860800 | ||
185723937 | mehrunesartem | D | Dec. 17, 2022, 7:40 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 7372800 | ||
185723596 | mehrunesartem | D | Dec. 17, 2022, 7:36 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 7987200 | ||
185723474 | mehrunesartem | D | Dec. 17, 2022, 7:35 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 8601600 | ||
185725763 | mehrunesartem | D | Dec. 17, 2022, 8:03 p.m. | OK | GNU C++20 (64) | TESTS | 91 | 46 | 9011200 | ||
185739903 | IanISam | D | Dec. 18, 2022, 2 a.m. | OK | Java 11 | TESTS | 91 | 343 | 7475200 | ||
185702383 | kartik__sethi | D | Dec. 17, 2022, 4:44 p.m. | OK | Java 11 | TESTS | 91 | 389 | 5939200 | ||
185700798 | procrastinate7 | D | Dec. 17, 2022, 4:40 p.m. | OK | Java 11 | TESTS | 91 | 405 | 6451200 | ||
185706075 | doomhammer. | D | Dec. 17, 2022, 4:55 p.m. | OK | Java 11 | TESTS | 91 | 405 | 7168000 | ||
185701802 | dzhi | D | Dec. 17, 2022, 4:43 p.m. | OK | Java 11 | TESTS | 91 | 420 | 6348800 | ||
185724061 | mcrash12 | D | Dec. 17, 2022, 7:42 p.m. | OK | Java 11 | TESTS | 91 | 560 | 13414400 | ||
185724247 | mcrash12 | D | Dec. 17, 2022, 7:44 p.m. | OK | Java 11 | TESTS | 91 | 576 | 7475200 | ||
185728462 | yash_rastogi_1 | D | Dec. 17, 2022, 8:41 p.m. | OK | Java 11 | TESTS | 91 | 748 | 6144000 | ||
185703664 | HeXecutor | D | Dec. 17, 2022, 4:48 p.m. | OK | Java 11 | TESTS | 91 | 1184 | 6860800 | ||
185701045 | Hala245 | D | Dec. 17, 2022, 4:41 p.m. | OK | Java 17 | TESTS | 91 | 326 | 7884800 | ||
185706201 | dunkingdonuts | D | Dec. 17, 2022, 4:55 p.m. | OK | Java 17 | TESTS | 91 | 436 | 19865600 | ||
185723491 | irachit0702 | D | Dec. 17, 2022, 7:35 p.m. | OK | Java 17 | TESTS | 91 | 560 | 19251200 | ||
185720872 | leonlian | D | Dec. 17, 2022, 7:08 p.m. | OK | Java 8 | TESTS | 91 | 187 | 4812800 | ||
185744538 | megaspazz | D | Dec. 18, 2022, 3:55 a.m. | OK | Java 8 | TESTS | 91 | 202 | 4710400 | ||
185720998 | leonlian | D | Dec. 17, 2022, 7:10 p.m. | OK | Java 8 | TESTS | 91 | 202 | 4812800 | ||
185717776 | NerfThis | D | Dec. 17, 2022, 6:41 p.m. | OK | Java 8 | TESTS | 91 | 264 | 16179200 | ||
185722902 | TheSawan | D | Dec. 17, 2022, 7:29 p.m. | OK | Java 8 | TESTS | 91 | 265 | 5222400 | ||
185720170 | 1-1-1 | D | Dec. 17, 2022, 7:01 p.m. | OK | Java 8 | TESTS | 91 | 265 | 13209600 | ||
185740194 | ikillmyself | D | Dec. 18, 2022, 2:08 a.m. | OK | Java 8 | TESTS | 91 | 280 | 11878400 | ||
185706421 | arutsudar | D | Dec. 17, 2022, 4:56 p.m. | OK | Java 8 | TESTS | 91 | 311 | 5324800 | ||
185703996 | sachinjaiswal | D | Dec. 17, 2022, 4:49 p.m. | OK | Java 8 | TESTS | 91 | 420 | 13312000 | ||
185703375 | deepkasana | D | Dec. 17, 2022, 4:47 p.m. | OK | Java 8 | TESTS | 91 | 1107 | 8601600 | ||
185727455 | KichhuMichhu | D | Dec. 17, 2022, 8:26 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1200 | 294092800 | ||
185724094 | KichhuMichhu | D | Dec. 17, 2022, 7:42 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1481 | 278016000 | ||
185726837 | KichhuMichhu | D | Dec. 17, 2022, 8:18 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1513 | 273305600 | ||
185725033 | KichhuMichhu | D | Dec. 17, 2022, 7:53 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1606 | 278528000 | ||
185722477 | KichhuMichhu | D | Dec. 17, 2022, 7:24 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1653 | 291123200 | ||
185725582 | KichhuMichhu | D | Dec. 17, 2022, 8 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1700 | 266444800 | ||
185721557 | KichhuMichhu | D | Dec. 17, 2022, 7:15 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1793 | 286617600 | ||
185719967 | KichhuMichhu | D | Dec. 17, 2022, 6:59 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1902 | 289484800 | ||
185715704 | KichhuMichhu | D | Dec. 17, 2022, 6:29 p.m. | OK | Kotlin 1.7 | TESTS | 91 | 1965 | 261120000 | ||
185702593 | Nuklinoid | D | Dec. 17, 2022, 4:45 p.m. | OK | Mono C# | TESTS | 91 | 608 | 24576000 | ||
185725019 | mehrunesartem | D | Dec. 17, 2022, 7:53 p.m. | OK | MS C++ 2017 | TESTS | 91 | 249 | 8396800 | ||
185743649 | fatant | D | Dec. 18, 2022, 3:35 a.m. | OK | MS C++ 2017 | TESTS | 91 | 748 | 15257600 | ||
185725795 | dooyoung | D | Dec. 17, 2022, 8:03 p.m. | OK | MS C++ 2017 | TESTS | 91 | 811 | 8704000 | ||
185717275 | asher10000 | D | Dec. 17, 2022, 6:37 p.m. | OK | MS C++ 2017 | TESTS | 91 | 950 | 13312000 | ||
185708782 | wkoo | D | Dec. 17, 2022, 5:01 p.m. | OK | PyPy 3 | TESTS | 91 | 530 | 35020800 | ||
185717302 | harvey123 | D | Dec. 17, 2022, 6:37 p.m. | OK | PyPy 3 | TESTS | 91 | 530 | 96972800 | ||
185710304 | BigNerd24 | D | Dec. 17, 2022, 5:04 p.m. | OK | PyPy 3 | TESTS | 91 | 545 | 30412800 | ||
185737230 | Remineva | D | Dec. 18, 2022, 12:23 a.m. | OK | PyPy 3-64 | TESTS | 91 | 343 | 43212800 | ||
185734901 | hvbird | D | Dec. 17, 2022, 10:53 p.m. | OK | PyPy 3-64 | TESTS | 91 | 389 | 50380800 | ||
185701722 | sushmanth.dampur8780 | D | Dec. 17, 2022, 4:43 p.m. | OK | PyPy 3-64 | TESTS | 91 | 405 | 49152000 | ||
185738165 | Little_Sheep_Yawn | D | Dec. 18, 2022, 1:02 a.m. | OK | PyPy 3-64 | TESTS | 91 | 420 | 44748800 | ||
185706603 | anuj_negi | D | Dec. 17, 2022, 4:56 p.m. | OK | PyPy 3-64 | TESTS | 91 | 436 | 54784000 | ||
185738038 | onemoreq | D | Dec. 18, 2022, 12:57 a.m. | OK | PyPy 3-64 | TESTS | 91 | 451 | 55705600 | ||
185745993 | sjNxksbzj | D | Dec. 18, 2022, 4:25 a.m. | OK | PyPy 3-64 | TESTS | 91 | 467 | 63488000 | ||
185725494 | D.V.Aravind | D | Dec. 17, 2022, 7:59 p.m. | OK | PyPy 3-64 | TESTS | 91 | 514 | 51609600 | ||
185701803 | Triump_0112 | D | Dec. 17, 2022, 4:43 p.m. | OK | PyPy 3-64 | TESTS | 91 | 529 | 42393600 | ||
185721673 | ZrjaK | D | Dec. 17, 2022, 7:16 p.m. | OK | PyPy 3-64 | TESTS | 91 | 560 | 56729600 | ||
185704193 | yash_mangal | D | Dec. 17, 2022, 4:50 p.m. | OK | Python 3 | TESTS | 91 | 935 | 16691200 | ||
185730363 | bogdan_ii | D | Dec. 17, 2022, 9:10 p.m. | OK | Python 3 | TESTS | 91 | 966 | 17100800 | ||
185739059 | nagarjuna97c | D | Dec. 18, 2022, 1:34 a.m. | OK | Python 3 | TESTS | 91 | 1107 | 15564800 | ||
185726532 | Raya_101 | D | Dec. 17, 2022, 8:14 p.m. | OK | Python 3 | TESTS | 91 | 1107 | 19763200 | ||
185740505 | tjonac | D | Dec. 18, 2022, 2:16 a.m. | OK | Python 3 | TESTS | 91 | 1200 | 10956800 | ||
185707885 | haroldgparker | D | Dec. 17, 2022, 4:59 p.m. | OK | Python 3 | TESTS | 91 | 1216 | 19660800 | ||
185703242 | ayushgupta71011 | D | Dec. 17, 2022, 4:47 p.m. | OK | Python 3 | TESTS | 91 | 1263 | 23244800 | ||
185702768 | Namanrockzzz | D | Dec. 17, 2022, 4:46 p.m. | OK | Python 3 | TESTS | 91 | 1278 | 22528000 | ||
185703829 | lfss_zxj | D | Dec. 17, 2022, 4:49 p.m. | OK | Python 3 | TESTS | 91 | 1419 | 17408000 | ||
185741508 | Spheniscine | D | Dec. 18, 2022, 2:42 a.m. | OK | Rust 2021 | TESTS | 91 | 78 | 5632000 |
Back to search problems