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 |
---|---|---|---|---|---|---|
1405 | Codeforces Round 668 (Div. 2) | FINISHED | False | 7200 | 132420299 | Sept. 6, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 21489 ) | A | Permutation Forgery | PROGRAMMING | constructive algorithms |
B"A permutation of length n 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). Let p be any permutation of length n . We define the fingerprint F(p) of p as the sorted array of sums of adjacent elements in p . More formally, F(p)= mathrm{sort}([p_1+p_2,p_2+p_3, ldots,p_{n-1}+p_n]). For example, if n=4 and p=[1,4,2,3], then the fingerprint is given by F(p)= mathrm{sort}([1+4,4+2,2+3])= mathrm{sort}([5,6,5])=[5,5,6] . You are given a permutation p of length n . Your task is to find a different permutation p' with the same fingerprint. Two permutations p and p' are considered different if there is some index i such that p_i ne p'_i . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 668 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 2 <= n <= 100 ) -- the length of the permutation. The second line of each test case contains n integers p_1, ldots,p_n ( 1 <= p_i <= n ). It is guaranteed that p is a permutation. For each test case, output n integers p'_1, ldots, p'_n -- a permutation such that p' ne p and F(p')=F(p) . We can prove that for every permutation satisfying the input constraints, a solution exists. If there are multiple solutions, you may output any. In the first test case, F(p)= mathrm{sort}([1+2])=[3] . And F(p')= mathrm{sort}([2+1])=[3] . In the second test case, F(p)= mathrm{sort}([2+1,1+6,6+5,5+4,4+3])= mathrm{sort}([3,7,11,9,7])=[3,7,7,9,11] . And F(p')= mathrm{sort}([1+2,2+5,5+6,6+3,3+4])= ma"... |
Codeforces Round #668 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
92096624 | Vicfred | A | Sept. 7, 2020, 1:27 a.m. | OK | D | TESTS | 12 | 61 | 1945600 | ||
92094476 | fpc_coder | A | Sept. 6, 2020, 11:47 p.m. | OK | FPC | TESTS | 12 | 202 | 0 | ||
92064234 | PAG | A | Sept. 6, 2020, 4:01 p.m. | OK | FPC | TESTS | 12 | 202 | 819200 | ||
92070057 | samhaque999 | A | Sept. 6, 2020, 4:21 p.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92063712 | abcd227 | A | Sept. 6, 2020, 4 p.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92094772 | irresistabledudex2 | A | Sept. 7, 2020, 12:05 a.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92100909 | krishna_kumar_prathipati | A | Sept. 7, 2020, 3:33 a.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92103261 | aditta_saikat | A | Sept. 7, 2020, 4:24 a.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92105671 | aes_the_tic | A | Sept. 7, 2020, 5:12 a.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92107497 | Redoy_Kumar | A | Sept. 7, 2020, 5:43 a.m. | OK | GNU C11 | TESTS | 12 | 249 | 0 | ||
92083993 | AbuSuf1an | A | Sept. 6, 2020, 6:39 p.m. | OK | GNU C11 | TESTS | 12 | 264 | 0 | ||
92074129 | harsh3pathi | A | Sept. 6, 2020, 4:34 p.m. | OK | GNU C11 | TESTS | 12 | 264 | 0 | ||
92101006 | fahimalhasan2019 | A | Sept. 7, 2020, 3:36 a.m. | OK | GNU C11 | TESTS | 12 | 264 | 0 | ||
92096761 | autistic_boy | A | Sept. 7, 2020, 1:32 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 0 | ||
92099162 | convicnow | A | Sept. 7, 2020, 2:46 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 0 | ||
92099647 | OFSHK | A | Sept. 7, 2020, 3 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 0 | ||
92099690 | brute_forceCE | A | Sept. 7, 2020, 3 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 0 | ||
92064530 | _PaRz1VaL | A | Sept. 6, 2020, 4:02 p.m. | OK | GNU C++11 | TESTS | 12 | 31 | 0 | ||
92099402 | YHHxBULIATANIA | A | Sept. 7, 2020, 2:53 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 1638400 | ||
92104007 | zhangguangwei | A | Sept. 7, 2020, 4:41 a.m. | OK | GNU C++11 | TESTS | 12 | 31 | 40140800 | ||
92102875 | kitalekita | A | Sept. 7, 2020, 4:16 a.m. | OK | GNU C++11 | TESTS | 12 | 46 | 0 | ||
92106554 | orrz | A | Sept. 7, 2020, 5:26 a.m. | OK | GNU C++11 | TESTS | 12 | 46 | 0 | ||
92107588 | worcher | A | Sept. 7, 2020, 5:45 a.m. | OK | GNU C++11 | TESTS | 12 | 46 | 0 | ||
92081875 | cryptomanic | A | Sept. 6, 2020, 6:07 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92083829 | BekarDanav | A | Sept. 6, 2020, 6:37 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92085945 | 19kanu30 | A | Sept. 6, 2020, 7:11 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92078454 | rocks03 | A | Sept. 6, 2020, 5:30 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92090199 | Saidurraahmaan | A | Sept. 6, 2020, 8:49 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92104270 | MPRUDRA | A | Sept. 7, 2020, 4:46 a.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92107510 | redoc117 | A | Sept. 7, 2020, 5:44 a.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92086635 | jporwal09 | A | Sept. 6, 2020, 7:25 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92070571 | passionategamer1005 | A | Sept. 6, 2020, 4:23 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92068980 | ritik159 | A | Sept. 6, 2020, 4:18 p.m. | OK | GNU C++14 | TESTS | 12 | 31 | 0 | ||
92097491 | ujwalll | A | Sept. 7, 2020, 1:57 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92102610 | Enthusiasticcitizens | A | Sept. 7, 2020, 4:12 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92102214 | shikderalislam | A | Sept. 7, 2020, 4:04 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92101940 | astikraj2207 | A | Sept. 7, 2020, 3:57 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92101749 | ravi9230 | A | Sept. 7, 2020, 3:53 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92100224 | NotIdeal | A | Sept. 7, 2020, 3:16 a.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92094521 | tsyr8924503 | A | Sept. 6, 2020, 11:50 p.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92087822 | rspr | A | Sept. 6, 2020, 7:47 p.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92083709 | Rivaakter | A | Sept. 6, 2020, 6:35 p.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92083635 | MannCodes | A | Sept. 6, 2020, 6:34 p.m. | OK | GNU C++17 | TESTS | 12 | 31 | 0 | ||
92101382 | Theofratus | A | Sept. 7, 2020, 3:45 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 30 | 0 | ||
92105576 | 6520 | A | Sept. 7, 2020, 5:10 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 30 | 0 | ||
92089167 | Mtaylor | A | Sept. 6, 2020, 8:18 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 30 | 2457600 | ||
92105384 | emthrm | A | Sept. 7, 2020, 5:07 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92105395 | rko27 | A | Sept. 7, 2020, 5:07 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92107234 | HOLMES_2k | A | Sept. 7, 2020, 5:39 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92108653 | Jef808 | A | Sept. 7, 2020, 6:03 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92103912 | ritikrai | A | Sept. 7, 2020, 4:38 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92105058 | vjudge2 | A | Sept. 7, 2020, 5:01 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92105289 | Bondo | A | Sept. 7, 2020, 5:05 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 31 | 0 | ||
92107948 | qinpeng | A | Sept. 7, 2020, 5:51 a.m. | OK | Go | TESTS | 12 | 234 | 204800 | ||
92103232 | kmangesh22 | A | Sept. 7, 2020, 4:24 a.m. | OK | Go | TESTS | 12 | 639 | 102400 | ||
92085008 | DreamInfinite | A | Sept. 6, 2020, 6:55 p.m. | OK | Java 11 | TESTS | 12 | 187 | 0 | ||
92107152 | abhi123valani | A | Sept. 7, 2020, 5:37 a.m. | OK | Java 11 | TESTS | 12 | 202 | 0 | ||
92108047 | iamgabruh | A | Sept. 7, 2020, 5:53 a.m. | OK | Java 11 | TESTS | 12 | 202 | 0 | ||
92099782 | kadintang1 | A | Sept. 7, 2020, 3:03 a.m. | OK | Java 11 | TESTS | 12 | 202 | 0 | ||
92090700 | brijeshujcbm | A | Sept. 6, 2020, 9:04 p.m. | OK | Java 11 | TESTS | 12 | 202 | 0 | ||
92079210 | mphillotry | A | Sept. 6, 2020, 5:36 p.m. | OK | Java 11 | TESTS | 12 | 202 | 0 | ||
92066743 | anshumanHere | A | Sept. 6, 2020, 4:10 p.m. | OK | Java 11 | TESTS | 12 | 217 | 0 | ||
92107379 | anshum_it_is | A | Sept. 7, 2020, 5:41 a.m. | OK | Java 11 | TESTS | 12 | 218 | 0 | ||
92106360 | nagu-pm | A | Sept. 7, 2020, 5:23 a.m. | OK | Java 11 | TESTS | 12 | 218 | 0 | ||
92105032 | sf14t | A | Sept. 7, 2020, 5 a.m. | OK | Java 11 | TESTS | 12 | 218 | 0 | ||
92090300 | priyesh002 | A | Sept. 6, 2020, 8:52 p.m. | OK | Java 8 | TESTS | 12 | 109 | 0 | ||
92087554 | TheSawan | A | Sept. 6, 2020, 7:43 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92085948 | kkkkush | A | Sept. 6, 2020, 7:11 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92081681 | khalled_95 | A | Sept. 6, 2020, 6:04 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92080658 | akram-adel | A | Sept. 6, 2020, 5:51 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92077561 | Manan8686 | A | Sept. 6, 2020, 5:24 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92104694 | bhavik128 | A | Sept. 7, 2020, 4:54 a.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92104398 | ashraybharambe | A | Sept. 7, 2020, 4:48 a.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92104021 | priyam_anand | A | Sept. 7, 2020, 4:41 a.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92088548 | AnandOza | A | Sept. 6, 2020, 8:02 p.m. | OK | Java 8 | TESTS | 12 | 124 | 0 | ||
92099552 | Spheniscine | A | Sept. 7, 2020, 2:57 a.m. | OK | Kotlin | TESTS | 12 | 140 | 512000 | ||
92077461 | koboshi | A | Sept. 6, 2020, 5:24 p.m. | OK | Kotlin | TESTS | 12 | 156 | 921600 | ||
92083541 | azukun | A | Sept. 6, 2020, 6:32 p.m. | OK | Mono C# | TESTS | 12 | 77 | 6860800 | ||
92063307 | hnust_mengdijie | A | Sept. 6, 2020, 3:58 p.m. | OK | MS C++ | TESTS | 12 | 31 | 0 | ||
92098005 | Marco. | A | Sept. 7, 2020, 2:14 a.m. | OK | MS C++ 2017 | TESTS | 12 | 46 | 0 | ||
92102429 | jshreevenkatesan | A | Sept. 7, 2020, 4:08 a.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92080888 | samcpp | A | Sept. 6, 2020, 5:54 p.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92071054 | Saket_Gupta | A | Sept. 6, 2020, 4:25 p.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92069267 | samcpp | A | Sept. 6, 2020, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92065282 | OMENZZZE | A | Sept. 6, 2020, 4:05 p.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92089661 | concept3d | A | Sept. 6, 2020, 8:33 p.m. | OK | MS C++ 2017 | TESTS | 12 | 93 | 0 | ||
92068260 | wolfie007 | A | Sept. 6, 2020, 4:15 p.m. | OK | MS C++ 2017 | TESTS | 12 | 108 | 0 | ||
92079138 | Gravekper | A | Sept. 6, 2020, 5:36 p.m. | OK | MS C++ 2017 | TESTS | 12 | 108 | 0 | ||
92071764 | Arch_kkk_ | A | Sept. 6, 2020, 4:27 p.m. | OK | MS C++ 2017 | TESTS | 12 | 109 | 0 | ||
92092421 | kit.shiron | A | Sept. 6, 2020, 10:06 p.m. | OK | PyPy 2 | TESTS | 12 | 109 | 1331200 | ||
92067525 | hajab | A | Sept. 6, 2020, 4:13 p.m. | OK | PyPy 2 | TESTS | 12 | 155 | 1843200 | ||
92105192 | tusshar | A | Sept. 7, 2020, 5:03 a.m. | OK | PyPy 3 | TESTS | 12 | 186 | 2969600 | ||
92077466 | anoubhav | A | Sept. 6, 2020, 5:24 p.m. | OK | PyPy 3 | TESTS | 12 | 186 | 3276800 | ||
92091696 | ecnerwala | A | Sept. 6, 2020, 9:38 p.m. | OK | PyPy 3 | TESTS | 12 | 186 | 6144000 | ||
92080579 | wow_ok | A | Sept. 6, 2020, 5:50 p.m. | OK | PyPy 3 | TESTS | 12 | 186 | 6144000 | ||
92100077 | AggarwalRaghav | A | Sept. 7, 2020, 3:12 a.m. | OK | PyPy 3 | TESTS | 12 | 186 | 6656000 | ||
92100540 | a0976531005 | A | Sept. 7, 2020, 3:23 a.m. | OK | PyPy 3 | TESTS | 12 | 187 | 5734400 | ||
92104001 | choppy | A | Sept. 7, 2020, 4:41 a.m. | OK | PyPy 3 | TESTS | 12 | 202 | 3584000 | ||
92077915 | LeeHoangzz | A | Sept. 6, 2020, 5:26 p.m. | OK | PyPy 3 | TESTS | 12 | 202 | 6656000 | ||
92097171 | Spelvin | A | Sept. 7, 2020, 1:46 a.m. | OK | PyPy 3 | TESTS | 12 | 217 | 3584000 | ||
92097081 | bcc0830 | A | Sept. 7, 2020, 1:44 a.m. | OK | PyPy 3 | TESTS | 12 | 218 | 2867200 | ||
92083734 | mokshasood06 | A | Sept. 6, 2020, 6:35 p.m. | OK | Python 2 | TESTS | 12 | 233 | 102400 | ||
92102065 | ritishkumarsingh | A | Sept. 7, 2020, 4 a.m. | OK | Python 3 | TESTS | 12 | 109 | 0 | ||
92083649 | rubydubee | A | Sept. 6, 2020, 6:34 p.m. | OK | Python 3 | TESTS | 12 | 109 | 0 | ||
92077604 | Norrius | A | Sept. 6, 2020, 5:24 p.m. | OK | Python 3 | TESTS | 12 | 109 | 0 | ||
92077043 | UnunidealC | A | Sept. 6, 2020, 5:22 p.m. | OK | Python 3 | TESTS | 12 | 109 | 0 | ||
92063130 | Avinashbabu7 | A | Sept. 6, 2020, 3:58 p.m. | OK | Python 3 | TESTS | 12 | 109 | 0 | ||
92106334 | Pavanrah | A | Sept. 7, 2020, 5:23 a.m. | OK | Python 3 | TESTS | 12 | 124 | 0 | ||
92091264 | bdomokos | A | Sept. 6, 2020, 9:23 p.m. | OK | Python 3 | TESTS | 12 | 124 | 0 | ||
92062836 | codejunk | A | Sept. 6, 2020, 3:57 p.m. | OK | Python 3 | TESTS | 12 | 124 | 0 | ||
92093802 | ptgvo | A | Sept. 6, 2020, 11:10 p.m. | OK | Python 3 | TESTS | 12 | 124 | 307200 | ||
92081009 | amassnao | A | Sept. 6, 2020, 5:56 p.m. | OK | Python 3 | TESTS | 12 | 124 | 307200 | ||
92077458 | wow_ok | A | Sept. 6, 2020, 5:24 p.m. | OK | Ruby | TESTS | 12 | 577 | 1024000 | ||
92094937 | o2k | A | Sept. 7, 2020, 12:13 a.m. | OK | Rust | TESTS | 12 | 46 | 0 |
Back to search problems