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 |
---|---|---|---|---|---|---|
1385 | Codeforces Round 656 (Div. 3) | FINISHED | False | 8100 | 142356311 | July 17, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 37636 ) | B | Restore the Permutation by Merger | PROGRAMMING | greedy | 800 |
B"A permutation of length n is a sequence of integers from 1 to n of length n containing each number exactly once. For example, [1] , [4, 3, 5, 1, 2] , [3, 2, 1] are permutations, and [1, 1] , [0, 1] , [2, 2, 1, 4] are not. There was a permutation p[1 ... n] . It was merged with itself. In other words, let's take two instances of p and insert elements of the second p into the first maintaining relative order of elements. The result is a sequence of the length 2n . For example, if p=[3, 1, 2] some possible results are: [3, 1, 2, 3, 1, 2] , [3, 3, 1, 1, 2, 2] , [3, 1, 3, 1, 2, 2] . The following sequences are not possible results of a merging: [1, 3, 2, 1, 2, 3 ], [ 3, 1, 2, 3, 2, 1] , [3, 3, 1, 2, 2, 1] . For example, if p=[2, 1] the possible results are: [2, 2, 1, 1] , [2, 1, 2, 1] . The following sequences are not possible results of a merging: [1, 1, 2, 2 ], [ 2, 1, 1, 2] , [1, 2, 2, 1] . Your task is to restore the permutation p by the given resulting sequence a . It is guaranteed that the answer exists and is unique. You have to answer t independent test cases. The first line of the input contains one integer t ( 1 <= t <= 400 ) -- the number of test cases. Then t test cases follow. The first line of the test case contains one integer n ( 1 <= n <= 50 ) -- the length of permutation. The second line of the test case contains 2n integers a_1, a_2, ... , a_{2n} ( 1 <= a_i <= n ), where a_i is the i -th element of a . It is guaranteed that the array a represents the result of merging of some permutation p with the same permutation p . For each test case, print the answer: n integers p_1, p_2, ... , p_n ( 1 <= p_i <= n ), representing the initial permutation. It is guaranteed that the answer exists "... |
Codeforces Round #656 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
87173742 | AbirChy | B | July 17, 2020, 6:54 p.m. | OK | GNU C11 | TESTS | 3 | 31 | 3686400 | 800 | |
87144700 | rainboy | B | July 17, 2020, 4:08 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87146758 | Faria218 | B | July 17, 2020, 4:13 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87129992 | tejava | B | July 17, 2020, 3:37 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87138993 | sushmita_3131 | B | July 17, 2020, 3:55 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87139744 | FallenRiser | B | July 17, 2020, 3:57 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87142947 | souvik7701 | B | July 17, 2020, 4:04 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 3686400 | 800 | |
87168251 | Dipanjan05 | B | July 17, 2020, 5:50 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 4096000 | 800 | |
87146878 | lllllyh | B | July 17, 2020, 4:13 p.m. | OK | GNU C11 | TESTS | 3 | 77 | 3686400 | 800 | |
87164235 | akash19jain | B | July 17, 2020, 5:11 p.m. | OK | GNU C11 | TESTS | 3 | 77 | 3686400 | 800 | |
87147047 | yunxiyunxi | B | July 17, 2020, 4:14 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3686400 | 800 | |
87142575 | lonely_wind_ | B | July 17, 2020, 4:03 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87187231 | Dreamfarer | B | July 18, 2020, 1:07 a.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87186573 | Rainer1116 | B | July 18, 2020, 12:36 a.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87152902 | docca0 | B | July 17, 2020, 4:29 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87149503 | YMSD | B | July 17, 2020, 4:20 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87149066 | JereGod | B | July 17, 2020, 4:19 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87147330 | yeahabibi | B | July 17, 2020, 4:15 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87146184 | lhzhhhhhh | B | July 17, 2020, 4:12 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87144615 | TOMforces | B | July 17, 2020, 4:08 p.m. | OK | GNU C++11 | TESTS | 3 | 15 | 3891200 | 800 | |
87185976 | Kritagya_khandelwal | B | July 18, 2020, 12:02 a.m. | OK | GNU C++14 | TESTS | 3 | 0 | 3891200 | 800 | |
87182861 | flyinrabbitz | B | July 17, 2020, 9:57 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87176735 | ernestlu | B | July 17, 2020, 7:37 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87153887 | minhle.ff | B | July 17, 2020, 4:32 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87147428 | amankumar6 | B | July 17, 2020, 4:15 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87137952 | abdomorsy389 | B | July 17, 2020, 3:53 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87132341 | aabanerjee | B | July 17, 2020, 3:41 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87127606 | BittencourtMH | B | July 17, 2020, 3:33 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87194949 | Abhiz_19 | B | July 18, 2020, 4:36 a.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87127398 | Seijuro | B | July 17, 2020, 3:32 p.m. | OK | GNU C++14 | TESTS | 3 | 15 | 3686400 | 800 | |
87187747 | gxlois | B | July 18, 2020, 1:29 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87195092 | anirban_mbstu | B | July 18, 2020, 4:38 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87191770 | adityakarad28 | B | July 18, 2020, 3:19 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87191467 | Kevin7Zz | B | July 18, 2020, 3:12 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87188580 | Nadim_brur | B | July 18, 2020, 1:56 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87186940 | Momo_xxx | B | July 18, 2020, 12:53 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87186309 | ahmed866 | B | July 18, 2020, 12:20 a.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87183513 | liuwj2312 | B | July 17, 2020, 10:18 p.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87181965 | Deep_Choder | B | July 17, 2020, 9:31 p.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87180683 | Ri_Ni | B | July 17, 2020, 8:56 p.m. | OK | GNU C++17 | TESTS | 3 | 15 | 3686400 | 800 | |
87169886 | mshiladityam | B | July 17, 2020, 6:08 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87170476 | menna_tallah | B | July 17, 2020, 6:14 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87170558 | R2-D2_hates_lemon | B | July 17, 2020, 6:15 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87175510 | vasugondaliya | B | July 17, 2020, 7:18 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87176462 | Phortox | B | July 17, 2020, 7:33 p.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87189992 | GreyNewbieRank | B | July 18, 2020, 2:34 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87191477 | Meteoriii | B | July 18, 2020, 3:12 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87191875 | devillove084 | B | July 18, 2020, 3:22 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87191897 | nicknamee12 | B | July 18, 2020, 3:22 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87192384 | yashj6294 | B | July 18, 2020, 3:33 a.m. | OK | GNU C++17 (64) | TESTS | 3 | 15 | 4300800 | 800 | |
87140372 | Rahul | B | July 17, 2020, 3:58 p.m. | OK | Go | TESTS | 3 | 30 | 10854400 | 800 | |
87191188 | synapse | B | July 18, 2020, 3:05 a.m. | OK | Go | TESTS | 3 | 46 | 10649600 | 800 | |
87156242 | gdebenitocassado | B | July 17, 2020, 4:38 p.m. | OK | Go | TESTS | 3 | 61 | 10854400 | 800 | |
87184646 | jc881203 | B | July 17, 2020, 10:58 p.m. | OK | Go | TESTS | 3 | 77 | 11980800 | 800 | |
87124612 | dblokhin | B | July 17, 2020, 3:27 p.m. | OK | Go | TESTS | 3 | 93 | 10649600 | 800 | |
87194079 | Trishan | B | July 18, 2020, 4:13 a.m. | OK | Go | TESTS | 3 | 93 | 11673600 | 800 | |
87141466 | jojo1094 | B | July 17, 2020, 4 p.m. | OK | Go | TESTS | 3 | 374 | 10649600 | 800 | |
87136676 | Lokesh1197 | B | July 17, 2020, 3:50 p.m. | OK | Haskell | TESTS | 3 | 62 | 11571200 | 800 | |
87131511 | specdrake | B | July 17, 2020, 3:40 p.m. | OK | Haskell | TESTS | 3 | 78 | 11571200 | 800 | |
87127541 | TearFox | B | July 17, 2020, 3:32 p.m. | OK | Haskell | TESTS | 3 | 93 | 13721600 | 800 | |
87179052 | Apass.Jack | B | July 17, 2020, 8:20 p.m. | OK | Java 11 | TESTS | 3 | 156 | 23859200 | 800 | |
87154700 | benle106 | B | July 17, 2020, 4:34 p.m. | OK | Java 11 | TESTS | 3 | 171 | 23756800 | 800 | |
87170098 | In_The_Name_Of_Love | B | July 17, 2020, 6:11 p.m. | OK | Java 11 | TESTS | 3 | 171 | 23961600 | 800 | |
87135980 | TienNguyen411 | B | July 17, 2020, 3:49 p.m. | OK | Java 11 | TESTS | 3 | 186 | 23859200 | 800 | |
87175870 | devesh08 | B | July 17, 2020, 7:24 p.m. | OK | Java 11 | TESTS | 3 | 186 | 23961600 | 800 | |
87176967 | kumarpritam863 | B | July 17, 2020, 7:41 p.m. | OK | Java 11 | TESTS | 3 | 186 | 24064000 | 800 | |
87135869 | tirth485 | B | July 17, 2020, 3:48 p.m. | OK | Java 11 | TESTS | 3 | 186 | 24473600 | 800 | |
87190087 | BueVonHun | B | July 18, 2020, 2:37 a.m. | OK | Java 11 | TESTS | 3 | 187 | 23961600 | 800 | |
87139249 | nhiemnguyen999 | B | July 17, 2020, 3:56 p.m. | OK | Java 11 | TESTS | 3 | 202 | 23961600 | 800 | |
87143402 | vivek21 | B | July 17, 2020, 4:05 p.m. | OK | Java 11 | TESTS | 3 | 202 | 23961600 | 800 | |
87190892 | Oland | B | July 18, 2020, 2:57 a.m. | OK | Java 8 | TESTS | 3 | 93 | 20377600 | 800 | |
87168376 | nidhigoel | B | July 17, 2020, 5:51 p.m. | OK | Java 8 | TESTS | 3 | 93 | 20480000 | 800 | |
87137422 | Hasib_Ullah | B | July 17, 2020, 3:52 p.m. | OK | Java 8 | TESTS | 3 | 93 | 20480000 | 800 | |
87190829 | PersonOfInterest | B | July 18, 2020, 2:56 a.m. | OK | Java 8 | TESTS | 3 | 108 | 20480000 | 800 | |
87129962 | vigneshpillutla | B | July 17, 2020, 3:37 p.m. | OK | Java 8 | TESTS | 3 | 108 | 20480000 | 800 | |
87187802 | robinz62 | B | July 18, 2020, 1:31 a.m. | OK | Java 8 | TESTS | 3 | 109 | 20377600 | 800 | |
87185027 | bluesky111 | B | July 17, 2020, 11:13 p.m. | OK | Java 8 | TESTS | 3 | 109 | 20377600 | 800 | |
87145115 | levi.blinder | B | July 17, 2020, 4:09 p.m. | OK | Java 8 | TESTS | 3 | 109 | 20377600 | 800 | |
87129888 | jainayushjain95 | B | July 17, 2020, 3:37 p.m. | OK | Java 8 | TESTS | 3 | 109 | 20377600 | 800 | |
87182592 | Peter_Fahmi | B | July 17, 2020, 9:50 p.m. | OK | Java 8 | TESTS | 3 | 109 | 20480000 | 800 | |
87181187 | Bauyrzhanrr | B | July 17, 2020, 9:09 p.m. | OK | Kotlin | TESTS | 3 | 234 | 21299200 | 800 | |
87150586 | StrawHat9 | B | July 17, 2020, 4:23 p.m. | OK | Mono C# | TESTS | 3 | 62 | 11776000 | 800 | |
87181909 | pycyu | B | July 17, 2020, 9:29 p.m. | OK | Mono C# | TESTS | 3 | 108 | 11571200 | 800 | |
87170973 | TRR | B | July 17, 2020, 6:19 p.m. | OK | Mono C# | TESTS | 3 | 108 | 11673600 | 800 | |
87139733 | dh111 | B | July 17, 2020, 3:57 p.m. | OK | MS C++ | TESTS | 3 | 31 | 3891200 | 800 | |
87136422 | zhou-zy | B | July 17, 2020, 3:50 p.m. | OK | MS C++ | TESTS | 3 | 31 | 4096000 | 800 | |
87138450 | wqlhhhh | B | July 17, 2020, 3:54 p.m. | OK | MS C++ | TESTS | 3 | 46 | 3891200 | 800 | |
87198526 | Smiita | B | July 18, 2020, 5:49 a.m. | OK | MS C++ | TESTS | 3 | 93 | 3891200 | 800 | |
87188704 | vjudge3 | B | July 18, 2020, 1:59 a.m. | OK | MS C++ | TESTS | 3 | 93 | 4096000 | 800 | |
87133989 | 201921121110chenminghao | B | July 17, 2020, 3:44 p.m. | OK | MS C++ 2017 | TESTS | 3 | 30 | 3686400 | 800 | |
87131197 | dayun6530 | B | July 17, 2020, 3:39 p.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 3686400 | 800 | |
87149230 | rubairshaid | B | July 17, 2020, 4:19 p.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 3686400 | 800 | |
87148013 | Slava_Petrosyan | B | July 17, 2020, 4:16 p.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 3686400 | 800 | |
87138463 | zinean00 | B | July 17, 2020, 3:54 p.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 3686400 | 800 | |
87148852 | mragab | B | July 17, 2020, 4:18 p.m. | OK | MS C++ 2017 | TESTS | 3 | 31 | 3891200 | 800 | |
87170688 | code_king1142 | B | July 17, 2020, 6:16 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 3686400 | 800 | |
87182162 | Baobab0304 | B | July 17, 2020, 9:37 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 3686400 | 800 | |
87186834 | putian | B | July 18, 2020, 12:48 a.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 3686400 | 800 | |
87180358 | lhcalphaA | B | July 17, 2020, 8:48 p.m. | OK | MS C++ 2017 | TESTS | 3 | 46 | 3686400 | 800 | |
87146973 | dxvgx | B | July 17, 2020, 4:14 p.m. | OK | Node.js | TESTS | 3 | 62 | 14028800 | 800 | |
87127563 | sarvagya8 | B | July 17, 2020, 3:33 p.m. | OK | Node.js | TESTS | 3 | 77 | 13926400 | 800 | |
87135376 | explorer_sifat | B | July 17, 2020, 3:47 p.m. | OK | Node.js | TESTS | 3 | 93 | 14131200 | 800 | |
87147026 | EgorStar | B | July 17, 2020, 4:14 p.m. | OK | PascalABC.NET | TESTS | 3 | 467 | 26521600 | 800 | |
87171849 | mayakin | B | July 17, 2020, 6:30 p.m. | OK | PHP | TESTS | 3 | 31 | 6041600 | 800 | |
87163347 | alexwice | B | July 17, 2020, 5:04 p.m. | OK | PyPy 2 | TESTS | 3 | 109 | 25190400 | 800 | |
87138353 | shehebe | B | July 17, 2020, 3:54 p.m. | OK | PyPy 2 | TESTS | 3 | 140 | 26726400 | 800 | |
87192324 | kk2906 | B | July 18, 2020, 3:32 a.m. | OK | PyPy 3 | TESTS | 3 | 155 | 23142400 | 800 | |
87148557 | varshahv15 | B | July 17, 2020, 4:18 p.m. | OK | PyPy 3 | TESTS | 3 | 170 | 22630400 | 800 | |
87125065 | ZzaZi | B | July 17, 2020, 3:28 p.m. | OK | PyPy 3 | TESTS | 3 | 170 | 22835200 | 800 | |
87154948 | dliang101607 | B | July 17, 2020, 4:35 p.m. | OK | PyPy 3 | TESTS | 3 | 170 | 23040000 | 800 | |
87156849 | titia | B | July 17, 2020, 4:40 p.m. | OK | PyPy 3 | TESTS | 3 | 171 | 24985600 | 800 | |
87129558 | Aarya_12 | B | July 17, 2020, 3:36 p.m. | OK | PyPy 3 | TESTS | 3 | 186 | 22732800 | 800 | |
87164493 | diffeo | B | July 17, 2020, 5:13 p.m. | OK | PyPy 3 | TESTS | 3 | 186 | 23756800 | 800 | |
87126461 | akhil070 | B | July 17, 2020, 3:31 p.m. | OK | PyPy 3 | TESTS | 3 | 186 | 24064000 | 800 | |
87164897 | RafaelC | B | July 17, 2020, 5:16 p.m. | OK | PyPy 3 | TESTS | 3 | 186 | 24166400 | 800 | |
87127543 | satakshigarg | B | July 17, 2020, 3:32 p.m. | OK | PyPy 3 | TESTS | 3 | 186 | 24268800 | 800 | |
87131037 | elistark | B | July 17, 2020, 3:39 p.m. | OK | Python 2 | TESTS | 3 | 186 | 6553600 | 800 | |
87163560 | FixMePls | B | July 17, 2020, 5:05 p.m. | OK | Python 3 | TESTS | 3 | 93 | 6656000 | 800 | |
87136267 | csiri | B | July 17, 2020, 3:49 p.m. | OK | Python 3 | TESTS | 3 | 93 | 6656000 | 800 | |
87194549 | Aurelius | B | July 18, 2020, 4:26 a.m. | OK | Python 3 | TESTS | 3 | 93 | 6963200 | 800 | |
87173401 | LintuStorm | B | July 17, 2020, 6:49 p.m. | OK | Python 3 | TESTS | 3 | 93 | 6963200 | 800 | |
87140827 | BorisPro | B | July 17, 2020, 3:59 p.m. | OK | Python 3 | TESTS | 3 | 93 | 7475200 | 800 | |
87155364 | jinal_4 | B | July 17, 2020, 4:36 p.m. | OK | Python 3 | TESTS | 3 | 108 | 6656000 | 800 | |
87147362 | I_AmStupid | B | July 17, 2020, 4:15 p.m. | OK | Python 3 | TESTS | 3 | 108 | 6656000 | 800 | |
87139073 | kanika_17bit | B | July 17, 2020, 3:55 p.m. | OK | Python 3 | TESTS | 3 | 108 | 6656000 | 800 | |
87128379 | DanailaM | B | July 17, 2020, 3:34 p.m. | OK | Python 3 | TESTS | 3 | 108 | 6656000 | 800 | |
87126023 | thinhnd194 | B | July 17, 2020, 3:30 p.m. | OK | Python 3 | TESTS | 3 | 108 | 6656000 | 800 | |
87129242 | masa0216masa0216masa0216 | B | July 17, 2020, 3:35 p.m. | OK | Ruby | TESTS | 3 | 514 | 48947200 | 800 | |
87191516 | sansen | B | July 18, 2020, 3:13 a.m. | OK | Rust | TESTS | 3 | 30 | 4300800 | 800 | |
87162725 | IvanDyachenko | B | July 17, 2020, 4:59 p.m. | OK | Scala | TESTS | 3 | 498 | 39833600 | 800 |
Back to search problems