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 |
---|---|---|---|---|---|---|
1210 | Dasha Code Championship - SPb Finals Round (only for onsite-finalists) | FINISHED | False | 9000 | 162680099 | Sept. 22, 2019, 9:05 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 176 ) | G | Mateusz and Escape Room | PROGRAMMING | dp | 3400 |
B"Mateusz likes to travel! However, on his 42 nd visit to Saint Computersburg there is not much left to sightsee. That's why he decided to go to an escape room with his friends! The team has solved all riddles flawlessly. There is only one riddle remaining -- a huge circular table! There are n weighing scales lying on top of the table, distributed along the circle. Each scale is adjacent to exactly two other scales: for each i in {1, 2, ... , n-1 } , the i -th and the (i+1) -th scales are adjacent to each other, as well as the first and the n -th scale. The i -th scale initially contains a_i heavy coins. Mateusz can perform moves -- each move consists of fetching a single coin from one scale and putting it on any adjacent scale. It turns out that the riddle will be solved when there is a specific amount of coins on each of the scales. Specifically, each scale has parameters l_i and r_i . If each coin lies on a single scale and for each i , the i -th scale contains at least l_i and at most r_i coins, the riddle will be solved and Mateusz's team will win! Mateusz is aiming for the best possible time. Therefore, he wants to solved the riddle as quickly as possible. What is the minimum possible number of moves required to fulfill all the conditions? The first line contains an integer n ( 3 <= n <= 35 ,000 ) -- the number of weighing scales in the circle. The following n lines describe the scales. The i -th of these lines describes the i -th scale and consists of three integers a_i, l_i, r_i ( 0 <= a_i <= 35 ,000 , 0 <= l_i <= r_i <= 35 ,000 ). It's guaranteed that the riddle is solvable, that is, sum_{i=1}^n l_i <= sum_{i=1}^n a_i <= sum_{i=1}^n r_i . Output one integer -- the minimum number of operations required to solve the riddle. "... |
Dasha Code Championship Finals and Mirror Round 588 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
61755699 | Alt... | G | Oct. 3, 2019, 5:25 a.m. | OK | GNU C++11 | TESTS | 85 | 452 | 3993600 | 3400 | |
61893243 | cocotea | G | Oct. 5, 2019, 6:28 a.m. | OK | GNU C++11 | TESTS | 85 | 5787 | 144281600 | 3400 | |
61857527 | Itst | G | Oct. 4, 2019, 2:26 p.m. | OK | GNU C++14 | TESTS | 85 | 608 | 4608000 | 3400 | |
62575508 | ak_taniya | G | Oct. 14, 2019, 3:47 p.m. | OK | GNU C++17 | TESTS | 85 | 342 | 2764800 | 3400 | |
69568712 | gongsuidashen | G | Jan. 26, 2020, 1:22 p.m. | OK | GNU C++17 | TESTS | 85 | 343 | 2764800 | 3400 | |
61755729 | Alt... | G | Oct. 3, 2019, 5:26 a.m. | OK | GNU C++17 | TESTS | 85 | 514 | 4198400 | 3400 | |
62063576 | Super_M. | G | Oct. 7, 2019, 2:26 p.m. | OK | GNU C++17 | TESTS | 85 | 592 | 4608000 | 3400 |
Back to search problems