Codeforces Round 838 (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
1762 Codeforces Round 838 (Div. 2) FINISHED False 9000 66151463 Dec. 15, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17262 ) B Make Array Good PROGRAMMING constructive algorithms implementation number theory sortings

B'An array b of m positive integers is good if for all pairs i and j ( 1 <= q i,j <= q m ), max(b_i,b_j) is divisible by min(b_i,b_j) . You are given an array a of n positive integers. You can perform the following operation: You have to construct a sequence of at most n operations that will make a good. It can be proven that under the constraints of the problem, such a sequence of operations always exists. 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 10^5 ) -- the length of the array a . The second line of each test case contains n space-separated integers a_1,a_2, ldots,a_n ( 1 <= q a_i <= q 10^9 ) -- representing the array a . It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test, output a single integer p ( 0 <= q p <= q n ) -- denoting the number of operations in your solution. In each of the following p lines, output two space-separated integers -- i and x . You do not need to minimize the number of operations. It can be proven that a solution always exists. In the first test case, array a becomes [5,5,5,5] after the operations. It is easy to see that [5,5,5,5] is good. In the second test case, array a is already good. In the third test case, after performing the operations, array a becomes [10,5,350,5,10] , which is good. In the fourth test case, after performing the operations, array a becomes [60,10,20] , which is good. '...

Tutorials

Codeforces Round #838 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
185383955 winwinry B Dec. 15, 2022, 6:56 p.m. OK GNU C11 TESTS 9 499 2355200
185367427 romeo2002 B Dec. 15, 2022, 4:58 p.m. OK GNU C11 TESTS 9 545 26009600
185362889 YiLinG B Dec. 15, 2022, 4:45 p.m. OK GNU C11 TESTS 9 561 819200
185364839 Innocent_Zero B Dec. 15, 2022, 4:51 p.m. OK GNU C11 TESTS 9 577 819200
185363336 iffatul_anon B Dec. 15, 2022, 4:47 p.m. OK GNU C11 TESTS 9 592 819200
185411677 Sarans5h B Dec. 16, 2022, 4:28 a.m. OK GNU C++14 TESTS 9 62 0
185376128 Andwerp B Dec. 15, 2022, 5:52 p.m. OK GNU C++14 TESTS 9 62 409600
185405999 wangongshecangqiong B Dec. 16, 2022, 2:24 a.m. OK GNU C++14 TESTS 9 62 409600
185408964 20112001009 B Dec. 16, 2022, 3:36 a.m. OK GNU C++14 TESTS 9 62 819200
185397109 Shresth222 B Dec. 15, 2022, 10:06 p.m. OK GNU C++14 TESTS 9 77 0
185416989 KirillKhalin B Dec. 16, 2022, 5:45 a.m. OK GNU C++14 TESTS 9 77 409600
185406221 wangongshecangqiong B Dec. 16, 2022, 2:30 a.m. OK GNU C++14 TESTS 9 77 409600
185402935 Fantasyli B Dec. 16, 2022, 12:59 a.m. OK GNU C++14 TESTS 9 77 409600
185409355 niyiqi B Dec. 16, 2022, 3:45 a.m. OK GNU C++14 TESTS 9 77 819200
185408292 nikhil51 B Dec. 16, 2022, 3:20 a.m. OK GNU C++14 TESTS 9 77 819200
185414815 haresh_kumar_v B Dec. 16, 2022, 5:17 a.m. OK GNU C++17 TESTS 9 62 0
185410588 pursuit_of_happiness B Dec. 16, 2022, 4:10 a.m. OK GNU C++17 TESTS 9 62 0
185384152 Anas_Maged5 B Dec. 15, 2022, 6:58 p.m. OK GNU C++17 TESTS 9 62 0
185376931 alex0101 B Dec. 15, 2022, 5:58 p.m. OK GNU C++17 TESTS 9 62 0
185403155 arctan90 B Dec. 16, 2022, 1:06 a.m. OK GNU C++17 TESTS 9 62 409600
185402136 Developy B Dec. 16, 2022, 12:35 a.m. OK GNU C++17 TESTS 9 62 409600
185401302 TrashPotato B Dec. 16, 2022, 12:08 a.m. OK GNU C++17 TESTS 9 62 409600
185396367 ggboygbdool B Dec. 15, 2022, 9:48 p.m. OK GNU C++17 TESTS 9 62 409600
185413693 PrickyToTheMoon B Dec. 16, 2022, 5:01 a.m. OK GNU C++17 TESTS 9 62 409600
185417900 4tran B Dec. 16, 2022, 5:56 a.m. OK GNU C++17 TESTS 9 62 819200
185374900 _kaguya_ B Dec. 15, 2022, 5:43 p.m. OK GNU C++17 (64) TESTS 9 46 0
185409462 fictitious_love B Dec. 16, 2022, 3:47 a.m. OK GNU C++17 (64) TESTS 9 46 0
185372456 incursive B Dec. 15, 2022, 5:29 p.m. OK GNU C++17 (64) TESTS 9 46 0
185400755 Alex_Wei B Dec. 15, 2022, 11:47 p.m. OK GNU C++17 (64) TESTS 9 46 0
185405207 HideInTheSea B Dec. 16, 2022, 2:04 a.m. OK GNU C++17 (64) TESTS 9 46 409600
185407471 Sam_Jiang B Dec. 16, 2022, 3:01 a.m. OK GNU C++17 (64) TESTS 9 46 409600
185395813 MohamedRefat B Dec. 15, 2022, 9:37 p.m. OK GNU C++17 (64) TESTS 9 46 614400
185411033 Yug_tyagi B Dec. 16, 2022, 4:16 a.m. OK GNU C++17 (64) TESTS 9 46 819200
185410256 Sempr B Dec. 16, 2022, 4:04 a.m. OK GNU C++17 (64) TESTS 9 46 67686400
185387445 enslaved B Dec. 15, 2022, 7:35 p.m. OK GNU C++17 (64) TESTS 9 61 2457600
185376550 SolarRabbit B Dec. 15, 2022, 5:55 p.m. OK GNU C++20 (64) TESTS 9 31 0
185379930 GoodLife_69 B Dec. 15, 2022, 6:20 p.m. OK GNU C++20 (64) TESTS 9 31 0
185382049 SashaT9 B Dec. 15, 2022, 6:38 p.m. OK GNU C++20 (64) TESTS 9 31 0
185378721 Sy_03 B Dec. 15, 2022, 6:11 p.m. OK GNU C++20 (64) TESTS 9 31 409600
185387203 tzhamoidin_official B Dec. 15, 2022, 7:32 p.m. OK GNU C++20 (64) TESTS 9 31 409600
185371861 iliakhalaji1385 B Dec. 15, 2022, 5:26 p.m. OK GNU C++20 (64) TESTS 9 31 409600
185379904 tester9887 B Dec. 15, 2022, 6:20 p.m. OK GNU C++20 (64) TESTS 9 31 819200
185383589 Ramaalali B Dec. 15, 2022, 6:52 p.m. OK GNU C++20 (64) TESTS 9 31 819200
185401863 uwq B Dec. 16, 2022, 12:28 a.m. OK GNU C++20 (64) TESTS 9 31 2969600
185378496 vikram2001 B Dec. 15, 2022, 6:09 p.m. OK GNU C++20 (64) TESTS 9 31 5017600
185398509 Yousef_Badr B Dec. 15, 2022, 10:40 p.m. OK Java 11 TESTS 9 233 0
185375160 Spidey2182 B Dec. 15, 2022, 5:45 p.m. OK Java 11 TESTS 9 233 0
185391362 doomhammer. B Dec. 15, 2022, 8:24 p.m. OK Java 11 TESTS 9 249 921600
185398418 Yousef_Badr B Dec. 15, 2022, 10:38 p.m. OK Java 11 TESTS 9 265 0
185385358 as9274 B Dec. 15, 2022, 7:11 p.m. OK Java 11 TESTS 9 280 0
185385291 saaksha B Dec. 15, 2022, 7:10 p.m. OK Java 11 TESTS 9 280 0
185373857 vishal_sahu B Dec. 15, 2022, 5:37 p.m. OK Java 11 TESTS 9 280 0
185414909 La_Pagla B Dec. 16, 2022, 5:18 a.m. OK Java 11 TESTS 9 280 2969600
185394531 nis1234 B Dec. 15, 2022, 9:12 p.m. OK Java 11 TESTS 9 280 4096000
185417495 __Serendipity B Dec. 16, 2022, 5:51 a.m. OK Java 11 TESTS 9 295 819200
185376910 yashbhardwaj24 B Dec. 15, 2022, 5:58 p.m. OK Java 17 TESTS 9 264 512000
185415774 KarMa_ B Dec. 16, 2022, 5:29 a.m. OK Java 17 TESTS 9 280 716800
185408859 pili B Dec. 16, 2022, 3:33 a.m. OK Java 17 TESTS 9 296 307200
185415030 -Jarvis- B Dec. 16, 2022, 5:19 a.m. OK Java 17 TESTS 9 296 512000
185414528 -Jarvis- B Dec. 16, 2022, 5:13 a.m. OK Java 17 TESTS 9 296 1024000
185381414 merlin_ B Dec. 15, 2022, 6:32 p.m. OK Java 17 TESTS 9 389 8704000
185403378 imtharun B Dec. 16, 2022, 1:12 a.m. OK Java 17 TESTS 9 623 1126400
185387731 WoodenTable B Dec. 15, 2022, 7:39 p.m. OK Java 17 TESTS 9 857 1126400
185363065 this_dp B Dec. 15, 2022, 4:46 p.m. OK Java 17 TESTS 9 889 102400
185407602 cys02 B Dec. 16, 2022, 3:04 a.m. OK Java 8 TESTS 9 155 0
185403791 ikillmyself B Dec. 16, 2022, 1:24 a.m. OK Java 8 TESTS 9 155 0
185402706 omeganot B Dec. 16, 2022, 12:53 a.m. OK Java 8 TESTS 9 155 38195200
185396799 imMortalSuv B Dec. 15, 2022, 9:58 p.m. OK Java 8 TESTS 9 280 8396800
185372504 Rohinth B Dec. 15, 2022, 5:29 p.m. OK Java 8 TESTS 9 280 8396800
185374358 toufique_husein B Dec. 15, 2022, 5:40 p.m. OK Java 8 TESTS 9 374 3072000
185398112 mass_2701 B Dec. 15, 2022, 10:30 p.m. OK Java 8 TESTS 9 888 17817600
185380840 Abhinav__hadole B Dec. 15, 2022, 6:27 p.m. OK Java 8 TESTS 9 919 0
185397868 raushnn B Dec. 15, 2022, 10:23 p.m. OK Java 8 TESTS 9 919 17817600
185373611 Aldijohn B Dec. 15, 2022, 5:35 p.m. OK Java 8 TESTS 9 982 0
185403192 Aksurana B Dec. 16, 2022, 1:07 a.m. OK MS C++ 2017 TESTS 9 576 0
185379228 rsFalse B Dec. 15, 2022, 6:15 p.m. OK Perl TESTS 9 623 12697600
185409202 kuangren777 B Dec. 16, 2022, 3:41 a.m. OK PyPy 3 TESTS 9 218 12390400
185380792 fntfaizan B Dec. 15, 2022, 6:27 p.m. OK PyPy 3 TESTS 9 576 11673600
185395260 WalrusRamen21 B Dec. 15, 2022, 9:25 p.m. OK PyPy 3 TESTS 9 592 11673600
185396370 kunal_14s B Dec. 15, 2022, 9:49 p.m. OK PyPy 3 TESTS 9 608 11571200
185375760 harshini.paranjape B Dec. 15, 2022, 5:49 p.m. OK PyPy 3 TESTS 9 654 21606400
185366673 ashuashutosh2211 B Dec. 15, 2022, 4:56 p.m. OK PyPy 3 TESTS 9 655 11673600
185366078 star-1ord B Dec. 15, 2022, 4:55 p.m. OK PyPy 3 TESTS 9 670 16691200
185364879 u1602016 B Dec. 15, 2022, 4:51 p.m. OK PyPy 3 TESTS 9 701 19046400
185394927 Nabeel_Ismaeel B Dec. 15, 2022, 9:19 p.m. OK PyPy 3-64 TESTS 9 155 18329600
185384604 mayank35 B Dec. 15, 2022, 7:03 p.m. OK PyPy 3-64 TESTS 9 170 15872000
185409883 Varad2002 B Dec. 16, 2022, 3:56 a.m. OK PyPy 3-64 TESTS 9 171 13414400
185405075 gesuta B Dec. 16, 2022, 2 a.m. OK PyPy 3-64 TESTS 9 171 14233600
185410708 griffindor B Dec. 16, 2022, 4:11 a.m. OK PyPy 3-64 TESTS 9 186 18124800
185382755 SophieHatter B Dec. 15, 2022, 6:44 p.m. OK PyPy 3-64 TESTS 9 186 19353600
185417862 voicon B Dec. 16, 2022, 5:56 a.m. OK PyPy 3-64 TESTS 9 202 14131200
185412835 FrozenKandy B Dec. 16, 2022, 4:47 a.m. OK PyPy 3-64 TESTS 9 233 18124800
185383998 oneku B Dec. 15, 2022, 6:56 p.m. OK PyPy 3-64 TESTS 9 233 23449600
185373389 MohamedHamed123 B Dec. 15, 2022, 5:34 p.m. OK PyPy 3-64 TESTS 9 234 18124800
185377092 eugalt B Dec. 15, 2022, 5:59 p.m. OK Python 3 TESTS 9 405 6963200
185364598 eugalt B Dec. 15, 2022, 4:51 p.m. OK Python 3 TESTS 9 405 6963200
185372982 rafzy15 B Dec. 15, 2022, 5:32 p.m. OK Python 3 TESTS 9 452 18636800
185379997 lucifer_delco B Dec. 15, 2022, 6:21 p.m. OK Python 3 TESTS 9 467 7884800
185367316 longvb48 B Dec. 15, 2022, 4:58 p.m. OK Python 3 TESTS 9 467 14950400
185412442 2009amit0509 B Dec. 16, 2022, 4:40 a.m. OK Python 3 TESTS 9 499 15052800
185385911 alex_777 B Dec. 15, 2022, 7:17 p.m. OK Python 3 TESTS 9 530 13312000
185379847 unfettered_one B Dec. 15, 2022, 6:20 p.m. OK Python 3 TESTS 9 561 9625600
185373220 thevaibhavdixit B Dec. 15, 2022, 5:33 p.m. OK Python 3 TESTS 9 561 12083200
185373541 mguliyev12360 B Dec. 15, 2022, 5:35 p.m. OK Python 3 TESTS 9 577 7884800
185391432 liut B Dec. 15, 2022, 8:25 p.m. OK Rust 2021 TESTS 9 15 409600
185387332 liut B Dec. 15, 2022, 7:34 p.m. OK Rust 2021 TESTS 9 31 5734400
185387498 Swordelf B Dec. 15, 2022, 7:36 p.m. OK Rust 2021 TESTS 9 31 9113600

remove filters

Back to search problems