Codeforces Round 410 (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
798 Codeforces Round 410 (Div. 2) FINISHED False 7200 239037899 April 21, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5829 ) C Mike and gcd problem PROGRAMMING dp greedy number theory 1700

B'Mike has a sequence A xe2 x80 x89= xe2 x80 x89[a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an] of length n. He considers the sequence B xe2 x80 x89= xe2 x80 x89[b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn] beautiful if the gcd of all its elements is bigger than 1, i.e. . Mike wants to change his sequence in order to make it beautiful. In one move he can choose an index i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89< xe2 x80 x89n), delete numbers ai, xe2 x80 x89ai xe2 x80 x89+ xe2 x80 x891 and put numbers ai xe2 x80 x89- xe2 x80 x89ai xe2 x80 x89+ xe2 x80 x891, xe2 x80 x89ai xe2 x80 x89+ xe2 x80 x89ai xe2 x80 x89+ xe2 x80 x891 in their place instead, in this order. He wants perform as few operations as possible. Find the minimal number of operations to make sequence A beautiful if it 's possible, or tell him that it is impossible to do so. is the biggest non-negative number d such that d divides bi for every i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n). The first line contains a single integer n (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000) -- length of sequence A. The second line contains n space-separated integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- elements of sequence A. Output on the first line "YES" (without quotes) if it is possible to make sequence A beautiful by performing operations described above, and "NO" (without quotes) otherwise. If the answer was "YES", output the minimal number of moves needed to make sequence A beautiful. In the first example you can simply make one move to obtain sequence [0, xe2 x80 x892] with . In the second example the gcd of the sequence is already greater than 1. '...

Tutorials

Codeforces Round #410 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
45857291 JonathanWang C Nov. 17, 2018, 2:59 a.m. OK Clang++17 Diagnostics TESTS 103 77 1331200 1700
57566544 vjudge3 C July 23, 2019, 3:11 a.m. OK Clang++17 Diagnostics TESTS 103 77 14643200 1700
57562496 vjudge4 C July 23, 2019, 1:33 a.m. OK Clang++17 Diagnostics TESTS 103 561 1024000 1700
26702413 FalseMirror C April 27, 2017, 12:59 p.m. OK D TESTS 103 46 7168000 1700
32350988 AsahiKasugano C Nov. 16, 2017, 9:05 a.m. OK FPC TESTS 103 31 409600 1700
27415521 k_nd C May 28, 2017, 3:12 p.m. OK FPC TESTS 103 31 819200 1700
26702678 vjudge2 C April 27, 2017, 1:13 p.m. OK FPC TESTS 103 31 2048000 1700
26589610 yan_lazy C April 22, 2017, 6:12 p.m. OK FPC TESTS 103 31 2048000 1700
26586842 andrew C April 22, 2017, 3:08 p.m. OK FPC TESTS 103 31 2048000 1700
26578338 Ahriman C April 22, 2017, 8:15 a.m. OK FPC TESTS 103 31 2048000 1700
41896562 chaorenhaha C Aug. 20, 2018, 9:47 a.m. OK FPC TESTS 103 46 409600 1700
32350958 URTATAGLM C Nov. 16, 2017, 9:03 a.m. OK FPC TESTS 103 46 921600 1700
26577032 GreymaneSilverfang C April 22, 2017, 7:09 a.m. OK FPC TESTS 103 46 2048000 1700
32317685 TShT C Nov. 14, 2017, 6:27 p.m. OK FPC TESTS 103 46 3993600 1700
27344743 pcraj C May 25, 2017, 8:26 p.m. OK GNU C TESTS 103 31 409600 1700
26639849 zhangcan2333 C April 24, 2017, 12:10 p.m. OK GNU C TESTS 103 31 2662400 1700
26802451 vjudge3 C May 2, 2017, 12:46 p.m. OK GNU C TESTS 103 46 2252800 1700
26579478 sahuang C April 22, 2017, 9:13 a.m. OK GNU C TESTS 103 1419 2252800 1700
32324994 vjudge1 C Nov. 15, 2017, 6 a.m. OK GNU C++ TESTS 103 15 409600 1700
27687850 yasugongshang C June 9, 2017, 11:23 a.m. OK GNU C++ TESTS 103 15 409600 1700
27150127 supy C May 16, 2017, 4:52 a.m. OK GNU C++ TESTS 103 15 409600 1700
26832834 schloss C May 4, 2017, 11:17 a.m. OK GNU C++ TESTS 103 15 409600 1700
26829376 vjudge5 C May 4, 2017, 6:43 a.m. OK GNU C++ TESTS 103 15 409600 1700
26829334 vjudge2 C May 4, 2017, 6:40 a.m. OK GNU C++ TESTS 103 15 409600 1700
26794717 AkaneSasu C May 2, 2017, 2:05 a.m. OK GNU C++ TESTS 103 15 2355200 1700
26829336 vjudge5 C May 4, 2017, 6:40 a.m. OK GNU C++ TESTS 103 15 3993600 1700
31736646 qaz_kyle C Oct. 26, 2017, 11:30 a.m. OK GNU C++ TESTS 103 30 409600 1700
31736940 mengbierr C Oct. 26, 2017, 11:51 a.m. OK GNU C++ TESTS 103 30 819200 1700
26579381 sahuang C April 22, 2017, 9:07 a.m. OK GNU C11 TESTS 103 1419 2252800 1700
26579348 sahuang C April 22, 2017, 9:05 a.m. OK GNU C11 TESTS 103 1450 2252800 1700
26651389 ctlchild C April 25, 2017, 1:43 a.m. OK GNU C++11 TESTS 103 15 2560000 1700
26658932 ecjtu-nzf C April 25, 2017, 11:27 a.m. OK GNU C++11 TESTS 103 15 2560000 1700
26576759 chamow C April 22, 2017, 6:53 a.m. OK GNU C++11 TESTS 103 15 2867200 1700
26924864 LIN452 C May 7, 2017, 1:56 p.m. OK GNU C++11 TESTS 103 15 3993600 1700
26918866 yp0413150208 C May 7, 2017, 8:09 a.m. OK GNU C++11 TESTS 103 15 3993600 1700
28590034 Mepler C July 16, 2017, 7:22 a.m. OK GNU C++11 TESTS 103 15 4096000 1700
26577155 xrdog C April 22, 2017, 7:16 a.m. OK GNU C++11 TESTS 103 15 18124800 1700
26640310 VAVAvile C April 24, 2017, 12:32 p.m. OK GNU C++11 TESTS 103 30 2048000 1700
26795338 vjudge3 C May 2, 2017, 3:17 a.m. OK GNU C++11 TESTS 103 30 2457600 1700
26628906 flatline C April 23, 2017, 9:28 p.m. OK GNU C++11 TESTS 103 30 2867200 1700
26949428 vjudge1 C May 8, 2017, 3:06 a.m. OK GNU C++14 TESTS 103 31 0 1700
26975614 gbuenoandrade C May 9, 2017, 2:27 p.m. OK GNU C++14 TESTS 103 31 0 1700
27625779 ifrag C June 7, 2017, 5:35 a.m. OK GNU C++14 TESTS 103 31 0 1700
40981740 ReaLNero1 C July 30, 2018, 6:07 p.m. OK GNU C++14 TESTS 103 31 409600 1700
30610231 vjudge2 C Sept. 22, 2017, 9:17 a.m. OK GNU C++14 TESTS 103 31 409600 1700
27312688 gerardd C May 24, 2017, 2:13 a.m. OK GNU C++14 TESTS 103 31 409600 1700
27261729 a88796366 C May 21, 2017, 7:40 a.m. OK GNU C++14 TESTS 103 31 409600 1700
27349071 BrotherZhi C May 26, 2017, 5:29 a.m. OK GNU C++14 TESTS 103 31 409600 1700
29785267 ivan100sic C Aug. 25, 2017, 3:23 p.m. OK GNU C++14 TESTS 103 31 409600 1700
27689086 TheTerminalGuy C June 9, 2017, 12:38 p.m. OK GNU C++14 TESTS 103 31 409600 1700
69712199 ankitpriyarup C Jan. 29, 2020, 7:31 a.m. OK GNU C++17 TESTS 103 46 0 1700
68238506 Pety C Jan. 5, 2020, 11:55 a.m. OK GNU C++17 TESTS 103 46 0 1700
63501592 vlad.iftimescu C Oct. 26, 2019, 5:23 p.m. OK GNU C++17 TESTS 103 46 0 1700
59601239 harry_game C Aug. 28, 2019, 6:08 a.m. OK GNU C++17 TESTS 103 46 0 1700
59328537 hashlib C Aug. 22, 2019, 10:38 p.m. OK GNU C++17 TESTS 103 46 0 1700
58511474 apostoldaniel854 C Aug. 9, 2019, 7:16 p.m. OK GNU C++17 TESTS 103 46 0 1700
56542606 lunga C July 5, 2019, 6:05 a.m. OK GNU C++17 TESTS 103 46 0 1700
55844685 ggawryal C June 20, 2019, 8:20 p.m. OK GNU C++17 TESTS 103 46 0 1700
54787904 Saurav_Paul C May 29, 2019, 5:22 a.m. OK GNU C++17 TESTS 103 46 0 1700
50205805 aesth C Feb. 19, 2019, 7:13 p.m. OK GNU C++17 TESTS 103 46 0 1700
40368578 vjudge2 C July 15, 2018, 7:06 a.m. OK GNU C++17 Diagnostics TESTS 103 1450 2355200 1700
27290688 megaspazz C May 22, 2017, 8:04 p.m. OK Go TESTS 103 31 20070400 1700
34493101 vjudge5 C Jan. 23, 2018, 6:43 p.m. OK Go TESTS 103 31 24780800 1700
26581596 odomontois C April 22, 2017, 11:03 a.m. OK Haskell TESTS 103 31 59699200 1700
27710811 U_Square C June 10, 2017, 8:16 p.m. OK Java 8 TESTS 103 109 0 1700
62547885 saurabhs1206 C Oct. 14, 2019, 7:16 a.m. OK Java 8 TESTS 103 124 0 1700
59589324 StayAwayFromBitches C Aug. 27, 2019, 7:32 p.m. OK Java 8 TESTS 103 124 0 1700
52333165 icpc_loser C April 5, 2019, 6:33 a.m. OK Java 8 TESTS 103 124 0 1700
30226012 Jeel_Vaishnav C Sept. 9, 2017, 12:54 p.m. OK Java 8 TESTS 103 124 0 1700
29697661 mualanhlung017 C Aug. 23, 2017, 4:31 a.m. OK Java 8 TESTS 103 124 0 1700
27833671 Sir-Shurikat C June 16, 2017, 9:38 p.m. OK Java 8 TESTS 103 124 0 1700
26679067 Psp_98 C April 26, 2017, 9:48 a.m. OK Java 8 TESTS 103 124 20377600 1700
26790454 step_by_step C May 1, 2017, 6:22 p.m. OK Java 8 TESTS 103 124 20582400 1700
26599147 Thacker C April 23, 2017, 8:40 a.m. OK Java 8 TESTS 103 124 20582400 1700
57763323 walticotc C July 25, 2019, 6:55 p.m. OK Mono C# TESTS 103 109 17612800 1700
49160578 Mem C Jan. 29, 2019, 3:12 p.m. OK Mono C# TESTS 103 124 14950400 1700
26657118 AnatolyTolstobrov C April 25, 2017, 9:31 a.m. OK MS C# TESTS 103 46 9625600 1700
26707644 Ilnur_the_best C April 27, 2017, 5:44 p.m. OK MS C# TESTS 103 93 23449600 1700
26584705 ShowStopper728 C April 22, 2017, 1:29 p.m. OK MS C# TESTS 103 93 24064000 1700
26605441 koyaaniqatsi C April 23, 2017, 1:53 p.m. OK MS C# TESTS 103 108 23142400 1700
26954676 vjudge2 C May 8, 2017, 10:45 a.m. OK MS C++ TESTS 103 31 512000 1700
26916429 vjudge3 C May 7, 2017, 5:36 a.m. OK MS C++ TESTS 103 31 1740800 1700
26768217 Omen C April 30, 2017, 1:08 p.m. OK MS C++ TESTS 103 31 2457600 1700
37396016 vjudge5 C April 17, 2018, 1:05 p.m. OK MS C++ TESTS 103 31 3891200 1700
38826812 vjudge4 C June 1, 2018, 11:50 a.m. OK MS C++ TESTS 103 31 3891200 1700
37431104 vjudge2 C April 18, 2018, 9:53 a.m. OK MS C++ TESTS 103 31 4198400 1700
26588603 f-zyj C April 22, 2017, 5 p.m. OK MS C++ TESTS 103 31 6041600 1700
57566546 vjudge2 C July 23, 2019, 3:11 a.m. OK MS C++ TESTS 103 46 409600 1700
57566991 vjudge4 C July 23, 2019, 3:21 a.m. OK MS C++ TESTS 103 46 409600 1700
57566613 vjudge4 C July 23, 2019, 3:13 a.m. OK MS C++ TESTS 103 46 409600 1700
57562988 vjudge3 C July 23, 2019, 1:48 a.m. OK MS C++ 2017 TESTS 103 46 819200 1700
57563134 vjudge5 C July 23, 2019, 1:51 a.m. OK MS C++ 2017 TESTS 103 46 819200 1700
57563850 vjudge4 C July 23, 2019, 2:10 a.m. OK MS C++ 2017 TESTS 103 61 16076800 1700
57564970 vjudge1 C July 23, 2019, 2:37 a.m. OK MS C++ 2017 TESTS 103 62 819200 1700
61801125 AleksanderBalobanov C Oct. 3, 2019, 7:02 p.m. OK MS C++ 2017 TESTS 103 62 2457600 1700
57566605 vjudge5 C July 23, 2019, 3:13 a.m. OK MS C++ 2017 TESTS 103 62 6041600 1700
57141075 dbadulin C July 16, 2019, 11:04 a.m. OK MS C++ 2017 TESTS 103 93 409600 1700
28797437 Ostkaka C July 23, 2017, 9:49 a.m. OK PyPy 2 TESTS 103 109 30105600 1700
26597339 babang C April 23, 2017, 7:06 a.m. OK PyPy 2 TESTS 103 217 32153600 1700
26597247 babang C April 23, 2017, 7 a.m. OK PyPy 2 TESTS 103 218 32358400 1700
27205139 tamir C May 18, 2017, 10:11 p.m. OK PyPy 3 TESTS 103 233 11468800 1700
49135381 homoeconomicus C Jan. 29, 2019, 7:23 a.m. OK PyPy 3 TESTS 103 248 11776000 1700
60262321 deadguy C Sept. 8, 2019, 12:02 p.m. OK PyPy 3 TESTS 103 265 11264000 1700
26789614 2390_ C May 1, 2017, 5:17 p.m. OK Python 2 TESTS 103 155 10240000 1700
31126209 Hahahahahahahhahaha C Oct. 7, 2017, 7:06 p.m. OK Python 2 TESTS 103 186 5632000 1700
28069484 Trunks C June 27, 2017, 6:15 a.m. OK Python 2 TESTS 103 186 10240000 1700
26775941 nealzane C April 30, 2017, 10:41 p.m. OK Python 2 TESTS 103 187 10240000 1700
26595321 rcpc-master C April 23, 2017, 4:53 a.m. OK Python 2 TESTS 103 202 10240000 1700
27833812 dragon.warrior C June 16, 2017, 9:50 p.m. OK Python 2 TESTS 103 249 7884800 1700
26605412 kien_metalrock C April 23, 2017, 1:52 p.m. OK Python 2 TESTS 103 264 12595200 1700
26576361 ankitaggarwal011 C April 22, 2017, 6:31 a.m. OK Python 2 TESTS 103 265 12595200 1700
26639660 000wangbo C April 24, 2017, 12:02 p.m. OK Python 2 TESTS 103 265 16588800 1700
41090879 Ali_Pi C Aug. 1, 2018, 4:35 p.m. OK Python 2 TESTS 103 280 5632000 1700
26767210 orailly C April 30, 2017, 12:14 p.m. OK Python 3 TESTS 103 109 13926400 1700
26767487 orailly C April 30, 2017, 12:29 p.m. OK Python 3 TESTS 103 124 13107200 1700
26607608 jdh C April 23, 2017, 2:38 p.m. OK Python 3 TESTS 103 124 13107200 1700
26767621 orailly C April 30, 2017, 12:35 p.m. OK Python 3 TESTS 103 124 13312000 1700
26767247 orailly C April 30, 2017, 12:16 p.m. OK Python 3 TESTS 103 124 13312000 1700
31201536 yugle7 C Oct. 10, 2017, 7:25 p.m. OK Python 3 TESTS 103 139 8396800 1700
31226697 toysheeyeyraku C Oct. 11, 2017, 7:48 p.m. OK Python 3 TESTS 103 140 8294400 1700
26897137 sonya123 C May 6, 2017, 9:01 a.m. OK Python 3 TESTS 103 140 8499200 1700
26950968 iynaur87 C May 8, 2017, 5:39 a.m. OK Python 3 TESTS 103 155 8601600 1700
26809781 Dehax C May 2, 2017, 9:49 p.m. OK Python 3 TESTS 103 155 13414400 1700
26594091 phirasit C April 23, 2017, 2:48 a.m. OK Ruby TESTS 103 171 24780800 1700

remove filters

Back to search problems