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 |
---|---|---|---|---|---|---|
1635 | Codeforces Round 772 (Div. 2) | FINISHED | False | 7200 | 86455499 | Feb. 20, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17853 ) | C | Differential Sorting | PROGRAMMING | constructive algorithms greedy |
B"You are given an array a of n elements. Your can perform the following operation no more than n times: Select three indices x,y,z (1 <= q x < y < z <= q n) and replace a_x with a_y - a_z . After the operation, |a_x| need to be less than 10^{18} . Your goal is to make the resulting array non-decreasing. If there are multiple solutions, you can output any. If it is impossible to achieve, you should report it as well. Each test contains multiple test cases. The first line will contain a single integer t (1 <= q t <= q 10000) -- the number of test cases. Then t test cases follow. The first line of each test case contains a single integer n (3 <= q n <= q 2 cdot 10^5) -- the size of the array a . The second line of each test case contains n integers a_1, a_2, ldots ,a_n (-10^9 <= q a_i <= q 10^9) , the elements of a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, print -1 in a single line if there is no solution. Otherwise in the first line you should print a single integer m (0 <= q m <= q n) -- number of operations you performed. Then the i -th of the following m lines should contain three integers x,y,z (1 <= q x < y < z <= q n) -- description of the i -th operation. If there are multiple solutions, you can output any. Note that you don't have to minimize the number of operations in this task. In the first example, the array becomes [-6,-4,2,-1,2] after the first operation, [-6,-4,-3,-1,2] after the second operation. In the second example, it is impossible to make the array sorted after any sequence of operations. In the third example, the array is already sorted, so we don't need to perform any operations. "... |
Codeforces Round #772 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
147108129 | dean.menezes | C | Feb. 20, 2022, 6:38 p.m. | OK | Clang++17 Diagnostics | TESTS | 32 | 233 | 716800 | ||
147126983 | CUMT-MJZ | C | Feb. 21, 2022, 1:25 a.m. | OK | Clang++17 Diagnostics | TESTS | 32 | 280 | 1740800 | ||
147122872 | gxlois | C | Feb. 20, 2022, 11:03 p.m. | OK | GNU C11 | TESTS | 32 | 967 | 819200 | ||
147121430 | 1435730 | C | Feb. 20, 2022, 10:21 p.m. | OK | GNU C11 | TESTS | 32 | 982 | 819200 | ||
147094982 | Lakshya_08 | C | Feb. 20, 2022, 4:28 p.m. | OK | GNU C11 | TESTS | 32 | 1014 | 819200 | ||
147138392 | YangTY | C | Feb. 21, 2022, 5:04 a.m. | OK | GNU C++14 | TESTS | 32 | 46 | 17612800 | ||
147131290 | An_Index_in_sci. | C | Feb. 21, 2022, 2:59 a.m. | OK | GNU C++14 | TESTS | 32 | 124 | 819200 | ||
147111825 | abhipatnaikdkl | C | Feb. 20, 2022, 7:22 p.m. | OK | GNU C++14 | TESTS | 32 | 124 | 819200 | ||
147113732 | p.ferrari | C | Feb. 20, 2022, 7:49 p.m. | OK | GNU C++14 | TESTS | 32 | 139 | 819200 | ||
147128182 | classic | C | Feb. 21, 2022, 2:03 a.m. | OK | GNU C++14 | TESTS | 32 | 139 | 819200 | ||
147126943 | Gxer-1 | C | Feb. 21, 2022, 1:24 a.m. | OK | GNU C++14 | TESTS | 32 | 139 | 819200 | ||
147123730 | wzh2022 | C | Feb. 20, 2022, 11:33 p.m. | OK | GNU C++14 | TESTS | 32 | 139 | 5529600 | ||
147137851 | XY_cpp | C | Feb. 21, 2022, 4:56 a.m. | OK | GNU C++14 | TESTS | 32 | 140 | 819200 | ||
147132878 | litachloveyou | C | Feb. 21, 2022, 3:31 a.m. | OK | GNU C++14 | TESTS | 32 | 140 | 819200 | ||
147131732 | shejunda | C | Feb. 21, 2022, 3:09 a.m. | OK | GNU C++14 | TESTS | 32 | 140 | 819200 | ||
147139542 | BambooWind | C | Feb. 21, 2022, 5:20 a.m. | OK | GNU C++17 | TESTS | 32 | 124 | 819200 | ||
147129647 | lqmm | C | Feb. 21, 2022, 2:41 a.m. | OK | GNU C++17 | TESTS | 32 | 124 | 819200 | ||
147090993 | LSBYYDS | C | Feb. 20, 2022, 4:17 p.m. | OK | GNU C++17 | TESTS | 32 | 124 | 819200 | ||
147134221 | Totoro_ | C | Feb. 21, 2022, 3:57 a.m. | OK | GNU C++17 | TESTS | 32 | 124 | 16076800 | ||
147113258 | DarkEnergy | C | Feb. 20, 2022, 7:42 p.m. | OK | GNU C++17 | TESTS | 32 | 139 | 819200 | ||
147116948 | misbah | C | Feb. 20, 2022, 8:43 p.m. | OK | GNU C++17 | TESTS | 32 | 139 | 819200 | ||
147128642 | Sofianelewin | C | Feb. 21, 2022, 2:15 a.m. | OK | GNU C++17 | TESTS | 32 | 139 | 819200 | ||
147136368 | HossamHamza0_0 | C | Feb. 21, 2022, 4:33 a.m. | OK | GNU C++17 | TESTS | 32 | 140 | 819200 | ||
147133814 | 0hoo | C | Feb. 21, 2022, 3:49 a.m. | OK | GNU C++17 | TESTS | 32 | 140 | 819200 | ||
147142512 | Aizen4325 | C | Feb. 21, 2022, 5:59 a.m. | OK | GNU C++17 | TESTS | 32 | 140 | 819200 | ||
147128936 | CartesianTree | C | Feb. 21, 2022, 2:23 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 78 | 32153600 | ||
147117885 | XqNUOgE5 | C | Feb. 20, 2022, 9 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 108 | 1638400 | ||
147110092 | Kaushal_26 | C | Feb. 20, 2022, 6:59 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 108 | 4812800 | ||
147133040 | LAB | C | Feb. 21, 2022, 3:34 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 108 | 4812800 | ||
147133357 | dfzgcj | C | Feb. 21, 2022, 3:40 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147133393 | dfzgcj | C | Feb. 21, 2022, 3:41 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147133193 | dfzgcj | C | Feb. 21, 2022, 3:37 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147131285 | GunZaaN | C | Feb. 21, 2022, 2:59 a.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147120047 | Greedious | C | Feb. 20, 2022, 9:46 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147114749 | kwee | C | Feb. 20, 2022, 8:05 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 109 | 819200 | ||
147107326 | gdryrp | C | Feb. 20, 2022, 6:30 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 819200 | ||
147110195 | kroyl | C | Feb. 20, 2022, 7:01 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 819200 | ||
147113765 | nebula | C | Feb. 20, 2022, 7:50 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 819200 | ||
147127295 | don2001 | C | Feb. 21, 2022, 1:36 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 819200 | ||
147103125 | DUMMY_S | C | Feb. 20, 2022, 5:57 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 921600 | ||
147106471 | DUMMY_S | C | Feb. 20, 2022, 6:22 p.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 921600 | ||
147136433 | modiii | C | Feb. 21, 2022, 4:34 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 1638400 | ||
147140468 | TheRubbish | C | Feb. 21, 2022, 5:33 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 1638400 | ||
147140454 | gongkoufadongji | C | Feb. 21, 2022, 5:32 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 1638400 | ||
147142544 | AdC_AB2 | C | Feb. 21, 2022, 5:59 a.m. | OK | GNU C++20 (64) | TESTS | 32 | 77 | 1638400 | ||
147119717 | koqo | C | Feb. 20, 2022, 9:38 p.m. | OK | Go | TESTS | 32 | 233 | 5529600 | ||
147136639 | Satyaa | C | Feb. 21, 2022, 4:37 a.m. | OK | Java 11 | TESTS | 32 | 265 | 0 | ||
147090835 | Abhishek_patel_ | C | Feb. 20, 2022, 4:16 p.m. | OK | Java 11 | TESTS | 32 | 280 | 0 | ||
147114177 | Andwerp | C | Feb. 20, 2022, 7:56 p.m. | OK | Java 11 | TESTS | 32 | 280 | 4505600 | ||
147135761 | ND_ | C | Feb. 21, 2022, 4:23 a.m. | OK | Java 11 | TESTS | 32 | 296 | 0 | ||
147116766 | henrychenOutlook | C | Feb. 20, 2022, 8:39 p.m. | OK | Java 11 | TESTS | 32 | 311 | 0 | ||
147091830 | Taha_Firoz | C | Feb. 20, 2022, 4:19 p.m. | OK | Java 11 | TESTS | 32 | 311 | 0 | ||
147104251 | KarMa_ | C | Feb. 20, 2022, 6:04 p.m. | OK | Java 11 | TESTS | 32 | 311 | 819200 | ||
147124889 | pepelats | C | Feb. 21, 2022, 12:13 a.m. | OK | Java 11 | TESTS | 32 | 326 | 0 | ||
147134830 | aditya2024 | C | Feb. 21, 2022, 4:08 a.m. | OK | Java 11 | TESTS | 32 | 327 | 0 | ||
147129168 | __Serendipity | C | Feb. 21, 2022, 2:29 a.m. | OK | Java 11 | TESTS | 32 | 327 | 0 | ||
147095725 | vermadv2000 | C | Feb. 20, 2022, 4:30 p.m. | OK | Java 8 | TESTS | 32 | 171 | 0 | ||
147111093 | dev_14 | C | Feb. 20, 2022, 7:13 p.m. | OK | Java 8 | TESTS | 32 | 187 | 2867200 | ||
147111875 | adi_daredevil | C | Feb. 20, 2022, 7:23 p.m. | OK | Java 8 | TESTS | 32 | 202 | 2867200 | ||
147109259 | arutsudar | C | Feb. 20, 2022, 6:49 p.m. | OK | Java 8 | TESTS | 32 | 202 | 3072000 | ||
147140250 | vaibhav_1710 | C | Feb. 21, 2022, 5:30 a.m. | OK | Java 8 | TESTS | 32 | 202 | 6348800 | ||
147105256 | Diaa12360 | C | Feb. 20, 2022, 6:11 p.m. | OK | Java 8 | TESTS | 32 | 202 | 14233600 | ||
147104935 | sky9313 | C | Feb. 20, 2022, 6:09 p.m. | OK | Java 8 | TESTS | 32 | 218 | 2867200 | ||
147139931 | vaibhav_1710 | C | Feb. 21, 2022, 5:25 a.m. | OK | Java 8 | TESTS | 32 | 218 | 6348800 | ||
147105764 | Mohamed308 | C | Feb. 20, 2022, 6:16 p.m. | OK | Java 8 | TESTS | 32 | 218 | 20172800 | ||
147117393 | Omar_Mohammad | C | Feb. 20, 2022, 8:51 p.m. | OK | Java 8 | TESTS | 32 | 218 | 20889600 | ||
147127966 | hcp | C | Feb. 21, 2022, 1:57 a.m. | OK | MS C++ 2017 | TESTS | 32 | 187 | 1638400 | ||
147137005 | SinaLIze | C | Feb. 21, 2022, 4:43 a.m. | OK | MS C++ 2017 | TESTS | 32 | 514 | 1638400 | ||
147131623 | RealStarlight | C | Feb. 21, 2022, 3:06 a.m. | OK | MS C++ 2017 | TESTS | 32 | 514 | 1638400 | ||
147138516 | SinaLIze | C | Feb. 21, 2022, 5:06 a.m. | OK | MS C++ 2017 | TESTS | 32 | 530 | 1638400 | ||
147128339 | seuangelfish | C | Feb. 21, 2022, 2:07 a.m. | OK | MS C++ 2017 | TESTS | 32 | 530 | 1638400 | ||
147131496 | RealStarlight | C | Feb. 21, 2022, 3:03 a.m. | OK | MS C++ 2017 | TESTS | 32 | 561 | 9216000 | ||
147092738 | edfearay11 | C | Feb. 20, 2022, 4:22 p.m. | OK | MS C++ 2017 | TESTS | 32 | 577 | 3276800 | ||
147139320 | whswhswhs | C | Feb. 21, 2022, 5:17 a.m. | OK | MS C++ 2017 | TESTS | 32 | 1076 | 8089600 | ||
147128266 | _Rimjhim_36 | C | Feb. 21, 2022, 2:05 a.m. | OK | MS C++ 2017 | TESTS | 32 | 1092 | 819200 | ||
147110087 | Rydolf_sikorski-Baal | C | Feb. 20, 2022, 6:59 p.m. | OK | MS C++ 2017 | TESTS | 32 | 1169 | 819200 | ||
147101884 | 1_2_3_4_5_9 | C | Feb. 20, 2022, 5:50 p.m. | OK | PyPy 2 | TESTS | 32 | 202 | 18432000 | ||
147120049 | omarnvidia | C | Feb. 20, 2022, 9:46 p.m. | OK | PyPy 3 | TESTS | 32 | 327 | 28569600 | ||
147104482 | KeiTsukishima | C | Feb. 20, 2022, 6:06 p.m. | OK | PyPy 3 | TESTS | 32 | 389 | 27033600 | ||
147096273 | priyankaskumar | C | Feb. 20, 2022, 4:31 p.m. | OK | PyPy 3 | TESTS | 32 | 639 | 18534400 | ||
147121659 | toam | C | Feb. 20, 2022, 10:27 p.m. | OK | PyPy 3 | TESTS | 32 | 717 | 18739200 | ||
147111084 | MistaAsh | C | Feb. 20, 2022, 7:13 p.m. | OK | PyPy 3 | TESTS | 32 | 732 | 18227200 | ||
147103127 | Srikanth31 | C | Feb. 20, 2022, 5:57 p.m. | OK | PyPy 3 | TESTS | 32 | 748 | 19251200 | ||
147108750 | zxcuser2 | C | Feb. 20, 2022, 6:44 p.m. | OK | PyPy 3 | TESTS | 32 | 748 | 19558400 | ||
147102872 | Fatduck | C | Feb. 20, 2022, 5:56 p.m. | OK | PyPy 3 | TESTS | 32 | 763 | 31334400 | ||
147097630 | atharva3008 | C | Feb. 20, 2022, 4:34 p.m. | OK | PyPy 3 | TESTS | 32 | 764 | 19046400 | ||
147092599 | 190330278 | C | Feb. 20, 2022, 4:21 p.m. | OK | PyPy 3 | TESTS | 32 | 764 | 19251200 | ||
147106005 | Nemisis2.O | C | Feb. 20, 2022, 6:18 p.m. | OK | PyPy 3-64 | TESTS | 32 | 217 | 27545600 | ||
147132715 | mnkp | C | Feb. 21, 2022, 3:28 a.m. | OK | PyPy 3-64 | TESTS | 32 | 217 | 27648000 | ||
147091260 | TheViking733n | C | Feb. 20, 2022, 4:17 p.m. | OK | PyPy 3-64 | TESTS | 32 | 561 | 28160000 | ||
147139029 | generic_placeholder_name | C | Feb. 21, 2022, 5:13 a.m. | OK | PyPy 3-64 | TESTS | 32 | 592 | 27648000 | ||
147137023 | shuklautkarsh7007 | C | Feb. 21, 2022, 4:44 a.m. | OK | PyPy 3-64 | TESTS | 32 | 623 | 28979200 | ||
147109195 | kaustavshouvik | C | Feb. 20, 2022, 6:49 p.m. | OK | PyPy 3-64 | TESTS | 32 | 655 | 26112000 | ||
147109711 | Yusif | C | Feb. 20, 2022, 6:55 p.m. | OK | PyPy 3-64 | TESTS | 32 | 670 | 52940800 | ||
147103624 | wskhanh | C | Feb. 20, 2022, 6 p.m. | OK | PyPy 3-64 | TESTS | 32 | 685 | 28160000 | ||
147103695 | wskhanh | C | Feb. 20, 2022, 6 p.m. | OK | PyPy 3-64 | TESTS | 32 | 685 | 28364800 | ||
147138263 | sumit_athani | C | Feb. 21, 2022, 5:02 a.m. | OK | PyPy 3-64 | TESTS | 32 | 717 | 28364800 | ||
147105526 | OLOGY | C | Feb. 20, 2022, 6:14 p.m. | OK | Python 2 | TESTS | 32 | 327 | 20275200 | ||
147134021 | xushuyu-s-grandfather | C | Feb. 21, 2022, 3:53 a.m. | OK | Python 3 | TESTS | 32 | 530 | 16179200 | ||
147104620 | Yaro373 | C | Feb. 20, 2022, 6:07 p.m. | OK | Python 3 | TESTS | 32 | 639 | 16179200 | ||
147092102 | Prashant968 | C | Feb. 20, 2022, 4:20 p.m. | OK | Python 3 | TESTS | 32 | 654 | 16486400 | ||
147097145 | UltraXDZN | C | Feb. 20, 2022, 4:33 p.m. | OK | Python 3 | TESTS | 32 | 826 | 15872000 | ||
147092399 | vishnesh | C | Feb. 20, 2022, 4:21 p.m. | OK | Python 3 | TESTS | 32 | 826 | 16179200 | ||
147109685 | D_Dima | C | Feb. 20, 2022, 6:55 p.m. | OK | Python 3 | TESTS | 32 | 842 | 16179200 | ||
147129715 | astitva19 | C | Feb. 21, 2022, 2:42 a.m. | OK | Python 3 | TESTS | 32 | 857 | 16179200 | ||
147117380 | ayushgupta71011 | C | Feb. 20, 2022, 8:51 p.m. | OK | Python 3 | TESTS | 32 | 857 | 16486400 | ||
147113781 | swapnilsingh421 | C | Feb. 20, 2022, 7:50 p.m. | OK | Python 3 | TESTS | 32 | 857 | 16486400 | ||
147133631 | bhuwanchandra.it | C | Feb. 21, 2022, 3:46 a.m. | OK | Python 3 | TESTS | 32 | 858 | 16179200 | ||
147096003 | ten- | C | Feb. 20, 2022, 4:30 p.m. | OK | Rust 2021 | TESTS | 32 | 62 | 25600000 |
Back to search problems