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 |
---|---|---|---|---|---|---|
1521 | Codeforces Round 720 (Div. 2) | FINISHED | False | 8100 | 111425099 | May 7, 2021, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 21473 ) | B | Nastia and a Good Array | PROGRAMMING | constructive algorithms math |
B"Nastia has received an array of n positive integers as a gift. She calls such an array a good that for all i ( 2 <= i <= n ) takes place gcd(a_{i - 1}, a_{i}) = 1 , where gcd(u, v) denotes the greatest common divisor (GCD) of integers u and v . You can perform the operation: select two different indices i, j ( 1 <= i, j <= n , i neq j ) and two integers x, y ( 1 <= x, y <= 2 cdot 10^9 ) so that min{(a_i, a_j)} = min{(x, y)} . Then change a_i to x and a_j to y . The girl asks you to make the array good using at most n operations. It can be proven that this is always possible. The first line contains a single integer t ( 1 <= t <= 10 ,000 ) -- the number of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 10^5 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ldots, a_{n} ( 1 <= a_i <= 10^9 ) -- the array which Nastia has received as a gift. It's guaranteed that the sum of n in one test doesn't exceed 2 cdot 10^5 . For each of t test cases print a single integer k ( 0 <= k <= n ) -- the number of operations. You don't need to minimize this number. In each of the next k lines print 4 integers i , j , x , y ( 1 <= i neq j <= n , 1 <= x, y <= 2 cdot 10^9 ) so that min{(a_i, a_j)} = min{(x, y)} -- in this manner you replace a_i with x and a_j with y . If there are multiple answers, print any. Consider the first test case. Initially a = [9, 6, 3, 11, 15] . In the first operation replace a_1 with 11 and a_5 with 9 . It's valid, because min{(a_1, a_5)} = min{(11, 9)} = 9 . After this a = [11, 6, 3, 11, 9] . In the second operation replace a_2 with 7 and a_5 wi"... |
90477 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
115644215 | Youmar24 | B | May 7, 2021, 10:29 p.m. | OK | FPC | TESTS | 15 | 655 | 4300800 | ||
115639768 | SajibKC_19 | B | May 7, 2021, 9:06 p.m. | OK | GNU C11 | TESTS | 15 | 1060 | 5324800 | ||
115655324 | Willemkmetsch | B | May 8, 2021, 3:19 a.m. | OK | GNU C++11 | TESTS | 15 | 93 | 5529600 | ||
115648657 | wangjiheng | B | May 8, 2021, 12:56 a.m. | OK | GNU C++11 | TESTS | 15 | 108 | 4300800 | ||
115663025 | czyer | B | May 8, 2021, 5:19 a.m. | OK | GNU C++11 | TESTS | 15 | 109 | 4300800 | ||
115646186 | Macesuted_AB | B | May 7, 2021, 11:26 p.m. | OK | GNU C++11 | TESTS | 15 | 109 | 13107200 | ||
115647987 | zkpj | B | May 8, 2021, 12:35 a.m. | OK | GNU C++11 | TESTS | 15 | 109 | 15974400 | ||
115653872 | s.vinci | B | May 8, 2021, 2:53 a.m. | OK | GNU C++11 | TESTS | 15 | 124 | 4300800 | ||
115656203 | Lappland_Texas | B | May 8, 2021, 3:33 a.m. | OK | GNU C++11 | TESTS | 15 | 124 | 4710400 | ||
115650191 | LinkZelda | B | May 8, 2021, 1:38 a.m. | OK | GNU C++11 | TESTS | 15 | 140 | 3686400 | ||
115616741 | Agile-Skl | B | May 7, 2021, 4:46 p.m. | OK | GNU C++11 | TESTS | 11 | 140 | 3891200 | ||
115656233 | Lappland_Texas | B | May 8, 2021, 3:33 a.m. | OK | GNU C++11 | TESTS | 15 | 140 | 4710400 | ||
115628986 | rakesh930 | B | May 7, 2021, 6:42 p.m. | OK | GNU C++14 | TESTS | 13 | 109 | 5632000 | ||
115626101 | Gankutsuou | B | May 7, 2021, 6:12 p.m. | OK | GNU C++14 | TESTS | 13 | 124 | 3788800 | ||
115642817 | UselessBrat | B | May 7, 2021, 9:58 p.m. | OK | GNU C++14 | TESTS | 15 | 124 | 4096000 | ||
115651560 | Reinhart | B | May 8, 2021, 2:10 a.m. | OK | GNU C++14 | TESTS | 15 | 124 | 4096000 | ||
115626522 | yog_111 | B | May 7, 2021, 6:16 p.m. | OK | GNU C++14 | TESTS | 13 | 124 | 4505600 | ||
115624925 | astro_lion | B | May 7, 2021, 6:01 p.m. | OK | GNU C++14 | TESTS | 13 | 124 | 5734400 | ||
115658005 | abhishek.gururani | B | May 8, 2021, 4:05 a.m. | OK | GNU C++14 | TESTS | 15 | 140 | 4096000 | ||
115665362 | _Sabib_ | B | May 8, 2021, 5:49 a.m. | OK | GNU C++14 | TESTS | 15 | 140 | 4198400 | ||
115647023 | jzdx | B | May 7, 2021, 11:59 p.m. | OK | GNU C++14 | TESTS | 15 | 140 | 4505600 | ||
115625232 | admirerofearth | B | May 7, 2021, 6:04 p.m. | OK | GNU C++14 | TESTS | 13 | 140 | 4710400 | ||
115623919 | _DaNeK_ | B | May 7, 2021, 5:54 p.m. | OK | GNU C++17 | TESTS | 11 | 124 | 4096000 | ||
115650781 | gugbablover | B | May 8, 2021, 1:53 a.m. | OK | GNU C++17 | TESTS | 15 | 124 | 4096000 | ||
115631370 | ADITYA_17 | B | May 7, 2021, 7:12 p.m. | OK | GNU C++17 | TESTS | 13 | 124 | 4096000 | ||
115630587 | Niloufer | B | May 7, 2021, 7:02 p.m. | OK | GNU C++17 | TESTS | 13 | 124 | 4096000 | ||
115629648 | arn200 | B | May 7, 2021, 6:50 p.m. | OK | GNU C++17 | TESTS | 13 | 124 | 4096000 | ||
115623711 | chnd_777 | B | May 7, 2021, 5:52 p.m. | OK | GNU C++17 | TESTS | 11 | 124 | 4096000 | ||
115622283 | _DaNeK_ | B | May 7, 2021, 5:42 p.m. | OK | GNU C++17 | TESTS | 11 | 124 | 4096000 | ||
115665315 | Anchord | B | May 8, 2021, 5:48 a.m. | OK | GNU C++17 | TESTS | 15 | 124 | 4198400 | ||
115635742 | Z4h1d | B | May 7, 2021, 8:12 p.m. | OK | GNU C++17 | TESTS | 15 | 124 | 4198400 | ||
115640439 | slayer2712 | B | May 7, 2021, 9:16 p.m. | OK | GNU C++17 | TESTS | 15 | 124 | 4198400 | ||
115648689 | LayCurse | B | May 8, 2021, 12:58 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 46 | 6860800 | ||
115635316 | JohnSmith0081 | B | May 7, 2021, 8:07 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 92 | 10444800 | ||
115647520 | tom0727 | B | May 8, 2021, 12:18 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 93 | 4710400 | ||
115628187 | DoTran | B | May 7, 2021, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 13 | 93 | 4915200 | ||
115620801 | Prakhar6969 | B | May 7, 2021, 5:36 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 93 | 5120000 | ||
115622846 | TAHMID37 | B | May 7, 2021, 5:45 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 93 | 5529600 | ||
115647223 | vincentpikachu20 | B | May 8, 2021, 12:07 a.m. | OK | GNU C++17 (64) | TESTS | 15 | 93 | 5529600 | ||
115633028 | Mr.Hmian | B | May 7, 2021, 7:35 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 93 | 6451200 | ||
115644775 | ratingminus | B | May 7, 2021, 10:42 p.m. | OK | GNU C++17 (64) | TESTS | 15 | 108 | 4710400 | ||
115621687 | Uppercase | B | May 7, 2021, 5:39 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 108 | 4915200 | ||
115653373 | SorryNaCN | B | May 8, 2021, 2:44 a.m. | OK | Go | TESTS | 15 | 202 | 15360000 | ||
115638868 | coder0687 | B | May 7, 2021, 8:52 p.m. | OK | Java 11 | TESTS | 15 | 249 | 35328000 | ||
115638720 | coder0687 | B | May 7, 2021, 8:50 p.m. | OK | Java 11 | TESTS | 15 | 280 | 35328000 | ||
115663849 | Andwerp | B | May 8, 2021, 5:30 a.m. | OK | Java 11 | TESTS | 15 | 280 | 39014400 | ||
115631098 | cyberphobia | B | May 7, 2021, 7:08 p.m. | OK | Java 11 | TESTS | 13 | 295 | 29900800 | ||
115623810 | ak_ankit | B | May 7, 2021, 5:53 p.m. | OK | Java 11 | TESTS | 11 | 296 | 24576000 | ||
115650584 | _Body | B | May 8, 2021, 1:48 a.m. | OK | Java 11 | TESTS | 15 | 311 | 24985600 | ||
115641226 | sarthakmanna | B | May 7, 2021, 9:29 p.m. | OK | Java 11 | TESTS | 15 | 311 | 25497600 | ||
115627743 | cyberphobia | B | May 7, 2021, 6:28 p.m. | OK | Java 11 | TESTS | 13 | 311 | 34508800 | ||
115638342 | MrOtter | B | May 7, 2021, 8:45 p.m. | OK | Java 11 | TESTS | 15 | 326 | 26316800 | ||
115663094 | sf14t | B | May 8, 2021, 5:20 a.m. | OK | Java 11 | TESTS | 15 | 327 | 30105600 | ||
115658764 | Pranay2516 | B | May 8, 2021, 4:18 a.m. | OK | Java 8 | TESTS | 15 | 171 | 20480000 | ||
115626611 | guru1603 | B | May 7, 2021, 6:17 p.m. | OK | Java 8 | TESTS | 13 | 187 | 21708800 | ||
115664683 | pranavggupta06 | B | May 8, 2021, 5:40 a.m. | OK | Java 8 | TESTS | 15 | 187 | 38400000 | ||
115635854 | Gupta-OP | B | May 7, 2021, 8:13 p.m. | OK | Java 8 | TESTS | 15 | 202 | 21606400 | ||
115653594 | Parimal | B | May 8, 2021, 2:49 a.m. | OK | Java 8 | TESTS | 15 | 217 | 22016000 | ||
115650823 | InANutshell | B | May 8, 2021, 1:54 a.m. | OK | Java 8 | TESTS | 15 | 233 | 21606400 | ||
115630156 | goyalronak3 | B | May 7, 2021, 6:56 p.m. | OK | Java 8 | TESTS | 13 | 233 | 21811200 | ||
115653138 | Parimal | B | May 8, 2021, 2:40 a.m. | OK | Java 8 | TESTS | 15 | 233 | 22118400 | ||
115651866 | thedesalizes | B | May 8, 2021, 2:15 a.m. | OK | Java 8 | TESTS | 15 | 248 | 21606400 | ||
115647634 | Abdallah_Ragab00 | B | May 8, 2021, 12:22 a.m. | OK | Java 8 | TESTS | 15 | 249 | 21708800 | ||
115643509 | muhammadmunna | B | May 7, 2021, 10:13 p.m. | OK | Kotlin | TESTS | 15 | 404 | 29081600 | ||
115644373 | muhammadmunna | B | May 7, 2021, 10:32 p.m. | OK | Kotlin | TESTS | 15 | 436 | 29081600 | ||
115644796 | muhammadmunna | B | May 7, 2021, 10:42 p.m. | OK | Kotlin | TESTS | 15 | 436 | 40140800 | ||
115644599 | muhammadmunna | B | May 7, 2021, 10:37 p.m. | OK | Kotlin | TESTS | 15 | 936 | 29081600 | ||
115642747 | muhammadmunna | B | May 7, 2021, 9:57 p.m. | OK | Kotlin | TESTS | 15 | 1574 | 28979200 | ||
115648330 | den1107 | B | May 8, 2021, 12:46 a.m. | OK | Kotlin | TESTS | 15 | 1762 | 23552000 | ||
115630123 | aleksikangas | B | May 7, 2021, 6:55 p.m. | OK | MS C++ 2017 | TESTS | 13 | 405 | 4198400 | ||
115630076 | aleksikangas | B | May 7, 2021, 6:55 p.m. | OK | MS C++ 2017 | TESTS | 13 | 405 | 4198400 | ||
115630097 | aleksikangas | B | May 7, 2021, 6:55 p.m. | OK | MS C++ 2017 | TESTS | 13 | 421 | 4198400 | ||
115631178 | vladnoov | B | May 7, 2021, 7:09 p.m. | OK | MS C++ 2017 | TESTS | 13 | 451 | 7987200 | ||
115629506 | nemethm | B | May 7, 2021, 6:48 p.m. | OK | MS C++ 2017 | TESTS | 13 | 483 | 4812800 | ||
115654483 | zyj2012190230 | B | May 8, 2021, 3:04 a.m. | OK | MS C++ 2017 | TESTS | 15 | 576 | 5324800 | ||
115664585 | Yujin01 | B | May 8, 2021, 5:39 a.m. | OK | MS C++ 2017 | TESTS | 15 | 654 | 3788800 | ||
115650393 | _Rimjhim_36 | B | May 8, 2021, 1:43 a.m. | OK | MS C++ 2017 | TESTS | 15 | 686 | 4403200 | ||
115650077 | Harshita_0304 | B | May 8, 2021, 1:35 a.m. | OK | MS C++ 2017 | TESTS | 15 | 732 | 4096000 | ||
115621443 | Basem.Maher | B | May 7, 2021, 5:38 p.m. | OK | MS C++ 2017 | TESTS | 11 | 810 | 22118400 | ||
115631949 | whaleee | B | May 7, 2021, 7:20 p.m. | OK | PyPy 2 | TESTS | 13 | 171 | 38297600 | ||
115632892 | lebron87 | B | May 7, 2021, 7:33 p.m. | OK | PyPy 2 | TESTS | 13 | 311 | 44236800 | ||
115633111 | s_prateek26 | B | May 7, 2021, 7:36 p.m. | OK | PyPy 3 | TESTS | 14 | 233 | 38400000 | ||
115625801 | legend.ary_as | B | May 7, 2021, 6:08 p.m. | OK | PyPy 3 | TESTS | 13 | 248 | 39833600 | ||
115622661 | kirito18086 | B | May 7, 2021, 5:44 p.m. | OK | PyPy 3 | TESTS | 11 | 264 | 39628800 | ||
115623663 | 6-_-9 | B | May 7, 2021, 5:52 p.m. | OK | PyPy 3 | TESTS | 11 | 280 | 38195200 | ||
115629245 | abhishekk_7 | B | May 7, 2021, 6:45 p.m. | OK | PyPy 3 | TESTS | 13 | 280 | 39526400 | ||
115625062 | armsusman | B | May 7, 2021, 6:02 p.m. | OK | PyPy 3 | TESTS | 13 | 358 | 43110400 | ||
115621538 | gourav2001k | B | May 7, 2021, 5:38 p.m. | OK | PyPy 3 | TESTS | 11 | 405 | 36761600 | ||
115663331 | singhumang305 | B | May 8, 2021, 5:23 a.m. | OK | PyPy 3 | TESTS | 15 | 529 | 32870400 | ||
115626620 | Kunal_makwana | B | May 7, 2021, 6:17 p.m. | OK | PyPy 3 | TESTS | 13 | 529 | 44646400 | ||
115626551 | hsdkfrhq | B | May 7, 2021, 6:16 p.m. | OK | PyPy 3 | TESTS | 13 | 529 | 44646400 | ||
115652699 | iska_terminator | B | May 8, 2021, 2:32 a.m. | OK | Python 3 | TESTS | 15 | 670 | 15360000 | ||
115660430 | eugalt | B | May 8, 2021, 4:44 a.m. | OK | Python 3 | TESTS | 15 | 685 | 16281600 | ||
115638643 | WhatsDerivative | B | May 7, 2021, 8:49 p.m. | OK | Python 3 | TESTS | 15 | 701 | 16384000 | ||
115632311 | gautham227 | B | May 7, 2021, 7:25 p.m. | OK | Python 3 | TESTS | 13 | 748 | 15155200 | ||
115656340 | Googler437 | B | May 8, 2021, 3:35 a.m. | OK | Python 3 | TESTS | 15 | 748 | 15257600 | ||
115625659 | mahtab_zihan | B | May 7, 2021, 6:07 p.m. | OK | Python 3 | TESTS | 13 | 748 | 15257600 | ||
115660101 | somilbaliyan | B | May 8, 2021, 4:39 a.m. | OK | Python 3 | TESTS | 15 | 763 | 15257600 | ||
115656784 | prashant-2-4-4 | B | May 8, 2021, 3:44 a.m. | OK | Python 3 | TESTS | 15 | 764 | 15257600 | ||
115636944 | CristianLazoQ | B | May 7, 2021, 8:26 p.m. | OK | Python 3 | TESTS | 15 | 779 | 15155200 | ||
115666089 | encrypted_jpg | B | May 8, 2021, 5:59 a.m. | OK | Python 3 | TESTS | 15 | 779 | 15257600 | ||
115626183 | myduomilia | B | May 7, 2021, 6:12 p.m. | OK | Rust | TESTS | 13 | 61 | 7372800 | ||
115626007 | myduomilia | B | May 7, 2021, 6:10 p.m. | OK | Rust | TESTS | 13 | 78 | 7372800 |
Back to search problems