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 |
---|---|---|---|---|---|---|
1681 | Educational Codeforces Round 129 (Rated for Div. 2) | FINISHED | False | 7200 | 83863463 | May 23, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 17667 ) | C | Double Sort | PROGRAMMING | implementation sortings | 1200 |
B"You are given two arrays a and b , both consisting of n integers. In one move, you can choose two indices i and j ( 1 <= i, j <= n ; i neq j ) and swap a_i with a_j and b_i with b_j . You have to perform the swap in both arrays. You are allowed to perform at most 10^4 moves (possibly, zero). Can you make both arrays sorted in a non-decreasing order at the end? If you can, print any sequence of moves that makes both arrays sorted. The first line contains a single integer t ( 1 <= t <= 100 ) -- the number of testcases. The first line of each testcase contains a single integer n ( 2 <= n <= 100 ) -- the number of elements in both arrays. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= n ) -- the first array. The third line contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= n ) -- the second array. For each testcase, print the answer. If it's impossible to make both arrays sorted in a non-decreasing order in at most 10^4 moves, print -1. Otherwise, first, print the number of moves k (0 <= k <= 10^4) . Then print i and j for each move (1 <= i, j <= n ; i neq j) . If there are multiple answers, then print any of them. You don't have to minimize the number of moves. "... |
103163 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
158411414 | nesco | C | May 25, 2022, 5:05 p.m. | OK | C# 10 | TESTS | 7 | 1357 | 6451200 | 1200 | |
158285597 | Imarion | C | May 24, 2022, 10:05 a.m. | OK | C# 8 | TESTS | 7 | 108 | 2355200 | 1200 | |
158339841 | extremall | C | May 24, 2022, 11:01 p.m. | OK | C# 8 | TESTS | 7 | 1356 | 4710400 | 1200 | |
158290119 | RFSS_ | C | May 24, 2022, 11:05 a.m. | OK | Clang++17 Diagnostics | TESTS | 7 | 530 | 23040000 | 1200 | |
158506280 | akshat211103 | C | May 26, 2022, 8:29 a.m. | OK | GNU C11 | TESTS | 7 | 1950 | 102400 | 1200 | |
158506312 | akshat211103 | C | May 26, 2022, 8:29 a.m. | OK | GNU C11 | TESTS | 7 | 1950 | 102400 | 1200 | |
158285682 | AJINKYA11 | C | May 24, 2022, 10:06 a.m. | OK | GNU C11 | TESTS | 7 | 1950 | 102400 | 1200 | |
158341615 | TimmyL | C | May 25, 2022, 12:33 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 0 | 1200 | |
158267594 | Just_coding_ | C | May 24, 2022, 5:52 a.m. | OK | GNU C++14 | TESTS | 7 | 0 | 102400 | 1200 | |
158393784 | drinkWater. | C | May 25, 2022, 1:38 p.m. | OK | GNU C++14 | TESTS | 7 | 0 | 102400 | 1200 | |
158298871 | duoluoluo | C | May 24, 2022, 12:50 p.m. | OK | GNU C++14 | TESTS | 7 | 0 | 102400 | 1200 | |
158308005 | codeanna | C | May 24, 2022, 2:32 p.m. | OK | GNU C++14 | TESTS | 7 | 0 | 3174400 | 1200 | |
158393636 | technuts01 | C | May 25, 2022, 1:36 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | 1200 | |
158380384 | farica | C | May 25, 2022, 10:56 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | 1200 | |
158468351 | Wilbert1124 | C | May 25, 2022, 8:02 p.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | 1200 | |
158490126 | J0kerX | C | May 26, 2022, 4:51 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | 1200 | |
158503791 | hiki_hachiman | C | May 26, 2022, 7:57 a.m. | OK | GNU C++14 | TESTS | 7 | 15 | 0 | 1200 | |
158318164 | FatemehA | C | May 24, 2022, 4:23 p.m. | OK | GNU C++17 | TESTS | 7 | 0 | 0 | 1200 | |
158311647 | tanzidi | C | May 24, 2022, 3:11 p.m. | OK | GNU C++17 | TESTS | 7 | 0 | 102400 | 1200 | |
158401444 | shy_but_not_shy | C | May 25, 2022, 3:10 p.m. | OK | GNU C++17 | TESTS | 7 | 0 | 102400 | 1200 | |
158338882 | M.Ibrahem | C | May 24, 2022, 10:17 p.m. | OK | GNU C++17 | TESTS | 7 | 0 | 102400 | 1200 | |
158300096 | Aizen4325 | C | May 24, 2022, 1:04 p.m. | OK | GNU C++17 | TESTS | 7 | 0 | 204800 | 1200 | |
158284540 | zjs22 | C | May 24, 2022, 9:50 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 204800 | 1200 | |
158291596 | mukund0909 | C | May 24, 2022, 11:23 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 204800 | 1200 | |
158268203 | Duck_sajin | C | May 24, 2022, 6:01 a.m. | OK | GNU C++17 | TESTS | 7 | 0 | 24064000 | 1200 | |
158579870 | pushpam08singh | C | May 27, 2022, 4:46 a.m. | OK | GNU C++17 | TESTS | 7 | 15 | 0 | 1200 | |
158563661 | kanha5125 | C | May 26, 2022, 7:59 p.m. | OK | GNU C++17 | TESTS | 7 | 15 | 0 | 1200 | |
158286955 | Abd-Alrhman.A | C | May 24, 2022, 10:24 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158267307 | Svlad_Cjelli | C | May 24, 2022, 5:48 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158329598 | nbp8 | C | May 24, 2022, 6:43 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158356121 | Owmicron | C | May 25, 2022, 6:25 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158308072 | 8acebuzzy | C | May 24, 2022, 2:32 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 0 | 7987200 | 1200 | |
158529822 | Chirag_Ujjwal | C | May 26, 2022, 1:05 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 0 | 1200 | |
158548289 | Lycoriss | C | May 26, 2022, 4:21 p.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 0 | 1200 | |
158516364 | Aditya_619 | C | May 26, 2022, 10:39 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 0 | 1200 | |
158487070 | satvik76 | C | May 26, 2022, 3:53 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 0 | 1200 | |
158482725 | jjjjssss6 | C | May 26, 2022, 2:22 a.m. | OK | GNU C++17 (64) | TESTS | 7 | 15 | 0 | 1200 | |
158398121 | jarvis_yash | C | May 25, 2022, 2:32 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158393437 | wuhufly | C | May 25, 2022, 1:34 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158391952 | PramodhR | C | May 25, 2022, 1:16 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158346452 | HodaKamal | C | May 25, 2022, 3:18 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158345461 | StRabbit | C | May 25, 2022, 2:50 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158333820 | nyet | C | May 24, 2022, 7:57 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158328488 | raipro | C | May 24, 2022, 6:27 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158413339 | _fire_fly_ | C | May 25, 2022, 5:29 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158484862 | maq5ud | C | May 26, 2022, 3:10 a.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158545336 | DOBO | C | May 26, 2022, 3:45 p.m. | OK | GNU C++20 (64) | TESTS | 7 | 0 | 0 | 1200 | |
158327707 | Death_on_2_Legs | C | May 24, 2022, 6:17 p.m. | OK | Haskell | TESTS | 7 | 405 | 109260800 | 1200 | |
158265787 | satyaa_78 | C | May 24, 2022, 5:24 a.m. | OK | Java 11 | TESTS | 7 | 171 | 0 | 1200 | |
158283902 | dinosparton_013 | C | May 24, 2022, 9:41 a.m. | OK | Java 11 | TESTS | 7 | 186 | 0 | 1200 | |
158335525 | nirvana_rsc | C | May 24, 2022, 8:37 p.m. | OK | Java 11 | TESTS | 7 | 186 | 102400 | 1200 | |
158389881 | aditya2024 | C | May 25, 2022, 12:53 p.m. | OK | Java 11 | TESTS | 7 | 187 | 0 | 1200 | |
158347153 | krishnagskr983 | C | May 25, 2022, 3:38 a.m. | OK | Java 11 | TESTS | 7 | 187 | 0 | 1200 | |
158270186 | super_geek | C | May 24, 2022, 6:29 a.m. | OK | Java 11 | TESTS | 7 | 187 | 0 | 1200 | |
158266351 | garg_lucifer | C | May 24, 2022, 5:33 a.m. | OK | Java 11 | TESTS | 7 | 187 | 0 | 1200 | |
158380468 | ayushgaur02 | C | May 25, 2022, 10:57 a.m. | OK | Java 11 | TESTS | 7 | 202 | 0 | 1200 | |
158359264 | nbhakar | C | May 25, 2022, 7:06 a.m. | OK | Java 11 | TESTS | 7 | 202 | 0 | 1200 | |
158315940 | sf14t | C | May 24, 2022, 3:58 p.m. | OK | Java 11 | TESTS | 7 | 202 | 0 | 1200 | |
158407207 | coderama | C | May 25, 2022, 4:14 p.m. | OK | Java 8 | TESTS | 7 | 78 | 0 | 1200 | |
158281884 | Dhananjay22 | C | May 24, 2022, 9:12 a.m. | OK | Java 8 | TESTS | 7 | 78 | 0 | 1200 | |
158295256 | roctes7 | C | May 24, 2022, 12:07 p.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | 1200 | |
158404334 | KhadijaBadrawy | C | May 25, 2022, 3:42 p.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | 1200 | |
158382101 | swarup_312 | C | May 25, 2022, 11:18 a.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | 1200 | |
158267494 | CodingJatt | C | May 24, 2022, 5:50 a.m. | OK | Java 8 | TESTS | 7 | 93 | 0 | 1200 | |
158352828 | aryaman_571 | C | May 25, 2022, 5:36 a.m. | OK | Java 8 | TESTS | 7 | 108 | 0 | 1200 | |
158346876 | Zicode | C | May 25, 2022, 3:29 a.m. | OK | Java 8 | TESTS | 7 | 108 | 0 | 1200 | |
158339282 | dev_14 | C | May 24, 2022, 10:34 p.m. | OK | Java 8 | TESTS | 7 | 108 | 0 | 1200 | |
158267124 | CrinklyGolem | C | May 24, 2022, 5:45 a.m. | OK | Java 8 | TESTS | 7 | 108 | 0 | 1200 | |
158506046 | BruteForcee | C | May 26, 2022, 8:26 a.m. | OK | Kotlin 1.4 | TESTS | 7 | 124 | 1228800 | 1200 | |
158328471 | Saeed.Afshari | C | May 24, 2022, 6:27 p.m. | OK | Kotlin 1.6 | TESTS | 7 | 312 | 4505600 | 1200 | |
158279581 | kitbuilder | C | May 24, 2022, 8:43 a.m. | OK | MS C++ 2017 | TESTS | 7 | 15 | 0 | 1200 | |
158390635 | Still_Theory | C | May 25, 2022, 1:01 p.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 0 | 1200 | |
158347593 | mnrmustafa | C | May 25, 2022, 3:50 a.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 0 | 1200 | |
158292621 | Pigeon_ | C | May 24, 2022, 11:35 a.m. | OK | MS C++ 2017 | TESTS | 7 | 31 | 0 | 1200 | |
158323351 | Hamo123 | C | May 24, 2022, 5:23 p.m. | OK | MS C++ 2017 | TESTS | 7 | 46 | 1638400 | 1200 | |
158285206 | Rishikant24 | C | May 24, 2022, 9:59 a.m. | OK | MS C++ 2017 | TESTS | 7 | 61 | 1638400 | 1200 | |
158383017 | bkifhr8 | C | May 25, 2022, 11:29 a.m. | OK | MS C++ 2017 | TESTS | 7 | 124 | 102400 | 1200 | |
158389535 | diajutcum | C | May 25, 2022, 12:49 p.m. | OK | MS C++ 2017 | TESTS | 7 | 124 | 3174400 | 1200 | |
158314610 | De_nis | C | May 24, 2022, 3:44 p.m. | OK | MS C++ 2017 | TESTS | 7 | 140 | 204800 | 1200 | |
158386498 | bkifhr10 | C | May 25, 2022, 12:12 p.m. | OK | MS C++ 2017 | TESTS | 7 | 140 | 1740800 | 1200 | |
158308915 | Inspired | C | May 24, 2022, 2:41 p.m. | OK | Node.js | TESTS | 7 | 77 | 2560000 | 1200 | |
158577196 | chinesedfan | C | May 27, 2022, 3:34 a.m. | OK | Node.js | TESTS | 7 | 171 | 19865600 | 1200 | |
158574227 | zkoong | C | May 27, 2022, 2:07 a.m. | OK | Node.js | TESTS | 7 | 311 | 46796800 | 1200 | |
158282486 | yoralbayev | C | May 24, 2022, 9:20 a.m. | OK | PHP | TESTS | 7 | 280 | 614400 | 1200 | |
158270266 | n.n.n.kz | C | May 24, 2022, 6:30 a.m. | OK | PHP | TESTS | 7 | 1637 | 0 | 1200 | |
158530508 | YMSeah | C | May 26, 2022, 1:13 p.m. | OK | PyPy 3 | TESTS | 7 | 124 | 4096000 | 1200 | |
158267853 | pranay_28 | C | May 24, 2022, 5:56 a.m. | OK | PyPy 3 | TESTS | 7 | 124 | 5529600 | 1200 | |
158353261 | manohar2509 | C | May 25, 2022, 5:42 a.m. | OK | PyPy 3 | TESTS | 7 | 155 | 4710400 | 1200 | |
158571127 | jscn | C | May 27, 2022, 12:04 a.m. | OK | PyPy 3 | TESTS | 7 | 170 | 4403200 | 1200 | |
158487967 | mkawa2 | C | May 26, 2022, 4:11 a.m. | OK | PyPy 3 | TESTS | 7 | 202 | 8294400 | 1200 | |
158370039 | mmooyyii | C | May 25, 2022, 9:07 a.m. | OK | PyPy 3 | TESTS | 7 | 217 | 8704000 | 1200 | |
158301086 | alina.v.novoselova | C | May 24, 2022, 1:15 p.m. | OK | PyPy 3 | TESTS | 7 | 638 | 11161600 | 1200 | |
158298311 | alina.v.novoselova | C | May 24, 2022, 12:44 p.m. | OK | PyPy 3 | TESTS | 7 | 639 | 10956800 | 1200 | |
158312213 | abeni5049 | C | May 24, 2022, 3:17 p.m. | OK | PyPy 3 | TESTS | 7 | 639 | 11059200 | 1200 | |
158301933 | alina.v.novoselova | C | May 24, 2022, 1:25 p.m. | OK | PyPy 3 | TESTS | 7 | 654 | 10956800 | 1200 | |
158277222 | _N_0_0_B_ | C | May 24, 2022, 8:12 a.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 7372800 | 1200 | |
158314107 | Amay12 | C | May 24, 2022, 3:39 p.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 7577600 | 1200 | |
158333693 | Akbar_23 | C | May 24, 2022, 7:55 p.m. | OK | PyPy 3-64 | TESTS | 7 | 93 | 9318400 | 1200 | |
158330748 | sp_Piyush | C | May 24, 2022, 7:01 p.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 7577600 | 1200 | |
158269108 | toam | C | May 24, 2022, 6:14 a.m. | OK | PyPy 3-64 | TESTS | 7 | 109 | 9318400 | 1200 | |
158295799 | dryeab | C | May 24, 2022, 12:14 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 8192000 | 1200 | |
158289529 | tushar26427 | C | May 24, 2022, 10:58 a.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 9216000 | 1200 | |
158279235 | only_for_kav_tripathi | C | May 24, 2022, 8:39 a.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 9318400 | 1200 | |
158312867 | ossau_guildo | C | May 24, 2022, 3:24 p.m. | OK | PyPy 3-64 | TESTS | 7 | 124 | 14131200 | 1200 | |
158272031 | nicku123 | C | May 24, 2022, 6:59 a.m. | OK | PyPy 3-64 | TESTS | 7 | 140 | 9113600 | 1200 | |
158351754 | Flanture | C | May 25, 2022, 5:19 a.m. | OK | Python 3 | TESTS | 7 | 108 | 0 | 1200 | |
158313920 | Amay12 | C | May 24, 2022, 3:36 p.m. | OK | Python 3 | TESTS | 7 | 108 | 102400 | 1200 | |
158406925 | iska_terminator | C | May 25, 2022, 4:10 p.m. | OK | Python 3 | TESTS | 7 | 109 | 0 | 1200 | |
158384218 | IManifold | C | May 25, 2022, 11:44 a.m. | OK | Python 3 | TESTS | 7 | 109 | 0 | 1200 | |
158382734 | jiangjiashi | C | May 25, 2022, 11:26 a.m. | OK | Python 3 | TESTS | 7 | 187 | 0 | 1200 | |
158302688 | sushant_7580 | C | May 24, 2022, 1:33 p.m. | OK | Python 3 | TESTS | 7 | 249 | 0 | 1200 | |
158282997 | shurick | C | May 24, 2022, 9:26 a.m. | OK | Python 3 | TESTS | 7 | 1076 | 512000 | 1200 | |
158298179 | codemakerself | C | May 24, 2022, 12:42 p.m. | OK | Python 3 | TESTS | 7 | 1185 | 0 | 1200 | |
158343333 | husnain | C | May 25, 2022, 1:46 a.m. | OK | Python 3 | TESTS | 7 | 1341 | 716800 | 1200 | |
158282978 | Muhammad.Daniyal | C | May 24, 2022, 9:26 a.m. | OK | Python 3 | TESTS | 7 | 1403 | 307200 | 1200 | |
158348649 | Spheniscine | C | May 25, 2022, 4:18 a.m. | OK | Rust 2021 | TESTS | 7 | 15 | 102400 | 1200 | |
158356511 | Russell_Emerine | C | May 25, 2022, 6:30 a.m. | OK | Rust 2021 | TESTS | 7 | 15 | 307200 | 1200 | |
158290780 | Hyrulia | C | May 24, 2022, 11:13 a.m. | OK | Rust 2021 | TESTS | 7 | 15 | 307200 | 1200 | |
158299412 | Hyrulia | C | May 24, 2022, 12:56 p.m. | OK | Rust 2021 | TESTS | 7 | 15 | 614400 | 1200 | |
158514469 | O0oo0Oo0OO0O0 | C | May 26, 2022, 10:14 a.m. | OK | Rust 2021 | TESTS | 7 | 30 | 307200 | 1200 | |
158291353 | Hyrulia | C | May 24, 2022, 11:20 a.m. | OK | Rust 2021 | TESTS | 7 | 30 | 819200 | 1200 | |
158291324 | Hyrulia | C | May 24, 2022, 11:20 a.m. | OK | Rust 2021 | TESTS | 7 | 30 | 819200 | 1200 | |
158291283 | Hyrulia | C | May 24, 2022, 11:19 a.m. | OK | Rust 2021 | TESTS | 7 | 31 | 307200 | 1200 | |
158515164 | O0oo0Oo0OO0O0 | C | May 26, 2022, 10:23 a.m. | OK | Rust 2021 | TESTS | 7 | 31 | 819200 | 1200 | |
158299177 | Hyrulia | C | May 24, 2022, 12:54 p.m. | OK | Rust 2021 | TESTS | 7 | 31 | 1331200 | 1200 |
Back to search problems