Codeforces Round 428 (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
839 Codeforces Round 428 (Div. 2) FINISHED False 7200 229274699 Aug. 12, 2017, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2972 ) D Winter is here PROGRAMMING combinatorics dp math number theory 2200

B"Winter is here at the North and the White Walkers are close. John Snow has an army consisting of n soldiers. While the rest of the world is fighting for the Iron Throne, he is going to get ready for the attack of the White Walkers. He has created a method to know how strong his army is. Let the i-th soldier xe2 x80 x99s strength be ai. For some k he calls i1, xe2 x80 x89i2, xe2 x80 x89..., xe2 x80 x89ik a clan if i1 xe2 x80 x89< xe2 x80 x89i2 xe2 x80 x89< xe2 x80 x89i3 xe2 x80 x89< xe2 x80 x89... xe2 x80 x89< xe2 x80 x89ik and gcd(ai1, xe2 x80 x89ai2, xe2 x80 x89..., xe2 x80 x89aik) xe2 x80 x89> xe2 x80 x891 . He calls the strength of that clan k xc2 xb7gcd(ai1, xe2 x80 x89ai2, xe2 x80 x89..., xe2 x80 x89aik). Then he defines the strength of his army by the sum of strengths of all possible clans. Your task is to find the strength of his army. As the number may be very large, you have to print it modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). Greatest common divisor (gcd) of a sequence of integers is the maximum possible integer so that each element of the sequence is divisible by it. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200000) -- the size of the army. The second line contains n 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 x891000000) -- denoting the strengths of his soldiers. Print one integer -- the strength of John Snow's army modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). In the first sample the clans are {1}, xe2 x80 x89{2}, xe2 x80 x89{1, xe2 x80 x892} so the answer will be 1 xc2 xb73 xe2 x80 x89+ xe2 x80 x891 xc2 xb73 xe2 x80 x89+ xe2 x80 x892 xc2 xb73 xe2 x80 x89= xe2 x80 x8912 "...

Tutorials

Codeforces Round #428 editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
33954589 AsahiKasugano D Jan. 6, 2018, 3:28 a.m. OK FPC TESTS 47 811 13619200 2200
29962776 vjudge3 D Sept. 1, 2017, 2:02 a.m. OK GNU C TESTS 47 468 26419200 2200
29862282 FoolMike D Aug. 29, 2017, 9:35 a.m. OK GNU C++ TESTS 47 93 24883200 2200
34246212 vjudge5 D Jan. 17, 2018, 9:50 a.m. OK GNU C++ TESTS 47 108 15052800 2200
34246202 Magolor D Jan. 17, 2018, 9:50 a.m. OK GNU C++ TESTS 47 109 15155200 2200
29426503 ztx D Aug. 13, 2017, 7:06 a.m. OK GNU C++ TESTS 47 124 10956800 2200
29474320 jugnu D Aug. 15, 2017, 6:23 a.m. OK GNU C++ TESTS 47 124 14131200 2200
40980270 ReaLNero1 D July 30, 2018, 5:27 p.m. OK GNU C++ TESTS 47 124 24883200 2200
29459760 19992147 D Aug. 14, 2017, 2:18 p.m. OK GNU C++ TESTS 47 140 34918400 2200
32829700 vjudge1 D Dec. 1, 2017, 12:33 p.m. OK GNU C++ TESTS 47 156 10649600 2200
29474281 vjudge4 D Aug. 15, 2017, 6:21 a.m. OK GNU C++ TESTS 47 156 15769600 2200
32829731 Doggu D Dec. 1, 2017, 12:34 p.m. OK GNU C++ TESTS 47 171 10649600 2200
55682884 rainboy D June 17, 2019, 1:57 p.m. OK GNU C11 TESTS 47 171 4812800 2200
59978214 orzorz_moeDzW D Sept. 4, 2019, 7:01 a.m. OK GNU C++11 TESTS 47 93 20070400 2200
46027086 daklqw D Nov. 21, 2018, 11:51 a.m. OK GNU C++11 TESTS 47 93 32051200 2200
46026741 weng_233 D Nov. 21, 2018, 11:41 a.m. OK GNU C++11 TESTS 47 108 20275200 2200
45998206 DavidLei D Nov. 20, 2018, 1:19 p.m. OK GNU C++11 TESTS 47 109 13004800 2200
59129104 ZPAYAUR D Aug. 20, 2019, 10:17 a.m. OK GNU C++11 TESTS 47 124 8806400 2200
29426561 ztx D Aug. 13, 2017, 7:09 a.m. OK GNU C++11 TESTS 47 124 10956800 2200
46422150 patris D Nov. 30, 2018, 10:37 p.m. OK GNU C++11 TESTS 47 124 16076800 2200
62172561 cyf32768 D Oct. 9, 2019, 2:01 a.m. OK GNU C++11 TESTS 47 124 16076800 2200
48475268 Darling-IcePrincess_1968 D Jan. 17, 2019, 1:57 a.m. OK GNU C++11 TESTS 47 124 28057600 2200
64511313 luogu_bot5 D Nov. 8, 2019, 8:55 a.m. OK GNU C++11 TESTS 47 139 7884800 2200
33016146 Flash-boy D Dec. 8, 2017, 7:02 a.m. OK GNU C++14 TESTS 47 109 22016000 2200
58572197 HouZAJ D Aug. 11, 2019, 10:44 a.m. OK GNU C++14 TESTS 47 109 29081600 2200
44274098 antguz D Oct. 13, 2018, 8:07 p.m. OK GNU C++14 TESTS 47 124 7987200 2200
58110327 Scut82 D Aug. 1, 2019, 6:50 a.m. OK GNU C++14 TESTS 47 124 20070400 2200
58110337 Scut82 D Aug. 1, 2019, 6:50 a.m. OK GNU C++14 TESTS 47 124 20070400 2200
64652469 Jester D Nov. 10, 2019, 5:51 p.m. OK GNU C++14 TESTS 47 139 3993600 2200
44712269 OmarHashim D Oct. 22, 2018, 7:25 p.m. OK GNU C++14 TESTS 47 139 12800000 2200
58110319 Scut82 D Aug. 1, 2019, 6:49 a.m. OK GNU C++14 TESTS 47 140 28057600 2200
36266764 Worg D March 14, 2018, 6:46 a.m. OK GNU C++14 TESTS 47 155 14028800 2200
29506338 ajs97 D Aug. 16, 2017, 1:23 p.m. OK GNU C++14 TESTS 47 156 7987200 2200
58860488 vjudge4 D Aug. 15, 2019, 11:25 a.m. OK GNU C++17 TESTS 47 124 12083200 2200
59137780 vjudge3 D Aug. 20, 2019, 1:17 p.m. OK GNU C++17 TESTS 47 156 9625600 2200
43236218 vjudge4 D Sept. 22, 2018, 8:12 a.m. OK GNU C++17 TESTS 47 171 8806400 2200
43236181 vjudge4 D Sept. 22, 2018, 8:11 a.m. OK GNU C++17 TESTS 47 171 8806400 2200
59136226 vjudge3 D Aug. 20, 2019, 12:45 p.m. OK GNU C++17 TESTS 47 171 9625600 2200
48433158 YouKn0wWho D Jan. 15, 2019, 6:35 p.m. OK GNU C++17 TESTS 47 171 11980800 2200
45834623 BohdanPastuschak D Nov. 16, 2018, 4:25 p.m. OK GNU C++17 TESTS 47 186 8396800 2200
59129199 vjudge1 D Aug. 20, 2019, 10:19 a.m. OK GNU C++17 TESTS 47 187 8806400 2200
69670736 Amber30 D Jan. 28, 2020, 12:55 p.m. OK GNU C++17 TESTS 47 187 12083200 2200
43236293 vjudge1 D Sept. 22, 2018, 8:14 a.m. OK GNU C++17 TESTS 47 202 8806400 2200
29438857 sl0th D Aug. 13, 2017, 4:21 p.m. OK Haskell TESTS 47 842 82841600 2200
29438702 sl0th D Aug. 13, 2017, 4:14 p.m. OK Haskell TESTS 47 857 81817600 2200
55682885 Dukkha D June 17, 2019, 1:57 p.m. OK Java 8 TESTS 47 280 8499200 2200
29523747 tmwilliamlin168 D Aug. 17, 2017, 10:08 a.m. OK Java 8 TESTS 47 358 9625600 2200
43342888 ZeyadKhattab D Sept. 23, 2018, 6:39 p.m. OK Java 8 TESTS 47 374 14540800 2200
31136949 aabdelzaher D Oct. 8, 2017, 8:14 a.m. OK Java 8 TESTS 47 389 7372800 2200
32503532 spandey128 D Nov. 20, 2017, 3 p.m. OK Java 8 TESTS 47 390 2457600 2200
29450305 Omar_Morsi D Aug. 14, 2017, 6:44 a.m. OK Java 8 TESTS 47 436 43417600 2200
67042006 satya26 D Dec. 16, 2019, 7:45 p.m. OK Java 8 TESTS 47 483 27136000 2200
30297801 nanoCat D Sept. 13, 2017, 2:02 a.m. OK Java 8 TESTS 47 499 16384000 2200
29429571 aya_cool D Aug. 13, 2017, 9:24 a.m. OK Java 8 TESTS 47 514 38297600 2200
29640707 donli D Aug. 21, 2017, 10:02 a.m. OK Java 8 TESTS 47 560 22425600 2200
29449757 ZephaniahWang D Aug. 14, 2017, 6:19 a.m. OK MS C++ TESTS 47 156 10956800 2200
43178840 vjudge4 D Sept. 21, 2018, 12:34 p.m. OK MS C++ TESTS 47 249 12288000 2200
43179032 vjudge2 D Sept. 21, 2018, 12:38 p.m. OK MS C++ TESTS 47 265 12288000 2200
43174728 vjudge2 D Sept. 21, 2018, 10:37 a.m. OK MS C++ TESTS 47 265 12288000 2200
43035960 vjudge2 D Sept. 18, 2018, 1:36 p.m. OK MS C++ TESTS 47 280 4812800 2200
43179210 vjudge1 D Sept. 21, 2018, 12:42 p.m. OK MS C++ TESTS 47 280 16384000 2200
43035927 vjudge3 D Sept. 18, 2018, 1:35 p.m. OK MS C++ TESTS 47 296 5120000 2200
43019004 vjudge4 D Sept. 18, 2018, 2:43 a.m. OK MS C++ TESTS 47 296 16793600 2200
42998586 fwat D Sept. 17, 2018, 12:57 p.m. OK MS C++ TESTS 47 358 28057600 2200
61849954 vjudge4 D Oct. 4, 2019, 12:26 p.m. OK MS C++ TESTS 47 373 16076800 2200
61603528 pajenegod D Oct. 1, 2019, 11:55 a.m. OK PyPy 2 TESTS 47 452 20582400 2200
29521965 pluristiq D Aug. 17, 2017, 8:36 a.m. OK PyPy 2 TESTS 47 1590 62464000 2200
33633232 yugle7 D Dec. 25, 2017, 9:59 p.m. OK PyPy 3 TESTS 47 1294 79564800 2200
29447706 -AC- D Aug. 14, 2017, 4:01 a.m. OK PyPy 3 TESTS 47 2386 83353600 2200
29450309 freedom_dr D Aug. 14, 2017, 6:44 a.m. OK PyPy 3 TESTS 47 2744 73523200 2200
33633281 yugle7 D Dec. 25, 2017, 10:03 p.m. OK Python 3 TESTS 47 2215 25497600 2200
36342437 imnotreal D March 17, 2018, 5:14 a.m. OK Python 3 TESTS 47 2339 24371200 2200
37526605 spliey D April 22, 2018, 4:12 a.m. OK Python 3 TESTS 47 2714 45363200 2200
37526586 spliey D April 22, 2018, 4:09 a.m. OK Python 3 TESTS 47 2823 46387200 2200
29444347 sntea D Aug. 13, 2017, 10:17 p.m. OK Rust TESTS 47 358 23040000 2200

remove filters

Back to search problems