Codeforces Round 505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

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
1025 Codeforces Round 505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) FINISHED False 8100 202839924 Aug. 19, 2018, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 8027 ) B Weakened Common Divisor PROGRAMMING brute force greedy number theory 1600

B"During the research on properties of the greatest common divisor (GCD) of a set of numbers, Ildar, a famous mathematician, introduced a brand new concept of the weakened common divisor (WCD) of a list of pairs of integers. For a given list of pairs of integers (a_1, b_1) , (a_2, b_2) , ..., (a_n, b_n) their WCD is arbitrary integer greater than 1 , such that it divides at least one element in each pair. WCD may not exist for some lists. For example, if the list looks like [(12, 15), (25, 18), (10, 24)] , then their WCD can be equal to 2 , 3 , 5 or 6 (each of these numbers is strictly greater than 1 and divides at least one number in each pair). You're currently pursuing your PhD degree under Ildar's mentorship, and that's why this problem was delegated to you. Your task is to calculate WCD efficiently. The first line contains a single integer n ( 1 <= n <= 150 ,000 ) -- the number of pairs. Each of the next n lines contains two integer values a_i , b_i ( 2 <= a_i, b_i <= 2 cdot 10^9 ). Print a single integer -- the WCD of the set of pairs. If there are multiple possible answers, output any; if there is no answer, print -1 . In the first example the answer is 6 since it divides 18 from the first pair, 24 from the second and 12 from the third ones. Note that other valid answers will also be accepted. In the second example there are no integers greater than 1 satisfying the conditions. In the third example one of the possible answers is 5 . Note that, for example, 15 is also allowed, but it's not necessary to maximize the output. "...

Tutorials

Codeforces Round #505 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
61609167 sash0 B Oct. 1, 2019, 1:36 p.m. OK D TESTS 99 124 4198400 1600
64453237 hos.lyric B Nov. 7, 2019, 7:51 a.m. OK D TESTS 99 171 11980800 1600
42008408 rr_ B Aug. 23, 2018, 8:23 p.m. OK D TESTS 99 249 0 1600
42008387 rr_ B Aug. 23, 2018, 8:21 p.m. OK D TESTS 99 249 0 1600
42116737 TShT B Aug. 26, 2018, 10:11 a.m. OK FPC TESTS 99 93 3993600 1600
42290402 freyes B Aug. 30, 2018, 8:16 p.m. OK GNU C TESTS 99 78 1228800 1600
41866940 NoSoul B Aug. 19, 2018, 5:21 p.m. OK GNU C TESTS 98 78 1638400 1600
41895569 13226029171 B Aug. 20, 2018, 9:15 a.m. OK GNU C TESTS 99 93 1228800 1600
41857856 aniket.shrimal B Aug. 19, 2018, 3:11 p.m. OK GNU C TESTS 98 124 4812800 1600
41879096 newbieski B Aug. 19, 2018, 11:57 p.m. OK GNU C TESTS 99 140 2457600 1600
41961361 zhtzht B Aug. 22, 2018, 9:37 a.m. OK GNU C++ TESTS 99 46 0 1600
42349934 luogu_bot4 B Sept. 2, 2018, 4:03 a.m. OK GNU C++ TESTS 99 46 0 1600
42349876 luogu_bot4 B Sept. 2, 2018, 3:58 a.m. OK GNU C++ TESTS 99 46 0 1600
42349857 luogu_bot1 B Sept. 2, 2018, 3:56 a.m. OK GNU C++ TESTS 99 46 0 1600
41937695 cwb_sb B Aug. 21, 2018, 1:39 p.m. OK GNU C++ TESTS 99 46 0 1600
41929627 Patti B Aug. 21, 2018, 9:21 a.m. OK GNU C++ TESTS 99 46 0 1600
41889916 Recc B Aug. 20, 2018, 6:34 a.m. OK GNU C++ TESTS 99 46 0 1600
41923229 Canophia B Aug. 21, 2018, 5:59 a.m. OK GNU C++ TESTS 99 46 1024000 1600
42124382 xxjAc B Aug. 26, 2018, 2:14 p.m. OK GNU C++ TESTS 99 46 1228800 1600
41880855 0322_0401 B Aug. 20, 2018, 1:24 a.m. OK GNU C++ TESTS 99 46 1228800 1600
62833752 DevJewel B Oct. 17, 2019, 9:03 p.m. OK GNU C11 TESTS 99 77 0 1600
41869564 sansen B Aug. 19, 2018, 5:58 p.m. OK GNU C11 TESTS 98 78 0 1600
45668198 dixitgarg B Nov. 13, 2018, 8:58 a.m. OK GNU C11 TESTS 99 93 3584000 1600
45668166 dixitgarg B Nov. 13, 2018, 8:56 a.m. OK GNU C11 TESTS 99 109 3584000 1600
41966651 tall15421542 B Aug. 22, 2018, 12:41 p.m. OK GNU C11 TESTS 99 109 10752000 1600
42824746 RainWing B Sept. 13, 2018, 9:13 a.m. OK GNU C11 TESTS 99 140 2457600 1600
45673843 Jousero B Nov. 13, 2018, 12:06 p.m. OK GNU C11 TESTS 99 498 0 1600
45673739 Jousero B Nov. 13, 2018, 12:03 p.m. OK GNU C11 TESTS 99 499 0 1600
45673872 vjudge5 B Nov. 13, 2018, 12:07 p.m. OK GNU C11 TESTS 99 499 0 1600
48494071 mmmod_lqs B Jan. 17, 2019, 12:14 p.m. OK GNU C++11 TESTS 99 31 21299200 1600
41920611 felmid B Aug. 21, 2018, 3:44 a.m. OK GNU C++11 TESTS 99 46 0 1600
42607864 Anson529 B Sept. 7, 2018, 9:07 a.m. OK GNU C++11 TESTS 99 46 0 1600
44575830 Yldan B Oct. 20, 2018, 7:02 a.m. OK GNU C++11 TESTS 99 46 0 1600
53496402 xuxuxuxuxu B April 29, 2019, 12:01 p.m. OK GNU C++11 TESTS 99 46 0 1600
61302456 vjudge4 B Sept. 26, 2019, 5:40 a.m. OK GNU C++11 TESTS 99 46 0 1600
61302515 vjudge4 B Sept. 26, 2019, 5:42 a.m. OK GNU C++11 TESTS 99 46 0 1600
42010029 Amad3usSystem B Aug. 23, 2018, 10:51 p.m. OK GNU C++11 TESTS 99 46 102400 1600
42425828 KKKKK_ON B Sept. 3, 2018, 12:38 p.m. OK GNU C++11 TESTS 99 46 204800 1600
42852199 Hacheylight B Sept. 14, 2018, 6:35 a.m. OK GNU C++11 TESTS 99 46 307200 1600
42022075 StayAwayFromBitches B Aug. 24, 2018, 9:47 a.m. OK GNU C++14 TESTS 99 46 1228800 1600
41870320 orz010orz B Aug. 19, 2018, 6:13 p.m. OK GNU C++14 TESTS 98 46 1331200 1600
41880622 interestingLSY B Aug. 20, 2018, 1:15 a.m. OK GNU C++14 TESTS 99 46 1331200 1600
41880218 ChesterKing B Aug. 20, 2018, 12:59 a.m. OK GNU C++14 TESTS 99 46 1843200 1600
42192047 nickluo B Aug. 28, 2018, 3:33 a.m. OK GNU C++14 TESTS 99 46 2560000 1600
41885086 mohamedeltair B Aug. 20, 2018, 3:06 a.m. OK GNU C++14 TESTS 99 78 0 1600
46690345 Nayem. B Dec. 6, 2018, 4:10 p.m. OK GNU C++14 TESTS 99 78 1228800 1600
41885369 mohamedeltair B Aug. 20, 2018, 3:18 a.m. OK GNU C++14 TESTS 99 78 1228800 1600
41940913 too_young_too_top1 B Aug. 21, 2018, 3:23 p.m. OK GNU C++14 TESTS 99 78 1638400 1600
52231951 bojverdict1 B April 2, 2019, 12:14 p.m. OK GNU C++14 TESTS 99 78 1740800 1600
41881097 LiChenKoh B Aug. 20, 2018, 1:35 a.m. OK GNU C++17 TESTS 99 46 1843200 1600
45997775 vjudge1 B Nov. 20, 2018, 1:08 p.m. OK GNU C++17 TESTS 99 78 0 1600
41890958 Nickir B Aug. 20, 2018, 7:05 a.m. OK GNU C++17 TESTS 99 78 102400 1600
47016286 Harshil_Bhavsar B Dec. 14, 2018, 7:13 p.m. OK GNU C++17 TESTS 99 78 2662400 1600
45801367 vjudge2 B Nov. 16, 2018, 1:30 p.m. OK GNU C++17 TESTS 99 93 0 1600
41911517 KrK B Aug. 20, 2018, 6:11 p.m. OK GNU C++17 TESTS 99 93 0 1600
61635012 Thanya_Leif B Oct. 1, 2019, 3:16 p.m. OK GNU C++17 TESTS 99 93 0 1600
46854944 neeleshsinha B Dec. 10, 2018, 2:16 p.m. OK GNU C++17 TESTS 99 93 307200 1600
45695052 yhchang3 B Nov. 14, 2018, 2:07 a.m. OK GNU C++17 TESTS 99 93 614400 1600
63747120 sakib_muhit B Oct. 29, 2019, 6:51 p.m. OK GNU C++17 TESTS 99 93 1228800 1600
44482016 sooraj10 B Oct. 18, 2018, 10:49 a.m. OK Java 8 TESTS 99 140 0 1600
44466628 ViciousCoder B Oct. 18, 2018, 2:58 a.m. OK Java 8 TESTS 99 140 0 1600
41879141 AQT B Aug. 20, 2018, midnight OK Java 8 TESTS 99 155 0 1600
41898527 deepkasana B Aug. 20, 2018, 10:56 a.m. OK Java 8 TESTS 99 156 0 1600
42957231 wery0 B Sept. 16, 2018, 4:58 p.m. OK Java 8 TESTS 99 171 0 1600
41999685 spar5h B Aug. 23, 2018, 2:18 p.m. OK Java 8 TESTS 99 171 0 1600
41954911 xyz_000 B Aug. 22, 2018, 5:46 a.m. OK Java 8 TESTS 99 171 0 1600
41937843 Tarun B Aug. 21, 2018, 1:44 p.m. OK Java 8 TESTS 99 171 0 1600
41922093 xodiac B Aug. 21, 2018, 5:10 a.m. OK Java 8 TESTS 99 171 0 1600
41914358 Aniket144 B Aug. 20, 2018, 8 p.m. OK Java 8 TESTS 99 171 0 1600
41862574 Slamur B Aug. 19, 2018, 3:38 p.m. OK Kotlin TESTS 98 421 6963200 1600
41871928 elizarov B Aug. 19, 2018, 6:45 p.m. OK Kotlin TESTS 99 592 204800 1600
55928972 og.kostya B June 22, 2019, 10:35 a.m. OK Mono C# TESTS 99 124 6758400 1600
41894083 fr0st B Aug. 20, 2018, 8:32 a.m. OK Mono C# TESTS 99 187 41472000 1600
41901006 Jarazorg B Aug. 20, 2018, 12:08 p.m. OK Mono C# TESTS 99 202 4300800 1600
41907045 mrthannn B Aug. 20, 2018, 3:12 p.m. OK Mono C# TESTS 99 202 4300800 1600
51651366 nemars B March 21, 2019, 6:59 p.m. OK Mono C# TESTS 99 234 6860800 1600
41896502 GustavK B Aug. 20, 2018, 9:45 a.m. OK Mono C# TESTS 99 249 10137600 1600
42307195 Alex_PKZDL B Aug. 31, 2018, 12:04 p.m. OK Mono C# TESTS 99 265 13721600 1600
42215350 blackstone1 B Aug. 28, 2018, 4:48 p.m. OK Mono C# TESTS 99 265 14438400 1600
41884441 lxn B Aug. 20, 2018, 2:46 a.m. OK MS C++ TESTS 99 61 102400 1600
48607165 vjudge4 B Jan. 20, 2019, 11:36 a.m. OK MS C++ TESTS 99 62 8294400 1600
61302302 vjudge1 B Sept. 26, 2019, 5:36 a.m. OK MS C++ TESTS 99 77 0 1600
60829210 vjudge5 B Sept. 19, 2019, 6:05 a.m. OK MS C++ TESTS 99 77 614400 1600
50157849 vjudge4 B Feb. 19, 2019, 11:07 a.m. OK MS C++ TESTS 99 77 1638400 1600
48318694 vjudge1 B Jan. 13, 2019, 8:03 a.m. OK MS C++ TESTS 99 77 1843200 1600
54468895 vjudge1 B May 22, 2019, 3:22 a.m. OK MS C++ TESTS 99 78 0 1600
50495484 vjudge2 B Feb. 25, 2019, 2:58 p.m. OK MS C++ TESTS 99 78 0 1600
61016993 vjudge4 B Sept. 21, 2019, 1:37 p.m. OK MS C++ TESTS 99 93 0 1600
43125642 scorpiowf B Sept. 20, 2018, 3:11 p.m. OK MS C++ TESTS 99 93 1740800 1600
62674125 AleksanderBalobanov B Oct. 16, 2019, 10:53 a.m. OK MS C++ 2017 TESTS 99 109 7987200 1600
66594119 yuanyuan2048 B Dec. 10, 2019, 2:02 p.m. OK MS C++ 2017 TESTS 99 296 1433600 1600
69663347 Mad112233 B Jan. 28, 2020, 10:20 a.m. OK MS C++ 2017 TESTS 99 312 0 1600
54468298 lantianbaiyun B May 22, 2019, 2:44 a.m. OK MS C++ 2017 TESTS 99 312 0 1600
66552319 CtrlAlt B Dec. 9, 2019, 3:23 p.m. OK MS C++ 2017 TESTS 99 312 307200 1600
65269561 MRamanauskas B Nov. 17, 2019, 6:56 p.m. OK MS C++ 2017 TESTS 99 327 2662400 1600
67068373 jagruthi B Dec. 17, 2019, 11:55 a.m. OK MS C++ 2017 TESTS 99 327 3174400 1600
55106146 Mole_Q B June 5, 2019, 2:46 a.m. OK MS C++ 2017 TESTS 99 358 16896000 1600
55106354 Mole_Q B June 5, 2019, 3:02 a.m. OK MS C++ 2017 TESTS 99 374 16896000 1600
55094903 Mole_Q B June 4, 2019, 4:34 p.m. OK MS C++ 2017 TESTS 99 1481 4505600 1600
42115849 kakkarotssj B Aug. 26, 2018, 9:35 a.m. OK PyPy 2 TESTS 99 421 10240000 1600
43268797 SerChirag B Sept. 22, 2018, 5:48 p.m. OK PyPy 2 TESTS 99 514 10444800 1600
41862237 Onesh0t B Aug. 19, 2018, 3:36 p.m. OK PyPy 2 TESTS 98 576 11264000 1600
60400908 ssk497 B Sept. 11, 2019, 4:39 p.m. OK PyPy 2 TESTS 99 608 12595200 1600
41872792 wanderer163 B Aug. 19, 2018, 7:07 p.m. OK PyPy 2 TESTS 99 623 3379200 1600
41985505 akshay125 B Aug. 23, 2018, 5:47 a.m. OK PyPy 2 TESTS 99 624 10752000 1600
42102006 kakkarotssj B Aug. 25, 2018, 8:01 p.m. OK PyPy 2 TESTS 99 624 23961600 1600
41867911 Pratik_2106 B Aug. 19, 2018, 5:33 p.m. OK PyPy 2 TESTS 98 654 13619200 1600
42217787 arikpamnani B Aug. 28, 2018, 6:15 p.m. OK PyPy 2 TESTS 99 655 10956800 1600
54539194 vjudge1 B May 23, 2019, 10:46 p.m. OK PyPy 2 TESTS 99 702 11059200 1600
50100411 toysheeyeyraku B Feb. 18, 2019, 2:38 p.m. OK PyPy 3 TESTS 99 468 9625600 1600
41876175 LordVader B Aug. 19, 2018, 9:04 p.m. OK PyPy 3 TESTS 99 482 8601600 1600
41970652 wadissimo B Aug. 22, 2018, 2:53 p.m. OK PyPy 3 TESTS 99 483 10137600 1600
41870009 tanmay28 B Aug. 19, 2018, 6:07 p.m. OK PyPy 3 TESTS 98 499 8499200 1600
41941499 Evil__Coder B Aug. 21, 2018, 3:46 p.m. OK PyPy 3 TESTS 99 577 9728000 1600
41872270 Praxis B Aug. 19, 2018, 6:53 p.m. OK PyPy 3 TESTS 99 1263 10137600 1600
49876062 111vad111 B Feb. 13, 2019, 3:55 p.m. OK PyPy 3 TESTS 99 1309 10137600 1600
41870058 bkalra92 B Aug. 19, 2018, 6:08 p.m. OK PyPy 3 TESTS 98 1310 10240000 1600
41878137 titia B Aug. 19, 2018, 10:41 p.m. OK PyPy 3 TESTS 99 1341 13926400 1600
41884705 gretel B Aug. 20, 2018, 2:53 a.m. OK PyPy 3 TESTS 99 1387 10137600 1600
49949384 fortmax120 B Feb. 15, 2019, 1:26 p.m. OK Python 2 TESTS 99 670 14336000 1600
41982421 shnamacedev B Aug. 23, 2018, 3 a.m. OK Python 2 TESTS 99 779 16281600 1600
41876970 anitocode B Aug. 19, 2018, 9:28 p.m. OK Python 2 TESTS 99 810 12390400 1600
41876280 Butane B Aug. 19, 2018, 9:07 p.m. OK Python 2 TESTS 99 826 12390400 1600
41875450 anitocode B Aug. 19, 2018, 8:35 p.m. OK Python 2 TESTS 99 826 12390400 1600
49924483 fortmax120 B Feb. 14, 2019, 9:15 p.m. OK Python 2 TESTS 99 872 14336000 1600
41860289 splidd B Aug. 19, 2018, 3:25 p.m. OK Python 2 TESTS 98 904 12390400 1600
41876604 sallyyao2001 B Aug. 19, 2018, 9:24 p.m. OK Python 2 TESTS 99 919 2457600 1600
41950564 wangkan2001 B Aug. 22, 2018, 12:41 a.m. OK Python 2 TESTS 99 935 2457600 1600
41862880 sunakshi159 B Aug. 19, 2018, 3:39 p.m. OK Python 2 TESTS 98 1045 13926400 1600
41953192 orailly B Aug. 22, 2018, 3:56 a.m. OK Python 3 TESTS 99 483 12800000 1600
41870468 tanmay28 B Aug. 19, 2018, 6:17 p.m. OK Python 3 TESTS 98 499 0 1600
41953623 orailly B Aug. 22, 2018, 4:31 a.m. OK Python 3 TESTS 99 514 12083200 1600
46735843 jpa B Dec. 7, 2018, 7:50 p.m. OK Python 3 TESTS 99 560 26726400 1600
50525463 ilya_kas B Feb. 26, 2019, 11:35 a.m. OK Python 3 TESTS 99 608 14540800 1600
52291469 fbsham102 B April 4, 2019, 2:14 a.m. OK Python 3 TESTS 99 623 0 1600
41953177 orailly B Aug. 22, 2018, 3:55 a.m. OK Python 3 TESTS 99 623 12902400 1600
52024150 ravi_joe B March 30, 2019, 2:03 p.m. OK Python 3 TESTS 99 654 14643200 1600
44771645 ashok123 B Oct. 24, 2018, 12:38 p.m. OK Python 3 TESTS 99 655 15052800 1600
42089340 romit17 B Aug. 25, 2018, 12:25 p.m. OK Python 3 TESTS 99 670 0 1600
41868374 pinguinson B Aug. 19, 2018, 5:40 p.m. OK Scala TESTS 98 717 307200 1600
41861762 limed B Aug. 19, 2018, 3:33 p.m. OK Scala TESTS 98 811 0 1600

remove filters

Back to search problems