CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!)

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
1896 CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 9000 30899399 Nov. 25, 2023, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9748 ) C Matching Arrays PROGRAMMING binary search constructive algorithms greedy sortings

B'You are given two arrays a and b of size n . The beauty of the arrays a and b is the number of indices i such that a_i > b_i . You are also given an integer x . Determine whether it is possible to rearrange the elements of b such that the beauty of the arrays becomes x . If it is possible, output one valid rearrangement of b . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n and x ( 1 <= n <= 2 cdot 10^5 , 0 <= x <= n ) -- the size of arrays a and b and the desired beauty of the arrays. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 2n ) -- the elements of array a . The third line of each test case contains n integers b_1, b_2, ldots, b_n ( 1 <= b_i <= 2n ) -- the elements of array b . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output "NO" if it is not possible to rearrange b to make the beauty of the arrays equal to x . Otherwise, output "YES". Then, on the next line, output n integers which represent the rearrangement of b . If there are multiple solutions, you may output any of them. You can output "YES" and "NO" in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses. In test cases 1 and 2, the beauty of the arrays has to be 0 since a_1 = 1 <= 2 = b_1 . In test cases 3, 4, 5 and 6, the only possible beauty of the arrays is x = 1 and x = 2 . In particular, if b is rearranged to [2, 4, 1] , then a_3 = 3 > 1 = b_3 , so the beauty of the arrays is 1 . If b is kept in the same order a'...

Tutorials

CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
234328143 Anastasiya_Andreevna C Nov. 25, 2023, 8:23 p.m. OK C# 10 TESTS 10 1247 92160000
234334518 NenadDapic C Nov. 25, 2023, 9:58 p.m. OK FPC TESTS 10 701 4915200
234353014 Luxinze C Nov. 26, 2023, 4:39 a.m. OK GNU C++14 TESTS 10 140 3174400
234319009 osvarp C Nov. 25, 2023, 6:36 p.m. OK GNU C++14 TESTS 10 140 3993600
234350018 Lyhhhh C Nov. 26, 2023, 3:47 a.m. OK GNU C++14 TESTS 10 155 3174400
234346694 ccsu_zx C Nov. 26, 2023, 2:44 a.m. OK GNU C++14 TESTS 10 155 3174400
234346106 lanzhu C Nov. 26, 2023, 2:33 a.m. OK GNU C++14 TESTS 10 155 3174400
234344708 Unk1ndled C Nov. 26, 2023, 2:04 a.m. OK GNU C++14 TESTS 10 155 3174400
234313615 TienDungz C Nov. 25, 2023, 5:54 p.m. OK GNU C++14 TESTS 10 155 3174400
234313265 BeYourSven C Nov. 25, 2023, 5:52 p.m. OK GNU C++14 TESTS 10 155 3174400
234302758 Jalali C Nov. 25, 2023, 4:58 p.m. OK GNU C++14 TESTS 10 155 3174400
234302714 Friday_night C Nov. 25, 2023, 4:58 p.m. OK GNU C++14 TESTS 10 155 3174400
234320976 nitvjudge4 C Nov. 25, 2023, 6:57 p.m. OK GNU C++17 TESTS 10 109 21811200
234342391 bgei69 C Nov. 26, 2023, 1:16 a.m. OK GNU C++17 TESTS 10 140 3174400
234316026 ericchen890 C Nov. 25, 2023, 6:09 p.m. OK GNU C++17 TESTS 10 140 3174400
234315900 2.16 C Nov. 25, 2023, 6:08 p.m. OK GNU C++17 TESTS 10 140 3174400
234295793 Ahmad_kreet C Nov. 25, 2023, 4:35 p.m. OK GNU C++17 TESTS 10 140 3584000
234349711 hypnotic___zzzZZ C Nov. 26, 2023, 3:42 a.m. OK GNU C++17 TESTS 10 140 3993600
234354769 Artinplanets C Nov. 26, 2023, 5:07 a.m. OK GNU C++17 TESTS 10 155 3174400
234353675 ken.kaneki C Nov. 26, 2023, 4:50 a.m. OK GNU C++17 TESTS 10 155 3174400
234353440 hypnotic___zzzZZ C Nov. 26, 2023, 4:46 a.m. OK GNU C++17 TESTS 10 155 3174400
234351277 LuOsIer C Nov. 26, 2023, 4:09 a.m. OK GNU C++17 TESTS 10 155 3174400
234325532 RohanC C Nov. 25, 2023, 7:49 p.m. OK GNU C++17 (64) TESTS 10 109 3174400
234296114 Jene1ht C Nov. 25, 2023, 4:36 p.m. OK GNU C++17 (64) TESTS 10 109 3993600
234339411 enslaved C Nov. 25, 2023, 11:48 p.m. OK GNU C++17 (64) TESTS 10 109 4812800
234305048 DinosaurSlayer C Nov. 25, 2023, 5:06 p.m. OK GNU C++17 (64) TESTS 10 109 7987200
234357801 alif_cse_ju C Nov. 26, 2023, 5:52 a.m. OK GNU C++17 (64) TESTS 10 124 3174400
234345020 harqwq C Nov. 26, 2023, 2:12 a.m. OK GNU C++17 (64) TESTS 10 124 3174400
234326032 ETK. C Nov. 25, 2023, 7:55 p.m. OK GNU C++17 (64) TESTS 10 124 3174400
234320095 ozneroL C Nov. 25, 2023, 6:47 p.m. OK GNU C++17 (64) TESTS 10 124 3174400
234312946 niraj.24 C Nov. 25, 2023, 5:51 p.m. OK GNU C++17 (64) TESTS 10 124 3174400
234297064 TsotneSV C Nov. 25, 2023, 4:39 p.m. OK GNU C++17 (64) TESTS 10 124 3174400
234303394 sami_nawshad85 C Nov. 25, 2023, 5:01 p.m. OK GNU C++20 (64) TESTS 10 78 3174400
234319780 karemo C Nov. 25, 2023, 6:44 p.m. OK GNU C++20 (64) TESTS 10 78 3276800
234350985 wendyasif C Nov. 26, 2023, 4:04 a.m. OK GNU C++20 (64) TESTS 10 78 4812800
234355639 gamejoye C Nov. 26, 2023, 5:20 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234355158 AgOH C Nov. 26, 2023, 5:13 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234354664 Ras_Vz C Nov. 26, 2023, 5:06 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234353444 Pratham_Shah10 C Nov. 26, 2023, 4:46 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234352880 solaidee C Nov. 26, 2023, 4:36 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234348188 Detach.. C Nov. 26, 2023, 3:15 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234346601 TanHaoXuan C Nov. 26, 2023, 2:42 a.m. OK GNU C++20 (64) TESTS 10 93 3174400
234292087 dannyshing C Nov. 25, 2023, 4:22 p.m. OK Java 11 TESTS 10 326 0
234301600 Edge_Tree C Nov. 25, 2023, 4:55 p.m. OK Java 11 TESTS 10 467 78438400
234292832 RahulAhuja2901 C Nov. 25, 2023, 4:24 p.m. OK Java 11 TESTS 10 888 76288000
234291556 Volkano C Nov. 25, 2023, 4:20 p.m. OK Java 11 TESTS 10 1154 147046400
234313512 kasiru_69 C Nov. 25, 2023, 5:53 p.m. OK Java 11 TESTS 10 1512 13414400
234291570 pranshupareek C Nov. 25, 2023, 4:20 p.m. OK Java 11 TESTS 10 1855 51814400
234299712 ALostSoul C Nov. 25, 2023, 4:48 p.m. OK Java 11 TESTS 10 1996 6963200
234324659 CutSandstone C Nov. 25, 2023, 7:40 p.m. OK Java 17 TESTS 10 358 7680000
234343250 alibaba C Nov. 26, 2023, 1:34 a.m. OK Java 17 TESTS 10 374 11264000
234352539 prateeksama2003 C Nov. 26, 2023, 4:30 a.m. OK Java 17 TESTS 10 405 9728000
234308927 Jagnath_Reddy C Nov. 25, 2023, 5:19 p.m. OK Java 17 TESTS 10 436 14950400
234351842 mehrotramanvendra C Nov. 26, 2023, 4:17 a.m. OK Java 17 TESTS 10 452 7372800
234326628 Nagendravarma C Nov. 25, 2023, 8:03 p.m. OK Java 17 TESTS 10 482 14438400
234319892 tirthgohil1410 C Nov. 25, 2023, 6:45 p.m. OK Java 17 TESTS 10 638 12902400
234353151 Xing_ke C Nov. 26, 2023, 4:41 a.m. OK Java 17 TESTS 10 1044 17510400
234298058 BrisS C Nov. 25, 2023, 4:42 p.m. OK Java 17 TESTS 10 1310 82944000
234315970 codeanand17 C Nov. 25, 2023, 6:09 p.m. OK Java 17 TESTS 10 1653 40960000
234318340 susvant C Nov. 25, 2023, 6:29 p.m. OK Java 21 TESTS 10 514 9420800
234300546 Akash_Sardar C Nov. 25, 2023, 4:51 p.m. OK Java 21 TESTS 10 670 19456000
234299264 mcrash12 C Nov. 25, 2023, 4:47 p.m. OK Java 21 TESTS 10 1263 51404800
234294693 67mnjhgfqwer C Nov. 25, 2023, 4:31 p.m. OK Java 21 TESTS 10 1731 7065600
234320359 Akarsh2810 C Nov. 25, 2023, 6:50 p.m. OK Java 8 TESTS 10 358 13414400
234322764 Sumitsingh7 C Nov. 25, 2023, 7:17 p.m. OK Java 8 TESTS 10 920 20787200
234307352 rajr86642 C Nov. 25, 2023, 5:14 p.m. OK Java 8 TESTS 10 1356 6348800
234325449 arvindf232 C Nov. 25, 2023, 7:48 p.m. OK Kotlin 1.6 TESTS 10 920 15257600
234290678 top73only C Nov. 25, 2023, 4:17 p.m. OK Kotlin 1.6 TESTS 10 967 15257600
234292651 maikh07 C Nov. 25, 2023, 4:24 p.m. OK MS C++ 2017 TESTS 10 483 3174400
234306211 ahtoh_ C Nov. 25, 2023, 5:10 p.m. OK Node.js TESTS 10 810 96870400
234290777 tamato C Nov. 25, 2023, 4:17 p.m. OK PyPy 3-64 TESTS 10 483 67379200
234318651 DarkTemplarDrop C Nov. 25, 2023, 6:33 p.m. OK PyPy 3-64 TESTS 10 498 47923200
234336742 VeryLate C Nov. 25, 2023, 10:44 p.m. OK PyPy 3-64 TESTS 10 530 59187200
234319952 trydiv2 C Nov. 25, 2023, 6:46 p.m. OK PyPy 3-64 TESTS 10 545 35840000
234339242 Sparkle_Twilight C Nov. 25, 2023, 11:44 p.m. OK PyPy 3-64 TESTS 10 577 42496000
234292127 MasterVroom C Nov. 25, 2023, 4:22 p.m. OK PyPy 3-64 TESTS 10 655 43724800
234293191 teekaytai C Nov. 25, 2023, 4:25 p.m. OK PyPy 3-64 TESTS 10 732 36044800
234325381 denilb C Nov. 25, 2023, 7:47 p.m. OK PyPy 3-64 TESTS 10 748 31744000
234343197 StacGnihsihp C Nov. 26, 2023, 1:33 a.m. OK PyPy 3-64 TESTS 10 748 32256000
234328894 CaptainUknown C Nov. 25, 2023, 8:33 p.m. OK PyPy 3-64 TESTS 10 748 33792000
234305887 denis7 C Nov. 25, 2023, 5:09 p.m. OK Python 3 TESTS 10 514 45977600
234294664 Trainer_Marvin C Nov. 25, 2023, 4:31 p.m. OK Python 3 TESTS 10 655 56012800
234305352 longvb48 C Nov. 25, 2023, 5:08 p.m. OK Python 3 TESTS 10 655 79155200
234319821 Mati_Y C Nov. 25, 2023, 6:44 p.m. OK Python 3 TESTS 10 717 42496000
234339142 Aniket54 C Nov. 25, 2023, 11:41 p.m. OK Python 3 TESTS 10 795 51200000
234299149 AryanGoel575 C Nov. 25, 2023, 4:46 p.m. OK Python 3 TESTS 10 811 43622400
234305090 Ratery C Nov. 25, 2023, 5:07 p.m. OK Python 3 TESTS 10 841 75878400
234339600 Aniket54 C Nov. 25, 2023, 11:54 p.m. OK Python 3 TESTS 10 872 59596800
234290446 fraxea C Nov. 25, 2023, 4:16 p.m. OK Python 3 TESTS 10 1013 53657600
234294134 mulyam13986 C Nov. 25, 2023, 4:29 p.m. OK Python 3 TESTS 10 1044 64512000
234337131 emiliopeju C Nov. 25, 2023, 10:53 p.m. OK Rust 2021 TESTS 10 171 25804800
234295685 Loganwick C Nov. 25, 2023, 4:34 p.m. OK Rust 2021 TESTS 10 186 15769600

remove filters

Back to search problems