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 |
---|---|---|---|---|---|---|
1718 | Codeforces Round 814 (Div. 1) | FINISHED | False | 7200 | 76519463 | Aug. 16, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1651 ) | C | Tonya and Burenka-179 | PROGRAMMING | brute force data structures greedy math number theory |
B'Tonya was given an array of a of length n written on a postcard for his birthday. For some reason, the postcard turned out to be a cyclic array, so the index of the element located strictly to the right of the n -th is 1 . Tonya wanted to study it better, so he bought a robot "Burenka-179". A program for Burenka is a pair of numbers (s, k) , where 1 <= q s <= q n , 1 <= q k <= q n-1 . Note that k cannot be equal to n . Initially, Tonya puts the robot in the position of the array s . After that, Burenka makes exactly n steps through the array. If at the beginning of a step Burenka stands in the position i , then the following happens: Help Tonya find the maximum possible usefulness of a program for "Burenka" if the initial usefulness of any program is 0 . Also, Tony 's friend Ilyusha asks him to change the array q times. Each time he wants to assign a_p := x for a given index p and a value x . You need to find the maximum possible usefulness of the program after each of these changes. The first line contains a single integer t ( 1 <= t <= 10^4 ) is the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and q ( 2 <= n <= 2 cdot 10^5 , 0 <= q <= 2 cdot 10^5 ). The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ) -- elements of the array. The following q lines contain changes, each of them contains two integers p and x ( 1 <= q p <= q n , 1 <= q x <= q 10^9 ), meaning you should assign a_p := x . It is guaranteed that the sum of n and the sum of q over all test cases do not exceed 2 cdot 10^5 . For each test case, output q+1 numbers -- the maximum usefulness of a program initially and after each of the changes. In the first test case, initial'... |
Codeforces Round #814 (Div. 1, Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
168587517 | Gassa | C | Aug. 16, 2022, 4:11 p.m. | OK | D | TESTS | 41 | 623 | 13516800 | ||
168608541 | Gassa | C | Aug. 16, 2022, 5:53 p.m. | OK | D | TESTS | 41 | 685 | 13516800 | ||
168594942 | SeiunSky | C | Aug. 16, 2022, 4:25 p.m. | OK | GNU C++14 | TESTS | 41 | 295 | 48844800 | ||
168594989 | awoo | C | Aug. 16, 2022, 4:25 p.m. | OK | GNU C++14 | TESTS | 41 | 342 | 47104000 | ||
168594944 | cyh_toby | C | Aug. 16, 2022, 4:25 p.m. | OK | GNU C++14 | TESTS | 41 | 389 | 42700800 | ||
168646827 | Potassium | C | Aug. 17, 2022, 4:03 a.m. | OK | GNU C++14 | TESTS | 41 | 436 | 46796800 | ||
168581354 | zqyyy | C | Aug. 16, 2022, 4 p.m. | OK | GNU C++14 | TESTS | 41 | 483 | 33075200 | ||
168583380 | nishkarsh | C | Aug. 16, 2022, 4:04 p.m. | OK | GNU C++14 | TESTS | 41 | 498 | 12902400 | ||
168617082 | squaredog | C | Aug. 16, 2022, 7:02 p.m. | OK | GNU C++14 | TESTS | 41 | 514 | 32051200 | ||
168633567 | Young.YQ | C | Aug. 17, 2022, 12:07 a.m. | OK | GNU C++14 | TESTS | 41 | 530 | 204083200 | ||
168543268 | Mr_Eight | C | Aug. 16, 2022, 3:04 p.m. | OK | GNU C++14 | TESTS | 41 | 561 | 64000000 | ||
168645597 | 5ab | C | Aug. 17, 2022, 3:44 a.m. | OK | GNU C++14 | TESTS | 41 | 608 | 27648000 | ||
168654424 | iaNTU | C | Aug. 17, 2022, 5:51 a.m. | OK | GNU C++17 | TESTS | 41 | 217 | 14745600 | ||
168654178 | iaNTU | C | Aug. 17, 2022, 5:48 a.m. | OK | GNU C++17 | TESTS | 41 | 217 | 14745600 | ||
168654724 | Bobocan | C | Aug. 17, 2022, 5:54 a.m. | OK | GNU C++17 | TESTS | 41 | 217 | 55808000 | ||
168611687 | Bobocan | C | Aug. 16, 2022, 6:14 p.m. | OK | GNU C++17 | TESTS | 41 | 342 | 80179200 | ||
168622297 | Bobocan | C | Aug. 16, 2022, 8:05 p.m. | OK | GNU C++17 | TESTS | 41 | 343 | 33996800 | ||
168645472 | sg0071729 | C | Aug. 17, 2022, 3:42 a.m. | OK | GNU C++17 | TESTS | 41 | 373 | 53657600 | ||
168609680 | xgcxgc | C | Aug. 16, 2022, 6 p.m. | OK | GNU C++17 | TESTS | 41 | 374 | 56934400 | ||
168584436 | fanache99 | C | Aug. 16, 2022, 4:05 p.m. | OK | GNU C++17 | TESTS | 41 | 389 | 37478400 | ||
168584990 | AngusRitossa | C | Aug. 16, 2022, 4:06 p.m. | OK | GNU C++17 | TESTS | 41 | 405 | 85913600 | ||
168549826 | Radewoosh | C | Aug. 16, 2022, 3:12 p.m. | OK | GNU C++17 | TESTS | 41 | 452 | 76492800 | ||
168617650 | Siberian | C | Aug. 16, 2022, 7:08 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 171 | 7782400 | ||
168613362 | Kude | C | Aug. 16, 2022, 6:27 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 264 | 6451200 | ||
168614371 | errorgorn | C | Aug. 16, 2022, 6:36 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 296 | 46694400 | ||
168638459 | MarkBcc168 | C | Aug. 17, 2022, 1:55 a.m. | OK | GNU C++17 (64) | TESTS | 41 | 312 | 8908800 | ||
168573114 | cuom1999 | C | Aug. 16, 2022, 3:46 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 312 | 49459200 | ||
168563311 | timmyfeng | C | Aug. 16, 2022, 3:31 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 374 | 156364800 | ||
168557581 | potato167 | C | Aug. 16, 2022, 3:22 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 389 | 20172800 | ||
168589924 | MateoCV | C | Aug. 16, 2022, 4:16 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 389 | 21708800 | ||
168560536 | hitonanode | C | Aug. 16, 2022, 3:26 p.m. | OK | GNU C++17 (64) | TESTS | 41 | 389 | 30412800 | ||
168637797 | 5ab | C | Aug. 17, 2022, 1:43 a.m. | OK | GNU C++17 (64) | TESTS | 41 | 420 | 27648000 | ||
168617877 | Siberian | C | Aug. 16, 2022, 7:10 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 124 | 7782400 | ||
168617618 | Siberian | C | Aug. 16, 2022, 7:08 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 139 | 7782400 | ||
168617693 | Siberian | C | Aug. 16, 2022, 7:08 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 155 | 7782400 | ||
168620286 | Ormlis | C | Aug. 16, 2022, 7:39 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 156 | 7270400 | ||
168576282 | maspy | C | Aug. 16, 2022, 3:51 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 217 | 40243200 | ||
168562740 | jeroenodb | C | Aug. 16, 2022, 3:30 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 218 | 4608000 | ||
168611425 | maxplus | C | Aug. 16, 2022, 6:12 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 218 | 45772800 | ||
168646241 | Clonoth | C | Aug. 17, 2022, 3:54 a.m. | OK | GNU C++20 (64) | TESTS | 41 | 218 | 62361600 | ||
168612345 | brunovsky | C | Aug. 16, 2022, 6:19 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 233 | 9113600 | ||
168614498 | maxplus | C | Aug. 16, 2022, 6:37 p.m. | OK | GNU C++20 (64) | TESTS | 41 | 233 | 10137600 | ||
168593540 | Hakiobo | C | Aug. 16, 2022, 4:22 p.m. | OK | Kotlin 1.4 | TESTS | 41 | 607 | 5939200 | ||
168567966 | arvindf232 | C | Aug. 16, 2022, 3:38 p.m. | OK | Kotlin 1.6 | TESTS | 41 | 654 | 5632000 | ||
168571348 | Tlatoani | C | Aug. 16, 2022, 3:43 p.m. | OK | Kotlin 1.6 | TESTS | 41 | 1513 | 110899200 | ||
168636896 | LXl491214 | C | Aug. 17, 2022, 1:26 a.m. | OK | MS C++ 2017 | TESTS | 41 | 1575 | 29286400 | ||
168636996 | LXl491214 | C | Aug. 17, 2022, 1:28 a.m. | OK | MS C++ 2017 | TESTS | 41 | 1606 | 32563200 | ||
168637046 | LXl491214 | C | Aug. 17, 2022, 1:29 a.m. | OK | MS C++ 2017 | TESTS | 41 | 1621 | 155340800 | ||
168636725 | LXl491214 | C | Aug. 17, 2022, 1:23 a.m. | OK | MS C++ 2017 | TESTS | 41 | 2901 | 12492800 | ||
168567864 | conqueror_of_tourist | C | Aug. 16, 2022, 3:37 p.m. | OK | PyPy 3-64 | TESTS | 41 | 701 | 29593600 | ||
168557346 | Egor | C | Aug. 16, 2022, 3:22 p.m. | OK | Rust 2021 | TESTS | 41 | 920 | 14131200 | ||
168567495 | qwerty787788 | C | Aug. 16, 2022, 3:37 p.m. | OK | Rust 2021 | TESTS | 41 | 1044 | 9830400 | ||
168561354 | sansen | C | Aug. 16, 2022, 3:28 p.m. | OK | Rust 2021 | TESTS | 41 | 1591 | 19968000 |
Back to search problems