Codeforces Round 899 (Div. 2)

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
1882 Codeforces Round 899 (Div. 2) FINISHED False 7200 41527463 Sept. 25, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1053 ) E1 Two Permutations (Easy Version) PROGRAMMING brute force constructive algorithms greedy number theory

B'This is the easy version of the problem. The difference between the two versions is that you do not have to minimize the number of operations in this version. You can make hacks only if both versions of the problem are solved. You have two permutations ^{ dagger} p_{1}, p_{2}, ldots, p_{n} (of integers 1 to n ) and q_{1}, q_{2}, ldots, q_{m} (of integers 1 to m ). Initially p_{i}=a_{i} for i=1, 2, ldots, n , and q_{j} = b_{j} for j = 1, 2, ldots, m . You can apply the following operation on the permutations several (possibly, zero) times. In one operation, p and q will change according to the following three steps: Your goal is to simultaneously make p_{i}=i for i=1, 2, ldots, n , and q_{j} = j for j = 1, 2, ldots, m . Find any valid way to achieve the goal using at most 10 ,000 operations, or say that none exists. Please note that you do not have to minimize the number of operations. It can be proved that if it is possible to achieve the goal, then there exists a way to do so using at most 10 ,000 operations. ^{ dagger} A permutation of length k is an array consisting of k distinct integers from 1 to k in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array), and [1,3,4] is also not a permutation ( k=3 but there is 4 in the array). The first line contains two integers n and m ( 1 <= n, m <= 2500 ). The second line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= n ). The third line contains m integers b_1, b_2, ldots, b_m ( 1 <= b_i <= m ). It is guaranteed that a and b are permutations. If there is no solution, print a single integer -1 . Otherwise, print an integer k ( 0 <= k <= 10 ,000 ) -- the number of operations to'...

Tutorials

Codeforces Round 899 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
225164089 pnlong2706 E1 Sept. 25, 2023, 5:50 p.m. OK GNU C++14 TESTS 67 30 307200
225148992 xkcdjerry E1 Sept. 25, 2023, 4:21 p.m. OK GNU C++14 TESTS 66 31 102400
225147512 Muelsyse_sep002 E1 Sept. 25, 2023, 4:17 p.m. OK GNU C++14 TESTS 66 31 102400
225196314 fangzhijina2020 E1 Sept. 26, 2023, 1:57 a.m. OK GNU C++14 TESTS 67 31 819200
225205013 ouuuyuuu E1 Sept. 26, 2023, 4:14 a.m. OK GNU C++14 TESTS 67 46 102400
225157256 Sqrtyz E1 Sept. 25, 2023, 5:07 p.m. OK GNU C++14 TESTS 66 46 102400
225152376 wjk123 E1 Sept. 25, 2023, 4:30 p.m. OK GNU C++14 TESTS 66 46 102400
225153668 vegetable_he E1 Sept. 25, 2023, 4:33 p.m. OK GNU C++14 TESTS 66 46 307200
225152549 Anasui E1 Sept. 25, 2023, 4:30 p.m. OK GNU C++14 TESTS 66 46 307200
225149340 optimize_2 E1 Sept. 25, 2023, 4:22 p.m. OK GNU C++14 TESTS 66 46 6553600
225178315 darshak_03 E1 Sept. 25, 2023, 8:04 p.m. OK GNU C++17 TESTS 67 30 512000
225160085 ElDiablo E1 Sept. 25, 2023, 5:22 p.m. OK GNU C++17 TESTS 67 30 512000
225190824 Macrosteam E1 Sept. 26, 2023, 12:04 a.m. OK GNU C++17 TESTS 67 31 204800
225180420 pavlukivan E1 Sept. 25, 2023, 8:30 p.m. OK GNU C++17 TESTS 67 31 307200
225173575 Yzm007 E1 Sept. 25, 2023, 7:13 p.m. OK GNU C++17 TESTS 67 31 409600
225191311 FzArK E1 Sept. 26, 2023, 12:17 a.m. OK GNU C++17 TESTS 67 31 512000
225151697 applese E1 Sept. 25, 2023, 4:28 p.m. OK GNU C++17 TESTS 66 31 716800
225191233 FzArK E1 Sept. 26, 2023, 12:15 a.m. OK GNU C++17 TESTS 67 31 819200
225150823 adman666 E1 Sept. 25, 2023, 4:26 p.m. OK GNU C++17 TESTS 66 46 102400
225153744 aaronkim00 E1 Sept. 25, 2023, 4:33 p.m. OK GNU C++17 TESTS 66 46 307200
225153220 Z_i_X E1 Sept. 25, 2023, 4:32 p.m. OK GNU C++17 (64) TESTS 66 15 307200
225197158 zhensuan E1 Sept. 26, 2023, 2:12 a.m. OK GNU C++17 (64) TESTS 67 15 614400
225163538 real_Godot E1 Sept. 25, 2023, 5:47 p.m. OK GNU C++17 (64) TESTS 67 31 1843200
225207895 bblyyds E1 Sept. 26, 2023, 5:01 a.m. OK GNU C++17 (64) TESTS 67 31 3993600
225169465 Chifwin E1 Sept. 25, 2023, 6:34 p.m. OK GNU C++17 (64) TESTS 67 31 18534400
225197082 1-96 E1 Sept. 26, 2023, 2:10 a.m. OK GNU C++17 (64) TESTS 67 46 102400
225193506 gqf123 E1 Sept. 26, 2023, 1:04 a.m. OK GNU C++17 (64) TESTS 67 46 307200
225190106 enslaved E1 Sept. 25, 2023, 11:44 p.m. OK GNU C++17 (64) TESTS 67 46 307200
225149617 yangjl E1 Sept. 25, 2023, 4:23 p.m. OK GNU C++17 (64) TESTS 66 46 4198400
225191544 jdurie E1 Sept. 26, 2023, 12:23 a.m. OK GNU C++17 (64) TESTS 67 46 5017600
225204845 dtta E1 Sept. 26, 2023, 4:11 a.m. OK GNU C++20 (64) TESTS 67 15 307200
225180788 Aadey_Shah E1 Sept. 25, 2023, 8:35 p.m. OK GNU C++20 (64) TESTS 67 15 307200
225180026 ppps E1 Sept. 25, 2023, 8:25 p.m. OK GNU C++20 (64) TESTS 67 15 307200
225161935 Jerry20110434 E1 Sept. 25, 2023, 5:35 p.m. OK GNU C++20 (64) TESTS 67 15 307200
225206646 pacha2880 E1 Sept. 26, 2023, 4:41 a.m. OK GNU C++20 (64) TESTS 67 15 409600
225200533 Aicu E1 Sept. 26, 2023, 3:05 a.m. OK GNU C++20 (64) TESTS 67 15 512000
225162473 genf E1 Sept. 25, 2023, 5:39 p.m. OK GNU C++20 (64) TESTS 67 15 614400
225190603 enzopsm E1 Sept. 25, 2023, 11:58 p.m. OK GNU C++20 (64) TESTS 67 15 32153600
225207108 olwvnnt E1 Sept. 26, 2023, 4:48 a.m. OK GNU C++20 (64) TESTS 67 31 102400
225205878 edisnimorF E1 Sept. 26, 2023, 4:29 a.m. OK GNU C++20 (64) TESTS 67 31 102400
225173258 TCchen E1 Sept. 25, 2023, 7:10 p.m. OK Java 11 TESTS 67 264 0
225159360 a3g1s E1 Sept. 25, 2023, 5:17 p.m. OK Java 8 TESTS 66 171 0
225194521 cc4414 E1 Sept. 26, 2023, 1:23 a.m. OK Java 8 TESTS 67 202 0
225153964 ezahid1662 E1 Sept. 25, 2023, 4:34 p.m. OK PyPy 3 TESTS 66 186 9523200
225178082 DottedCalculator E1 Sept. 25, 2023, 8:02 p.m. OK PyPy 3-64 TESTS 67 109 7987200
225150585 plevande E1 Sept. 25, 2023, 4:25 p.m. OK PyPy 3-64 TESTS 66 202 9728000
225199449 yuki_keshiki E1 Sept. 26, 2023, 2:48 a.m. OK PyPy 3-64 TESTS 67 202 10137600
225147136 toam E1 Sept. 25, 2023, 4:16 p.m. OK PyPy 3-64 TESTS 66 218 9932800
225176840 codicon E1 Sept. 25, 2023, 7:47 p.m. OK PyPy 3-64 TESTS 67 233 10137600
225177190 codicon E1 Sept. 25, 2023, 7:51 p.m. OK PyPy 3-64 TESTS 67 248 10137600
225187337 raideva E1 Sept. 25, 2023, 10:28 p.m. OK PyPy 3-64 TESTS 67 249 15872000

remove filters

Back to search problems