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 |
---|---|---|---|---|---|---|
1332 | Codeforces Round 630 (Div. 2) | FINISHED | False | 9000 | 146161499 | March 31, 2020, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 301 ) | G | No Monotone Triples | PROGRAMMING | data structures | 3000 |
B"Given a sequence of integers a of length n , a tuple (i,j,k) is called monotone triples if For example, a=[5,3,4,5] , then (2,3,4) is monotone triples for sequence a while (1,3,4) is not. Bob is given a sequence of integers a of length n in a math exam. The exams itself contains questions of form L, R , for each of them he is asked to find any subsequence b with size greater than 2 (i.e. |b| ge 3 ) of sequence a_L, a_{L+1}, ldots, a_{R} . Recall that an sequence b is a subsequence of sequence a if b can be obtained by deletion of several (possibly zero, or all) elements. However, he hates monotone stuff, and he wants to find a subsequence free from monotone triples. Besides, he wants to find one subsequence with the largest length among all subsequences free from monotone triples for every query. Please help Bob find out subsequences meeting the above constraints. The first line contains two integers n , q ( 3 <= n <= 2 cdot 10^5 , 1 <= q <= 2 cdot 10^5 ) -- the length of sequence a and the number of queries. The second line contains n integers a_1,a_2, ldots, a_n ( 1 <= a_i <= 10^{9} ), representing the sequence a . Then each of the following q lines contains two integers L , R ( 1 <= L,R <= n , R-L ge 2 ). For each query, output 0 if there is no subsequence b satisfying the constraints mentioned in the legend. You can print the empty line after but that's not mandatory. Otherwise, output one integer k ( k > 2 ) denoting the length of sequence b , then output k integers i_1, i_2, ldots, i_k ( L <= i_1 < i_2< ldots<i_k <= R ) satisfying that b_j = a_{i_j} for 1 <= j <= k . If there are multiple answers with the maximum length, print any of them. For the first query, the given sequence itself is monotone triples free. Fo"... |
Codeforces Round #630 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
75046162 | wasa855 | G | April 1, 2020, 6:27 a.m. | OK | GNU C++11 | TESTS | 135 | 202 | 16793600 | 3000 | |
75707655 | DWAE86 | G | April 7, 2020, 3:07 a.m. | OK | GNU C++11 | TESTS | 135 | 218 | 20377600 | 3000 | |
75090090 | lzoilxy | G | April 1, 2020, 2:20 p.m. | OK | GNU C++11 | TESTS | 135 | 218 | 66560000 | 3000 | |
75090577 | lzoilxy | G | April 1, 2020, 2:24 p.m. | OK | GNU C++11 | TESTS | 135 | 218 | 66867200 | 3000 | |
75475404 | lzoilxy | G | April 4, 2020, 10:19 a.m. | OK | GNU C++11 | TESTS | 135 | 234 | 66560000 | 3000 | |
75671697 | OIer_whx | G | April 6, 2020, 3:35 p.m. | OK | GNU C++11 | TESTS | 135 | 248 | 49664000 | 3000 | |
75233523 | Glu_TtoNy | G | April 2, 2020, 11:47 a.m. | OK | GNU C++11 | TESTS | 135 | 249 | 49971200 | 3000 | |
75052704 | dysyn1314 | G | April 1, 2020, 7:41 a.m. | OK | GNU C++11 | TESTS | 135 | 265 | 22630400 | 3000 | |
75233280 | vjudge2 | G | April 2, 2020, 11:45 a.m. | OK | GNU C++11 | TESTS | 135 | 265 | 49664000 | 3000 | |
75299555 | ACMonster | G | April 3, 2020, 1:20 a.m. | OK | GNU C++11 | TESTS | 135 | 296 | 59392000 | 3000 | |
75010977 | rainboy | G | March 31, 2020, 6:36 p.m. | OK | GNU C++14 | TESTS | 135 | 296 | 16793600 | 3000 | |
75708127 | submit_code_dsi | G | April 7, 2020, 3:20 a.m. | OK | GNU C++14 | TESTS | 135 | 327 | 18534400 | 3000 | |
75269078 | vsriram1012 | G | April 2, 2020, 5:06 p.m. | OK | GNU C++14 | TESTS | 135 | 342 | 18534400 | 3000 | |
75265608 | vsriram1012 | G | April 2, 2020, 4:32 p.m. | OK | GNU C++14 | TESTS | 135 | 342 | 18534400 | 3000 | |
75263648 | vsriram1012 | G | April 2, 2020, 4:12 p.m. | OK | GNU C++14 | TESTS | 135 | 342 | 18534400 | 3000 | |
75011758 | yan-zp | G | March 31, 2020, 6:46 p.m. | OK | GNU C++14 | TESTS | 135 | 358 | 15872000 | 3000 | |
75529105 | _cielll_ | G | April 5, 2020, 2:22 a.m. | OK | GNU C++14 | TESTS | 135 | 358 | 18534400 | 3000 | |
75170637 | Etam | G | April 1, 2020, 6:22 p.m. | OK | GNU C++14 | TESTS | 135 | 358 | 18534400 | 3000 | |
76247577 | Sacxy | G | April 11, 2020, 11:50 a.m. | OK | GNU C++14 | TESTS | 135 | 373 | 18534400 | 3000 | |
74987408 | PinkRabbit | G | March 31, 2020, 3:43 p.m. | OK | GNU C++14 | TESTS | 135 | 374 | 15360000 | 3000 | |
75564493 | limbo.null | G | April 5, 2020, 11:49 a.m. | OK | GNU C++17 | TESTS | 135 | 248 | 29184000 | 3000 | |
75658053 | iotang | G | April 6, 2020, 12:58 p.m. | OK | GNU C++17 | TESTS | 135 | 296 | 32460800 | 3000 | |
75311382 | penguin1017 | G | April 3, 2020, 5:38 a.m. | OK | GNU C++17 | TESTS | 135 | 342 | 16998400 | 3000 | |
75204705 | triple__a | G | April 2, 2020, 5:43 a.m. | OK | GNU C++17 | TESTS | 135 | 342 | 18534400 | 3000 | |
75707520 | PeterBC | G | April 7, 2020, 3:03 a.m. | OK | GNU C++17 | TESTS | 135 | 343 | 18534400 | 3000 | |
75705760 | Pappu_kumar | G | April 7, 2020, 2:09 a.m. | OK | GNU C++17 | TESTS | 135 | 343 | 18534400 | 3000 | |
75940771 | emma | G | April 9, 2020, 1:12 a.m. | OK | GNU C++17 | TESTS | 135 | 358 | 18636800 | 3000 | |
75004981 | Egor.Lifar | G | March 31, 2020, 5:54 p.m. | OK | GNU C++17 | TESTS | 135 | 374 | 23244800 | 3000 | |
75703243 | ILLLZKQF | G | April 7, 2020, 12:43 a.m. | OK | GNU C++17 | TESTS | 135 | 420 | 32870400 | 3000 | |
75064137 | Mr.Robot_28 | G | April 1, 2020, 9:52 a.m. | OK | GNU C++17 | TESTS | 135 | 421 | 30617600 | 3000 | |
75783842 | kostia244 | G | April 7, 2020, 8:20 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 358 | 35123200 | 3000 | |
75020365 | ecnerwala | G | March 31, 2020, 8:52 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 389 | 35430400 | 3000 | |
75013632 | risujiroh | G | March 31, 2020, 7:10 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 436 | 29900800 | 3000 | |
75617414 | zjsdut | G | April 6, 2020, 2:19 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 451 | 53145600 | 3000 | |
75001203 | jiangly | G | March 31, 2020, 5:20 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 483 | 53043200 | 3000 | |
75081154 | autoint | G | April 1, 2020, 12:53 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 499 | 18739200 | 3000 | |
75187966 | .tx | G | April 1, 2020, 11:12 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 670 | 43008000 | 3000 | |
75218726 | qazswedx2 | G | April 2, 2020, 8:53 a.m. | OK | GNU C++17 (64) | TESTS | 135 | 794 | 50073600 | 3000 | |
74993967 | HIR180 | G | March 31, 2020, 4:01 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 811 | 25600000 | 3000 | |
75001367 | ksun48 | G | March 31, 2020, 5:21 p.m. | OK | GNU C++17 (64) | TESTS | 135 | 1044 | 83763200 | 3000 |
Back to search problems