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 |
---|---|---|---|---|---|---|
1495 | Codeforces Round 706 (Div. 1) | FINISHED | False | 7200 | 121802063 | March 10, 2021, 12:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 350 ) | F | Squares | PROGRAMMING | constructive algorithms data structures graphs trees |
B"There are n squares drawn from left to right on the floor. The i -th square has three integers p_i,a_i,b_i , written on it. The sequence p_1,p_2, ... ,p_n forms a permutation. Each round you will start from the leftmost square 1 and jump to the right. If you are now on the i -th square, you can do one of the following two operations: There are q rounds in the game. To make the game more difficult, you need to maintain a square set S (initially it is empty). You must pass through these squares during the round (other squares can also be passed through). The square set S for the i -th round is obtained by adding or removing a square from the square set for the (i-1) -th round. For each round find the minimum cost you should pay to end it. The first line contains two integers n , q ( 1 <= n,q <= 2 cdot 10^5 ) -- the number of squares and the number of rounds. The second line contains n distinct integers p_1,p_2, ... ,p_n ( 1 <= p_i <= n ). It is guaranteed that the sequence p_1,p_2, ... ,p_n forms a permutation. The third line contains n integers a_1,a_2, ldots,a_n ( -10^9 <= a_i <= 10^9 ). The fourth line contains n integers b_1,b_2, ... ,b_n ( -10^9 <= b_i <= 10^9 ). Then q lines follow, i -th of them contains a single integer x_i ( 1 <= x_i <= n ). If x_i was in the set S on the (i-1) -th round you should remove it, otherwise, you should add it. Print q lines, each of them should contain a single integer -- the minimum cost you should pay to end the corresponding round. Let's consider the character T as the end of a round. Then we can draw two graphs for the first and the second test. In the first round of the first test, the set that you must pass through is {1 } . The path you can use is 1 to 3 to T and its cost is 6 . In the second round of the first t"... |
Codeforces Round #706 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
109654039 | rainboy | F | March 10, 2021, 7:24 p.m. | OK | GNU C11 | TESTS | 27 | 1200 | 21811200 | ||
109654127 | rainboy | F | March 10, 2021, 7:26 p.m. | OK | GNU C11 | TESTS | 27 | 1201 | 19251200 | ||
109654056 | rainboy | F | March 10, 2021, 7:24 p.m. | OK | GNU C11 | TESTS | 27 | 1216 | 21811200 | ||
109631618 | rainboy | F | March 10, 2021, 3:04 p.m. | OK | GNU C11 | TESTS | 27 | 1263 | 21811200 | ||
109637826 | Imakf | F | March 10, 2021, 3:56 p.m. | OK | GNU C++11 | TESTS | 27 | 280 | 33689600 | ||
109626806 | EmptySoulist | F | March 10, 2021, 2:37 p.m. | OK | GNU C++11 | TESTS | 27 | 608 | 77721600 | ||
109632141 | atoiz | F | March 10, 2021, 3:08 p.m. | OK | GNU C++11 | TESTS | 27 | 795 | 100249600 | ||
109672305 | TiwAirOAO | F | March 11, 2021, 5:07 a.m. | OK | GNU C++14 | TESTS | 27 | 826 | 267161600 | ||
109602412 | y1s1 | F | March 10, 2021, 1:23 p.m. | OK | GNU C++14 | TESTS | 27 | 1060 | 33689600 | ||
109675761 | tenkei | F | March 11, 2021, 6 a.m. | OK | GNU C++17 | TESTS | 27 | 483 | 28467200 | ||
109667744 | dengyipeng | F | March 11, 2021, 3:21 a.m. | OK | GNU C++17 | TESTS | 27 | 670 | 37171200 | ||
109656812 | CoderAnshu | F | March 10, 2021, 8:22 p.m. | OK | GNU C++17 | TESTS | 27 | 670 | 44032000 | ||
109654156 | rainboy | F | March 10, 2021, 7:27 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 436 | 19148800 | ||
109632444 | jiangly | F | March 10, 2021, 3:10 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 436 | 46080000 | ||
109632494 | rainboy | F | March 10, 2021, 3:10 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 467 | 21811200 | ||
109607835 | maroonrk | F | March 10, 2021, 1:34 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 514 | 57753600 | ||
109647200 | Benq | F | March 10, 2021, 5:42 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 530 | 58675200 | ||
109620903 | blackbori | F | March 10, 2021, 2:01 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 561 | 92774400 | ||
109666403 | wlzhouzhuan | F | March 11, 2021, 2:42 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 592 | 49459200 | ||
109644046 | DimmyT | F | March 10, 2021, 5:03 p.m. | OK | GNU C++17 (64) | TESTS | 27 | 608 | 111001600 | ||
109666304 | wlzhouzhuan | F | March 11, 2021, 2:38 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 623 | 80691200 | ||
109666379 | wlzhouzhuan | F | March 11, 2021, 2:41 a.m. | OK | GNU C++17 (64) | TESTS | 27 | 639 | 80691200 |
Back to search problems