VK Cup 2017 - Round 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
772 VK Cup 2017 - Round 2 FINISHED False 7200 284048723 April 16, 2017, 3:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 4987 ) A Voltage Keepsake PROGRAMMING binary search math 1800

You have n devices that you want to use simultaneously. The i -th device uses a i units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ· a i units of power. The i -th device currently has b i units of power stored. All devices can store an arbitrary amount of power. You have a single charger that can plug to any single device. The charger will add p units of power per second to a device. This charging is continuous. That is, if you plug in a device for λ seconds, it will gain λ· p units of power. You can switch which device is charging at any arbitrary unit of time (including real numbers), and the time it takes to switch is negligible. You are wondering, what is the maximum amount of time you can use the devices until one of them hits 0 units of power. If you can use the devices indefinitely, print -1 . Otherwise, print the maximum amount of time before any one device hits 0 power. The first line contains two integers, n and p ( 1 ≤ n ≤ 100 000 , 1 ≤ p ≤ 10 9 ) — the number of devices and the power of the charger. This is followed by n lines which contain two integers each. Line i contains the integers a i and b i ( 1 ≤ a i , b i ≤ 100 000 ) — the power of the device and the amount of power stored in the device in the beginning. If you can use the devices indefinitely, print -1 . Otherwise, print the maximum amount of time before any one device hits 0 power. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 4 . Namely, let's assume that your answer is a and the answer of the jury is b . The checker program will consider your answer correct if . In sample test 1, you can charge the first device for the entire time until it hits zero power. The second device has enough power to last this time without being charged. In sample test 2, you can use the device indefinitely. In sample test 3, we can charge the third device for 2 / 5 of a second, then switch to charge the secon

Tutorials

VK Cup Round 2 + Codeforces Round #409 Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
26721294 thucnguyen A April 28, 2017, 2:36 p.m. OK FPC TESTS 94 109 21708800 1800
26721272 Minh_love_Hong_Phuc A April 28, 2017, 2:35 p.m. OK FPC TESTS 94 109 21708800 1800
30859791 fivut A Sept. 30, 2017, 8:49 a.m. OK FPC TESTS 94 499 10854400 1800
30841237 fivut A Sept. 29, 2017, 9:01 p.m. OK FPC TESTS 94 1153 1843200 1800
36386587 vjudge1 A March 18, 2018, 11:27 a.m. OK GNU C TESTS 94 93 4915200 1800
36388304 vjudge4 A March 18, 2018, 12:27 p.m. OK GNU C TESTS 94 108 4915200 1800
28925167 vjudge2 A July 27, 2017, 8:23 a.m. OK GNU C++ TESTS 94 46 2662400 1800
28898156 vjudge5 A July 26, 2017, 8:09 a.m. OK GNU C++ TESTS 94 46 2867200 1800
28898111 vjudge5 A July 26, 2017, 8:07 a.m. OK GNU C++ TESTS 94 46 2867200 1800
28897911 vjudge4 A July 26, 2017, 7:59 a.m. OK GNU C++ TESTS 94 46 2867200 1800
28897332 vjudge5 A July 26, 2017, 7:36 a.m. OK GNU C++ TESTS 94 46 2867200 1800
26539323 Magic A April 21, 2017, 2:08 p.m. OK GNU C++ TESTS 94 46 2867200 1800
40982345 ReaLNero1 A July 30, 2018, 6:22 p.m. OK GNU C++ TESTS 94 46 3686400 1800
26450773 dima_gozha A April 17, 2017, 9:41 a.m. OK GNU C++ TESTS 94 46 10137600 1800
27469526 jiyutian A May 31, 2017, 2:58 p.m. OK GNU C++ TESTS 94 62 614400 1800
40214675 vjudge1 A July 12, 2018, 1:19 a.m. OK GNU C++ TESTS 94 62 819200 1800
62677439 TianZuiXing A Oct. 16, 2019, 11:50 a.m. OK GNU C++11 TESTS 94 46 819200 1800
44981324 qugemingzhizhennan A Oct. 28, 2018, 8:49 a.m. OK GNU C++11 TESTS 94 46 819200 1800
63288451 luogu_bot5 A Oct. 24, 2019, 11:04 a.m. OK GNU C++11 TESTS 94 46 921600 1800
26448518 ditoly A April 17, 2017, 7:43 a.m. OK GNU C++11 TESTS 94 46 2662400 1800
26442123 Stolyarov A April 16, 2017, 11:47 p.m. OK GNU C++11 TESTS 94 46 2867200 1800
26427485 dengaleev RemmargorP A April 16, 2017, 4:28 p.m. OK GNU C++11 TESTS 94 46 2867200 1800
26436829 Flyce A April 16, 2017, 7:02 p.m. OK GNU C++11 TESTS 94 46 4505600 1800
28539110 KzAiLl A July 14, 2017, 6:05 a.m. OK GNU C++11 TESTS 94 61 2867200 1800
28380363 vjudge2 A July 9, 2017, 4:23 a.m. OK GNU C++11 TESTS 94 61 2867200 1800
28380305 yyf0309 A July 9, 2017, 4:18 a.m. OK GNU C++11 TESTS 94 61 2867200 1800
26420202 Egor.Lifar voidmax A April 16, 2017, 3:49 p.m. OK GNU C++14 TESTS 94 46 2764800 1800
61058251 angrysqrt3 A Sept. 22, 2019, 8:43 a.m. OK GNU C++14 TESTS 94 62 819200 1800
53215814 husseincoder A April 24, 2019, 8:43 a.m. OK GNU C++14 TESTS 94 62 819200 1800
51266728 vjudge4 A March 13, 2019, 3:53 p.m. OK GNU C++14 TESTS 94 62 1638400 1800
26424057 vlad-r despair A April 16, 2017, 4:07 p.m. OK GNU C++14 TESTS 94 62 2662400 1800
26671140 ibrahim_tabba A April 25, 2017, 9:32 p.m. OK GNU C++14 TESTS 94 62 2764800 1800
26431378 Nodir.Daminov Ximera A April 16, 2017, 5:04 p.m. OK GNU C++14 TESTS 94 62 2764800 1800
26422626 TonySnark A April 16, 2017, 3:58 p.m. OK GNU C++14 TESTS 94 62 2764800 1800
26421513 Barricadenick Bobrosoft A April 16, 2017, 3:54 p.m. OK GNU C++14 TESTS 94 62 2764800 1800
26420571 sereja589 A April 16, 2017, 3:50 p.m. OK GNU C++14 TESTS 94 62 2764800 1800
65898659 vjudge4 A Nov. 28, 2019, 7:36 a.m. OK GNU C++17 TESTS 94 62 819200 1800
61193422 vjudge2 A Sept. 24, 2019, 4:15 a.m. OK GNU C++17 TESTS 94 62 819200 1800
38527140 FullMetal_520 A May 22, 2018, 7:36 a.m. OK GNU C++17 TESTS 94 62 819200 1800
57090866 aboAdnan A July 15, 2019, 10:42 a.m. OK GNU C++17 TESTS 94 77 819200 1800
54794076 hjk1030 A May 29, 2019, 8:45 a.m. OK GNU C++17 TESTS 94 77 819200 1800
61355090 xxfy A Sept. 27, 2019, 10:05 a.m. OK GNU C++17 TESTS 94 77 1638400 1800
68656548 vjudge1 A Jan. 12, 2020, 12:24 p.m. OK GNU C++17 TESTS 94 78 819200 1800
68001451 itachikesh A Dec. 31, 2019, 11:03 a.m. OK GNU C++17 TESTS 94 78 819200 1800
65798678 vjudge5 A Nov. 27, 2019, 6:22 a.m. OK GNU C++17 TESTS 94 78 819200 1800
63952807 yuhta A Oct. 31, 2019, 10:42 p.m. OK GNU C++17 TESTS 94 78 819200 1800
27156290 prashanth_rebala A May 16, 2017, 9:54 a.m. OK Java 8 TESTS 94 186 0 1800
26479738 hiThere23 A April 18, 2017, 4:06 p.m. OK Java 8 TESTS 94 187 20582400 1800
37580279 KulikAlex A April 24, 2018, 5:44 p.m. OK Java 8 TESTS 94 218 20787200 1800
37580109 KulikAlex A April 24, 2018, 5:37 p.m. OK Java 8 TESTS 94 233 20787200 1800
27202022 vikiCoder A May 18, 2017, 5:41 p.m. OK Java 8 TESTS 94 234 0 1800
27201997 vikiCoder A May 18, 2017, 5:39 p.m. OK Java 8 TESTS 94 234 0 1800
26429329 LLIAMA3OB alexander89116 A April 16, 2017, 4:43 p.m. OK Java 8 TESTS 94 265 20684800 1800
26425024 Slamur Sinner A April 16, 2017, 4:12 p.m. OK Java 8 TESTS 94 280 21504000 1800
26470238 VArtem A April 18, 2017, 6:55 a.m. OK Java 8 TESTS 94 295 20377600 1800
38429794 jajajas A May 19, 2018, 12:02 p.m. OK Java 8 TESTS 94 296 0 1800
26587499 bintree A April 22, 2017, 3:46 p.m. OK Kotlin TESTS 94 1169 26624000 1800
26460961 suns A April 17, 2017, 5:27 p.m. OK MS C# TESTS 94 405 28364800 1800
66038911 vjudge5 A Nov. 30, 2019, 12:48 p.m. OK MS C++ TESTS 94 78 1638400 1800
48445516 vjudge1 A Jan. 16, 2019, 7:15 a.m. OK MS C++ TESTS 94 78 1638400 1800
26434977 karapuz A April 16, 2017, 6:39 p.m. OK MS C++ TESTS 94 187 18124800 1800
48525605 vjudge5 A Jan. 18, 2019, 8:56 a.m. OK MS C++ TESTS 94 202 240435200 1800
26457104 Yurik A April 17, 2017, 2:16 p.m. OK MS C++ TESTS 94 295 3686400 1800
68641881 vjudge1 A Jan. 12, 2020, 7:47 a.m. OK MS C++ TESTS 94 514 9420800 1800
40096741 homoeconomicus A July 9, 2018, midnight OK PyPy 3 TESTS 94 1060 13926400 1800
26591805 ya_ilya A April 22, 2017, 9:17 p.m. OK Python 2 TESTS 94 452 18022400 1800
29623045 Abdelrahman_Radwan A Aug. 20, 2017, 2:12 p.m. OK Python 3 TESTS 94 530 11264000 1800
26432450 Kirillov_Alexey Radi4 A April 16, 2017, 5:16 p.m. OK Python 3 TESTS 94 576 16281600 1800
31153031 yugle7 A Oct. 8, 2017, 7:23 p.m. OK Python 3 TESTS 94 592 10547200 1800
42118976 Mk_Python_v1 A Aug. 26, 2018, 11:27 a.m. OK Python 3 TESTS 94 623 10956800 1800

remove filters

Back to search problems