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 |
---|---|---|---|---|---|---|
1627 | Codeforces Round 766 (Div. 2) | FINISHED | False | 7200 | 89565899 | Jan. 15, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2413 ) | E | Not Escaping | PROGRAMMING | data structures dp implementation shortest paths sortings two pointers |
B'Major Ram is being chased by his arch enemy Raghav. Ram must reach the top of the building to escape via helicopter. The building, however, is on fire. Ram must choose the optimal path to reach the top of the building to lose the minimum amount of health. The building consists of n floors, each with m rooms each. Let (i, j) represent the j -th room on the i -th floor. Additionally, there are k ladders installed. The i -th ladder allows Ram to travel from (a_i, b_i) to (c_i, d_i) , but not in the other direction. Ram also gains h_i health points if he uses the ladder i . It is guaranteed a_i < c_i for all ladders. If Ram is on the i -th floor, he can move either left or right. Travelling across floors, however, is treacherous. If Ram travels from (i, j) to (i, k) , he loses |j-k| cdot x_i health points. Ram enters the building at (1, 1) while his helicopter is waiting at (n, m) . What is the minimum amount of health Ram loses if he takes the most optimal path? Note this answer may be negative (in which case he gains health). Output "NO ESCAPE" if no matter what path Ram takes, he cannot escape the clutches of Raghav. The first line of input contains t ( 1 <= q t <= q 5 cdot 10^4 ) -- the number of test cases. The first line of each test case consists of 3 integers n, m, k ( 2 <= q n, m <= q 10^5 ; 1 <= q k <= q 10^5 ) -- the number of floors, the number of rooms on each floor and the number of ladders respectively. The second line of a test case consists of n integers x_1, x_2, ... , x_n ( 1 <= q x_i <= q 10^6 ). The next k lines describe the ladders. Ladder i is denoted by a_i, b_i, c_i, d_i, h_i ( 1 <= q a_i < c_i <= q n ; 1 <= q b_i, d_i <= q m ; 1 <= q h_i <= q 10^6 ) -- the rooms it connects and the health points gained from using it. It is guaranteed a_i < c_i '... |
Codeforces Round #766 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
142906926 | KING_OF_TURTLE | E | Jan. 16, 2022, 2:16 a.m. | OK | GNU C++14 | TESTS | 62 | 139 | 12902400 | ||
142904991 | Tyyyyyy | E | Jan. 16, 2022, 1:01 a.m. | OK | GNU C++14 | TESTS | 62 | 140 | 9625600 | ||
142885190 | buko | E | Jan. 15, 2022, 5:21 p.m. | OK | GNU C++14 | TESTS | 62 | 140 | 53862400 | ||
142908220 | vjudge1 | E | Jan. 16, 2022, 2:54 a.m. | OK | GNU C++14 | TESTS | 62 | 155 | 9625600 | ||
142888902 | dlalswp25 | E | Jan. 15, 2022, 5:57 p.m. | OK | GNU C++14 | TESTS | 62 | 155 | 10649600 | ||
142884373 | Ruki.cf | E | Jan. 15, 2022, 5:15 p.m. | OK | GNU C++14 | TESTS | 62 | 155 | 10649600 | ||
142903259 | CK2021 | E | Jan. 15, 2022, 11:30 p.m. | OK | GNU C++14 | TESTS | 62 | 156 | 28876800 | ||
142906497 | NEFU_DaTieJiang | E | Jan. 16, 2022, 1:59 a.m. | OK | GNU C++14 | TESTS | 62 | 171 | 9625600 | ||
142876287 | gigajet | E | Jan. 15, 2022, 4:26 p.m. | OK | GNU C++14 | TESTS | 62 | 171 | 10854400 | ||
142908861 | E-ray | E | Jan. 16, 2022, 3:12 a.m. | OK | GNU C++14 | TESTS | 62 | 171 | 13824000 |
Back to search problems