Codeforces Round 668 (Div. 1)

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
1404 Codeforces Round 668 (Div. 1) FINISHED False 7200 132420299 Sept. 6, 2020, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2693 ) C Fixed Point Removal PROGRAMMING binary search data structures greedy

B'Let a_1, ldots, a_n be an array of n positive integers. In one operation, you can choose an index i such that a_i = i , and remove a_i from the array (after the removal, the remaining parts are concatenated). The weight of a is defined as the maximum number of elements you can remove. You must answer q independent queries (x, y) : after replacing the x first elements of a and the y last elements of a by n+1 (making them impossible to remove), what would be the weight of a ? The first line contains two integers n and q ( 1 <= n, q <= 3 cdot 10^5 ) -- the length of the array and the number of queries. The second line contains n integers a_1 , a_2 , ..., a_n ( 1 <= q a_i <= q n ) -- elements of the array. The i -th of the next q lines contains two integers x and y ( x, y ge 0 and x+y < n ). Print q lines, i -th line should contain a single integer -- the answer to the i -th query. Explanation of the first query: After making first x = 3 and last y = 1 elements impossible to remove, a becomes [ x , x , x , 9, 5, 4, 6, 5, 7, 8, 3, 11, x ] (we represent 14 as x for clarity). Here is a strategy that removes 5 elements (the element removed is colored in red): It is impossible to remove more than 5 elements, hence the weight is 5 . '...

Tutorials

Codeforces Round #668 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
92096832 2018LZY C Sept. 7, 2020, 1:35 a.m. OK GNU C++11 TESTS 63 171 13516800
92101875 yyzs123 C Sept. 7, 2020, 3:56 a.m. OK GNU C++11 TESTS 63 265 7270400
92064093 yao11617 C Sept. 6, 2020, 4:01 p.m. OK GNU C++11 TESTS 62 280 12390400
92056830 142857 C Sept. 6, 2020, 3:37 p.m. OK GNU C++11 TESTS 62 280 12390400
92092372 srijon51 C Sept. 6, 2020, 10:03 p.m. OK GNU C++11 TESTS 63 295 13516800
92066123 hrazvan C Sept. 6, 2020, 4:08 p.m. OK GNU C++11 TESTS 62 327 9420800
92062414 alex_Harry C Sept. 6, 2020, 3:55 p.m. OK GNU C++11 TESTS 62 327 21708800
92055449 Fuyuki C Sept. 6, 2020, 3:33 p.m. OK GNU C++11 TESTS 62 342 24473600
92049586 nwi C Sept. 6, 2020, 3:18 p.m. OK GNU C++11 TESTS 62 343 16896000
92050456 EternalAlexander C Sept. 6, 2020, 3:20 p.m. OK GNU C++11 TESTS 62 373 8396800
92095851 lavenderwithbluish C Sept. 7, 2020, 12:55 a.m. OK GNU C++14 TESTS 63 327 24064000
92106195 DougZheng C Sept. 7, 2020, 5:21 a.m. OK GNU C++14 TESTS 63 343 14745600
92077676 pichulia C Sept. 6, 2020, 5:25 p.m. OK GNU C++14 TESTS 62 358 11366400
92098898 lawfung C Sept. 7, 2020, 2:39 a.m. OK GNU C++14 TESTS 63 358 13516800
92098844 lawfung C Sept. 7, 2020, 2:38 a.m. OK GNU C++14 TESTS 63 358 13516800
92077903 qxforever C Sept. 6, 2020, 5:26 p.m. OK GNU C++14 TESTS 62 374 9625600
92062523 jo_on C Sept. 6, 2020, 3:55 p.m. OK GNU C++14 TESTS 62 389 24064000
92105257 Potassium C Sept. 7, 2020, 5:04 a.m. OK GNU C++14 TESTS 63 390 7270400
92068443 kohandy C Sept. 6, 2020, 4:16 p.m. OK GNU C++14 TESTS 62 390 84992000
92098604 lawfung C Sept. 7, 2020, 2:31 a.m. OK GNU C++14 TESTS 63 405 7270400
92064736 _andyli C Sept. 6, 2020, 4:03 p.m. OK GNU C++17 TESTS 62 202 21094400
92105280 Bennettz C Sept. 7, 2020, 5:05 a.m. OK GNU C++17 TESTS 63 311 7270400
92105229 Bennettz C Sept. 7, 2020, 5:04 a.m. OK GNU C++17 TESTS 63 311 7270400
92103379 Bennettz C Sept. 7, 2020, 4:27 a.m. OK GNU C++17 TESTS 63 327 7270400
92095473 arnold518 C Sept. 7, 2020, 12:39 a.m. OK GNU C++17 TESTS 63 342 19558400
92054136 Unsterblicher_Geist C Sept. 6, 2020, 3:30 p.m. OK GNU C++17 TESTS 62 358 29491200
92102111 bdzxt C Sept. 7, 2020, 4:01 a.m. OK GNU C++17 TESTS 63 374 8396800
92081098 Lemur95 C Sept. 6, 2020, 5:57 p.m. OK GNU C++17 TESTS 62 374 13516800
92098000 CQXYM C Sept. 7, 2020, 2:14 a.m. OK GNU C++17 TESTS 63 374 22835200
92045227 mango_lassi C Sept. 6, 2020, 3:08 p.m. OK GNU C++17 TESTS 62 389 12697600
92095176 RiverHamster C Sept. 7, 2020, 12:26 a.m. OK GNU C++17 (64) TESTS 63 156 22425600
92067551 kessido C Sept. 6, 2020, 4:13 p.m. OK GNU C++17 (64) TESTS 62 280 31334400
92103046 suta C Sept. 7, 2020, 4:20 a.m. OK GNU C++17 (64) TESTS 63 295 18534400
92090663 errorgorn C Sept. 6, 2020, 9:03 p.m. OK GNU C++17 (64) TESTS 63 296 13516800
92097930 tyler C Sept. 7, 2020, 2:12 a.m. OK GNU C++17 (64) TESTS 63 296 16179200
92077673 rniya C Sept. 6, 2020, 5:25 p.m. OK GNU C++17 (64) TESTS 62 296 16691200
92083138 Monogon C Sept. 6, 2020, 6:26 p.m. OK GNU C++17 (64) TESTS 62 311 15360000
92059392 nxteru C Sept. 6, 2020, 3:45 p.m. OK GNU C++17 (64) TESTS 62 311 17715200
92047948 tute7627 C Sept. 6, 2020, 3:14 p.m. OK GNU C++17 (64) TESTS 62 312 26624000
92043774 maroonrk C Sept. 6, 2020, 3:04 p.m. OK GNU C++17 (64) TESTS 62 327 26316800
92089377 Dukkha C Sept. 6, 2020, 8:24 p.m. OK Java 11 TESTS 63 561 15052800
92069708 Dukkha C Sept. 6, 2020, 4:20 p.m. OK Java 11 TESTS 62 639 15052800
92104873 Richard727 C Sept. 7, 2020, 4:58 a.m. OK Java 11 TESTS 63 670 49868800
92091112 mphillotry C Sept. 6, 2020, 9:17 p.m. OK Java 11 TESTS 63 732 36864000
92079082 uwi C Sept. 6, 2020, 5:35 p.m. OK Java 11 TESTS 62 982 19968000
92046109 qwerty787788 C Sept. 6, 2020, 3:10 p.m. OK Java 11 TESTS 62 1388 60723200
92087725 cirno3153 C Sept. 6, 2020, 7:46 p.m. OK Java 11 TESTS 63 1434 81817600
92079228 uwi C Sept. 6, 2020, 5:36 p.m. OK Java 11 TESTS 62 1465 68915200
92087323 cirno3153 C Sept. 6, 2020, 7:38 p.m. OK Java 11 TESTS 63 2074 132300800
92080182 YahiaSherif C Sept. 6, 2020, 5:46 p.m. OK Java 8 TESTS 62 607 50380800
92098293 Agnimandur C Sept. 7, 2020, 2:22 a.m. OK Java 8 TESTS 63 702 15360000
92053064 SecondThread C Sept. 6, 2020, 3:27 p.m. OK Java 8 TESTS 62 716 11776000
92054463 cwise C Sept. 6, 2020, 3:30 p.m. OK Java 8 TESTS 62 795 87142400
92086707 TheSawan C Sept. 6, 2020, 7:26 p.m. OK Java 8 TESTS 62 950 24268800
92064081 iakovlev.zakhar C Sept. 6, 2020, 4:01 p.m. OK Java 8 TESTS 62 967 17920000
92068830 TheSawan C Sept. 6, 2020, 4:17 p.m. OK Java 8 TESTS 62 1123 39219200
92077643 Taran_1407 C Sept. 6, 2020, 5:24 p.m. OK Java 8 TESTS 62 1263 29798400
92086145 fetetriste C Sept. 6, 2020, 7:15 p.m. OK Java 8 TESTS 62 1434 24678400
92082772 O_E C Sept. 6, 2020, 6:20 p.m. OK Java 8 TESTS 62 1435 103833600
92082759 azukun C Sept. 6, 2020, 6:20 p.m. OK Mono C# TESTS 62 654 31129600
92059884 mban259 C Sept. 6, 2020, 3:46 p.m. OK Mono C# TESTS 62 2074 45260800
92071765 Yupiteru C Sept. 6, 2020, 4:27 p.m. OK Mono C# TESTS 62 2167 137523200
92081059 keymoon C Sept. 6, 2020, 5:56 p.m. OK Mono C# TESTS 62 2323 64512000
92077569 r57shell C Sept. 6, 2020, 5:24 p.m. OK MS C++ TESTS 62 857 27136000
92077514 youx C Sept. 6, 2020, 5:24 p.m. OK MS C++ 2017 TESTS 62 529 22323200
92077639 shirowa C Sept. 6, 2020, 5:24 p.m. OK MS C++ 2017 TESTS 62 2230 22732800
92071205 SPD_9X2 C Sept. 6, 2020, 4:25 p.m. OK PyPy 3 TESTS 62 1996 45568000
92094397 kclee2172 C Sept. 6, 2020, 11:43 p.m. OK PyPy 3 TESTS 63 2277 61747200
92096279 kobae964 C Sept. 7, 2020, 1:13 a.m. OK Rust TESTS 63 716 19251200
92062000 ngtkana C Sept. 6, 2020, 3:54 p.m. OK Rust TESTS 62 3198 21299200

remove filters

Back to search problems