Codeforces Round 509 (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
1041 Codeforces Round 509 (Div. 2) FINISHED False 7200 194729099 Sept. 16, 2018, 10:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 14064 ) B Buying a TV Set PROGRAMMING math 1100

B"Monocarp has decided to buy a new TV set and hang it on the wall in his flat. The wall has enough free space so Monocarp can buy a TV set with screen width not greater than a and screen height not greater than b . Monocarp is also used to TV sets with a certain aspect ratio: formally, if the width of the screen is w , and the height of the screen is h , then the following condition should be met: frac{w}{h} = frac{x}{y} . There are many different TV sets in the shop. Monocarp is sure that for any pair of positive integers w and h there is a TV set with screen width w and height h in the shop. Monocarp isn't ready to choose the exact TV set he is going to buy. Firstly he wants to determine the optimal screen resolution. He has decided to try all possible variants of screen size. But he must count the number of pairs of positive integers w and h , beforehand, such that (w <= a) , (h <= b) and ( frac{w}{h} = frac{x}{y}) . In other words, Monocarp wants to determine the number of TV sets having aspect ratio frac{x}{y} , screen width not exceeding a , and screen height not exceeding b . Two TV sets are considered different if they have different screen width or different screen height. The first line contains four integers a , b , x , y ( 1 <= a, b, x, y <= 10^{18} ) -- the constraints on the screen width and height, and on the aspect ratio. Print one integer -- the number of different variants to choose TV screen width and screen height so that they meet the aforementioned constraints. In the first example, there are 3 possible variants: (5, 3) , (10, 6) , (15, 9) . In the second example, there is no TV set meeting the constraints. In the third example, there is only one variant: (3, 2) . "...

Tutorials

Codeforces Round #509 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
42967016 luogu_bot2 B Sept. 17, 2018, 2:11 a.m. OK FPC TESTS 75 31 0 1100
45089967 njsfdxfszx59 B Oct. 30, 2018, 9:07 a.m. OK FPC TESTS 75 31 0 1100
43174842 timesong B Sept. 21, 2018, 10:41 a.m. OK FPC TESTS 75 31 0 1100
43445196 BattleCry B Sept. 26, 2018, 11:04 a.m. OK FPC TESTS 75 31 0 1100
45086838 chaorenhaha B Oct. 30, 2018, 7:50 a.m. OK FPC TESTS 75 31 0 1100
42966072 hjsshjg B Sept. 17, 2018, 1:02 a.m. OK FPC TESTS 75 31 0 1100
42962616 sad101010 B Sept. 16, 2018, 8:23 p.m. OK FPC TESTS 75 31 0 1100
42946028 vdanh7277 B Sept. 16, 2018, 12:31 p.m. OK FPC TESTS 75 31 0 1100
42935158 ZuZKho B Sept. 16, 2018, 11:33 a.m. OK FPC TESTS 75 31 0 1100
42933908 immr B Sept. 16, 2018, 11:27 a.m. OK FPC TESTS 75 31 0 1100
45280104 yrk317 B Nov. 4, 2018, 1:15 p.m. OK GNU C11 TESTS 75 30 0 1100
50631834 Magicdog_Jo B March 1, 2019, 9:32 a.m. OK GNU C11 TESTS 75 31 0 1100
58863605 akash19jain B Aug. 15, 2019, 12:35 p.m. OK GNU C11 TESTS 75 31 0 1100
65484378 yigezhe B Nov. 21, 2019, 12:46 p.m. OK GNU C11 TESTS 75 31 0 1100
65488743 DevJewel B Nov. 21, 2019, 1:48 p.m. OK GNU C11 TESTS 75 31 0 1100
69070393 ndaidemf B Jan. 18, 2020, 9:19 p.m. OK GNU C11 TESTS 75 31 0 1100
46253046 NoSoul B Nov. 26, 2018, 3:08 p.m. OK GNU C11 TESTS 75 31 0 1100
47874759 xmq5513 B Jan. 3, 2019, 2:44 p.m. OK GNU C11 TESTS 75 31 0 1100
48593249 Karasu B Jan. 20, 2019, 4:35 a.m. OK GNU C11 TESTS 75 31 0 1100
49458362 MrSKJ B Feb. 4, 2019, 11:39 a.m. OK GNU C11 TESTS 75 31 0 1100
67779671 sri_akshya_18 B Dec. 28, 2019, 10:27 a.m. OK GNU C++11 TESTS 75 31 0 1100
69878138 deja_vu_ B Jan. 31, 2020, 5:11 a.m. OK GNU C++11 TESTS 75 31 0 1100
68371695 6five B Jan. 7, 2020, 5:57 p.m. OK GNU C++11 TESTS 75 31 0 1100
68121254 wkwkwill B Jan. 3, 2020, 1:24 p.m. OK GNU C++11 TESTS 75 31 0 1100
67785518 luogu_bot1 B Dec. 28, 2019, 12:36 p.m. OK GNU C++11 TESTS 75 31 0 1100
68706443 danielcm583 B Jan. 13, 2020, 11:29 a.m. OK GNU C++11 TESTS 75 31 0 1100
68975923 _Kema_ B Jan. 17, 2020, 8:49 a.m. OK GNU C++11 TESTS 75 31 0 1100
69048054 vjudge1 B Jan. 18, 2020, 11:42 a.m. OK GNU C++11 TESTS 75 31 0 1100
69432289 luogu_bot4 B Jan. 23, 2020, 5:43 p.m. OK GNU C++11 TESTS 75 31 0 1100
69658774 pipiguai B Jan. 28, 2020, 8:33 a.m. OK GNU C++11 TESTS 75 31 0 1100
44068515 Yershat B Oct. 10, 2018, 10:47 a.m. OK GNU C++14 TESTS 75 15 0 1100
42993289 FenriR_Uzh B Sept. 17, 2018, 11:11 a.m. OK GNU C++14 TESTS 75 15 0 1100
42956505 alshahreyaj B Sept. 16, 2018, 4:36 p.m. OK GNU C++14 TESTS 75 15 0 1100
52617178 Noemikulcsar B April 11, 2019, 7:05 p.m. OK GNU C++14 TESTS 75 15 0 1100
58695401 kpkp B Aug. 13, 2019, 5:46 a.m. OK GNU C++14 TESTS 75 30 0 1100
66016117 Myrat.A B Nov. 30, 2019, 5:29 a.m. OK GNU C++14 TESTS 75 30 0 1100
60441299 Happy_100 B Sept. 12, 2019, 12:36 p.m. OK GNU C++14 TESTS 75 30 0 1100
59932404 phuc003 B Sept. 3, 2019, 7:51 a.m. OK GNU C++14 TESTS 75 30 0 1100
57351444 368 B July 20, 2019, 3:51 a.m. OK GNU C++14 TESTS 75 30 0 1100
55532946 rajat_chandak B June 13, 2019, 2:38 p.m. OK GNU C++14 TESTS 75 30 0 1100
46574443 2looper B Dec. 4, 2018, 7:56 a.m. OK GNU C++17 TESTS 75 15 0 1100
49824479 Surya_41 B Feb. 12, 2019, 10:44 a.m. OK GNU C++17 TESTS 75 15 0 1100
48993028 Shridhar B Jan. 26, 2019, 3:17 p.m. OK GNU C++17 TESTS 75 15 307200 1100
56948206 AngelGH B July 13, 2019, 12:28 a.m. OK GNU C++17 TESTS 75 30 0 1100
59932962 hieulew203 B Sept. 3, 2019, 8:10 a.m. OK GNU C++17 TESTS 75 30 0 1100
65434640 dontquit B Nov. 20, 2019, 1:03 p.m. OK GNU C++17 TESTS 75 30 0 1100
69066376 ERROR... B Jan. 18, 2020, 6:49 p.m. OK GNU C++17 TESTS 75 30 0 1100
55536553 karansiwach360 B June 13, 2019, 4:45 p.m. OK GNU C++17 TESTS 75 30 0 1100
56857850 bsse1129 B July 11, 2019, 7:36 p.m. OK GNU C++17 TESTS 75 30 0 1100
53006548 Resting_Prince B April 19, 2019, 9:52 a.m. OK GNU C++17 TESTS 75 30 0 1100
42939804 Flaker B Sept. 16, 2018, 11:58 a.m. OK Go TESTS 75 46 0 1100
43007055 Haar B Sept. 17, 2018, 4:29 p.m. OK Haskell TESTS 75 30 8396800 1100
43016047 jedikni B Sept. 17, 2018, 11 p.m. OK Haskell TESTS 75 31 8396800 1100
55730827 caoash B June 18, 2019, 9:04 p.m. OK Java 8 TESTS 75 109 0 1100
66428677 ijxjdjd B Dec. 7, 2019, 12:33 a.m. OK Java 8 TESTS 75 109 0 1100
57919195 vvenkai B July 29, 2019, 3:32 a.m. OK Java 8 TESTS 75 109 0 1100
54836004 hridaygoyal007 B May 30, 2019, 10:56 a.m. OK Java 8 TESTS 75 109 0 1100
45243541 LemonPudding B Nov. 3, 2018, 12:48 p.m. OK Java 8 TESTS 75 109 0 1100
45227708 llamaoo7 B Nov. 3, 2018, 4:53 a.m. OK Java 8 TESTS 75 109 0 1100
44773162 harpreetmehra B Oct. 24, 2018, 1:12 p.m. OK Java 8 TESTS 75 109 0 1100
44311341 shifona B Oct. 14, 2018, 11:40 a.m. OK Java 8 TESTS 75 109 0 1100
68957504 O_E B Jan. 16, 2020, 9:07 p.m. OK Java 8 TESTS 75 124 0 1100
68380002 akshVerma B Jan. 7, 2020, 11:32 p.m. OK Java 8 TESTS 75 124 0 1100
43096091 stepanovep B Sept. 20, 2018, 12:01 a.m. OK Kotlin TESTS 75 155 0 1100
42973366 tumoyakov B Sept. 17, 2018, 8:06 a.m. OK Kotlin TESTS 75 171 102400 1100
42933361 zloi.timur B Sept. 16, 2018, 11:24 a.m. OK Kotlin TESTS 75 202 614400 1100
54438154 og.kostya B May 21, 2019, 7:05 a.m. OK Mono C# TESTS 75 46 0 1100
42967471 eki B Sept. 17, 2018, 2:43 a.m. OK Mono C# TESTS 75 46 0 1100
43201384 justpwned B Sept. 21, 2018, 3:25 p.m. OK Mono C# TESTS 75 46 0 1100
43652722 nastya1199 B Oct. 1, 2018, 4:27 p.m. OK Mono C# TESTS 75 46 0 1100
42960126 TrinidadTobago B Sept. 16, 2018, 6:36 p.m. OK Mono C# TESTS 75 46 204800 1100
43476744 witchu B Sept. 27, 2018, 3:53 a.m. OK Mono C# TESTS 75 62 0 1100
43313756 nemars B Sept. 23, 2018, 1:47 p.m. OK Mono C# TESTS 75 62 0 1100
42938467 mircea85 B Sept. 16, 2018, 11:50 a.m. OK Mono C# TESTS 75 62 204800 1100
43044449 namaku B Sept. 18, 2018, 5:16 p.m. OK Mono C# TESTS 75 62 3584000 1100
43866448 tolmachev411 B Oct. 5, 2018, 6:17 p.m. OK Mono C# TESTS 75 62 3584000 1100
44976105 vjudge2 B Oct. 28, 2018, 5:36 a.m. OK MS C++ TESTS 75 30 0 1100
42970530 CrashMaster B Sept. 17, 2018, 5:54 a.m. OK MS C++ TESTS 75 30 0 1100
57356295 shio B July 20, 2019, 6:26 a.m. OK MS C++ TESTS 75 31 0 1100
54656487 vjudge2 B May 26, 2019, 8:40 a.m. OK MS C++ TESTS 75 31 0 1100
54654601 vjudge1 B May 26, 2019, 7:32 a.m. OK MS C++ TESTS 75 31 0 1100
54654062 vjudge4 B May 26, 2019, 7:15 a.m. OK MS C++ TESTS 75 31 0 1100
54652259 vjudge3 B May 26, 2019, 6:12 a.m. OK MS C++ TESTS 75 31 0 1100
58163695 monggo1995 B Aug. 2, 2019, 8:19 a.m. OK MS C++ TESTS 75 31 0 1100
58164897 monggo1995 B Aug. 2, 2019, 8:42 a.m. OK MS C++ TESTS 75 31 0 1100
62907877 vjudge5 B Oct. 19, 2019, 6:24 a.m. OK MS C++ TESTS 75 31 0 1100
64598233 Wilmetronw B Nov. 9, 2019, 5:37 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
55997774 devaar100 B June 24, 2019, 11:26 a.m. OK MS C++ 2017 TESTS 75 31 0 1100
49472576 Still_Theory B Feb. 4, 2019, 5:49 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
49472609 Souseisaki B Feb. 4, 2019, 5:50 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
50628523 taolahung01 B March 1, 2019, 7:39 a.m. OK MS C++ 2017 TESTS 75 31 0 1100
52268087 CristianoRonaldo B April 3, 2019, 12:07 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
54778216 VladKozin B May 28, 2019, 7:21 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
55243102 Mad112233 B June 7, 2019, 12:07 p.m. OK MS C++ 2017 TESTS 75 31 0 1100
67701078 vjudge5 B Dec. 27, 2019, 2:41 p.m. OK MS C++ 2017 TESTS 75 31 307200 1100
65805731 NewLul B Nov. 27, 2019, 8:51 a.m. OK MS C++ 2017 TESTS 75 46 0 1100
42934594 olpurgin B Sept. 16, 2018, 11:31 a.m. OK PascalABC.NET TESTS 75 61 102400 1100
42988851 SirCookie B Sept. 17, 2018, 9:48 a.m. OK PascalABC.NET TESTS 75 62 0 1100
45448193 edkuz11 B Nov. 8, 2018, 2:28 p.m. OK PascalABC.NET TESTS 75 62 102400 1100
42972236 gmusya B Sept. 17, 2018, 7:17 a.m. OK PascalABC.NET TESTS 75 62 102400 1100
52743747 HiKiTA B April 14, 2019, 10:32 a.m. OK PascalABC.NET TESTS 75 311 204800 1100
43102177 shadow98 B Sept. 20, 2018, 6:07 a.m. OK Perl TESTS 75 46 102400 1100
42965049 nealzane B Sept. 16, 2018, 11:26 p.m. OK PyPy 2 TESTS 75 124 0 1100
66163837 aaa_bbb_ccc B Dec. 2, 2019, 6:24 a.m. OK PyPy 2 TESTS 75 155 0 1100
42951928 masonsbro B Sept. 16, 2018, 2:39 p.m. OK PyPy 2 TESTS 75 155 0 1100
43152262 akshay125 B Sept. 20, 2018, 5:59 p.m. OK PyPy 2 TESTS 75 155 307200 1100
42998869 soumyasarkar1998 B Sept. 17, 2018, 1:03 p.m. OK PyPy 2 TESTS 75 234 7782400 1100
43021122 Djok216 B Sept. 18, 2018, 5 a.m. OK PyPy 2 TESTS 75 248 7782400 1100
43410457 SerChirag B Sept. 25, 2018, 1:16 p.m. OK PyPy 2 TESTS 75 327 7782400 1100
48924553 HazemEssawi B Jan. 25, 2019, 9:38 a.m. OK PyPy 3 TESTS 75 124 0 1100
50351790 lIn_nIl B Feb. 23, 2019, 8:51 a.m. OK PyPy 3 TESTS 75 139 0 1100
46064054 atharva456 B Nov. 22, 2018, 3:06 p.m. OK PyPy 3 TESTS 75 139 0 1100
67377291 vaaven B Dec. 21, 2019, 3:23 p.m. OK PyPy 3 TESTS 75 140 0 1100
61363327 essi B Sept. 27, 2019, 12:46 p.m. OK PyPy 3 TESTS 75 140 0 1100
59192473 zenithzyf B Aug. 20, 2019, 10:24 p.m. OK PyPy 3 TESTS 75 140 0 1100
58124307 Mehrdad_ravenS B Aug. 1, 2019, 12:02 p.m. OK PyPy 3 TESTS 75 140 0 1100
57964610 roman_kruger B July 30, 2019, 2 a.m. OK PyPy 3 TESTS 75 140 0 1100
51485054 ..vince B March 19, 2019, 1:13 p.m. OK PyPy 3 TESTS 75 140 0 1100
49689609 abdolsamad B Feb. 10, 2019, 10:22 a.m. OK PyPy 3 TESTS 75 140 0 1100
46832008 vjudge3 B Dec. 9, 2018, 10:20 p.m. OK Python 2 TESTS 75 171 0 1100
46717375 vjudge3 B Dec. 7, 2018, 11:56 a.m. OK Python 2 TESTS 75 171 0 1100
45898181 EoinDavey B Nov. 18, 2018, 1:27 a.m. OK Python 2 TESTS 75 171 0 1100
44765076 FlyingBag65 B Oct. 24, 2018, 9:21 a.m. OK Python 2 TESTS 75 171 0 1100
42968439 HangNguyen B Sept. 17, 2018, 3:47 a.m. OK Python 2 TESTS 75 171 0 1100
44028481 vjudge3 B Oct. 9, 2018, 9:19 a.m. OK Python 2 TESTS 75 186 0 1100
43158330 arikpamnani B Sept. 20, 2018, 9:46 p.m. OK Python 2 TESTS 75 186 0 1100
43044110 aman_shahi2 B Sept. 18, 2018, 5:06 p.m. OK Python 2 TESTS 75 186 0 1100
42956710 yougaindra B Sept. 16, 2018, 4:42 p.m. OK Python 2 TESTS 75 187 0 1100
42945086 Papasani_mohan B Sept. 16, 2018, 12:26 p.m. OK Python 2 TESTS 75 187 0 1100
60916447 kopok2 B Sept. 20, 2019, 8:27 a.m. OK Python 3 TESTS 75 109 0 1100
60766764 mrchampion05 B Sept. 18, 2019, 11:15 a.m. OK Python 3 TESTS 75 109 0 1100
58867643 death_c0der B Aug. 15, 2019, 2 p.m. OK Python 3 TESTS 75 109 0 1100
55552159 tchr B June 14, 2019, 7:48 a.m. OK Python 3 TESTS 75 109 0 1100
55469382 ziddi B June 11, 2019, 5:56 p.m. OK Python 3 TESTS 75 109 0 1100
53527986 lcxz8686tl B April 29, 2019, 5:50 p.m. OK Python 3 TESTS 75 109 0 1100
53276635 anonymous43 B April 25, 2019, 9:47 a.m. OK Python 3 TESTS 75 109 0 1100
53184188 chiragsoni812 B April 23, 2019, 9:19 a.m. OK Python 3 TESTS 75 109 0 1100
53183114 tanu38 B April 23, 2019, 8:44 a.m. OK Python 3 TESTS 75 109 0 1100
50770442 Jsxft B March 4, 2019, 4:11 a.m. OK Python 3 TESTS 75 109 0 1100
42933670 Danil B Sept. 16, 2018, 11:26 a.m. OK Ruby TESTS 75 62 0 1100
55315430 ar7L B June 8, 2019, 9:15 p.m. OK Ruby TESTS 75 77 0 1100
43075227 cielavenir B Sept. 19, 2018, 11:28 a.m. OK Ruby TESTS 75 77 0 1100
42967856 package.zaic B Sept. 17, 2018, 3:09 a.m. OK Ruby TESTS 75 77 102400 1100
43172759 ondrej.hosak B Sept. 21, 2018, 9:29 a.m. OK Ruby TESTS 75 77 204800 1100

remove filters

Back to search problems