Codeforces Round 757 (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
1614 Codeforces Round 757 (Div. 2) FINISHED False 7200 99341063 Nov. 26, 2021, 11:15 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4026 ) D1 Divan and Kostomuksha (easy version) PROGRAMMING dp number theory 2100

B"This is the easy version of the problem. The only difference is maximum value of a_i . Once in Kostomuksha Divan found an array a consisting of positive integers. Now he wants to reorder the elements of a to maximize the value of the following function: sum_{i=1}^n operatorname{gcd}(a_1, , a_2, , ... , , a_i), where operatorname{gcd}(x_1, x_2, ldots, x_k) denotes the greatest common divisor of integers x_1, x_2, ldots, x_k , and operatorname{gcd}(x) = x for any integer x . Reordering elements of an array means changing the order of elements in the array arbitrary, or leaving the initial order. Of course, Divan can solve this problem. However, he found it interesting, so he decided to share it with you. The first line contains a single integer n ( 1 <= q n <= q 10^5 ) -- the size of the array a . The second line contains n integers a_{1}, , a_{2}, , ... , , a_{n} ( 1 <= a_{i} <= 5 cdot 10^6 ) -- the array a . Output the maximum value of the function that you can get by reordering elements of the array a . In the first example, it's optimal to rearrange the elements of the given array in the following order: [6, , 2, , 2, , 2, , 3, , 1] : operatorname{gcd}(a_1) + operatorname{gcd}(a_1, , a_2) + operatorname{gcd}(a_1, , a_2, , a_3) + operatorname{gcd}(a_1, , a_2, , a_3, , a_4) + operatorname{gcd}(a_1, , a_2, , a_3, , a_4, , a_5) + operatorname{gcd}(a_1, , a_2, , a_3, , a_4, , a_5, , a_6) = 6 + 2 + 2 + 2 + 1 + 1 = 14. It can be shown that it is impossible to get a better answer. In the second example, it's optimal to rearrange the elements of a given array in the following order: [100, , 10, , 10, , 5, , 1, , 3, , 3, , 7, , 42, , 54] . "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
137074458 gxlois D1 Nov. 26, 2021, 11:04 p.m. OK D TESTS 43 3821 283443200 2100
137060644 Bliss_of_comprehension D1 Nov. 26, 2021, 5:33 p.m. OK GNU C++14 TESTS 43 670 105779200 2100
137034845 dztlb D1 Nov. 26, 2021, 1:05 p.m. OK GNU C++14 TESTS 43 764 125235200 2100
137077591 Xedokal D1 Nov. 27, 2021, 1:37 a.m. OK GNU C++14 TESTS 43 780 341708800 2100
137083580 Irene D1 Nov. 27, 2021, 4:01 a.m. OK GNU C++14 TESTS 43 857 100249600 2100
137032298 Starlight237 D1 Nov. 26, 2021, 12:58 p.m. OK GNU C++14 TESTS 43 858 67276800 2100
137048174 hellojim D1 Nov. 26, 2021, 2:50 p.m. OK GNU C++14 TESTS 43 904 92364800 2100
137089946 No-Rain D1 Nov. 27, 2021, 5:37 a.m. OK GNU C++14 TESTS 43 904 309043200 2100
137043859 Hoshizora_Z D1 Nov. 26, 2021, 2:07 p.m. OK GNU C++14 TESTS 43 950 480972800 2100
137090932 gerard.onats D1 Nov. 27, 2021, 5:49 a.m. OK GNU C++14 TESTS 43 998 65843200 2100
137081430 gerard.onats D1 Nov. 27, 2021, 3:14 a.m. OK GNU C++14 TESTS 43 1014 65843200 2100
137084885 decsp D1 Nov. 27, 2021, 4:26 a.m. OK GNU C++17 TESTS 43 530 83353600 2100
137049872 Linqi05 D1 Nov. 26, 2021, 3:08 p.m. OK GNU C++17 TESTS 43 592 180326400 2100
137075801 daxia D1 Nov. 27, 2021, 12:23 a.m. OK GNU C++17 TESTS 43 608 121548800 2100
137091976 whywyh D1 Nov. 27, 2021, 6:02 a.m. OK GNU C++17 TESTS 43 623 269312000 2100
137049194 zxyoi D1 Nov. 26, 2021, 3:01 p.m. OK GNU C++17 TESTS 43 639 327987200 2100
137055401 hamamu D1 Nov. 26, 2021, 4:19 p.m. OK GNU C++17 TESTS 43 670 125337600 2100
137047173 linjiale D1 Nov. 26, 2021, 2:39 p.m. OK GNU C++17 TESTS 43 701 105164800 2100
137048157 zech D1 Nov. 26, 2021, 2:50 p.m. OK GNU C++17 TESTS 43 732 902963200 2100
137072307 tloinuy D1 Nov. 26, 2021, 9:32 p.m. OK GNU C++17 TESTS 43 764 80588800 2100
137089737 fdahsjklfhds D1 Nov. 27, 2021, 5:35 a.m. OK GNU C++17 TESTS 43 779 268492800 2100
137049134 DeepJay D1 Nov. 26, 2021, 3 p.m. OK GNU C++17 (64) TESTS 43 436 561049600 2100
137076097 keenlf D1 Nov. 27, 2021, 12:37 a.m. OK GNU C++17 (64) TESTS 43 451 128921600 2100
137057593 0x3f3f3f3f3f D1 Nov. 26, 2021, 4:50 p.m. OK GNU C++17 (64) TESTS 43 545 100556800 2100
137062671 ikefumy D1 Nov. 26, 2021, 6:02 p.m. OK GNU C++17 (64) TESTS 43 623 89292800 2100
137074758 NRolly D1 Nov. 26, 2021, 11:23 p.m. OK GNU C++17 (64) TESTS 43 655 100249600 2100
137059440 limil D1 Nov. 26, 2021, 5:16 p.m. OK GNU C++17 (64) TESTS 43 686 85196800 2100
137082344 trouble... D1 Nov. 27, 2021, 3:33 a.m. OK GNU C++17 (64) TESTS 43 811 420864000 2100
137049237 k.makise D1 Nov. 26, 2021, 3:01 p.m. OK GNU C++17 (64) TESTS 43 841 140288000 2100
137055463 shiro53 D1 Nov. 26, 2021, 4:20 p.m. OK GNU C++17 (64) TESTS 43 888 125132800 2100
137072648 Uppercase D1 Nov. 26, 2021, 9:43 p.m. OK GNU C++17 (64) TESTS 43 904 65024000 2100
137047722 fishcathu. D1 Nov. 26, 2021, 2:45 p.m. OK GNU C++20 (64) TESTS 43 405 84377600 2100
137077467 19992147 D1 Nov. 27, 2021, 1:32 a.m. OK GNU C++20 (64) TESTS 43 436 64204800 2100
137060024 fishcathu. D1 Nov. 26, 2021, 5:24 p.m. OK GNU C++20 (64) TESTS 43 514 69324800 2100
137049360 fishcathu. D1 Nov. 26, 2021, 3:02 p.m. OK GNU C++20 (64) TESTS 43 514 81510400 2100
137074992 ToToMI D1 Nov. 26, 2021, 11:36 p.m. OK GNU C++20 (64) TESTS 43 561 421171200 2100
137076708 lmnopqrst D1 Nov. 27, 2021, 1:04 a.m. OK GNU C++20 (64) TESTS 43 623 123392000 2100
137042693 jimm89 D1 Nov. 26, 2021, 1:59 p.m. OK GNU C++20 (64) TESTS 43 623 126361600 2100
137059025 ftiasch D1 Nov. 26, 2021, 5:11 p.m. OK GNU C++20 (64) TESTS 43 624 325222400 2100
137047418 suimu D1 Nov. 26, 2021, 2:42 p.m. OK GNU C++20 (64) TESTS 43 795 120217600 2100
137042319 L1ngYu233 D1 Nov. 26, 2021, 1:57 p.m. OK GNU C++20 (64) TESTS 43 826 677376000 2100
137084805 DedsecKnight D1 Nov. 27, 2021, 4:25 a.m. OK Java 11 TESTS 43 2714 83660800 2100
137085946 Satyaa D1 Nov. 27, 2021, 4:44 a.m. OK Java 11 TESTS 43 2947 73932800 2100
137086759 Satyaa D1 Nov. 27, 2021, 4:57 a.m. OK Java 11 TESTS 43 2963 74752000 2100
137085150 Satyaa D1 Nov. 27, 2021, 4:31 a.m. OK Java 11 TESTS 43 3307 74752000 2100
137080369 long2142453426 D1 Nov. 27, 2021, 2:51 a.m. OK Java 11 TESTS 43 3494 115200000 2100
137067812 bobib D1 Nov. 26, 2021, 7:36 p.m. OK Java 11 TESTS 43 3540 129843200 2100
137048774 _Body D1 Nov. 26, 2021, 2:56 p.m. OK Java 11 TESTS 43 3977 122572800 2100
137041696 Adi_7861 D1 Nov. 26, 2021, 1:54 p.m. OK Java 8 TESTS 43 3883 121036800 2100
137055275 pulkit14 D1 Nov. 26, 2021, 4:17 p.m. OK Java 8 TESTS 43 3993 152473600 2100
137032726 kakel_san D1 Nov. 26, 2021, 12:59 p.m. OK .NET Core C# TESTS 43 1465 95744000 2100
137043538 KumaTachiRen D1 Nov. 26, 2021, 2:05 p.m. OK .NET Core C# TESTS 43 2121 64409600 2100
137066091 OLOGY D1 Nov. 26, 2021, 7:01 p.m. OK PyPy 2 TESTS 43 732 155648000 2100
137076265 OLOGY D1 Nov. 27, 2021, 12:45 a.m. OK PyPy 2 TESTS 43 780 163840000 2100
137076294 OLOGY D1 Nov. 27, 2021, 12:46 a.m. OK PyPy 2 TESTS 43 794 165171200 2100
137069644 OLOGY D1 Nov. 26, 2021, 8:16 p.m. OK PyPy 2 TESTS 43 857 140288000 2100
137074740 OLOGY D1 Nov. 26, 2021, 11:22 p.m. OK PyPy 2 TESTS 43 904 140185600 2100
137062590 OLOGY D1 Nov. 26, 2021, 6:01 p.m. OK PyPy 2 TESTS 43 1887 148275200 2100
137062297 OLOGY D1 Nov. 26, 2021, 5:57 p.m. OK PyPy 2 TESTS 43 2215 148275200 2100
137063187 OLOGY D1 Nov. 26, 2021, 6:11 p.m. OK PyPy 2 TESTS 43 2230 148275200 2100
137062350 OLOGY D1 Nov. 26, 2021, 5:57 p.m. OK PyPy 2 TESTS 43 2355 148275200 2100
137062320 OLOGY D1 Nov. 26, 2021, 5:57 p.m. OK PyPy 2 TESTS 43 2557 154726400 2100
137042453 toam D1 Nov. 26, 2021, 1:58 p.m. OK PyPy 3 TESTS 43 857 164556800 2100
137077619 whatshisbucket D1 Nov. 27, 2021, 1:38 a.m. OK PyPy 3 TESTS 43 1014 167936000 2100
137076509 whatshisbucket D1 Nov. 27, 2021, 12:56 a.m. OK PyPy 3 TESTS 43 1029 167731200 2100
137074863 hxu10 D1 Nov. 26, 2021, 11:29 p.m. OK PyPy 3 TESTS 43 1465 139264000 2100
137074881 hxu10 D1 Nov. 26, 2021, 11:30 p.m. OK PyPy 3 TESTS 43 1559 139264000 2100
137074906 hxu10 D1 Nov. 26, 2021, 11:31 p.m. OK PyPy 3 TESTS 43 1716 139468800 2100
137038265 titia D1 Nov. 26, 2021, 1:14 p.m. OK PyPy 3 TESTS 43 2058 166604800 2100
137076409 whatshisbucket D1 Nov. 27, 2021, 12:52 a.m. OK PyPy 3 TESTS 43 2526 225177600 2100
137042152 toam D1 Nov. 26, 2021, 1:56 p.m. OK PyPy 3 TESTS 43 2807 164352000 2100
137076124 whatshisbucket D1 Nov. 27, 2021, 12:38 a.m. OK PyPy 3 TESTS 43 3010 245145600 2100
137058715 OLOGY D1 Nov. 26, 2021, 5:07 p.m. OK PyPy 3-64 TESTS 43 1170 109158400 2100
137065023 titia D1 Nov. 26, 2021, 6:43 p.m. OK PyPy 3-64 TESTS 43 1200 144281600 2100
137074927 hxu10 D1 Nov. 26, 2021, 11:33 p.m. OK PyPy 3-64 TESTS 43 1435 159846400 2100
137074918 hxu10 D1 Nov. 26, 2021, 11:32 p.m. OK PyPy 3-64 TESTS 43 1856 155852800 2100
137045139 anishde85 D1 Nov. 26, 2021, 2:20 p.m. OK PyPy 3-64 TESTS 43 3541 141619200 2100
137036135 misorin D1 Nov. 26, 2021, 1:09 p.m. OK PyPy 3-64 TESTS 43 3853 355635200 2100
137072879 sansen D1 Nov. 26, 2021, 9:50 p.m. OK Rust TESTS 43 311 63078400 2100
137085043 Spheniscine D1 Nov. 27, 2021, 4:29 a.m. OK Rust TESTS 43 451 106496000 2100
137090068 Spheniscine D1 Nov. 27, 2021, 5:39 a.m. OK Rust TESTS 43 483 106496000 2100
137085867 Spheniscine D1 Nov. 27, 2021, 4:43 a.m. OK Rust TESTS 43 623 106496000 2100
137080869 Spheniscine D1 Nov. 27, 2021, 3:02 a.m. OK Rust TESTS 43 2480 81100800 2100

remove filters

Back to search problems