Codeforces Round 869 (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
1817 Codeforces Round 869 (Div. 1) FINISHED False 8100 49044299 April 29, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 11148 ) A Almost Increasing Subsequence PROGRAMMING data structures greedy

B'A sequence is almost-increasing if it does not contain three consecutive elements x, y, z such that x ge y ge z . You are given an array a_1, a_2, ... , a_n and q queries. Each query consists of two integers 1 <= l <= r <= n . For each query, find the length of the longest almost-increasing subsequence of the subarray a_l, a_{l+1}, ... , a_r . A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements. The first line of input contains two integers, n and q ( 1 <= q n, q <= q 200 ,000 ) -- the length of the array a and the number of queries. The second line contains n integers a_1, a_2, ... , a_n ( 1 <= q a_i <= q 10^9 ) -- the values of the array a . Each of the next q lines contains the description of a query. Each line contains two integers l and r ( 1 <= q l <= q r <= q n ) -- the query is about the subarray a_l, a_{l+1}, ... , a_r . For each of the q queries, print a line containing the length of the longest almost-increasing subsequence of the subarray a_l, a_{l+1}, ... , a_r . In the first query, the subarray is a_1, a_2, a_3 = [1,2,4] . The whole subarray is almost-increasing, so the answer is 3 . In the second query, the subarray is a_1, a_2, a_3,a_4 = [1,2,4,3] . The whole subarray is a almost-increasing, because there are no three consecutive elements such that x geq y geq z . So the answer is 4 . In the third query, the subarray is a_2, a_3, a_4, a_5 = [2, 4, 3, 3] . The whole subarray is not almost-increasing, because the last three elements satisfy 4 geq 3 geq 3 . An almost-increasing subsequence of length 3 can be found (for example taking a_2,a_3,a_5 = [2,4,3] ). So the answer is 3 . '...

Tutorials

Codeforces Round #869 (Div.1, Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
203925699 LeonidR A April 29, 2023, 3:05 p.m. OK C# 10 TESTS 16 217 37171200
203918691 mban259 A April 29, 2023, 2:49 p.m. OK C# 10 TESTS 16 1404 36864000
204001188 atong A April 30, 2023, 5:07 a.m. OK Clang++20 Diagnostics TESTS 27 311 921600
203917437 Gassa A April 29, 2023, 2:46 p.m. OK D TESTS 16 327 13619200
203915273 hos.lyric A April 29, 2023, 2:39 p.m. OK D TESTS 16 514 13516800
203920097 Iamjuruo A April 29, 2023, 2:53 p.m. OK GNU C11 TESTS 16 889 2457600
203931217 pengin_2000 A April 29, 2023, 3:20 p.m. OK GNU C11 TESTS 16 966 3993600
203917757 chro4896 A April 29, 2023, 2:47 p.m. OK GNU C11 TESTS 16 998 2355200
203919621 Pompeii A April 29, 2023, 2:52 p.m. OK GNU C++14 TESTS 16 78 3481600
203993238 fjashufi A April 30, 2023, 2:17 a.m. OK GNU C++14 TESTS 16 156 1638400
203917570 zltzlt A April 29, 2023, 2:47 p.m. OK GNU C++14 TESTS 16 171 1638400
203922449 Iratis A April 29, 2023, 2:58 p.m. OK GNU C++14 TESTS 16 171 1638400
203989222 dongyc666 A April 30, 2023, 12:35 a.m. OK GNU C++14 TESTS 16 171 3993600
203939303 Ice_teapoy A April 29, 2023, 3:43 p.m. OK GNU C++14 TESTS 16 171 11980800
203945539 waaitg A April 29, 2023, 4:04 p.m. OK GNU C++14 TESTS 16 186 1638400
203925063 wuhudsm A April 29, 2023, 3:04 p.m. OK GNU C++14 TESTS 16 186 11980800
203928026 qiliangzhe A April 29, 2023, 3:11 p.m. OK GNU C++14 TESTS 16 187 1638400
203997752 syxwz A April 30, 2023, 3:59 a.m. OK GNU C++14 TESTS 27 187 1638400
203987950 Outlier_ A April 29, 2023, 11:58 p.m. OK GNU C++17 TESTS 16 171 1638400
203917937 lddlinan A April 29, 2023, 2:47 p.m. OK GNU C++17 TESTS 16 171 1740800
203918680 OIer_kzc A April 29, 2023, 2:49 p.m. OK GNU C++17 TESTS 16 171 2764800
203915469 AngusRitossa A April 29, 2023, 2:40 p.m. OK GNU C++17 TESTS 16 186 1638400
203961292 jonathanirvings A April 29, 2023, 5:27 p.m. OK GNU C++17 TESTS 16 186 1638400
203969800 Believer_112 A April 29, 2023, 6:41 p.m. OK GNU C++17 TESTS 16 187 1638400
203969787 Believer_112 A April 29, 2023, 6:41 p.m. OK GNU C++17 TESTS 16 187 1638400
203919876 flaranis A April 29, 2023, 2:52 p.m. OK GNU C++17 TESTS 16 187 1638400
203916787 Ant_Man A April 29, 2023, 2:45 p.m. OK GNU C++17 TESTS 16 187 1638400
203937363 frodakcin A April 29, 2023, 3:37 p.m. OK GNU C++17 TESTS 16 187 3174400
203915256 QAQAutoMaton A April 29, 2023, 2:39 p.m. OK GNU C++17 (64) TESTS 16 46 5836800
203978278 enslaved A April 29, 2023, 8:27 p.m. OK GNU C++17 (64) TESTS 16 124 3993600
203915565 yzc2005 A April 29, 2023, 2:41 p.m. OK GNU C++17 (64) TESTS 16 139 1638400
203928345 ttttan A April 29, 2023, 3:12 p.m. OK GNU C++17 (64) TESTS 16 140 1638400
203925757 Warriors_fsy A April 29, 2023, 3:05 p.m. OK GNU C++17 (64) TESTS 16 140 1638400
203931609 gqf123 A April 29, 2023, 3:21 p.m. OK GNU C++17 (64) TESTS 16 140 1843200
203976965 Noproblem29 A April 29, 2023, 8:07 p.m. OK GNU C++17 (64) TESTS 16 140 3174400
203922739 torisasami A April 29, 2023, 2:58 p.m. OK GNU C++17 (64) TESTS 16 140 3276800
203932409 wnmrmr A April 29, 2023, 3:23 p.m. OK GNU C++17 (64) TESTS 16 140 12288000
203934455 ahshafi A April 29, 2023, 3:29 p.m. OK GNU C++17 (64) TESTS 16 155 1638400
203960737 cmk666 A April 29, 2023, 5:25 p.m. OK GNU C++20 (64) TESTS 16 31 1843200
203930304 Zhouershan A April 29, 2023, 3:17 p.m. OK GNU C++20 (64) TESTS 16 46 9625600
203933837 maspy A April 29, 2023, 3:27 p.m. OK GNU C++20 (64) TESTS 16 77 6451200
204003775 wazy233 A April 30, 2023, 5:50 a.m. OK GNU C++20 (64) TESTS 27 93 1638400
204003966 I_LOVE_TCA A April 30, 2023, 5:53 a.m. OK GNU C++20 (64) TESTS 27 93 1638400
203931301 iridescent_53 A April 29, 2023, 3:20 p.m. OK GNU C++20 (64) TESTS 16 93 2457600
203994146 Karrrrrr A April 30, 2023, 2:38 a.m. OK GNU C++20 (64) TESTS 16 93 2457600
203996672 Jason_Jiao A April 30, 2023, 3:35 a.m. OK GNU C++20 (64) TESTS 27 108 1638400
203992623 stevancv A April 30, 2023, 2:01 a.m. OK GNU C++20 (64) TESTS 16 108 1638400
203990675 Tobo A April 30, 2023, 1:12 a.m. OK GNU C++20 (64) TESTS 16 108 1638400
203923812 profchi A April 29, 2023, 3:01 p.m. OK Java 11 TESTS 16 373 0
203926110 cirno3153 A April 29, 2023, 3:06 p.m. OK Java 11 TESTS 16 499 16793600
203998879 kasiru_69 A April 30, 2023, 4:27 a.m. OK Java 11 TESTS 27 1730 3891200
203973524 CutSandstone A April 29, 2023, 7:21 p.m. OK Java 17 TESTS 16 280 819200
203920516 SecondThread A April 29, 2023, 2:53 p.m. OK Java 8 TESTS 16 421 74854400
203923769 golions A April 29, 2023, 3:01 p.m. OK Java 8 TESTS 16 467 4710400
203916845 FastFreeTask A April 29, 2023, 2:45 p.m. OK Kotlin 1.6 TESTS 16 607 15155200
203915647 Tlatoani A April 29, 2023, 2:41 p.m. OK Kotlin 1.7 TESTS 16 1341 134041600
203927027 hxu10 A April 29, 2023, 3:09 p.m. OK PyPy 3 TESTS 16 546 25702400
203917645 misorin A April 29, 2023, 2:47 p.m. OK PyPy 3 TESTS 16 639 44953600
203968479 limbo16 A April 29, 2023, 6:29 p.m. OK PyPy 3 TESTS 16 811 17715200
203921062 plevande A April 29, 2023, 2:55 p.m. OK PyPy 3 TESTS 16 1185 30003200
203928097 conqueror_of_tourist A April 29, 2023, 3:11 p.m. OK PyPy 3-64 TESTS 16 280 30515200
203999658 codicon A April 30, 2023, 4:35 a.m. OK PyPy 3-64 TESTS 27 280 31641600
203963013 codicon A April 29, 2023, 5:39 p.m. OK PyPy 3-64 TESTS 16 296 30412800
203963303 codicon A April 29, 2023, 5:42 p.m. OK PyPy 3-64 TESTS 16 296 31539200
203963190 codicon A April 29, 2023, 5:41 p.m. OK PyPy 3-64 TESTS 16 311 31539200
203938515 codicon A April 29, 2023, 3:41 p.m. OK PyPy 3-64 TESTS 16 327 30412800
203940905 petamingks A April 29, 2023, 3:48 p.m. OK PyPy 3-64 TESTS 16 358 30924800
203943583 Alex239 A April 29, 2023, 3:58 p.m. OK PyPy 3-64 TESTS 16 373 31334400
203922191 Kita A April 29, 2023, 2:57 p.m. OK PyPy 3-64 TESTS 16 405 35430400
203916945 alexwice A April 29, 2023, 2:45 p.m. OK PyPy 3-64 TESTS 16 420 41881600
203917627 Jimanbanashi A April 29, 2023, 2:47 p.m. OK Python 2 TESTS 16 576 18841600
203982985 isPritchin A April 29, 2023, 9:56 p.m. OK Python 3 TESTS 16 624 25804800
203962505 momoyao A April 29, 2023, 5:36 p.m. OK Python 3 TESTS 16 780 14028800
203963787 WhaleVomit A April 29, 2023, 5:46 p.m. OK Python 3 TESTS 16 1045 15667200
204000203 Spheniscine A April 30, 2023, 4:46 a.m. OK Rust 2021 TESTS 27 93 2560000
203916353 sansen A April 29, 2023, 2:44 p.m. OK Rust 2021 TESTS 16 124 17715200
203930487 Spheniscine A April 29, 2023, 3:18 p.m. OK Rust 2021 TESTS 16 155 18432000
203948065 WaterColor2037 A April 29, 2023, 4:14 p.m. OK Rust 2021 TESTS 16 1591 13721600

remove filters

Back to search problems