Codeforces Round 773 (Div. 1)

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
1641 Codeforces Round 773 (Div. 1) FINISHED False 7200 86212199 Feb. 23, 2022, 10:10 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 17966 ) A Great Sequence PROGRAMMING brute force greedy sortings

B'A sequence of positive integers is called great for a positive integer x , if we can split it into pairs in such a way that in each pair the first number multiplied by x is equal to the second number. More formally, a sequence a of size n is great for a positive integer x , if n is even and there exists a permutation p of size n , such that for each i ( 1 <= i <= frac{n}{2} ) a_{p_{2i-1}} cdot x = a_{p_{2i}} . Sam has a sequence a and a positive integer x . Help him to make the sequence great: find the minimum possible number of positive integers that should be added to the sequence a to make it great for the number x . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 20 ,000 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains two integers n , x ( 1 <= n <= 2 cdot 10^5 , 2 <= x <= 10^6 ). The next line contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case print a single integer -- the minimum number of integers that can be added to the end of a to make it a great sequence for the number x . In the first test case, Sam got lucky and the sequence is already great for the number 4 because you can divide it into such pairs: (1, 4) , (4, 16) . Thus we can add 0 numbers. In the second test case, you can add numbers 1 and 14 to the sequence, then you can divide all 8 integers into such pairs: (1, 2) , (1, 2) , (2, 4) , (7, 14) . It is impossible to add less than 2 integers to fix the sequence. '...

Tutorials

Codeforces Round #773 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
147416278 Gassa A Feb. 23, 2022, 10:19 a.m. OK D TESTS 38 109 6144000
147427829 chro4896 A Feb. 23, 2022, 10:36 a.m. OK GNU C11 TESTS 38 140 3174400
147421672 ZhangCW_QwQ A Feb. 23, 2022, 10:27 a.m. OK GNU C++14 TESTS 38 31 8089600
147418126 BARBARIANNNNN A Feb. 23, 2022, 10:22 a.m. OK GNU C++14 TESTS 38 62 1024000
147417841 crazy_sea A Feb. 23, 2022, 10:21 a.m. OK GNU C++14 TESTS 38 62 1638400
147417173 yao11617 A Feb. 23, 2022, 10:20 a.m. OK GNU C++14 TESTS 38 62 2048000
147478349 Taystered A Feb. 23, 2022, 1:55 p.m. OK GNU C++14 TESTS 38 78 1024000
147416264 zmj2008AKIOI A Feb. 23, 2022, 10:19 a.m. OK GNU C++14 TESTS 38 78 1024000
147418500 usernameson A Feb. 23, 2022, 10:22 a.m. OK GNU C++14 TESTS 38 78 1638400
147417203 LWLAymh A Feb. 23, 2022, 10:20 a.m. OK GNU C++14 TESTS 38 78 2355200
147416732 107543639 A Feb. 23, 2022, 10:20 a.m. OK GNU C++14 TESTS 38 78 3379200
147427485 yaoxi A Feb. 23, 2022, 10:35 a.m. OK GNU C++14 TESTS 38 93 819200
147415606 lddlinan A Feb. 23, 2022, 10:17 a.m. OK GNU C++17 TESTS 38 61 1536000
147486723 Andrew_sun A Feb. 23, 2022, 3:10 p.m. OK GNU C++17 TESTS 38 62 819200
147414609 Wailydest A Feb. 23, 2022, 10:13 a.m. OK GNU C++17 TESTS 38 62 1024000
147420141 Paul_Liao_1457 A Feb. 23, 2022, 10:24 a.m. OK GNU C++17 TESTS 38 62 1331200
147420937 wucstdio A Feb. 23, 2022, 10:26 a.m. OK GNU C++17 TESTS 38 62 2560000
147416349 CHNJZ A Feb. 23, 2022, 10:19 a.m. OK GNU C++17 TESTS 38 62 15974400
147498165 ShahainManujith A Feb. 23, 2022, 5:07 p.m. OK GNU C++17 TESTS 39 77 819200
147415867 hotwords A Feb. 23, 2022, 10:18 a.m. OK GNU C++17 TESTS 38 77 819200
147472044 forgothandle A Feb. 23, 2022, 1:08 p.m. OK GNU C++17 TESTS 38 77 1638400
147513974 ilyakrasnovv A Feb. 23, 2022, 8:37 p.m. OK GNU C++17 TESTS 39 77 1638400
147415585 LayCurse A Feb. 23, 2022, 10:17 a.m. OK GNU C++17 (64) TESTS 38 15 101478400
147419326 CE_WA_TLE A Feb. 23, 2022, 10:23 a.m. OK GNU C++17 (64) TESTS 38 31 10752000
147414810 ecnerwala A Feb. 23, 2022, 10:14 a.m. OK GNU C++17 (64) TESTS 38 46 819200
147480275 fvogel A Feb. 23, 2022, 2:12 p.m. OK GNU C++17 (64) TESTS 38 46 1843200
147447186 antguz A Feb. 23, 2022, 11:14 a.m. OK GNU C++17 (64) TESTS 38 46 4198400
147415052 natsugiri A Feb. 23, 2022, 10:16 a.m. OK GNU C++17 (64) TESTS 38 61 1638400
147418384 hanguandong A Feb. 23, 2022, 10:22 a.m. OK GNU C++17 (64) TESTS 38 62 921600
147417028 zhrrrr A Feb. 23, 2022, 10:20 a.m. OK GNU C++17 (64) TESTS 38 77 2457600
147503219 Raw A Feb. 23, 2022, 6:02 p.m. OK GNU C++17 (64) TESTS 39 77 3276800
147414696 liyh A Feb. 23, 2022, 10:14 a.m. OK GNU C++17 (64) TESTS 38 77 10444800
147414901 tourist A Feb. 23, 2022, 10:15 a.m. OK GNU C++20 (64) TESTS 38 31 819200
147416277 ultizet A Feb. 23, 2022, 10:19 a.m. OK GNU C++20 (64) TESTS 38 31 1024000
147415360 George1123 A Feb. 23, 2022, 10:17 a.m. OK GNU C++20 (64) TESTS 38 31 2662400
147418326 askd A Feb. 23, 2022, 10:22 a.m. OK GNU C++20 (64) TESTS 38 31 3174400
147416094 MOPKOBKA228 A Feb. 23, 2022, 10:18 a.m. OK GNU C++20 (64) TESTS 38 31 3174400
147418016 WinterLove A Feb. 23, 2022, 10:22 a.m. OK GNU C++20 (64) TESTS 38 46 819200
147418615 Linkus A Feb. 23, 2022, 10:22 a.m. OK GNU C++20 (64) TESTS 38 46 1024000
147423621 celesta A Feb. 23, 2022, 10:29 a.m. OK GNU C++20 (64) TESTS 38 46 1638400
147415651 flukehn A Feb. 23, 2022, 10:17 a.m. OK GNU C++20 (64) TESTS 38 46 1638400
147415169 ARegularCoder A Feb. 23, 2022, 10:16 a.m. OK GNU C++20 (64) TESTS 38 46 1638400
147414975 uwi A Feb. 23, 2022, 10:15 a.m. OK Java 11 TESTS 38 233 0
147414608 robinz62 A Feb. 23, 2022, 10:13 a.m. OK Java 11 TESTS 38 467 5427200
147420265 procrastinate7 A Feb. 23, 2022, 10:25 a.m. OK Java 11 TESTS 38 482 19046400
147418490 insert_cool_handle A Feb. 23, 2022, 10:22 a.m. OK Java 11 TESTS 38 561 5939200
147420896 knightL A Feb. 23, 2022, 10:26 a.m. OK Java 11 TESTS 38 794 48435200
147420563 YahiaSherif A Feb. 23, 2022, 10:25 a.m. OK Java 8 TESTS 38 217 3481600
147506887 Daly105 A Feb. 23, 2022, 6:45 p.m. OK Java 8 TESTS 39 249 18227200
147415071 iakovlev.zakhar A Feb. 23, 2022, 10:16 a.m. OK Java 8 TESTS 38 405 16691200
147418195 AdhmMohamed A Feb. 23, 2022, 10:22 a.m. OK Java 8 TESTS 38 529 17100800
147416942 Cepera A Feb. 23, 2022, 10:20 a.m. OK Java 8 TESTS 38 561 15462400
147415912 fetetriste A Feb. 23, 2022, 10:18 a.m. OK Java 8 TESTS 38 654 41574400
147420214 Hakiobo A Feb. 23, 2022, 10:25 a.m. OK Kotlin 1.4 TESTS 38 405 6656000
147482174 arvindf232 A Feb. 23, 2022, 2:28 p.m. OK Kotlin 1.4 TESTS 38 436 5324800
147414664 Sparky_Master_WCH1226 A Feb. 23, 2022, 10:14 a.m. OK Kotlin 1.4 TESTS 38 436 5324800
147416285 darnley A Feb. 23, 2022, 10:19 a.m. OK Kotlin 1.5 TESTS 38 483 18739200
147476513 ComPhyPark A Feb. 23, 2022, 1:40 p.m. OK MS C++ 2017 TESTS 38 78 3276800
147417912 LXl491214 A Feb. 23, 2022, 10:21 a.m. OK MS C++ 2017 TESTS 38 186 6451200
147415729 machine_solution A Feb. 23, 2022, 10:18 a.m. OK MS C++ 2017 TESTS 38 249 9830400
147417516 kakel_san A Feb. 23, 2022, 10:21 a.m. OK .NET Core C# TESTS 38 187 45977600
147469146 OLOGY A Feb. 23, 2022, 12:50 p.m. OK PyPy 2 TESTS 38 373 20684800
147415335 NecroSean38 A Feb. 23, 2022, 10:17 a.m. OK PyPy 3 TESTS 38 311 25702400
147414932 toam A Feb. 23, 2022, 10:15 a.m. OK PyPy 3 TESTS 38 342 24166400
147475283 Joshc A Feb. 23, 2022, 1:30 p.m. OK PyPy 3 TESTS 38 343 26009600
147507741 whatshisbucket A Feb. 23, 2022, 6:57 p.m. OK PyPy 3 TESTS 39 421 21811200
147415363 asdsasd A Feb. 23, 2022, 10:17 a.m. OK PyPy 3 TESTS 38 436 27238400
147415129 zloyrobot A Feb. 23, 2022, 10:16 a.m. OK PyPy 3 TESTS 38 576 29081600
147415799 akhan42 A Feb. 23, 2022, 10:18 a.m. OK PyPy 3 TESTS 38 576 41472000
147525719 cxgod1234 A Feb. 24, 2022, 2:11 a.m. OK PyPy 3 TESTS 39 733 22630400
147526182 xiesunsun A Feb. 24, 2022, 2:23 a.m. OK PyPy 3-64 TESTS 39 280 38297600
147419434 eepsilon A Feb. 23, 2022, 10:23 a.m. OK PyPy 3-64 TESTS 38 327 35020800
147415325 tamato A Feb. 23, 2022, 10:17 a.m. OK PyPy 3-64 TESTS 38 342 33587200
147537055 anupam_sudh A Feb. 24, 2022, 5:51 a.m. OK PyPy 3-64 TESTS 39 358 34304000
147414692 lucifer1004 A Feb. 23, 2022, 10:14 a.m. OK PyPy 3-64 TESTS 38 390 34304000
147516360 wettkoenig A Feb. 23, 2022, 9:30 p.m. OK PyPy 3-64 TESTS 39 405 28876800
147517499 wettkoenig A Feb. 23, 2022, 9:58 p.m. OK PyPy 3-64 TESTS 39 436 29286400
147415964 chinerist A Feb. 23, 2022, 10:18 a.m. OK PyPy 3-64 TESTS 38 467 36454400
147510924 plevande A Feb. 23, 2022, 7:45 p.m. OK PyPy 3-64 TESTS 39 467 41676800
147469195 OLOGY A Feb. 23, 2022, 12:50 p.m. OK Python 2 TESTS 38 389 15052800
147529432 mayank26596 A Feb. 24, 2022, 3:39 a.m. OK Python 3 TESTS 39 296 18739200
147528218 surajbhanarkar08 A Feb. 24, 2022, 3:14 a.m. OK Python 3 TESTS 39 483 25600000
147414883 Egor A Feb. 23, 2022, 10:15 a.m. OK Rust 2021 TESTS 38 31 9830400
147414791 qwerty787788 A Feb. 23, 2022, 10:14 a.m. OK Rust 2021 TESTS 38 61 2457600
147414581 sansen A Feb. 23, 2022, 10:13 a.m. OK Rust 2021 TESTS 38 61 11264000
147429542 orz_liuwei A Feb. 23, 2022, 10:38 a.m. OK Rust 2021 TESTS 38 155 6348800

remove filters

Back to search problems