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 |
---|---|---|---|---|---|---|
1854 | Codeforces Round 889 (Div. 1) | FINISHED | False | 9000 | 41181899 | July 29, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 14270 ) | A1 | Dual (Easy Version) | PROGRAMMING | constructive algorithms math |
B'The only difference between the two versions of this problem is the constraint on the maximum number of operations. You can make hacks only if all versions of the problem are solved. You are given an array a_1, a_2, ... , a_n of integers (positive, negative or 0 ). You can perform multiple operations on the array (possibly 0 operations). In one operation, you choose i, j ( 1 <= q i, j <= q n , they can be equal) and set a_i := a_i + a_j (i.e., add a_j to a_i ). Make the array non-decreasing (i.e., a_i <= q a_{i+1} for 1 <= q i <= q n-1 ) in at most 50 operations. You do not need to minimize the number of operations. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 500 ). The description of the test cases follows. The first line contains a single integer n ( 1 <= n <= 20 ) -- the length of the array. The second line contains n integers a_1, a_2, ldots, a_n ( -20 <= a_i <= 20 ) -- the array before performing the operations. For each test case, output your operations in the following format. The first line should contain an integer k ( 0 <= k <= 50 ) -- the number of operations. The next k lines represent the k operations in order. Each of these k lines should contain two integers i and j ( 1 <= q i, j <= q n ) -- the corresponding operation consists in adding a_j to a_i . After all the operations, the array a_1, a_2, ... , a_n must be non-decreasing. In the first test case, by adding a_1 = 2 to a_2 , we get the array [2, 3] which is non-decreasing. In the second test case, the array changes as: In the third test case, the final array is [2, 3, 3, 3, 3] . '... |
Editorial of Codeforces Round 889 (Div. 1 + Div. 2) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
216382885 | lAMaLOSER | A1 | July 30, 2023, 1:40 a.m. | OK | C# 10 | TESTS | 3 | 62 | 1024000 | ||
216249971 | KumaTachiRen | A1 | July 29, 2023, 2:46 p.m. | OK | C# 8 | TESTS | 2 | 77 | 2048000 | ||
216255771 | hos.lyric | A1 | July 29, 2023, 2:52 p.m. | OK | D | TESTS | 2 | 31 | 0 | ||
216264531 | Gassa | A1 | July 29, 2023, 3:04 p.m. | OK | D | TESTS | 2 | 31 | 204800 | ||
216256198 | chro4896 | A1 | July 29, 2023, 2:53 p.m. | OK | GNU C11 | TESTS | 2 | 30 | 0 | ||
216388016 | xiaoxiexie | A1 | July 30, 2023, 3:05 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216387606 | ldh081122 | A1 | July 30, 2023, 2:58 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216384094 | slzxpanhongxuan | A1 | July 30, 2023, 2:01 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216381516 | Marple. | A1 | July 30, 2023, 1:16 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216345501 | atbottom | A1 | July 29, 2023, 5:48 p.m. | OK | GNU C++14 | TESTS | 2 | 0 | 0 | ||
216310130 | Const_int | A1 | July 29, 2023, 4:11 p.m. | OK | GNU C++14 | TESTS | 2 | 0 | 0 | ||
216309208 | Tom66 | A1 | July 29, 2023, 4:10 p.m. | OK | GNU C++14 | TESTS | 2 | 0 | 0 | ||
216274023 | paul2008 | A1 | July 29, 2023, 3:17 p.m. | OK | GNU C++14 | TESTS | 2 | 0 | 0 | ||
216388972 | xiaoxiexie | A1 | July 30, 2023, 3:20 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216394309 | ciuim | A1 | July 30, 2023, 4:34 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 0 | ||
216284102 | fingerdash | A1 | July 29, 2023, 3:31 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216277694 | sedev57 | A1 | July 29, 2023, 3:22 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216273226 | Lovely_Ran | A1 | July 29, 2023, 3:16 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216263278 | ArgintLaAnu | A1 | July 29, 2023, 3:02 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216262978 | NKheyuxiang | A1 | July 29, 2023, 3:02 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216262474 | pandaforever | A1 | July 29, 2023, 3:01 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216260411 | ekatsim | A1 | July 29, 2023, 2:58 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216260371 | Kawaii2DIdolOfGSHS | A1 | July 29, 2023, 2:58 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216258857 | TrivialMan | A1 | July 29, 2023, 2:56 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216311982 | LTL_td | A1 | July 29, 2023, 4:14 p.m. | OK | GNU C++17 | TESTS | 2 | 0 | 0 | ||
216380211 | chfychin | A1 | July 30, 2023, 12:49 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
216374521 | stevenkplus | A1 | July 29, 2023, 10:31 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
216359328 | 12tqian | A1 | July 29, 2023, 7:27 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
216341030 | zihouzhong | A1 | July 29, 2023, 5:04 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216316720 | MaGnsi0 | A1 | July 29, 2023, 4:23 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216308910 | GoatTamer | A1 | July 29, 2023, 4:09 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216308337 | mo_onrabbit2 | A1 | July 29, 2023, 4:08 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216308316 | lucasxia01 | A1 | July 29, 2023, 4:08 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216296773 | NK_ | A1 | July 29, 2023, 3:50 p.m. | OK | GNU C++17 (64) | TESTS | 2 | 0 | 0 | ||
216385100 | Once_I_Liked_AGirl | A1 | July 30, 2023, 2:18 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 0 | 0 | ||
216388025 | shibashibainuinuinu | A1 | July 30, 2023, 3:05 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216391035 | JYJin | A1 | July 30, 2023, 3:50 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216391020 | Hiranmoy | A1 | July 30, 2023, 3:49 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216390457 | Tiagodfs | A1 | July 30, 2023, 3:42 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216389615 | nor | A1 | July 30, 2023, 3:30 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216388947 | __jk__ | A1 | July 30, 2023, 3:20 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216387711 | Vercingetorix | A1 | July 30, 2023, 2:59 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216382415 | Lavine | A1 | July 30, 2023, 1:31 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216380064 | SATSKY | A1 | July 30, 2023, 12:45 a.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216378089 | cqbzdj | A1 | July 29, 2023, 11:55 p.m. | OK | GNU C++20 (64) | TESTS | 3 | 0 | 0 | ||
216272238 | profchi | A1 | July 29, 2023, 3:14 p.m. | OK | Java 11 | TESTS | 2 | 171 | 0 | ||
216262288 | FierteDeCeylan | A1 | July 29, 2023, 3:01 p.m. | OK | Java 11 | TESTS | 2 | 187 | 0 | ||
216352494 | kasiru_69 | A1 | July 29, 2023, 6:27 p.m. | OK | Java 11 | TESTS | 3 | 248 | 0 | ||
216257080 | lemon_codes | A1 | July 29, 2023, 2:54 p.m. | OK | Java 17 | TESTS | 2 | 218 | 512000 | ||
216284835 | yvbf | A1 | July 29, 2023, 3:32 p.m. | OK | Java 8 | TESTS | 2 | 77 | 0 | ||
216252200 | golions | A1 | July 29, 2023, 2:48 p.m. | OK | Java 8 | TESTS | 2 | 77 | 0 | ||
216398703 | formidablechief_27 | A1 | July 30, 2023, 5:28 a.m. | OK | Java 8 | TESTS | 3 | 93 | 0 | ||
216285880 | cc4414 | A1 | July 29, 2023, 3:33 p.m. | OK | Java 8 | TESTS | 2 | 93 | 0 | ||
216291548 | SecondThread | A1 | July 29, 2023, 3:42 p.m. | OK | Java 8 | TESTS | 2 | 108 | 38297600 | ||
216299668 | RMA-NB | A1 | July 29, 2023, 3:54 p.m. | OK | Java 8 | TESTS | 2 | 124 | 0 | ||
216271612 | Tlatoani | A1 | July 29, 2023, 3:14 p.m. | OK | Kotlin 1.6 | TESTS | 2 | 280 | 0 | ||
216252313 | bcollet | A1 | July 29, 2023, 2:48 p.m. | OK | PyPy 2 | TESTS | 2 | 46 | 1331200 | ||
216256044 | misorin | A1 | July 29, 2023, 2:52 p.m. | OK | PyPy 3 | TESTS | 2 | 109 | 2764800 | ||
216261929 | plevande | A1 | July 29, 2023, 3 p.m. | OK | PyPy 3 | TESTS | 2 | 109 | 2969600 | ||
216253489 | SPD_9X2 | A1 | July 29, 2023, 2:49 p.m. | OK | PyPy 3 | TESTS | 2 | 124 | 4812800 | ||
216347673 | hxu10 | A1 | July 29, 2023, 5:58 p.m. | OK | PyPy 3 | TESTS | 2 | 140 | 4198400 | ||
216276401 | Maruzensky | A1 | July 29, 2023, 3:20 p.m. | OK | PyPy 3-64 | TESTS | 2 | 93 | 5836800 | ||
216258260 | titia | A1 | July 29, 2023, 2:55 p.m. | OK | PyPy 3-64 | TESTS | 2 | 108 | 8192000 | ||
216258665 | jatloe | A1 | July 29, 2023, 2:56 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 6758400 | ||
216255499 | Kita | A1 | July 29, 2023, 2:52 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 8806400 | ||
216251379 | tassei903 | A1 | July 29, 2023, 2:47 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 9318400 | ||
216266564 | Alex239 | A1 | July 29, 2023, 3:07 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 9523200 | ||
216264132 | codicon | A1 | July 29, 2023, 3:03 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 9625600 | ||
216247746 | kyoran | A1 | July 29, 2023, 2:44 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 9728000 | ||
216271072 | xxh1999 | A1 | July 29, 2023, 3:13 p.m. | OK | PyPy 3-64 | TESTS | 2 | 124 | 10035200 | ||
216260148 | huikang | A1 | July 29, 2023, 2:58 p.m. | OK | PyPy 3-64 | TESTS | 2 | 139 | 6451200 | ||
216247916 | Ritwin | A1 | July 29, 2023, 2:44 p.m. | OK | Python 3 | TESTS | 2 | 61 | 102400 | ||
216259883 | qwerty787788 | A1 | July 29, 2023, 2:57 p.m. | OK | Rust 2021 | TESTS | 2 | 0 | 0 | ||
216247625 | sansen | A1 | July 29, 2023, 2:44 p.m. | OK | Rust 2021 | TESTS | 2 | 0 | 102400 | ||
216284476 | m.cpp | A1 | July 29, 2023, 3:31 p.m. | OK | Rust 2021 | TESTS | 2 | 15 | 0 | ||
216272185 | haihamabossu | A1 | July 29, 2023, 3:14 p.m. | OK | Rust 2021 | TESTS | 2 | 15 | 0 | ||
216257073 | nairb | A1 | July 29, 2023, 2:54 p.m. | OK | Rust 2021 | TESTS | 2 | 61 | 102400 | ||
216271406 | andrey.m | A1 | July 29, 2023, 3:13 p.m. | OK | Rust 2021 | TESTS | 2 | 78 | 0 | ||
216356370 | scnucjh | A1 | July 29, 2023, 6:59 p.m. | OK | Scala | TESTS | 3 | 607 | 0 |
Back to search problems