Divide by Zero 2021 and Codeforces Round 714 (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
1513 Divide by Zero 2021 and Codeforces Round 714 (Div. 2) FINISHED False 7200 119114663 April 11, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5635 ) D GCD and MST PROGRAMMING constructive algorithms data structures ds graphs implementation number theory sortings

B'You are given an array a of n ( n geq 2 ) positive integers and an integer p . Consider an undirected weighted graph of n vertices numbered from 1 to n for which the edges between the vertices i and j ( i<j ) are added in the following manner: Here gcd(x, y, ldots) denotes the greatest common divisor (GCD) of integers x , y , .... Note that there could be multiple edges between i and j if both of the above conditions are true, and if both the conditions fail for i and j , then there is no edge between these vertices. The goal is to find the weight of the minimum spanning tree of this graph. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The first line of each test case contains two integers n ( 2 <= q n <= q 2 cdot 10^5 ) and p ( 1 <= q p <= q 10^9 ) -- the number of nodes and the parameter p . The second line contains n integers a_1, a_2, a_3, ... , a_n ( 1 <= q a_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . Output t lines. For each test case print the weight of the corresponding graph. Here are the graphs for the four test cases of the example (the edges of a possible MST of the graphs are marked pink): For test case 1 For test case 2 For test case 3 For test case 4 '...

Tutorials

Divide by Zero 2021 and Codeforces Round #714 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
112748362 lanChe D April 12, 2021, 5:31 a.m. OK GNU C++11 TESTS 35 31 2662400
112741861 ___red___ D April 12, 2021, 3:27 a.m. OK GNU C++11 TESTS 35 46 3276800
112704094 guapisolo D April 11, 2021, 4:19 p.m. OK GNU C++11 TESTS 35 46 4608000
112740308 wangyitest D April 12, 2021, 2:47 a.m. OK GNU C++11 TESTS 35 46 13107200
112740281 wangyitest D April 12, 2021, 2:46 a.m. OK GNU C++11 TESTS 35 46 13107200
112709317 void_basic_learner D April 11, 2021, 4:34 p.m. OK GNU C++11 TESTS 35 46 14438400
112705308 Crab_Dave D April 11, 2021, 4:22 p.m. OK GNU C++11 TESTS 35 61 6656000
112707449 lzy_LzY_lZy D April 11, 2021, 4:29 p.m. OK GNU C++11 TESTS 35 62 1638400
112714765 zhuzhirui2005 D April 11, 2021, 5:32 p.m. OK GNU C++11 TESTS 35 62 1843200
112733017 2bno_2 D April 12, 2021, 1:01 a.m. OK GNU C++11 TESTS 35 62 2457600
112739753 George1123 D April 12, 2021, 2:29 a.m. OK GNU C++14 TESTS 35 77 1843200
112703494 emotionles D April 11, 2021, 4:17 p.m. OK GNU C++14 TESTS 35 78 2867200
112716677 Astronomax D April 11, 2021, 5:53 p.m. OK GNU C++14 TESTS 35 78 3174400
112727744 matterhunt D April 11, 2021, 9:05 p.m. OK GNU C++14 TESTS 35 78 3993600
112720574 nikolapesic2802 D April 11, 2021, 6:45 p.m. OK GNU C++14 TESTS 35 78 3993600
112711908 Entropy D April 11, 2021, 5:09 p.m. OK GNU C++14 TESTS 35 78 6451200
112703618 rain_island D April 11, 2021, 4:17 p.m. OK GNU C++14 TESTS 35 93 2662400
112704706 FreeSin2000 D April 11, 2021, 4:20 p.m. OK GNU C++14 TESTS 35 93 3174400
112746548 iNx D April 12, 2021, 5:02 a.m. OK GNU C++14 TESTS 35 93 3379200
112716076 kareem98 D April 11, 2021, 5:46 p.m. OK GNU C++14 TESTS 35 93 3993600
112742150 StelaYuri D April 12, 2021, 3:34 a.m. OK GNU C++17 TESTS 35 77 1638400
112711343 nechaev D April 11, 2021, 5:05 p.m. OK GNU C++17 TESTS 35 78 1638400
112702797 faguzman4 D April 11, 2021, 4:14 p.m. OK GNU C++17 TESTS 35 78 2457600
112717242 iwanna D April 11, 2021, 5:59 p.m. OK GNU C++17 TESTS 35 78 2662400
112719425 peterr D April 11, 2021, 6:28 p.m. OK GNU C++17 TESTS 35 78 2662400
112743736 yizhiyu D April 12, 2021, 4:07 a.m. OK GNU C++17 TESTS 35 78 3276800
112741643 Yzm007 D April 12, 2021, 3:22 a.m. OK GNU C++17 TESTS 35 78 3993600
112741127 thaixuandang D April 12, 2021, 3:09 a.m. OK GNU C++17 TESTS 35 92 2457600
112711523 kitesho D April 11, 2021, 5:06 p.m. OK GNU C++17 TESTS 35 92 3276800
112705191 yugurt D April 11, 2021, 4:22 p.m. OK GNU C++17 TESTS 35 92 3584000
112747393 lPADORUlPADORUlPADORU D April 12, 2021, 5:16 a.m. OK GNU C++17 (64) TESTS 35 61 5836800
112716409 Meul D April 11, 2021, 5:50 p.m. OK GNU C++17 (64) TESTS 35 62 2457600
112747814 _Isaunoya_ D April 12, 2021, 5:22 a.m. OK GNU C++17 (64) TESTS 35 62 2662400
112703716 Lazit D April 11, 2021, 4:17 p.m. OK GNU C++17 (64) TESTS 35 62 3174400
112724455 erray D April 11, 2021, 7:49 p.m. OK GNU C++17 (64) TESTS 35 62 3276800
112712289 FatihSolak D April 11, 2021, 5:11 p.m. OK GNU C++17 (64) TESTS 35 62 3276800
112733700 paulll D April 12, 2021, 1:30 a.m. OK GNU C++17 (64) TESTS 35 62 5120000
112746793 lPADORUlPADORUlPADORU D April 12, 2021, 5:06 a.m. OK GNU C++17 (64) TESTS 35 62 5836800
112747830 myy04 D April 12, 2021, 5:23 a.m. OK GNU C++17 (64) TESTS 35 62 9216000
112702506 alwyn D April 11, 2021, 4:13 p.m. OK GNU C++17 (64) TESTS 35 77 2457600
112733933 iamavalon D April 12, 2021, 1:39 a.m. OK Java 11 TESTS 35 327 6963200
112726310 saptarshi1729 D April 11, 2021, 8:28 p.m. OK Java 11 TESTS 35 358 4300800
112709055 procrastinate7 D April 11, 2021, 4:33 p.m. OK Java 11 TESTS 35 358 11468800
112720427 nagabhushan D April 11, 2021, 6:42 p.m. OK Java 11 TESTS 35 358 12902400
112712601 nirvana_rsc D April 11, 2021, 5:13 p.m. OK Java 11 TESTS 35 373 7884800
112750161 onteeae D April 12, 2021, 5:58 a.m. OK Java 11 TESTS 35 373 19660800
112713621 nirvana_rsc D April 11, 2021, 5:20 p.m. OK Java 11 TESTS 35 374 7884800
112723907 _merlin_ D April 11, 2021, 7:38 p.m. OK Java 11 TESTS 35 670 51404800
112724966 ritesharma D April 11, 2021, 7:59 p.m. OK Java 11 TESTS 35 1060 132096000
112722923 HBP D April 11, 2021, 7:22 p.m. OK Java 11 TESTS 35 1138 62361600
112749184 aggarwalanshul01 D April 12, 2021, 5:44 a.m. OK Java 8 TESTS 35 202 15564800
112705253 Whiplash99 D April 11, 2021, 4:22 p.m. OK Java 8 TESTS 35 296 16179200
112703967 flyman3046 D April 11, 2021, 4:18 p.m. OK Java 8 TESTS 35 326 23244800
112704421 WhatIsLove D April 11, 2021, 4:20 p.m. OK Java 8 TESTS 35 389 45875200
112715193 Restricted D April 11, 2021, 5:36 p.m. OK Java 8 TESTS 35 607 48332800
112702801 martins D April 11, 2021, 4:14 p.m. OK Java 8 TESTS 35 638 42393600
112719827 Akram-Adel D April 11, 2021, 6:34 p.m. OK Java 8 TESTS 35 670 66662400
112719238 P___ D April 11, 2021, 6:25 p.m. OK MS C++ 2017 TESTS 35 109 4403200
112703477 grey D April 11, 2021, 4:17 p.m. OK MS C++ 2017 TESTS 35 248 6656000
112724546 svr2kos2 D April 11, 2021, 7:51 p.m. OK MS C++ 2017 TESTS 35 358 22528000
112713056 sakapon D April 11, 2021, 5:16 p.m. OK .NET Core C# TESTS 35 171 25292800
112736736 sakapon D April 12, 2021, 2 a.m. OK .NET Core C# TESTS 35 186 27033600
112715367 Satwik_Tiwari D April 11, 2021, 5:38 p.m. OK PyPy 3 TESTS 35 374 29081600
112749777 mkawa2 D April 12, 2021, 5:52 a.m. OK PyPy 3 TESTS 35 436 86835200
112749108 mkawa2 D April 12, 2021, 5:43 a.m. OK PyPy 3 TESTS 35 451 86835200
112708437 VTifand D April 11, 2021, 4:31 p.m. OK PyPy 3 TESTS 35 452 21708800
112706605 jimm89 D April 11, 2021, 4:26 p.m. OK PyPy 3 TESTS 35 452 26009600
112711546 not_tehlka D April 11, 2021, 5:06 p.m. OK PyPy 3 TESTS 35 514 26521600
112712690 at_f D April 11, 2021, 5:14 p.m. OK PyPy 3 TESTS 35 686 28262400
112743121 Genius3435 D April 12, 2021, 3:53 a.m. OK PyPy 3 TESTS 35 733 23142400
112713817 codicon D April 11, 2021, 5:22 p.m. OK PyPy 3 TESTS 35 748 24473600
112713015 colicon D April 11, 2021, 5:16 p.m. OK PyPy 3 TESTS 35 748 24473600
112722912 r-tron18 D April 11, 2021, 7:21 p.m. OK Python 3 TESTS 35 1418 50278400

remove filters

Back to search problems