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 |
---|---|---|---|---|---|---|
1370 | Codeforces Round 651 (Div. 2) | FINISHED | False | 8100 | 144516263 | June 20, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 23926 ) | B | GCD Compression | PROGRAMMING | brute force constructive algorithms math number theory |
B"Ashish has an array a of consisting of 2n positive integers. He wants to compress a into an array b of size n-1 . To do this, he first discards exactly 2 (any two) elements from a . He then performs the following operation until there are no elements left in a : The compressed array b has to have a special property. The greatest common divisor ( mathrm{gcd} ) of all its elements should be greater than 1 . Recall that the mathrm{gcd} of an array of positive integers is the biggest integer that is a divisor of all integers in the array. It can be proven that it is always possible to compress array a into an array b of size n-1 such that gcd(b_1, b_2..., b_{n-1}) > 1 . Help Ashish find a way to do so. The first line contains a single integer t ( 1 <= q t <= q 10 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= q n <= q 1000 ). The second line of each test case contains 2n integers a_1, a_2, ldots, a_{2n} ( 1 <= q a_i <= q 1000 ) -- the elements of the array a . For each test case, output n-1 lines -- the operations performed to compress the array a to the array b . The initial discard of the two elements is not an operation, you don't need to output anything about it. The i -th line should contain two integers, the indices ( 1 --based) of the two elements from the array a that are used in the i -th operation. All 2n-2 indices should be distinct integers from 1 to 2n . You don't need to output two initially discarded elements from a . If there are multiple answers, you can find any. In the first test case, b = {3+6, 4+5 } = {9, 9 } and mathrm{gcd}(9, 9) = 9 . In the second test case, b = {9+10 } = {19 } and mathrm{gcd}(19) = 19 . In the third"... |
Editorial — Codeforces Round #651 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
84479901 | Gassa | B | June 20, 2020, 3:46 p.m. | OK | D | TESTS | 27 | 31 | 4198400 | ||
84500475 | jaeger177012 | B | June 20, 2020, 4:27 p.m. | OK | GNU C11 | TESTS | 27 | 46 | 204800 | ||
84538769 | BugLeave | B | June 21, 2020, 1:07 a.m. | OK | GNU C11 | TESTS | 27 | 61 | 0 | ||
84489736 | rainboy | B | June 20, 2020, 4:04 p.m. | OK | GNU C11 | TESTS | 27 | 61 | 0 | ||
84499165 | Sanjida_99 | B | June 20, 2020, 4:24 p.m. | OK | GNU C11 | TESTS | 27 | 61 | 204800 | ||
84499059 | anujsinghal | B | June 20, 2020, 4:23 p.m. | OK | GNU C11 | TESTS | 27 | 61 | 204800 | ||
84496629 | nikm | B | June 20, 2020, 4:18 p.m. | OK | GNU C11 | TESTS | 27 | 62 | 0 | ||
84525108 | Vainhav183 | B | June 20, 2020, 7:32 p.m. | OK | GNU C11 | TESTS | 27 | 62 | 0 | ||
84488602 | Flames2012 | B | June 20, 2020, 4:02 p.m. | OK | GNU C11 | TESTS | 27 | 62 | 0 | ||
84521011 | tasja | B | June 20, 2020, 6:43 p.m. | OK | GNU C11 | TESTS | 27 | 62 | 102400 | ||
84507895 | subham348 | B | June 20, 2020, 4:42 p.m. | OK | GNU C11 | TESTS | 27 | 62 | 102400 | ||
84497521 | lzzAKIOI | B | June 20, 2020, 4:20 p.m. | OK | GNU C++11 | TESTS | 27 | 30 | 102400 | ||
84518598 | bnfsh | B | June 20, 2020, 6:23 p.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84539247 | Aralon | B | June 21, 2020, 1:26 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84539370 | smsylby | B | June 21, 2020, 1:31 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84539885 | zhangpuyang | B | June 21, 2020, 1:49 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84540229 | Johnson_sky | B | June 21, 2020, 2:01 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84540616 | ezboy | B | June 21, 2020, 2:13 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84543164 | __Archer | B | June 21, 2020, 3:21 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84536966 | new_xyq | B | June 20, 2020, 11:57 p.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84543233 | huanggs | B | June 21, 2020, 3:22 a.m. | OK | GNU C++11 | TESTS | 27 | 31 | 0 | ||
84530427 | Monuwar | B | June 20, 2020, 8:53 p.m. | OK | GNU C++14 | TESTS | 27 | 30 | 204800 | ||
84478172 | _jantr__ | B | June 20, 2020, 3:43 p.m. | OK | GNU C++14 | TESTS | 27 | 30 | 204800 | ||
84489586 | _Hasak1 | B | June 20, 2020, 4:04 p.m. | OK | GNU C++14 | TESTS | 27 | 30 | 18022400 | ||
84522121 | JayB | B | June 20, 2020, 6:55 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84522173 | yatin_kwatra | B | June 20, 2020, 6:56 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84523076 | dipeshrathi163 | B | June 20, 2020, 7:06 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84532082 | SuperJ6 | B | June 20, 2020, 9:26 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84532834 | hornycoder | B | June 20, 2020, 9:43 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84536927 | Zhangjiacheng2006 | B | June 20, 2020, 11:56 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84523595 | Abukhadijah | B | June 20, 2020, 7:12 p.m. | OK | GNU C++14 | TESTS | 27 | 31 | 0 | ||
84532179 | Tadek | B | June 20, 2020, 9:28 p.m. | OK | GNU C++17 | TESTS | 27 | 30 | 307200 | ||
84541892 | Mohit_Singh_Dhattarwal | B | June 21, 2020, 2:50 a.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84536988 | CSU_WJJJ | B | June 20, 2020, 11:58 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84534445 | MO_Salah99 | B | June 20, 2020, 10:23 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84525048 | fakehandle | B | June 20, 2020, 7:32 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84520370 | Mobin12345 | B | June 20, 2020, 6:37 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84520046 | Lovish_dua | B | June 20, 2020, 6:35 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84499355 | mhhmkht | B | June 20, 2020, 4:24 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84497234 | Mosharrof13 | B | June 20, 2020, 4:19 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84497144 | AlveRahman | B | June 20, 2020, 4:19 p.m. | OK | GNU C++17 | TESTS | 27 | 31 | 0 | ||
84525180 | balraj.babrah | B | June 20, 2020, 7:33 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 30 | 102400 | ||
84534082 | danielvitor23 | B | June 20, 2020, 10:13 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 30 | 102400 | ||
84521485 | kvutxdy | B | June 20, 2020, 6:48 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84521587 | jainbot27 | B | June 20, 2020, 6:49 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84528070 | CodingKnight | B | June 20, 2020, 8:14 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84530846 | mrboorger | B | June 20, 2020, 9:01 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84538213 | tyler | B | June 21, 2020, 12:47 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84540602 | sanyam1101 | B | June 21, 2020, 2:13 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84518290 | hemant1729 | B | June 20, 2020, 6:20 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84518654 | het.patel | B | June 20, 2020, 6:23 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 31 | 0 | ||
84540041 | snow_bear_328 | B | June 21, 2020, 1:54 a.m. | OK | Go | TESTS | 27 | 62 | 102400 | ||
84489294 | takezawa | B | June 20, 2020, 4:03 p.m. | OK | Go | TESTS | 27 | 77 | 102400 | ||
84499873 | TheGreatGeek | B | June 20, 2020, 4:25 p.m. | OK | Haskell | TESTS | 27 | 62 | 102400 | ||
84532558 | derrick20 | B | June 20, 2020, 9:37 p.m. | OK | Java 11 | TESTS | 27 | 171 | 0 | ||
84532880 | derrick20 | B | June 20, 2020, 9:44 p.m. | OK | Java 11 | TESTS | 27 | 186 | 0 | ||
84532617 | derrick20 | B | June 20, 2020, 9:38 p.m. | OK | Java 11 | TESTS | 27 | 186 | 0 | ||
84496658 | harman_singh21 | B | June 20, 2020, 4:18 p.m. | OK | Java 11 | TESTS | 27 | 202 | 0 | ||
84481301 | gaurav.mishra_ | B | June 20, 2020, 3:49 p.m. | OK | Java 11 | TESTS | 27 | 202 | 0 | ||
84494424 | DR.KOKS | B | June 20, 2020, 4:13 p.m. | OK | Java 11 | TESTS | 27 | 217 | 0 | ||
84529415 | namandeept_00 | B | June 20, 2020, 8:35 p.m. | OK | Java 11 | TESTS | 27 | 217 | 0 | ||
84521809 | amit_chas | B | June 20, 2020, 6:51 p.m. | OK | Java 11 | TESTS | 27 | 218 | 0 | ||
84529001 | namandeept_00 | B | June 20, 2020, 8:29 p.m. | OK | Java 11 | TESTS | 27 | 218 | 0 | ||
84519042 | bckslsh03 | B | June 20, 2020, 6:26 p.m. | OK | Java 11 | TESTS | 27 | 218 | 0 | ||
84533569 | Ziklon | B | June 20, 2020, 10 p.m. | OK | Java 8 | TESTS | 27 | 109 | 0 | ||
84477147 | sunnycarlos | B | June 20, 2020, 3:42 p.m. | OK | Java 8 | TESTS | 27 | 109 | 0 | ||
84506625 | kunalkatiyar9 | B | June 20, 2020, 4:39 p.m. | OK | Java 8 | TESTS | 27 | 109 | 0 | ||
84543799 | dewanshnigam | B | June 21, 2020, 3:35 a.m. | OK | Java 8 | TESTS | 27 | 109 | 0 | ||
84539338 | bluesky111 | B | June 21, 2020, 1:30 a.m. | OK | Java 8 | TESTS | 27 | 109 | 0 | ||
84543236 | Manan8686 | B | June 21, 2020, 3:22 a.m. | OK | Java 8 | TESTS | 27 | 124 | 0 | ||
84528452 | beroul | B | June 20, 2020, 8:20 p.m. | OK | Java 8 | TESTS | 27 | 124 | 0 | ||
84527954 | arjunbhatt670 | B | June 20, 2020, 8:12 p.m. | OK | Java 8 | TESTS | 27 | 124 | 0 | ||
84527847 | bilalcim | B | June 20, 2020, 8:10 p.m. | OK | Java 8 | TESTS | 27 | 124 | 0 | ||
84523838 | wwwwwwwwwwww | B | June 20, 2020, 7:15 p.m. | OK | Java 8 | TESTS | 27 | 124 | 0 | ||
84520679 | iShivansh | B | June 20, 2020, 6:40 p.m. | OK | Kotlin | TESTS | 27 | 202 | 0 | ||
84478930 | rohanbojja | B | June 20, 2020, 3:45 p.m. | OK | Kotlin | TESTS | 27 | 233 | 0 | ||
84503652 | sid9406 | B | June 20, 2020, 4:33 p.m. | OK | Kotlin | TESTS | 27 | 234 | 0 | ||
84491744 | PussyKiller | B | June 20, 2020, 4:08 p.m. | OK | Kotlin | TESTS | 27 | 264 | 1126400 | ||
84484538 | rudolf | B | June 20, 2020, 3:54 p.m. | OK | Kotlin | TESTS | 27 | 265 | 1945600 | ||
84531275 | ansergeyg | B | June 20, 2020, 9:09 p.m. | OK | Mono C# | TESTS | 27 | 77 | 3072000 | ||
84529061 | osthir | B | June 20, 2020, 8:30 p.m. | OK | Mono C# | TESTS | 27 | 93 | 2764800 | ||
84483126 | peterc | B | June 20, 2020, 3:52 p.m. | OK | Mono C# | TESTS | 27 | 93 | 4505600 | ||
84483311 | Khazmadu | B | June 20, 2020, 3:52 p.m. | OK | Mono C# | TESTS | 27 | 156 | 5734400 | ||
84486426 | babahanx | B | June 20, 2020, 3:58 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 0 | ||
84497508 | icecap360 | B | June 20, 2020, 4:20 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 0 | ||
84530056 | Whirlwind_Matar | B | June 20, 2020, 8:46 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 0 | ||
84530070 | Husne_Matar | B | June 20, 2020, 8:47 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 0 | ||
84522740 | alibabaand40haramies | B | June 20, 2020, 7:02 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 307200 | ||
84504654 | morysoly | B | June 20, 2020, 4:35 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 307200 | ||
84483801 | cwdck | B | June 20, 2020, 3:53 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 307200 | ||
84475462 | zinean00 | B | June 20, 2020, 3:39 p.m. | OK | MS C++ 2017 | TESTS | 27 | 46 | 307200 | ||
84485594 | areakRU | B | June 20, 2020, 3:56 p.m. | OK | MS C++ 2017 | TESTS | 27 | 62 | 307200 | ||
84528097 | _vanger_ | B | June 20, 2020, 8:14 p.m. | OK | MS C++ 2017 | TESTS | 27 | 77 | 0 | ||
84488074 | realnimish | B | June 20, 2020, 4:01 p.m. | OK | PyPy 2 | TESTS | 27 | 187 | 5120000 | ||
84517919 | realnimish | B | June 20, 2020, 6:18 p.m. | OK | PyPy 2 | TESTS | 27 | 202 | 4505600 | ||
84483859 | ksdthegr8 | B | June 20, 2020, 3:53 p.m. | OK | PyPy 2 | TESTS | 27 | 389 | 5120000 | ||
84524064 | agrawalamritanshu82 | B | June 20, 2020, 7:18 p.m. | OK | PyPy 3 | TESTS | 27 | 171 | 2764800 | ||
84542369 | the_sf | B | June 21, 2020, 3:02 a.m. | OK | PyPy 3 | TESTS | 27 | 171 | 4096000 | ||
84532642 | xuey | B | June 20, 2020, 9:39 p.m. | OK | PyPy 3 | TESTS | 27 | 187 | 5632000 | ||
84544206 | ashish_759 | B | June 21, 2020, 3:43 a.m. | OK | PyPy 3 | TESTS | 27 | 187 | 6451200 | ||
84476156 | asiltureli | B | June 20, 2020, 3:40 p.m. | OK | PyPy 3 | TESTS | 27 | 202 | 5632000 | ||
84491483 | notacow | B | June 20, 2020, 4:08 p.m. | OK | PyPy 3 | TESTS | 27 | 202 | 5734400 | ||
84484918 | ritiksingh2020 | B | June 20, 2020, 3:55 p.m. | OK | PyPy 3 | TESTS | 27 | 202 | 6963200 | ||
84517964 | jlallas384 | B | June 20, 2020, 6:18 p.m. | OK | PyPy 3 | TESTS | 27 | 217 | 6553600 | ||
84496453 | mrinal2233 | B | June 20, 2020, 4:18 p.m. | OK | PyPy 3 | TESTS | 27 | 217 | 7065600 | ||
84520056 | akay_99 | B | June 20, 2020, 6:35 p.m. | OK | PyPy 3 | TESTS | 27 | 217 | 7372800 | ||
84477528 | Mike10 | B | June 20, 2020, 3:42 p.m. | OK | Python 2 | TESTS | 27 | 202 | 204800 | ||
84489815 | tanujrastogi | B | June 20, 2020, 4:04 p.m. | OK | Python 2 | TESTS | 27 | 202 | 307200 | ||
84528692 | eugalt | B | June 20, 2020, 8:24 p.m. | OK | Python 3 | TESTS | 27 | 124 | 819200 | ||
84528586 | eugalt | B | June 20, 2020, 8:22 p.m. | OK | Python 3 | TESTS | 27 | 124 | 819200 | ||
84517922 | stnkien | B | June 20, 2020, 6:18 p.m. | OK | Python 3 | TESTS | 27 | 124 | 819200 | ||
84483028 | mishrajeegaurav | B | June 20, 2020, 3:52 p.m. | OK | Python 3 | TESTS | 27 | 124 | 1024000 | ||
84541918 | the_irresponsible_coder | B | June 21, 2020, 2:51 a.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84519983 | showman_ | B | June 20, 2020, 6:34 p.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84503428 | c_py | B | June 20, 2020, 4:33 p.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84489804 | vanya12 | B | June 20, 2020, 4:04 p.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84483678 | srao9151 | B | June 20, 2020, 3:53 p.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84481428 | thiyagutenysen | B | June 20, 2020, 3:49 p.m. | OK | Python 3 | TESTS | 27 | 139 | 819200 | ||
84489395 | ktn_yuta | B | June 20, 2020, 4:03 p.m. | OK | Rust | TESTS | 27 | 139 | 512000 | ||
84481934 | BridgeBurner | B | June 20, 2020, 3:50 p.m. | OK | Scala | TESTS | 27 | 670 | 0 |
Back to search problems