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 |
---|---|---|---|---|---|---|
1809 | Educational Codeforces Round 145 (Rated for Div. 2) | FINISHED | False | 7200 | 57684263 | March 23, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 793 ) | F | Traveling in Berland | PROGRAMMING | binary search data structures graphs greedy implementation |
B"There are n cities in Berland, arranged in a circle and numbered from 1 to n in clockwise order. You want to travel all over Berland, starting in some city, visiting all the other cities and returning to the starting city. Unfortunately, you can only drive along the Berland Ring Highway, which connects all n cities. The road was designed by a very titled and respectable minister, so it is one-directional -- it can only be traversed clockwise, only from the city i to the city (i bmod n) + 1 (i.e. from 1 to 2 , from 2 in 3 , ..., from n to 1 ). The fuel tank of your car holds up to k liters of fuel. To drive from the i -th city to the next one, a_i liters of fuel are needed (and are consumed in the process). Every city has a fuel station; a liter of fuel in the i -th city costs b_i burles. Refueling between cities is not allowed; if fuel has run out between cities, then your journey is considered incomplete. For each city, calculate the minimum cost of the journey if you start and finish it in that city. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and k ( 3 <= n <= 2 cdot 10^5 ; 1 <= k <= 10^9 ) -- the number of cities and the volume of fuel tank, respectively. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= k ). The third line contains n integers b_1, b_2, ... , b_n ( 1 <= b_i <= 2 ). The sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, print n integers, where the i -th of them is equal to the minimum cost of the journey if you start and finish in the i -th city. "... |
114300 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
198891764 | gzchenben | F | March 24, 2023, 4:53 a.m. | OK | GNU C++14 | TESTS | 19 | 156 | 7987200 | ||
198834308 | 572txdy | F | March 23, 2023, 4:58 p.m. | OK | GNU C++14 | TESTS | 19 | 171 | 3584000 | ||
198893069 | sourav_suku | F | March 24, 2023, 5:09 a.m. | OK | GNU C++14 | TESTS | 19 | 202 | 7987200 | ||
198829076 | dhlee1031 | F | March 23, 2023, 4:36 p.m. | OK | GNU C++14 | TESTS | 19 | 202 | 9625600 | ||
198828143 | cyb1010 | F | March 23, 2023, 4:34 p.m. | OK | GNU C++14 | TESTS | 19 | 202 | 19251200 | ||
198831148 | yiqiAtiya | F | March 23, 2023, 4:43 p.m. | OK | GNU C++14 | TESTS | 19 | 202 | 28876800 | ||
198897416 | wdcfuixchw | F | March 24, 2023, 6:01 a.m. | OK | GNU C++14 | TESTS | 19 | 218 | 19251200 | ||
198880757 | LXH-cat | F | March 24, 2023, 1:24 a.m. | OK | GNU C++14 | TESTS | 19 | 218 | 19251200 | ||
198841937 | wrhaco | F | March 23, 2023, 5:43 p.m. | OK | GNU C++14 | TESTS | 19 | 218 | 44236800 | ||
198844020 | Seast | F | March 23, 2023, 5:58 p.m. | OK | GNU C++14 | TESTS | 19 | 280 | 25804800 | ||
198870306 | stefanbalaz2 | F | March 23, 2023, 10:10 p.m. | OK | GNU C++17 | TESTS | 19 | 171 | 9625600 | ||
198885350 | zft_4995 | F | March 24, 2023, 3:05 a.m. | OK | GNU C++17 | TESTS | 19 | 171 | 12902400 | ||
198835051 | 1459007298 | F | March 23, 2023, 5:02 p.m. | OK | GNU C++17 | TESTS | 19 | 171 | 72192000 | ||
198895101 | Lihecen1234 | F | March 24, 2023, 5:34 a.m. | OK | GNU C++17 | TESTS | 19 | 186 | 7987200 | ||
198849687 | patou | F | March 23, 2023, 6:46 p.m. | OK | GNU C++17 | TESTS | 19 | 202 | 11264000 | ||
198854402 | batmanbc | F | March 23, 2023, 7:32 p.m. | OK | GNU C++17 | TESTS | 19 | 202 | 13926400 | ||
198851648 | cutmdo | F | March 23, 2023, 7:05 p.m. | OK | GNU C++17 | TESTS | 19 | 218 | 10547200 | ||
198840762 | Creativity-.-0 | F | March 23, 2023, 5:35 p.m. | OK | GNU C++17 | TESTS | 19 | 234 | 15462400 | ||
198868352 | DylanSmith | F | March 23, 2023, 9:46 p.m. | OK | GNU C++17 | TESTS | 19 | 545 | 13824000 | ||
198852672 | Tinky-Winky | F | March 23, 2023, 7:15 p.m. | OK | GNU C++17 | TESTS | 19 | 545 | 25702400 | ||
198837652 | pawan1712 | F | March 23, 2023, 5:17 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 124 | 4812800 | ||
198875943 | Superposition | F | March 23, 2023, 11:49 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 124 | 8089600 | ||
198830428 | diskoteka | F | March 23, 2023, 4:40 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 124 | 12185600 | ||
198882108 | stan23456 | F | March 24, 2023, 1:54 a.m. | OK | GNU C++17 (64) | TESTS | 19 | 124 | 22425600 | ||
198846338 | pd_codes | F | March 23, 2023, 6:16 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 139 | 18124800 | ||
198853681 | minato | F | March 23, 2023, 7:25 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 139 | 20480000 | ||
198825593 | Kude | F | March 23, 2023, 4:29 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 140 | 16076800 | ||
198829705 | cxm1024 | F | March 23, 2023, 4:38 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 140 | 19865600 | ||
198830510 | Hyperbolic | F | March 23, 2023, 4:41 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 171 | 17510400 | ||
198826201 | Andreasyan | F | March 23, 2023, 4:31 p.m. | OK | GNU C++17 (64) | TESTS | 19 | 202 | 54476800 |
Back to search problems