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 |
1178
|
Codeforces Global Round 4 |
FINISHED |
False |
9000 |
173802287 |
July 20, 2019, 3:35 p.m. |
Problems
B'Warning: This problem has an unusual memory limit! Bob decided that he will not waste his prime years implementing GUI forms for a large corporation and instead will earn his supper on the Stock Exchange Reykjavik. The Stock Exchange Reykjavik is the only actual stock exchange in the world. The only type of transaction is to take a single share of stock x and exchange it for a single share of stock y , provided that the current price of share x is at least the current price of share y . There are 2n stocks listed on the SER that are of interest to Bob, numbered from 1 to 2n . Bob owns a single share of stocks 1 through n and would like to own a single share of each of n+1 through 2n some time in the future. Bob managed to forecast the price of each stock -- in time t geq 0 , the stock i will cost a_i cdot lfloor t rfloor + b_i . The time is currently t = 0 . Help Bob find the earliest moment in time in which he can own a single share of each of n+1 through 2n , and the minimum number of stock exchanges he has to perform in order to do that. You may assume that the Stock Exchange has an unlimited amount of each stock at any point in time. The first line contains a single integer n ( 1 <= q n <= q 2200 ) -- the number stocks currently owned by Bob. Each of the next 2n lines contains integers a_i and b_i ( 0 <= q a_i, b_i <= q 10^9 ), representing the stock price of stock i . If it is impossible for Bob to achieve his goal, output a single integer -1 . Otherwise, output two integers T and E , where T is the minimum time in which he can achieve his goal, and E is the minimum number of exchanges in which he can achieve his goal at time T . In the first example, Bob simply waits until time t = 3 , when both stocks cost exactly the same amount. In the second example, the optimum stra'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
62520164 |
EASHWATCH |
H |
Oct. 13, 2019, 3:31 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
373 |
2150400 |
|
3500 |
57865561 |
lopare |
H |
July 27, 2019, 8:45 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
374 |
2560000 |
|
3500 |
57464956 |
Hazyknight |
H |
July 21, 2019, 3:11 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
374 |
2560000 |
|
3500 |
69606964 |
a1b3c7d9 |
H |
Jan. 27, 2020, 10:06 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
966 |
3584000 |
|
3500 |
69609604 |
a1b3c7d9 |
H |
Jan. 27, 2020, 11:01 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
967 |
3584000 |
|
3500 |
59065434 |
yasugongshang |
H |
Aug. 19, 2019, 1:34 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
967 |
7065600 |
|
3500 |
69621567 |
vjudge5 |
H |
Jan. 27, 2020, 2:38 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
982 |
3584000 |
|
3500 |
69621460 |
luogu_bot3 |
H |
Jan. 27, 2020, 2:36 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
982 |
3584000 |
|
3500 |
69875554 |
Winlere |
H |
Jan. 31, 2020, 3:46 a.m. |
OK |
GNU C++11 |
TESTS |
137 |
1201 |
1638400 |
|
3500 |
69848721 |
vjudge2 |
H |
Jan. 30, 2020, 3 p.m. |
OK |
GNU C++11 |
TESTS |
137 |
1216 |
1638400 |
|
3500 |
69455788 |
vjudge2 |
H |
Jan. 24, 2020, 8:34 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
218 |
12595200 |
|
3500 |
57985762 |
newbiegcz |
H |
July 30, 2019, 11:20 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
233 |
12595200 |
|
3500 |
60957067 |
mayaohua2003 |
H |
Sept. 21, 2019, 3:18 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
389 |
2252800 |
|
3500 |
61549784 |
cz_xuyixuan |
H |
Sept. 30, 2019, 12:01 p.m. |
OK |
GNU C++14 |
TESTS |
137 |
904 |
2867200 |
|
3500 |
61545106 |
cz_xuyixuan |
H |
Sept. 30, 2019, 10:04 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
904 |
2969600 |
|
3500 |
59071051 |
ldmhoang |
H |
Aug. 19, 2019, 4:46 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
1356 |
7884800 |
|
3500 |
57427789 |
BSBandme |
H |
July 20, 2019, 9:41 p.m. |
OK |
GNU C++14 |
TESTS |
137 |
1794 |
11878400 |
|
3500 |
57573815 |
ecnerwala |
H |
July 23, 2019, 6:18 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
3244 |
3072000 |
|
3500 |
57575347 |
ecnerwala |
H |
July 23, 2019, 6:48 a.m. |
OK |
GNU C++14 |
TESTS |
137 |
4476 |
3072000 |
|
3500 |
58165195 |
Alireza_Keshavarz |
H |
Aug. 2, 2019, 8:48 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
249 |
12595200 |
|
3500 |
58468965 |
life_errror_executed |
H |
Aug. 8, 2019, 9:45 p.m. |
OK |
GNU C++17 |
TESTS |
137 |
390 |
2662400 |
|
3500 |
67628655 |
LJZ_C |
H |
Dec. 26, 2019, 1:07 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
436 |
2252800 |
|
3500 |
67415323 |
CN_zwang2002 |
H |
Dec. 22, 2019, 9:39 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
670 |
2355200 |
|
3500 |
57711811 |
neal |
H |
July 25, 2019, 12:30 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
811 |
1945600 |
|
3500 |
57619897 |
neal |
H |
July 24, 2019, 3:57 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
841 |
1945600 |
|
3500 |
58084608 |
GM_Targeted |
H |
July 31, 2019, 3:05 p.m. |
OK |
GNU C++17 |
TESTS |
137 |
842 |
1433600 |
|
3500 |
62576708 |
virajudaysingh |
H |
Oct. 14, 2019, 4:06 p.m. |
OK |
GNU C++17 |
TESTS |
137 |
842 |
1945600 |
|
3500 |
57620082 |
neal |
H |
July 24, 2019, 4:04 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
842 |
1945600 |
|
3500 |
57619654 |
neal |
H |
July 24, 2019, 3:48 a.m. |
OK |
GNU C++17 |
TESTS |
137 |
842 |
1945600 |
|
3500 |
remove filters
Back to search problems