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 |
---|---|---|---|---|---|---|
1650 | Codeforces Round 776 (Div. 3) | FINISHED | False | 8100 | 85073099 | March 8, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 13104 ) | D | Twist the Permutation | PROGRAMMING | brute force constructive algorithms math |
B"Petya got an array a of numbers from 1 to n , where a[i]=i . He performed n operations sequentially. In the end, he received a new state of the a array. At the i -th operation, Petya chose the first i elements of the array and cyclically shifted them to the right an arbitrary number of times (elements with indexes i+1 and more remain in their places). One cyclic shift to the right is such a transformation that the array a=[a_1, a_2, ... , a_n] becomes equal to the array a = [a_i, a_1, a_2, ... , a_{i-2}, a_{i-1}, a_{i+1}, a_{i+2}, ... , a_n] . For example, if a = [5,4,2,1,3] and i=3 (that is, this is the third operation), then as a result of this operation, he could get any of these three arrays: Let's look at an example. Let n=6 , i.e. initially a=[1,2,3,4,5,6] . A possible scenario is described below. You are given a final array state a after all n operations. Determine if there is a way to perform the operation that produces this result. In this case, if an answer exists, print the numbers of cyclical shifts that occurred during each of the n operations. The first line of the input contains an integer t ( 1 <= t <= 500 ) -- the number of test cases in the test. The descriptions of the test cases follow. The first line of the description of each test case contains one integer n ( 2 <= n <= 2 cdot10^3 ) -- the length of the array a . The next line contains the final state of the array a : n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) are written. All a_i are distinct. It is guaranteed that the sum of n values over all test cases does not exceed 2 cdot10^3 . For each test case, print the answer on a separate line. Print -1 if the given final value a cannot be obtained by performing an arbitrary number of cyclic shifts on each operation. Otherwise, print n non-negati"... |
100712 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
148940553 | nhanhoang510 | D | March 9, 2022, 3:09 a.m. | OK | FPC | TESTS | 14 | 30 | 0 | ||
148904452 | ashwith | D | March 8, 2022, 4:43 p.m. | OK | GNU C11 | TESTS | 10 | 31 | 0 | ||
148907017 | vladislav_k | D | March 8, 2022, 4:48 p.m. | OK | GNU C11 | TESTS | 10 | 31 | 0 | ||
148940135 | xiane | D | March 9, 2022, 3 a.m. | OK | GNU C11 | TESTS | 14 | 966 | 32256000 | ||
148911479 | codingfreak999 | D | March 8, 2022, 5:12 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 0 | ||
148930696 | Pi_17 | D | March 8, 2022, 9:46 p.m. | OK | GNU C++14 | TESTS | 14 | 0 | 102400 | ||
148921148 | swsti | D | March 8, 2022, 6:54 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 204800 | ||
148911901 | nilesh_gup | D | March 8, 2022, 5:15 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 204800 | ||
148903298 | tophong2001 | D | March 8, 2022, 4:40 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 204800 | ||
148910569 | Bedo_Sayed | D | March 8, 2022, 5:06 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 3276800 | ||
148927213 | ankitcareers7 | D | March 8, 2022, 8:33 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 4198400 | ||
148910618 | yycaidd | D | March 8, 2022, 5:06 p.m. | OK | GNU C++14 | TESTS | 10 | 0 | 8499200 | ||
148934189 | wind_cross | D | March 9, 2022, 12:13 a.m. | OK | GNU C++14 | TESTS | 14 | 0 | 15974400 | ||
148947235 | saswatpanda19990 | D | March 9, 2022, 5:12 a.m. | OK | GNU C++14 | TESTS | 14 | 15 | 0 | ||
148917880 | harshagrawal | D | March 8, 2022, 6:12 p.m. | OK | GNU C++17 | TESTS | 10 | 0 | 0 | ||
148907388 | modiii | D | March 8, 2022, 4:49 p.m. | OK | GNU C++17 | TESTS | 10 | 0 | 0 | ||
148932243 | snail_khel | D | March 8, 2022, 10:35 p.m. | OK | GNU C++17 | TESTS | 14 | 0 | 0 | ||
148912733 | jatin1510 | D | March 8, 2022, 5:22 p.m. | OK | GNU C++17 | TESTS | 10 | 0 | 102400 | ||
148910492 | sergey_sychev | D | March 8, 2022, 5:05 p.m. | OK | GNU C++17 | TESTS | 10 | 0 | 102400 | ||
148948324 | garvitvirmani | D | March 9, 2022, 5:28 a.m. | OK | GNU C++17 | TESTS | 14 | 0 | 102400 | ||
148947385 | COVINA | D | March 9, 2022, 5:14 a.m. | OK | GNU C++17 | TESTS | 14 | 0 | 102400 | ||
148944756 | NITYAM_BHUSHAN | D | March 9, 2022, 4:30 a.m. | OK | GNU C++17 | TESTS | 14 | 0 | 204800 | ||
148940490 | _Gargera_ | D | March 9, 2022, 3:08 a.m. | OK | GNU C++17 | TESTS | 14 | 0 | 204800 | ||
148938429 | Gourab_biswas | D | March 9, 2022, 2:20 a.m. | OK | GNU C++17 | TESTS | 14 | 0 | 204800 | ||
148902609 | 0111t | D | March 8, 2022, 4:38 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148931238 | kal013 | D | March 8, 2022, 10:01 p.m. | OK | GNU C++17 (64) | TESTS | 14 | 0 | 0 | ||
148920359 | pranay.2 | D | March 8, 2022, 6:43 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148915987 | Mac.Rose | D | March 8, 2022, 5:51 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148912857 | InFaNg | D | March 8, 2022, 5:23 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148909462 | virt_contest_taker | D | March 8, 2022, 4:59 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148904973 | dong_gas | D | March 8, 2022, 4:44 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148902782 | SlayerJ | D | March 8, 2022, 4:39 p.m. | OK | GNU C++17 (64) | TESTS | 10 | 0 | 0 | ||
148942840 | anmichi | D | March 9, 2022, 3:55 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 15 | 0 | ||
148947768 | monkedluffy | D | March 9, 2022, 5:20 a.m. | OK | GNU C++17 (64) | TESTS | 14 | 15 | 0 | ||
148943875 | lalit_1471 | D | March 9, 2022, 4:15 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
148942859 | magiccat | D | March 9, 2022, 3:55 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
148938631 | Shuai. | D | March 9, 2022, 2:25 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
148934427 | Menos | D | March 9, 2022, 12:21 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
148925232 | anjali_raj_123 | D | March 8, 2022, 7:56 p.m. | OK | GNU C++20 (64) | TESTS | 10 | 0 | 0 | ||
148920518 | wasted-light | D | March 8, 2022, 6:45 p.m. | OK | GNU C++20 (64) | TESTS | 10 | 0 | 0 | ||
148916881 | Mac_prime | D | March 8, 2022, 6:01 p.m. | OK | GNU C++20 (64) | TESTS | 10 | 0 | 0 | ||
148914425 | nebula | D | March 8, 2022, 5:36 p.m. | OK | GNU C++20 (64) | TESTS | 10 | 0 | 0 | ||
148919930 | iamsahil_2703 | D | March 8, 2022, 6:38 p.m. | OK | GNU C++20 (64) | TESTS | 10 | 0 | 0 | ||
148946627 | tohemis2 | D | March 9, 2022, 5:03 a.m. | OK | GNU C++20 (64) | TESTS | 14 | 0 | 0 | ||
148920451 | TomazGomes | D | March 8, 2022, 6:45 p.m. | OK | Haskell | TESTS | 10 | 61 | 0 | ||
148921833 | TomazGomes | D | March 8, 2022, 7:04 p.m. | OK | Haskell | TESTS | 10 | 109 | 0 | ||
148931419 | Andwerp | D | March 8, 2022, 10:07 p.m. | OK | Java 11 | TESTS | 14 | 156 | 0 | ||
148918873 | henrychenOutlook | D | March 8, 2022, 6:24 p.m. | OK | Java 11 | TESTS | 10 | 171 | 0 | ||
148938140 | Wuya | D | March 9, 2022, 2:12 a.m. | OK | Java 11 | TESTS | 14 | 186 | 0 | ||
148929508 | wizwilzo | D | March 8, 2022, 9:19 p.m. | OK | Java 11 | TESTS | 10 | 186 | 0 | ||
148916103 | Hrufnarwa | D | March 8, 2022, 5:53 p.m. | OK | Java 11 | TESTS | 10 | 187 | 0 | ||
148907108 | sinnay | D | March 8, 2022, 4:49 p.m. | OK | Java 11 | TESTS | 10 | 187 | 0 | ||
148936299 | Eslam_Ahmed | D | March 9, 2022, 1:19 a.m. | OK | Java 11 | TESTS | 14 | 202 | 0 | ||
148919052 | henrychenOutlook | D | March 8, 2022, 6:26 p.m. | OK | Java 11 | TESTS | 10 | 202 | 0 | ||
148950767 | dhruvil_01 | D | March 9, 2022, 6 a.m. | OK | Java 11 | TESTS | 14 | 202 | 0 | ||
148949192 | i2w2411 | D | March 9, 2022, 5:40 a.m. | OK | Java 11 | TESTS | 14 | 202 | 0 | ||
148910325 | kocko | D | March 8, 2022, 5:04 p.m. | OK | Java 8 | TESTS | 10 | 93 | 0 | ||
148903917 | ved20 | D | March 8, 2022, 4:42 p.m. | OK | Java 8 | TESTS | 10 | 93 | 0 | ||
148943516 | SubhaniSk7 | D | March 9, 2022, 4:08 a.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
148943068 | ak_ankit | D | March 9, 2022, 3:59 a.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
148931989 | DEMO23 | D | March 8, 2022, 10:26 p.m. | OK | Java 8 | TESTS | 14 | 93 | 0 | ||
148917394 | honeysingh18 | D | March 8, 2022, 6:07 p.m. | OK | Java 8 | TESTS | 10 | 93 | 0 | ||
148905130 | SathishBatsy | D | March 8, 2022, 4:45 p.m. | OK | Java 8 | TESTS | 10 | 124 | 0 | ||
148909534 | g906360 | D | March 8, 2022, 4:59 p.m. | OK | Java 8 | TESTS | 10 | 139 | 0 | ||
148924034 | abetrack3 | D | March 8, 2022, 7:38 p.m. | OK | Java 8 | TESTS | 10 | 139 | 0 | ||
148943217 | wzwww13754322042 | D | March 9, 2022, 4:02 a.m. | OK | Java 8 | TESTS | 14 | 140 | 0 | ||
148931379 | PavelChadnov | D | March 8, 2022, 10:05 p.m. | OK | Kotlin 1.4 | TESTS | 14 | 171 | 1638400 | ||
148915451 | Golovanov399 | D | March 8, 2022, 5:46 p.m. | OK | Kotlin 1.5 | TESTS | 10 | 233 | 0 | ||
148915343 | artemida | D | March 8, 2022, 5:45 p.m. | OK | MS C++ 2017 | TESTS | 10 | 15 | 0 | ||
148942854 | Sagidullca | D | March 9, 2022, 3:55 a.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 0 | ||
148904370 | return_myself | D | March 8, 2022, 4:43 p.m. | OK | MS C++ 2017 | TESTS | 10 | 15 | 102400 | ||
148945847 | shuitishashou | D | March 9, 2022, 4:50 a.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 102400 | ||
148932303 | zuev93 | D | March 8, 2022, 10:37 p.m. | OK | MS C++ 2017 | TESTS | 14 | 15 | 102400 | ||
148908347 | reosfire | D | March 8, 2022, 4:53 p.m. | OK | .NET Core C# | TESTS | 10 | 92 | 3276800 | ||
148936228 | scixing | D | March 9, 2022, 1:17 a.m. | OK | .NET Core C# | TESTS | 14 | 124 | 409600 | ||
148923331 | michael.g.pan | D | March 8, 2022, 7:27 p.m. | OK | PyPy 3 | TESTS | 10 | 92 | 2150400 | ||
148923988 | minm | D | March 8, 2022, 7:37 p.m. | OK | PyPy 3 | TESTS | 10 | 93 | 2969600 | ||
148948918 | MistaAsh | D | March 9, 2022, 5:36 a.m. | OK | PyPy 3 | TESTS | 14 | 93 | 3481600 | ||
148950480 | kuanc | D | March 9, 2022, 5:57 a.m. | OK | PyPy 3 | TESTS | 14 | 108 | 4812800 | ||
148921281 | amanbucha | D | March 8, 2022, 6:56 p.m. | OK | PyPy 3 | TESTS | 10 | 124 | 3379200 | ||
148940339 | majay1638 | D | March 9, 2022, 3:04 a.m. | OK | PyPy 3 | TESTS | 14 | 124 | 6656000 | ||
148915628 | Code_Breaker101 | D | March 8, 2022, 5:48 p.m. | OK | PyPy 3-64 | TESTS | 10 | 108 | 9625600 | ||
148909558 | dvaravind | D | March 8, 2022, 4:59 p.m. | OK | PyPy 3-64 | TESTS | 10 | 109 | 7884800 | ||
148922384 | zxcuser2 | D | March 8, 2022, 7:12 p.m. | OK | PyPy 3-64 | TESTS | 10 | 124 | 7987200 | ||
148904730 | Gnadi4 | D | March 8, 2022, 4:44 p.m. | OK | PyPy 3-64 | TESTS | 10 | 124 | 8089600 | ||
148910732 | bodorbolo | D | March 8, 2022, 5:07 p.m. | OK | PyPy 3-64 | TESTS | 10 | 124 | 9523200 | ||
148950503 | mnkp | D | March 9, 2022, 5:57 a.m. | OK | PyPy 3-64 | TESTS | 14 | 140 | 10342400 | ||
148930216 | wolfram_ | D | March 8, 2022, 9:35 p.m. | OK | PyPy 3-64 | TESTS | 14 | 140 | 10752000 | ||
148910733 | rafle | D | March 8, 2022, 5:07 p.m. | OK | PyPy 3-64 | TESTS | 10 | 140 | 11571200 | ||
148921182 | CaptainUknown | D | March 8, 2022, 6:55 p.m. | OK | PyPy 3-64 | TESTS | 10 | 140 | 37478400 | ||
148904068 | saini.laxman2002 | D | March 8, 2022, 4:42 p.m. | OK | PyPy 3-64 | TESTS | 10 | 155 | 9216000 | ||
148925449 | mihir111p | D | March 8, 2022, 8 p.m. | OK | Python 3 | TESTS | 10 | 61 | 409600 | ||
148915901 | namans777 | D | March 8, 2022, 5:51 p.m. | OK | Python 3 | TESTS | 10 | 61 | 409600 | ||
148905492 | Jaggu509 | D | March 8, 2022, 4:45 p.m. | OK | Python 3 | TESTS | 10 | 61 | 409600 | ||
148912710 | rinzller | D | March 8, 2022, 5:22 p.m. | OK | Python 3 | TESTS | 10 | 61 | 512000 | ||
148910778 | Ghooster | D | March 8, 2022, 5:07 p.m. | OK | Python 3 | TESTS | 10 | 61 | 819200 | ||
148911074 | SKA1812 | D | March 8, 2022, 5:09 p.m. | OK | Python 3 | TESTS | 10 | 62 | 409600 | ||
148906516 | spandanreddykolthuri | D | March 8, 2022, 4:47 p.m. | OK | Python 3 | TESTS | 10 | 62 | 409600 | ||
148903746 | vikas_1997 | D | March 8, 2022, 4:41 p.m. | OK | Python 3 | TESTS | 10 | 62 | 409600 | ||
148902926 | Acetylcholinesterase | D | March 8, 2022, 4:39 p.m. | OK | Python 3 | TESTS | 10 | 62 | 409600 | ||
148902993 | RomUsh | D | March 8, 2022, 4:39 p.m. | OK | Python 3 | TESTS | 10 | 62 | 512000 |
Back to search problems