Codeforces Round 511 (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
1034 Codeforces Round 511 (Div. 1) FINISHED False 7200 199985124 Sept. 21, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8946 ) A Enlarge GCD PROGRAMMING number theory 1700

B'Mr. F has n positive integers, a_1, a_2, ldots, a_n . He thinks the greatest common divisor of these integers is too small. So he wants to enlarge it by removing some of the integers. But this problem is too simple for him, so he does not want to do it by himself. If you help him, he will give you some scores in reward. Your task is to calculate the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers. The first line contains an integer n ( 2 <= q n <= q 3 cdot 10^5 ) -- the number of integers Mr. F has. The second line contains n integers, a_1, a_2, ldots, a_n ( 1 <= q a_i <= q 1.5 cdot 10^7 ). Print an integer -- the minimum number of integers you need to remove so that the greatest common divisor of the remaining integers is bigger than that of all integers. You should not remove all of the integers. If there is no solution, print xc2 xab-1 xc2 xbb (without quotes). In the first example, the greatest common divisor is 1 in the beginning. You can remove 1 so that the greatest common divisor is enlarged to 2 . The answer is 1 . In the second example, the greatest common divisor is 3 in the beginning. You can remove 6 and 9 so that the greatest common divisor is enlarged to 15 . There is no solution which removes only one integer. So the answer is 2 . In the third example, there is no solution to enlarge the greatest common divisor. So the answer is -1 . '...

Tutorials

Codeforces Round #511 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
49534093 PhuongPeu A Feb. 6, 2019, 3:06 p.m. OK FPC TESTS 74 858 136601600 1700
55075055 yukato0701 A June 4, 2019, 8:11 a.m. OK GNU C11 TESTS 74 623 181452800 1700
55302755 yukato0701 A June 8, 2019, 12:44 p.m. OK GNU C11 TESTS 74 638 181452800 1700
54992100 yukato0701 A June 2, 2019, 7:32 p.m. OK GNU C11 TESTS 74 888 181452800 1700
55065888 yukato0701 A June 4, 2019, 3:32 a.m. OK GNU C11 TESTS 74 888 181452800 1700
43349438 lvskiller A Sept. 24, 2018, 12:31 a.m. OK GNU C11 TESTS 74 904 126156800 1700
55302727 yukato0701 A June 8, 2019, 12:43 p.m. OK GNU C11 TESTS 74 920 181452800 1700
43226689 sparsh_123 A Sept. 21, 2018, 9:30 p.m. OK GNU C11 TESTS 74 998 121446400 1700
55065850 yukato0701 A June 4, 2019, 3:31 a.m. OK GNU C11 TESTS 74 998 181452800 1700
55908482 GM_Targeted A June 21, 2019, 10:57 p.m. OK GNU C++11 TESTS 74 77 120217600 1700
60373445 GM_Targeted A Sept. 11, 2019, 4:39 a.m. OK GNU C++11 TESTS 74 78 120217600 1700
55908501 GM_Targeted A June 21, 2019, 10:58 p.m. OK GNU C++11 TESTS 74 78 120217600 1700
55907628 GM_Targeted A June 21, 2019, 10:09 p.m. OK GNU C++11 TESTS 74 108 120217600 1700
55907557 GM_Targeted A June 21, 2019, 10:06 p.m. OK GNU C++11 TESTS 74 109 120217600 1700
43368896 YangDavid A Sept. 24, 2018, 1:37 p.m. OK GNU C++11 TESTS 74 187 69324800 1700
43196074 LittleFall A Sept. 21, 2018, 3:04 p.m. OK GNU C++11 TESTS 74 202 181555200 1700
53669226 SoiMae A May 2, 2019, 12:17 p.m. OK GNU C++11 TESTS 74 217 181555200 1700
43523398 luogu_bot5 A Sept. 28, 2018, 9:55 a.m. OK GNU C++11 TESTS 74 217 181555200 1700
53669224 SoiMae A May 2, 2019, 12:17 p.m. OK GNU C++11 TESTS 74 218 181555200 1700
60373436 GM_Targeted A Sept. 11, 2019, 4:38 a.m. OK GNU C++14 TESTS 74 171 120217600 1700
46353581 neal A Nov. 29, 2018, 6:51 a.m. OK GNU C++14 TESTS 74 218 123392000 1700
43229814 neal A Sept. 22, 2018, 1:06 a.m. OK GNU C++14 TESTS 74 233 123289600 1700
43273611 neal A Sept. 22, 2018, 8:40 p.m. OK GNU C++14 TESTS 74 233 123392000 1700
43269058 neal A Sept. 22, 2018, 5:56 p.m. OK GNU C++14 TESTS 74 234 123289600 1700
43273473 neal A Sept. 22, 2018, 8:34 p.m. OK GNU C++14 TESTS 74 249 123392000 1700
43269236 neal A Sept. 22, 2018, 6:01 p.m. OK GNU C++14 TESTS 74 264 123289600 1700
61510581 vjudge4 A Sept. 29, 2019, 3:57 p.m. OK GNU C++14 TESTS 74 264 181555200 1700
45223765 hairybaalsac A Nov. 3, 2018, 12:58 a.m. OK GNU C++14 TESTS 74 265 181555200 1700
45432141 mehul1999k A Nov. 8, 2018, 4:55 a.m. OK GNU C++14 TESTS 74 265 181555200 1700
46755455 mtmohim A Dec. 8, 2018, 11:28 a.m. OK GNU C++17 TESTS 74 171 61337600 1700
43524175 Trisolaris A Sept. 28, 2018, 10:22 a.m. OK GNU C++17 TESTS 74 171 130150400 1700
44751708 ReaLNero1 A Oct. 23, 2018, 8:18 p.m. OK GNU C++17 TESTS 74 186 61542400 1700
43587792 Demeter A Sept. 29, 2018, 9:25 p.m. OK GNU C++17 TESTS 74 202 182988800 1700
43694981 lovro A Oct. 2, 2018, 4:04 p.m. OK GNU C++17 TESTS 74 233 26112000 1700
43433282 q234rty A Sept. 26, 2018, 3:20 a.m. OK GNU C++17 TESTS 74 264 266752000 1700
43586995 Demeter A Sept. 29, 2018, 8:47 p.m. OK GNU C++17 TESTS 74 265 181555200 1700
53192452 Hugin A April 23, 2019, 1:31 p.m. OK GNU C++17 TESTS 74 265 181555200 1700
43293183 GeoMerlin A Sept. 23, 2018, 11:54 a.m. OK GNU C++17 TESTS 74 280 128102400 1700
50637443 BryanValeriano A March 1, 2019, 12:26 p.m. OK GNU C++17 TESTS 74 280 181555200 1700
69714514 synapse A Jan. 29, 2020, 8:30 a.m. OK Go TESTS 74 498 199475200 1700
65555051 ijxjdjd A Nov. 22, 2019, 9:06 p.m. OK Java 8 TESTS 74 623 191180800 1700
47347022 kusomushi A Dec. 21, 2018, 8:43 p.m. OK Java 8 TESTS 74 639 184115200 1700
43226570 pushpakdhakad75 A Sept. 21, 2018, 9:26 p.m. OK Java 8 TESTS 74 655 118579200 1700
46884095 Depool A Dec. 10, 2018, 9:30 p.m. OK Java 8 TESTS 74 670 113254400 1700
67848367 Harpae A Dec. 28, 2019, 11:53 p.m. OK Java 8 TESTS 74 670 203366400 1700
66303561 yaoct A Dec. 5, 2019, 8:22 a.m. OK Java 8 TESTS 74 701 123904000 1700
43280914 Aniket_144 A Sept. 23, 2018, 5:11 a.m. OK Java 8 TESTS 74 716 125337600 1700
43295127 janush A Sept. 23, 2018, 1:02 p.m. OK Java 8 TESTS 74 717 192512000 1700
43190207 guptautkarsh028 A Sept. 21, 2018, 2:47 p.m. OK Java 8 TESTS 74 733 207769600 1700
45964881 hongquanntct A Nov. 19, 2018, 1:22 p.m. OK Java 8 TESTS 74 748 124518400 1700
56309143 og.kostya A June 30, 2019, 1:45 p.m. OK Mono C# TESTS 74 545 127385600 1700
54793914 vjudge5 A May 29, 2019, 8:41 a.m. OK MS C++ TESTS 74 389 82329600 1700
49180338 vjudge3 A Jan. 30, 2019, 1:01 a.m. OK MS C++ TESTS 74 436 181555200 1700
43635169 vjudge2 A Oct. 1, 2018, 8:10 a.m. OK MS C++ TESTS 74 467 196915200 1700
43639561 vjudge2 A Oct. 1, 2018, 10:34 a.m. OK MS C++ TESTS 74 483 196608000 1700
69099812 vjudge1 A Jan. 19, 2020, 1:30 p.m. OK MS C++ TESTS 74 498 136499200 1700
43635300 vjudge3 A Oct. 1, 2018, 8:16 a.m. OK MS C++ TESTS 74 530 196915200 1700
60757596 vjudge5 A Sept. 18, 2019, 9:40 a.m. OK MS C++ TESTS 74 545 10956800 1700
49181753 vjudge1 A Jan. 30, 2019, 2:26 a.m. OK MS C++ TESTS 74 577 62873600 1700
61809519 vjudge5 A Oct. 4, 2019, 1:08 a.m. OK MS C++ TESTS 74 577 121446400 1700
43196014 wa1tz719 A Sept. 21, 2018, 3:04 p.m. OK MS C++ TESTS 74 592 61542400 1700
61562464 CtrlAlt A Sept. 30, 2019, 4:02 p.m. OK MS C++ 2017 TESTS 74 311 130048000 1700
58423295 920848348 A Aug. 7, 2019, 8:39 a.m. OK MS C++ 2017 TESTS 74 607 181555200 1700
56248771 BessieTheCow A June 29, 2019, 12:34 a.m. OK MS C++ 2017 TESTS 74 701 24268800 1700
69078860 vjudge4 A Jan. 19, 2020, 5:19 a.m. OK MS C++ 2017 TESTS 74 779 76390400 1700
52518692 AleksanderBalobanov A April 9, 2019, 7:24 a.m. OK MS C++ 2017 TESTS 74 888 195379200 1700
48989873 ChopperCP A Jan. 26, 2019, 1:55 p.m. OK MS C++ 2017 TESTS 74 904 180326400 1700
49679046 xiaowuc1 A Feb. 9, 2019, 10:25 p.m. OK PyPy 2 TESTS 74 748 96153600 1700
44232067 Grevozin A Oct. 13, 2018, 1:18 a.m. OK Rust TESTS 74 296 133017600 1700

remove filters

Back to search problems