Codeforces Round 626 (Div. 1, based on Moscow Open Olympiad in Informatics)

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
1322 Codeforces Round 626 (Div. 1, based on Moscow Open Olympiad in Informatics) FINISHED False 7200 153779111 March 7, 2020, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2508 ) C Instant Noodles PROGRAMMING graphs hashing math number theory

B'Wu got hungry after an intense training session, and came to a nearby store to buy his favourite instant noodles. After Wu paid for his purchase, the cashier gave him an interesting task. You are given a bipartite graph with positive integers in all vertices of the right half. For a subset S of vertices of the left half we define N(S) as the set of all vertices of the right half adjacent to at least one vertex in S , and f(S) as the sum of all numbers in vertices of N(S) . Find the greatest common divisor of f(S) for all possible non-empty subsets S (assume that GCD of empty set is 0 ). Wu is too tired after his training to solve this problem. Help him! The first line contains a single integer t ( 1 <= q t <= q 500 ,000 ) -- the number of test cases in the given test set. Test case descriptions follow. The first line of each case description contains two integers n and m ( 1~ <= q~n,~m~ <= q~500 ,000 ) -- the number of vertices in either half of the graph, and the number of edges respectively. The second line contains n integers c_i ( 1 <= q c_i <= q 10^{12} ). The i -th number describes the integer in the vertex i of the right half of the graph. Each of the following m lines contains a pair of integers u_i and v_i ( 1 <= q u_i, v_i <= q n ), describing an edge between the vertex u_i of the left half and the vertex v_i of the right half. It is guaranteed that the graph does not contain multiple edges. Test case descriptions are separated with empty lines. The total value of n across all test cases does not exceed 500 ,000 , and the total value of m across all test cases does not exceed 500 ,000 as well. For each test case print a single integer -- the required greatest common divisor. The greatest common divisor of a set of integers is the largest integer g such that all elements of the set are'...

Tutorials

Codeforces Round #626 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
72654781 Gassa C March 7, 2020, 11:14 a.m. OK D TESTS 89 1201 55500800
72676564 physics0523 C March 7, 2020, 4:29 p.m. OK GNU C11 TESTS 89 405 29388800
72659103 Binary_Search_Tree C March 7, 2020, 11:34 a.m. OK GNU C++11 TESTS 89 202 52121600
72658875 stal_xy23z7b8 C March 7, 2020, 11:34 a.m. OK GNU C++11 TESTS 89 218 16076800
72651238 msuwakow C March 7, 2020, 10:57 a.m. OK GNU C++11 TESTS 89 233 24883200
72646584 lzr_010506 C March 7, 2020, 10:36 a.m. OK GNU C++11 TESTS 89 249 28057600
72653666 hs-black C March 7, 2020, 11:09 a.m. OK GNU C++11 TESTS 89 249 77824000
72665816 It5t C March 7, 2020, 1:30 p.m. OK GNU C++11 TESTS 89 295 27545600
72664836 lzoilxy C March 7, 2020, 1:15 p.m. OK GNU C++11 TESTS 89 295 32051200
72640194 CYJian C March 7, 2020, 10:11 a.m. OK GNU C++11 TESTS 89 296 29388800
72666615 OrzLiM_817 C March 7, 2020, 1:42 p.m. OK GNU C++11 TESTS 89 296 53657600
72663428 foreverlasting C March 7, 2020, 12:55 p.m. OK GNU C++11 TESTS 89 311 126361600
72647939 sjcakioi C March 7, 2020, 10:42 a.m. OK GNU C++14 TESTS 89 405 56422400
72656380 Hyperbolic C March 7, 2020, 11:23 a.m. OK GNU C++14 TESTS 89 483 28262400
72667315 iotang C March 7, 2020, 1:53 p.m. OK GNU C++14 TESTS 89 529 26009600
72649900 ZZZZZZZZZZZZZZZZZZ C March 7, 2020, 10:50 a.m. OK GNU C++14 TESTS 89 592 20070400
72645552 PinkieRabbit C March 7, 2020, 10:32 a.m. OK GNU C++14 TESTS 89 607 14028800
72678868 MISANTHROPE C March 7, 2020, 5:07 p.m. OK GNU C++14 TESTS 89 607 31436800
72675079 Hongzy C March 7, 2020, 4:02 p.m. OK GNU C++14 TESTS 89 608 10035200
72640613 yhx-12243 C March 7, 2020, 10:13 a.m. OK GNU C++14 TESTS 89 608 20070400
72651828 wucstdio C March 7, 2020, 10:59 a.m. OK GNU C++14 TESTS 89 608 21606400
72645591 Retro3014 C March 7, 2020, 10:32 a.m. OK GNU C++14 TESTS 89 608 29696000
72681395 limbo.null C March 7, 2020, 5:30 p.m. OK GNU C++17 TESTS 89 295 23961600
72645155 interestingLSY C March 7, 2020, 10:30 a.m. OK GNU C++17 TESTS 89 436 49868800
72644379 LayCurse C March 7, 2020, 10:27 a.m. OK GNU C++17 TESTS 89 483 21299200
72665850 Changyu C March 7, 2020, 1:31 p.m. OK GNU C++17 TESTS 89 576 20070400
72644950 CMXRYNP C March 7, 2020, 10:29 a.m. OK GNU C++17 TESTS 89 623 12083200
72665101 sugarrr C March 7, 2020, 1:19 p.m. OK GNU C++17 TESTS 89 623 16486400
72682979 badcw C March 7, 2020, 6:12 p.m. OK GNU C++17 TESTS 89 623 20275200
72647101 lezdzh C March 7, 2020, 10:38 a.m. OK GNU C++17 TESTS 89 623 37683200
72664438 GiannisAntetokounmpo C March 7, 2020, 1:10 p.m. OK GNU C++17 TESTS 89 624 80179200
72638032 mnbvmar C March 7, 2020, 10:03 a.m. OK GNU C++17 TESTS 89 638 16076800
72640563 uwi C March 7, 2020, 10:12 a.m. OK Java 11 TESTS 89 732 51609600
72678361 TheSawan C March 7, 2020, 4:59 p.m. OK Java 11 TESTS 89 1700 166297600
72690631 Hemose C March 7, 2020, 8:42 p.m. OK Java 11 TESTS 89 1824 87756800
72675124 cwise C March 7, 2020, 4:03 p.m. OK Java 8 TESTS 89 530 86016000
72666516 cwise C March 7, 2020, 1:40 p.m. OK Java 8 TESTS 89 545 86016000
72643923 qwerty787788 C March 7, 2020, 10:26 a.m. OK Java 8 TESTS 89 702 42086400
72651659 Taran_1407 C March 7, 2020, 10:59 a.m. OK Java 8 TESTS 89 810 48332800
72657816 SecondThread C March 7, 2020, 11:30 a.m. OK Java 8 TESTS 89 1247 94003200
72652673 Tlatoani C March 7, 2020, 11:04 a.m. OK Kotlin TESTS 89 1747 194969600
72649179 math957963 C March 7, 2020, 10:47 a.m. OK MS C++ TESTS 89 561 55705600
72661997 pichulia C March 7, 2020, 12:36 p.m. OK MS C++ 2017 TESTS 89 1075 59699200
72663978 bcollet C March 7, 2020, 1:03 p.m. OK PyPy 2 TESTS 89 1372 108544000
72644307 titia C March 7, 2020, 10:27 a.m. OK PyPy 3 TESTS 89 1622 109465600
72650729 sansen C March 7, 2020, 10:54 a.m. OK Rust TESTS 89 389 42086400

remove filters

Back to search problems