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 |
---|---|---|---|---|---|---|
1711 | Codeforces Round 810 (Div. 2) | FINISHED | False | 7200 | 78593063 | July 24, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 25369 ) | A | Perfect Permutation | PROGRAMMING | constructive algorithms |
B'You are given a positive integer n . The weight of a permutation p_1, p_2, ldots, p_n is the number of indices 1 <= i <= n such that i divides p_i . Find a permutation p_1,p_2, ... , p_n with the minimum possible weight (among all permutations of length n ). A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array) and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). The description of the test cases follows. The only line of each test case contains a single integer n ( 1 <= q n <= q 10^5 ) -- the length of permutation. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, print a line containing n integers p_1, p_2, ... , p_n so that the permutation p has the minimum possible weight. If there are several possible answers, you can print any of them. In the first test case, the only valid permutation is p=[1] . Its weight is 1 . In the second test case, one possible answer is the permutation p=[2,1,4,3] . One can check that 1 divides p_1 and i does not divide p_i for i=2,3,4 , so the weight of this permutation is 1 . It is impossible to find a permutation of length 4 with a strictly smaller weight. '... |
Codeforces Round #810 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
165578714 | yousuf19 | A | July 24, 2022, 4:09 p.m. | OK | C# 10 | TESTS | 6 | 327 | 2969600 | ||
165576093 | Antroz | A | July 24, 2022, 4:01 p.m. | OK | C# 10 | TESTS | 6 | 608 | 3584000 | ||
165581026 | iskyldrm | A | July 24, 2022, 4:17 p.m. | OK | C# 8 | TESTS | 6 | 405 | 3788800 | ||
165581745 | chrislemon | A | July 24, 2022, 4:19 p.m. | OK | C# 8 | TESTS | 6 | 623 | 3276800 | ||
165632730 | shayonop | A | July 25, 2022, 5:54 a.m. | OK | GNU C11 | TESTS | 6 | 405 | 0 | ||
165586112 | antuda | A | July 24, 2022, 4:32 p.m. | OK | GNU C11 | TESTS | 6 | 405 | 0 | ||
165631658 | yyzq | A | July 25, 2022, 5:36 a.m. | OK | GNU C11 | TESTS | 6 | 405 | 0 | ||
165576826 | mdtariqulislam5000 | A | July 24, 2022, 4:03 p.m. | OK | GNU C11 | TESTS | 6 | 405 | 409600 | ||
165602126 | N20070 | A | July 24, 2022, 7:45 p.m. | OK | GNU C11 | TESTS | 6 | 405 | 409600 | ||
165606336 | mainuddin_ | A | July 24, 2022, 8:55 p.m. | OK | GNU C11 | TESTS | 6 | 405 | 409600 | ||
165575705 | mdtajulislam5001 | A | July 24, 2022, 4 p.m. | OK | GNU C11 | TESTS | 6 | 405 | 409600 | ||
165579071 | Satvat | A | July 24, 2022, 4:10 p.m. | OK | GNU C11 | TESTS | 6 | 421 | 0 | ||
165576363 | G.manrejuan | A | July 24, 2022, 4:02 p.m. | OK | GNU C11 | TESTS | 6 | 436 | 0 | ||
165598468 | ChereDeShoytan | A | July 24, 2022, 6:55 p.m. | OK | GNU C11 | TESTS | 6 | 436 | 409600 | ||
165608361 | lord_bendtner | A | July 24, 2022, 9:37 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165600711 | magdygeorge | A | July 24, 2022, 7:25 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165598061 | Nudrage | A | July 24, 2022, 6:49 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165594953 | kvssg123 | A | July 24, 2022, 6:13 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165594170 | tripplet | A | July 24, 2022, 6:05 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165626996 | I_Love_Disha_Patani | A | July 25, 2022, 4:12 a.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165623436 | Sand_Tripper | A | July 25, 2022, 3:11 a.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165616963 | Qinxiang | A | July 25, 2022, 1:24 a.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165613597 | include_BM | A | July 25, 2022, 12:04 a.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165611028 | sardaar_coders | A | July 24, 2022, 10:46 p.m. | OK | GNU C++14 | TESTS | 6 | 15 | 0 | ||
165631784 | furan | A | July 25, 2022, 5:39 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165632010 | xdedm | A | July 25, 2022, 5:42 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165632043 | fangt | A | July 25, 2022, 5:42 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165632270 | a_anjali | A | July 25, 2022, 5:46 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165633181 | victorlisboa | A | July 25, 2022, 6 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165630460 | lmlmlm | A | July 25, 2022, 5:17 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165630363 | orz_max | A | July 25, 2022, 5:16 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165629197 | komal15 | A | July 25, 2022, 4:56 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165628090 | DeepakSivala | A | July 25, 2022, 4:33 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165627761 | bluestonenerd | A | July 25, 2022, 4:27 a.m. | OK | GNU C++17 | TESTS | 6 | 15 | 0 | ||
165629722 | adityasonani | A | July 25, 2022, 5:06 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165626858 | whohet | A | July 25, 2022, 4:09 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165624666 | XHYU61 | A | July 25, 2022, 3:32 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165622207 | BurnedChicken | A | July 25, 2022, 2:52 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165621498 | MarkBcc168 | A | July 25, 2022, 2:41 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165620931 | YangHan | A | July 25, 2022, 2:32 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165617325 | Messywind | A | July 25, 2022, 1:30 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165615331 | RetsaZC19 | A | July 25, 2022, 12:50 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165613990 | Eter.nal | A | July 25, 2022, 12:14 a.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165613368 | enslaved | A | July 24, 2022, 11:58 p.m. | OK | GNU C++17 (64) | TESTS | 6 | 15 | 0 | ||
165628837 | baby._.shadow | A | July 25, 2022, 4:49 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165629322 | noeltom787 | A | July 25, 2022, 4:58 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165629376 | Divyanshi66 | A | July 25, 2022, 4:59 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165630374 | arjun752 | A | July 25, 2022, 5:16 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165632047 | sharmaharisam | A | July 25, 2022, 5:42 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165632242 | 0xmessi | A | July 25, 2022, 5:46 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165632261 | LuluOwO | A | July 25, 2022, 5:46 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165632353 | nlog | A | July 25, 2022, 5:47 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165632361 | jagerknight | A | July 25, 2022, 5:48 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165633053 | codingwizard24 | A | July 25, 2022, 5:58 a.m. | OK | GNU C++20 (64) | TESTS | 6 | 15 | 0 | ||
165593756 | markmoretto | A | July 24, 2022, 6:02 p.m. | OK | Go | TESTS | 6 | 30 | 409600 | ||
165593012 | NoInternetName | A | July 24, 2022, 5:55 p.m. | OK | Go | TESTS | 6 | 31 | 409600 | ||
165592689 | markmoretto | A | July 24, 2022, 5:53 p.m. | OK | Go | TESTS | 6 | 93 | 47923200 | ||
165628812 | __Serendipity | A | July 25, 2022, 4:49 a.m. | OK | Java 11 | TESTS | 6 | 171 | 0 | ||
165627298 | KarMa_ | A | July 25, 2022, 4:17 a.m. | OK | Java 11 | TESTS | 6 | 186 | 0 | ||
165602632 | satyaa_78 | A | July 24, 2022, 7:53 p.m. | OK | Java 11 | TESTS | 6 | 202 | 0 | ||
165601598 | pras7946 | A | July 24, 2022, 7:37 p.m. | OK | Java 11 | TESTS | 6 | 202 | 0 | ||
165628991 | x21svage | A | July 25, 2022, 4:52 a.m. | OK | Java 11 | TESTS | 6 | 217 | 0 | ||
165591513 | swift51385 | A | July 24, 2022, 5:45 p.m. | OK | Java 11 | TESTS | 6 | 233 | 0 | ||
165627754 | Vaibhav_Rajpal | A | July 25, 2022, 4:27 a.m. | OK | Java 11 | TESTS | 6 | 514 | 0 | ||
165604708 | Avi_kr | A | July 24, 2022, 8:27 p.m. | OK | Java 11 | TESTS | 6 | 530 | 0 | ||
165581509 | fastyKid | A | July 24, 2022, 4:18 p.m. | OK | Java 11 | TESTS | 6 | 530 | 0 | ||
165627511 | aggarwal_08 | A | July 25, 2022, 4:21 a.m. | OK | Java 11 | TESTS | 6 | 545 | 0 | ||
165608729 | Bahaalization | A | July 24, 2022, 9:45 p.m. | OK | Java 17 | TESTS | 6 | 202 | 819200 | ||
165578656 | jaddlex | A | July 24, 2022, 4:09 p.m. | OK | Java 17 | TESTS | 6 | 249 | 716800 | ||
165579374 | vasanthgk02 | A | July 24, 2022, 4:11 p.m. | OK | Java 17 | TESTS | 6 | 514 | 614400 | ||
165581340 | coderev_12 | A | July 24, 2022, 4:18 p.m. | OK | Java 17 | TESTS | 6 | 561 | 409600 | ||
165591710 | track12 | A | July 24, 2022, 5:46 p.m. | OK | Java 17 | TESTS | 6 | 577 | 1126400 | ||
165622153 | wyxfwxh250821 | A | July 25, 2022, 2:51 a.m. | OK | Java 8 | TESTS | 6 | 93 | 0 | ||
165612481 | Rayhan_ChowdhuRy | A | July 24, 2022, 11:31 p.m. | OK | Java 8 | TESTS | 6 | 108 | 0 | ||
165573716 | newt0n | A | July 24, 2022, 3:54 p.m. | OK | Java 8 | TESTS | 6 | 109 | 0 | ||
165619940 | Socrates1232 | A | July 25, 2022, 2:16 a.m. | OK | Java 8 | TESTS | 6 | 124 | 0 | ||
165599239 | jkslyk | A | July 24, 2022, 7:05 p.m. | OK | Java 8 | TESTS | 6 | 124 | 0 | ||
165574684 | javaisbetter | A | July 24, 2022, 3:57 p.m. | OK | Java 8 | TESTS | 6 | 124 | 0 | ||
165571353 | headshot1703 | A | July 24, 2022, 3:46 p.m. | OK | Java 8 | TESTS | 6 | 124 | 0 | ||
165632955 | swaggy_baba | A | July 25, 2022, 5:57 a.m. | OK | Java 8 | TESTS | 6 | 139 | 0 | ||
165582629 | nand678 | A | July 24, 2022, 4:22 p.m. | OK | Java 8 | TESTS | 6 | 171 | 0 | ||
165576530 | Samyakj820 | A | July 24, 2022, 4:02 p.m. | OK | Java 8 | TESTS | 6 | 233 | 0 | ||
165623490 | ripity | A | July 25, 2022, 3:12 a.m. | OK | Kotlin 1.6 | TESTS | 6 | 187 | 0 | ||
165585149 | lara_stamac | A | July 24, 2022, 4:30 p.m. | OK | MS C++ 2017 | TESTS | 6 | 31 | 0 | ||
165579528 | sunkaimiao | A | July 24, 2022, 4:12 p.m. | OK | MS C++ 2017 | TESTS | 6 | 61 | 409600 | ||
165581771 | foxymiron | A | July 24, 2022, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 6 | 77 | 0 | ||
165578392 | atulya282 | A | July 24, 2022, 4:08 p.m. | OK | MS C++ 2017 | TESTS | 6 | 77 | 0 | ||
165599334 | Crimson_Quasar | A | July 24, 2022, 7:06 p.m. | OK | MS C++ 2017 | TESTS | 6 | 77 | 614400 | ||
165596305 | TemporalBloom | A | July 24, 2022, 6:27 p.m. | OK | MS C++ 2017 | TESTS | 6 | 92 | 0 | ||
165612011 | 67ovo | A | July 24, 2022, 11:15 p.m. | OK | MS C++ 2017 | TESTS | 6 | 93 | 0 | ||
165574595 | rt_20 | A | July 24, 2022, 3:56 p.m. | OK | MS C++ 2017 | TESTS | 6 | 93 | 0 | ||
165596931 | kirill06 | A | July 24, 2022, 6:34 p.m. | OK | MS C++ 2017 | TESTS | 6 | 93 | 409600 | ||
165582573 | burrito1510 | A | July 24, 2022, 4:22 p.m. | OK | MS C++ 2017 | TESTS | 6 | 93 | 409600 | ||
165603630 | Darooha | A | July 24, 2022, 8:10 p.m. | OK | Ocaml | TESTS | 6 | 46 | 204800 | ||
165600133 | 784 | A | July 24, 2022, 7:17 p.m. | OK | Perl | TESTS | 6 | 31 | 0 | ||
165600388 | 784 | A | July 24, 2022, 7:20 p.m. | OK | Perl | TESTS | 6 | 31 | 921600 | ||
165599602 | 784 | A | July 24, 2022, 7:10 p.m. | OK | Perl | TESTS | 6 | 61 | 921600 | ||
165603341 | LarryNY | A | July 24, 2022, 8:05 p.m. | OK | PyPy 3 | TESTS | 6 | 109 | 6963200 | ||
165627494 | misorin | A | July 25, 2022, 4:21 a.m. | OK | PyPy 3 | TESTS | 6 | 124 | 10035200 | ||
165598864 | Noureldin | A | July 24, 2022, 7 p.m. | OK | PyPy 3 | TESTS | 6 | 124 | 10956800 | ||
165592385 | YashNandwana | A | July 24, 2022, 5:51 p.m. | OK | PyPy 3 | TESTS | 6 | 155 | 7987200 | ||
165579519 | IceMang | A | July 24, 2022, 4:12 p.m. | OK | PyPy 3 | TESTS | 6 | 202 | 8192000 | ||
165597468 | hxu10 | A | July 24, 2022, 6:42 p.m. | OK | PyPy 3 | TESTS | 6 | 217 | 9728000 | ||
165619031 | rajeshpenugonda6 | A | July 25, 2022, 2 a.m. | OK | PyPy 3 | TESTS | 6 | 280 | 7987200 | ||
165607287 | chal_bhai___ | A | July 24, 2022, 9:14 p.m. | OK | PyPy 3 | TESTS | 6 | 296 | 8704000 | ||
165571235 | pushsin089 | A | July 24, 2022, 3:46 p.m. | OK | PyPy 3 | TESTS | 6 | 327 | 6963200 | ||
165574776 | RAZE_TEAM | A | July 24, 2022, 3:57 p.m. | OK | PyPy 3 | TESTS | 6 | 358 | 9523200 | ||
165582483 | mlabeeb | A | July 24, 2022, 4:22 p.m. | OK | PyPy 3-64 | TESTS | 6 | 93 | 10444800 | ||
165623156 | only_noob | A | July 25, 2022, 3:07 a.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 9318400 | ||
165597821 | mayank35 | A | July 24, 2022, 6:46 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 9830400 | ||
165600994 | DarkHorse_it_iz | A | July 24, 2022, 7:29 p.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 9830400 | ||
165606185 | oadey89 | A | July 24, 2022, 8:53 p.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 10956800 | ||
165628990 | Rikudo_6 | A | July 25, 2022, 4:52 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 9523200 | ||
165598346 | gesuta | A | July 24, 2022, 6:53 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 9523200 | ||
165609149 | agw02010 | A | July 24, 2022, 9:55 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 10444800 | ||
165602111 | DarkHorse_it_iz | A | July 24, 2022, 7:45 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 10752000 | ||
165624092 | Turtleeee | A | July 25, 2022, 3:22 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 10854400 | ||
165617278 | Tqm01 | A | July 25, 2022, 1:29 a.m. | OK | Python 3 | TESTS | 6 | 109 | 4812800 | ||
165582601 | return7g | A | July 24, 2022, 4:22 p.m. | OK | Python 3 | TESTS | 6 | 124 | 5324800 | ||
165604370 | pe4enowa | A | July 24, 2022, 8:22 p.m. | OK | Python 3 | TESTS | 6 | 139 | 4710400 | ||
165605327 | crlin.m | A | July 24, 2022, 8:38 p.m. | OK | Python 3 | TESTS | 6 | 139 | 6758400 | ||
165593457 | eugalt | A | July 24, 2022, 5:59 p.m. | OK | Python 3 | TESTS | 6 | 140 | 2355200 | ||
165575473 | an1439 | A | July 24, 2022, 3:59 p.m. | OK | Python 3 | TESTS | 6 | 140 | 6553600 | ||
165572951 | Pevojed | A | July 24, 2022, 3:51 p.m. | OK | Python 3 | TESTS | 6 | 155 | 4096000 | ||
165627377 | Aoof | A | July 25, 2022, 4:18 a.m. | OK | Python 3 | TESTS | 6 | 155 | 7168000 | ||
165571968 | MhKh | A | July 24, 2022, 3:48 p.m. | OK | Python 3 | TESTS | 6 | 155 | 7270400 | ||
165597238 | piSquared | A | July 24, 2022, 6:38 p.m. | OK | Python 3 | TESTS | 6 | 156 | 3584000 | ||
165605760 | apilat | A | July 24, 2022, 8:45 p.m. | OK | Rust 2021 | TESTS | 6 | 31 | 819200 | ||
165599960 | luukaos | A | July 24, 2022, 7:15 p.m. | OK | Rust 2021 | TESTS | 6 | 93 | 5734400 |
Back to search problems