Codeforces Global Round 20

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
1672 Codeforces Global Round 20 FINISHED False 10800 81100499 April 23, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6298 ) D Cyclic Rotation PROGRAMMING constructive algorithms greedy implementation two pointers 1700

B'There is an array a of length n . You may perform the following operation any number of times: You are also given another array b of length n which is a permutation of a . Determine whether it is possible to transform array a into an array b using the above operation some number of times. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains an integer n ( 1 <= n <= 2 cdot 10 ^ 5 ) -- the length of array a and b . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ) -- elements of the array a . The third line of each test case contains n integers b_1, b_2, ldots, b_n ( 1 <= b_i <= n ) -- elements of the array b . It is guaranteed that b is a permutation of a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10 ^ 5 For each test case, print "YES" (without quotes) if it is possible to transform array a to b , and "NO" (without quotes) otherwise. You can output "YES" and "NO" in any case (for example, strings "yEs", "yes" and "Yes" will be recognized as a positive response). In the first test case, we can choose l=2 and r=5 to form [1, 3, 3, 2, 2] . In the second test case, we can choose l=2 and r=4 to form [1, 4, 2, 2, 1] . Then, we can choose l=1 and r=5 to form [4, 2, 2, 1, 1] . In the third test case, it can be proven that it is not possible to transform array a to b using the operation. '...

Tutorials

Global Round 20 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
154864673 rainboy D April 24, 2022, 2:53 p.m. OK GNU C11 TESTS 10 93 2457600 1700
154795489 AstralLing D April 23, 2022, 11:17 p.m. OK GNU C++14 TESTS 10 31 4505600 1700
154789527 Jonothor_Darry D April 23, 2022, 8:59 p.m. OK GNU C++14 TESTS 10 62 17817600 1700
154833032 Duy_e D April 24, 2022, 9:38 a.m. OK GNU C++14 TESTS 10 78 2457600 1700
154807614 XueYJ D April 24, 2022, 4:30 a.m. OK GNU C++14 TESTS 10 78 2457600 1700
154774156 Duy_e D April 23, 2022, 5:33 p.m. OK GNU C++14 TESTS 10 78 2457600 1700
154822813 Liang2003 D April 24, 2022, 7:46 a.m. OK GNU C++14 TESTS 10 78 2764800 1700
154822174 syyyl D April 24, 2022, 7:39 a.m. OK GNU C++14 TESTS 10 78 3584000 1700
154790799 daniyarello D April 23, 2022, 9:24 p.m. OK GNU C++14 TESTS 10 78 5427200 1700
154809054 aaforce202 D April 24, 2022, 4:59 a.m. OK GNU C++14 TESTS 10 93 2355200 1700
154846320 QuantAsk D April 24, 2022, 11:54 a.m. OK GNU C++14 TESTS 10 93 2355200 1700
154795785 et3_tsy3.0 D April 23, 2022, 11:27 p.m. OK GNU C++17 TESTS 10 15 2560000 1700
154800840 tsy123456 D April 24, 2022, 2 a.m. OK GNU C++17 TESTS 10 62 2355200 1700
154852978 gz04 D April 24, 2022, 12:54 p.m. OK GNU C++17 TESTS 10 78 2355200 1700
154889173 Anchord D April 24, 2022, 8:41 p.m. OK GNU C++17 TESTS 10 78 2457600 1700
154859743 Blueberry_1 D April 24, 2022, 2 p.m. OK GNU C++17 TESTS 10 78 2457600 1700
154820425 lissl123 D April 24, 2022, 7:21 a.m. OK GNU C++17 TESTS 10 78 2457600 1700
154902306 smlj D April 25, 2022, 4:08 a.m. OK GNU C++17 TESTS 10 78 2457600 1700
154805633 Queens1de D April 24, 2022, 3:49 a.m. OK GNU C++17 TESTS 10 78 2457600 1700
154784828 Graphter D April 23, 2022, 7:41 p.m. OK GNU C++17 TESTS 10 78 2457600 1700
154811264 Rajasik D April 24, 2022, 5:29 a.m. OK GNU C++17 TESTS 10 78 2457600 1700
154827746 Ahaooops D April 24, 2022, 8:41 a.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154902835 est_stella D April 25, 2022, 4:21 a.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154883761 ILoveSashaBlouse D April 24, 2022, 7:01 p.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154827112 Leonard D April 24, 2022, 8:34 a.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154800183 Retired_Isaunoya D April 24, 2022, 1:43 a.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154799468 Artemis_Bow D April 24, 2022, 1:22 a.m. OK GNU C++17 (64) TESTS 10 46 2457600 1700
154821092 linxd D April 24, 2022, 7:28 a.m. OK GNU C++17 (64) TESTS 10 46 2560000 1700
154780687 Lucina D April 23, 2022, 6:40 p.m. OK GNU C++17 (64) TESTS 10 46 3891200 1700
154815840 G_LX D April 24, 2022, 6:29 a.m. OK GNU C++17 (64) TESTS 10 46 8908800 1700
154836059 nohaxjustsoflo D April 24, 2022, 10:13 a.m. OK GNU C++17 (64) TESTS 10 46 12595200 1700
154882305 luca0929 D April 24, 2022, 6:35 p.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154870073 cosenza D April 24, 2022, 3:49 p.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154836759 timreizin D April 24, 2022, 10:22 a.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154835446 aspireboy D April 24, 2022, 10:06 a.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154831238 innocent_SINNER D April 24, 2022, 9:17 a.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154829354 abotaha23 D April 24, 2022, 8:56 a.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154860219 NK_ D April 24, 2022, 2:05 p.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154907450 don2001 D April 25, 2022, 5:57 a.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154883542 Srbmaury D April 24, 2022, 6:56 p.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154882318 luca0929 D April 24, 2022, 6:35 p.m. OK GNU C++20 (64) TESTS 10 46 2457600 1700
154904860 gaju321 D April 25, 2022, 5:04 a.m. OK Java 11 TESTS 10 202 0 1700
154904713 gaju321 D April 25, 2022, 5:01 a.m. OK Java 11 TESTS 10 217 0 1700
154786594 Restricted D April 23, 2022, 8:09 p.m. OK Java 11 TESTS 10 217 0 1700
154822817 _ryan18_ D April 24, 2022, 7:46 a.m. OK Java 11 TESTS 10 218 0 1700
154775578 AndreySiunov D April 23, 2022, 5:44 p.m. OK Java 11 TESTS 10 233 0 1700
154779344 The_terminator D April 23, 2022, 6:23 p.m. OK Java 11 TESTS 10 234 0 1700
154849223 eshan18.09 D April 24, 2022, 12:19 p.m. OK Java 11 TESTS 10 249 921600 1700
154799937 lucasr D April 24, 2022, 1:35 a.m. OK Java 11 TESTS 10 249 8089600 1700
154823667 1364354238zxd D April 24, 2022, 7:56 a.m. OK Java 11 TESTS 10 265 0 1700
154819056 Hrufnarwa D April 24, 2022, 7:07 a.m. OK Java 11 TESTS 10 373 15667200 1700
154828698 Sachin_2961 D April 24, 2022, 8:49 a.m. OK Java 8 TESTS 10 109 0 1700
154783508 ND_ D April 23, 2022, 7:21 p.m. OK Java 8 TESTS 10 124 4198400 1700
154789705 leonlian D April 23, 2022, 9:03 p.m. OK Java 8 TESTS 10 140 5632000 1700
154877029 invincible777 D April 24, 2022, 5:15 p.m. OK Java 8 TESTS 10 156 9216000 1700
154783546 ND_ D April 23, 2022, 7:21 p.m. OK Java 8 TESTS 10 186 4096000 1700
154786034 Swapniltri D April 23, 2022, 8 p.m. OK Java 8 TESTS 10 187 8089600 1700
154783576 ND_ D April 23, 2022, 7:22 p.m. OK Java 8 TESTS 10 202 4096000 1700
154788395 ziduoyi D April 23, 2022, 8:40 p.m. OK Java 8 TESTS 10 217 5632000 1700
154791019 O_E D April 23, 2022, 9:28 p.m. OK Java 8 TESTS 10 280 30924800 1700
154789213 darkl0rd D April 23, 2022, 8:54 p.m. OK Kotlin 1.6 TESTS 10 374 16486400 1700
154865016 AIdancer D April 24, 2022, 2:57 p.m. OK MS C++ 2017 TESTS 10 124 5324800 1700
154777856 aquatoria D April 23, 2022, 6:06 p.m. OK MS C++ 2017 TESTS 10 296 4505600 1700
154887524 wundersmith D April 24, 2022, 8:12 p.m. OK MS C++ 2017 TESTS 10 358 4915200 1700
154804860 CtrlACtrlV D April 24, 2022, 3:34 a.m. OK MS C++ 2017 TESTS 10 358 64204800 1700
154778126 acorn11 D April 23, 2022, 6:09 p.m. OK PyPy 2 TESTS 10 389 16588800 1700
154787080 hxu10 D April 23, 2022, 8:18 p.m. OK PyPy 3 TESTS 10 170 20275200 1700
154805851 ruimina D April 24, 2022, 3:54 a.m. OK PyPy 3 TESTS 10 187 24473600 1700
154805636 ruimina D April 24, 2022, 3:49 a.m. OK PyPy 3 TESTS 10 202 24473600 1700
154805116 ruimina D April 24, 2022, 3:39 a.m. OK PyPy 3 TESTS 10 202 24473600 1700
154776896 abhijeet.panihar.cse20 D April 23, 2022, 5:56 p.m. OK PyPy 3 TESTS 10 202 24678400 1700
154776862 tryharda D April 23, 2022, 5:56 p.m. OK PyPy 3 TESTS 10 202 24678400 1700
154805025 lemiao12 D April 24, 2022, 3:37 a.m. OK PyPy 3 TESTS 10 202 25088000 1700
154805783 ruimina D April 24, 2022, 3:52 a.m. OK PyPy 3 TESTS 10 218 24473600 1700
154775945 KingMace D April 23, 2022, 5:47 p.m. OK PyPy 3 TESTS 10 296 26624000 1700
154884781 BingHa D April 24, 2022, 7:19 p.m. OK PyPy 3 TESTS 10 327 21401600 1700
154789081 IkshitG D April 23, 2022, 8:52 p.m. OK PyPy 3-64 TESTS 10 140 31948800 1700
154801805 chinerist D April 24, 2022, 2:24 a.m. OK PyPy 3-64 TESTS 10 140 32256000 1700
154780684 asdsasd D April 23, 2022, 6:40 p.m. OK PyPy 3-64 TESTS 10 155 32972800 1700
154779093 asdsasd D April 23, 2022, 6:20 p.m. OK PyPy 3-64 TESTS 10 155 34816000 1700
154779250 asdsasd D April 23, 2022, 6:22 p.m. OK PyPy 3-64 TESTS 10 171 34406400 1700
154773816 lemiao12 D April 23, 2022, 5:31 p.m. OK PyPy 3-64 TESTS 10 171 40243200 1700
154774166 lemiao12 D April 23, 2022, 5:33 p.m. OK PyPy 3-64 TESTS 10 186 40243200 1700
154850907 kritarth21 D April 24, 2022, 12:35 p.m. OK PyPy 3-64 TESTS 10 187 44032000 1700
154839947 Nemisis2.O D April 24, 2022, 11:01 a.m. OK PyPy 3-64 TESTS 10 202 36147200 1700
154839806 rivnam D April 24, 2022, 10:59 a.m. OK PyPy 3-64 TESTS 10 202 36147200 1700
154778022 Jimanbanashi D April 23, 2022, 6:08 p.m. OK Python 2 TESTS 10 436 24268800 1700
154776772 shkaal D April 23, 2022, 5:55 p.m. OK Python 3 TESTS 10 249 17612800 1700

remove filters

Back to search problems