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 86457263 April 23, 2022, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 831 ) F2 Checker for Array Shuffling PROGRAMMING constructive algorithms dfs and similar graphs 2800

B'oolimry has an array a of length n which he really likes. Today, you have changed his array to b , a permutation of a , to make him sad. Because oolimry is only a duck, he can only perform the following operation to restore his array: The sadness of the array b is the minimum number of operations needed to transform b into a . Given the arrays a and b , where b is a permutation of a , determine if b has the maximum sadness over all permutations of a . 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 a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_i <= q n ) -- the elements of the array a . The third line of each test case contains n integers b_1, b_2, ldots, b_n ( 1 <= q b_i <= q n ) -- the 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 "AC" (without quotes) if b has the maximum sadness over all permutations of a , and "WA" (without quotes) otherwise. In the first test case, the array [1,2] has sadness 1 . We can transform [1,2] into [2,1] using one operation with (i,j)=(1,2) . In the second test case, the array [3,3,2,1] has sadness 2 . We can transform [3,3,2,1] into [1,2,3,3] with two operations with (i,j)=(1,4) and (i,j)=(2,3) respectively. In the third test case, the array [2,1] has sadness 0 . In the fourth test case, the array [3,2,3,1] has sadness 1 . '...

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
154863455 rainboy F2 April 24, 2022, 2:40 p.m. OK GNU C11 TESTS 22 109 13824000 2800
154801644 AstralLing F2 April 24, 2022, 2:21 a.m. OK GNU C++14 TESTS 22 78 21606400 2800
154896842 KING_OF_TURTLE F2 April 25, 2022, 1:38 a.m. OK GNU C++14 TESTS 22 109 8294400 2800
154813675 XueYJ F2 April 24, 2022, 6:01 a.m. OK GNU C++14 TESTS 22 109 10956800 2800
154897395 LZDQ F2 April 25, 2022, 2:12 a.m. OK GNU C++14 TESTS 22 109 11980800 2800
154803497 Eric_hooo F2 April 24, 2022, 3:03 a.m. OK GNU C++14 TESTS 22 124 9011200 2800
154811904 Aokana F2 April 24, 2022, 5:38 a.m. OK GNU C++14 TESTS 22 124 11571200 2800
154802181 happyguy656 F2 April 24, 2022, 2:34 a.m. OK GNU C++14 TESTS 22 124 13312000 2800
154819894 Chinese_zjc_ F2 April 24, 2022, 7:16 a.m. OK GNU C++14 TESTS 22 124 14745600 2800
154816269 qinzhaoyang F2 April 24, 2022, 6:34 a.m. OK GNU C++14 TESTS 22 124 21196800 2800
154778071 Potassium F2 April 23, 2022, 6:08 p.m. OK GNU C++14 TESTS 22 124 23347200 2800
154783232 rajkon F2 April 23, 2022, 7:17 p.m. OK GNU C++17 TESTS 22 124 8192000 2800
154814991 Fairy_Tale F2 April 24, 2022, 6:19 a.m. OK GNU C++17 TESTS 22 124 8192000 2800
154778536 abc864197532 F2 April 23, 2022, 6:14 p.m. OK GNU C++17 TESTS 22 124 9011200 2800
154774461 Tc14 F2 April 23, 2022, 5:36 p.m. OK GNU C++17 TESTS 22 124 9011200 2800
154853981 pippeladins F2 April 24, 2022, 1:04 p.m. OK GNU C++17 TESTS 22 124 9011200 2800
154808164 OGname F2 April 24, 2022, 4:42 a.m. OK GNU C++17 TESTS 22 124 10649600 2800
154802395 yuto1115 F2 April 24, 2022, 2:39 a.m. OK GNU C++17 TESTS 22 124 11161600 2800
154810600 crh_pro F2 April 24, 2022, 5:20 a.m. OK GNU C++17 TESTS 22 139 13926400 2800
154866914 anpoli99 F2 April 24, 2022, 3:18 p.m. OK GNU C++17 TESTS 22 139 14848000 2800
154851559 Tinky1224 F2 April 24, 2022, 12:41 p.m. OK GNU C++17 TESTS 22 139 21708800 2800
154897146 CE_WA_TLE F2 April 25, 2022, 2:05 a.m. OK GNU C++17 (64) TESTS 22 46 62464000 2800
154817170 slenbol F2 April 24, 2022, 6:45 a.m. OK GNU C++17 (64) TESTS 22 93 8192000 2800
154801557 Retired_Isaunoya F2 April 24, 2022, 2:18 a.m. OK GNU C++17 (64) TESTS 22 93 11468800 2800
154827483 MAOoo_Love_Molly F2 April 24, 2022, 8:38 a.m. OK GNU C++17 (64) TESTS 22 93 13414400 2800
154859872 enslaved F2 April 24, 2022, 2:02 p.m. OK GNU C++17 (64) TESTS 22 108 12083200 2800
154800106 tyin F2 April 24, 2022, 1:40 a.m. OK GNU C++17 (64) TESTS 22 109 11468800 2800
154802571 xyf007 F2 April 24, 2022, 2:43 a.m. OK GNU C++17 (64) TESTS 22 109 11673600 2800
154868494 F_know F2 April 24, 2022, 3:35 p.m. OK GNU C++17 (64) TESTS 22 109 15769600 2800
154795242 tsukiko_tsutsukakushi F2 April 23, 2022, 11:09 p.m. OK GNU C++17 (64) TESTS 22 109 16896000 2800
154777940 errorgorn F2 April 23, 2022, 6:07 p.m. OK GNU C++17 (64) TESTS 22 109 26009600 2800
154799480 Tyyyyyy F2 April 24, 2022, 1:22 a.m. OK GNU C++20 (64) TESTS 22 61 26419200 2800
154820692 zmwang F2 April 24, 2022, 7:23 a.m. OK GNU C++20 (64) TESTS 22 77 79155200 2800
154854471 fcw F2 April 24, 2022, 1:09 p.m. OK GNU C++20 (64) TESTS 22 78 11468800 2800
154834533 atodo F2 April 24, 2022, 9:55 a.m. OK GNU C++20 (64) TESTS 22 93 10649600 2800
154824206 DivQ F2 April 24, 2022, 8:02 a.m. OK GNU C++20 (64) TESTS 22 93 11468800 2800
154779716 A_G F2 April 23, 2022, 6:27 p.m. OK GNU C++20 (64) TESTS 22 93 13414400 2800
154820409 erray F2 April 24, 2022, 7:21 a.m. OK GNU C++20 (64) TESTS 22 93 13414400 2800
154810241 Gary2005 F2 April 24, 2022, 5:15 a.m. OK GNU C++20 (64) TESTS 22 93 15974400 2800
154840777 njwrz F2 April 24, 2022, 11:09 a.m. OK GNU C++20 (64) TESTS 22 93 16793600 2800
154886830 Ivan_len F2 April 24, 2022, 7:58 p.m. OK GNU C++20 (64) TESTS 22 93 25600000 2800
154778397 SecondThread F2 April 23, 2022, 6:12 p.m. OK Java 8 TESTS 22 420 106086400 2800
154836183 XYShaoKang F2 April 24, 2022, 10:15 a.m. OK Node.js TESTS 22 685 66457600 2800
154792189 eepsilon F2 April 23, 2022, 9:52 p.m. OK PyPy 3 TESTS 22 420 25600000 2800

remove filters

Back to search problems