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 |
|---|---|---|---|---|---|---|
| 2101 | Codeforces Round 1024 (Div. 1) | FINISHED | False | 9000 | 29431523 | May 11, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1002 ) | D | Mani and Segments | PROGRAMMING | data structures implementation two pointers |
An array (b) of length (|b|) is cute if the sum of the length of its Longest Increasing Subsequence (LIS) and the length of its Longest Decreasing Subsequence (LDS)(^{\text{∗}}) is exactly one more than the length of the array. More formally, the array (b) is cute if (\operatorname{LIS}(b) + \operatorname{LDS}(b) = |b| + 1). You are given a permutation (a) of length (n)(^{\text{†}}). Your task is to count the number of non-empty subarrays(^{\text{‡}}) of permutation (a) that are cute. (^{\text{∗}})A sequence (x) is a subsequence of a sequence (y) if (x) can be obtained from (y) by the deletion of several (possibly, zero or all) element from arbitrary positions. The longest increasing (decreasing) subsequence of an array is the longest subsequence such that its elements are ordered in strictly increasing (decreasing) order. (^{\text{†}})A permutation of length (n) is an array consisting of (n) distinct integers from (1) to (n) in arbitrary order. For example, (2,3,1,5,4) is a permutation, but (1,2,2) is not a permutation ((2) appears twice in the array), and (1,3,4) is also not a permutation ((n=3) but there is (4) in the array). (^{\text{‡}})An array (x) is a subarray of an array (y) if (x) can be obtained from (y) by the deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains a single integer (n) ((1\le n\le 2 \cdot 10^5)) — the length of permutation (a). The second line of each test case contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \le a_i \le n)) — the elements of permutation (a). It is guaranteed that the sum of $ |
| 142788 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 319278351 | DanTheMan. | D | May 11, 2025, 4:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 109 | 102400 | ||
| 319297064 | AiPd | D | May 11, 2025, 6:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 109 | 1126400 | ||
| 319276725 | QZJ666 | D | May 11, 2025, 4:21 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 109 | 4096000 | ||
| 319282457 | KroosTheKeenGlint | D | May 11, 2025, 4:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 124 | 2457600 | ||
| 319289997 | Muelsyse | D | May 11, 2025, 5:02 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 124 | 3276800 | ||
| 319268762 | kai824 | D | May 11, 2025, 4 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 124 | 5017600 | ||
| 319290625 | _luqyou_ | D | May 11, 2025, 5:04 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 156 | 40140800 | ||
| 319271256 | LOL_I_AM_SERZH | D | May 11, 2025, 4:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 171 | 1945600 | ||
| 319282866 | Sai_t | D | May 11, 2025, 4:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 233 | 19763200 | ||
| 319280998 | Potassium | D | May 11, 2025, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 47 | 265 | 11161600 | ||
| 319276231 | Xylenox | D | May 11, 2025, 4:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 93 | 0 | ||
| 319317764 | Zhouershan | D | May 12, 2025, 2 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 93 | 3788800 | ||
| 319304301 | fractal | D | May 11, 2025, 7:54 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 93 | 8089600 | ||
| 319299574 | fractal | D | May 11, 2025, 6:49 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 93 | 8089600 | ||
| 319317010 | slzxpanhongxuan | D | May 12, 2025, 1:41 a.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 93 | 24064000 | ||
| 319290376 | BalintR | D | May 11, 2025, 5:03 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 108 | 819200 | ||
| 319278287 | HuaJun | D | May 11, 2025, 4:25 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 109 | 6963200 | ||
| 319266935 | fishcathu | D | May 11, 2025, 3:56 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 124 | 8089600 | ||
| 319305452 | crystal_castles | D | May 11, 2025, 8:12 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 124 | 11161600 | ||
| 319276432 | Shifted | D | May 11, 2025, 4:20 p.m. | OK | C++20 (GCC 13-64) | TESTS | 47 | 139 | 1945600 | ||
| 319323537 | Nlll | D | May 12, 2025, 3:55 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 78 | 102400 | ||
| 319323514 | krit3379 | D | May 12, 2025, 3:54 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 102400 | ||
| 319279675 | Mr.Bebra | D | May 11, 2025, 4:30 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 102400 | ||
| 319299971 | aimoon | D | May 11, 2025, 6:53 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 1228800 | ||
| 319290664 | Dalek_of_Rivia | D | May 11, 2025, 5:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 1228800 | ||
| 319247463 | ecnerwala | D | May 11, 2025, 3:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 2048000 | ||
| 319297801 | bookcat | D | May 11, 2025, 6:29 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 3276800 | ||
| 319270423 | olmrgcsi | D | May 11, 2025, 4:04 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 93 | 4812800 | ||
| 319275366 | Halzion | D | May 11, 2025, 4:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 108 | 102400 | ||
| 319288841 | superguymj | D | May 11, 2025, 4:59 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 47 | 108 | 512000 | ||
| 319300464 | rainboy | D | May 11, 2025, 7 p.m. | OK | GNU C11 | TESTS | 47 | 93 | 2457600 | ||
| 319325322 | muradbhai | D | May 12, 2025, 4:25 a.m. | OK | GNU C11 | TESTS | 47 | 93 | 4096000 | ||
| 319325077 | muradbhai | D | May 12, 2025, 4:21 a.m. | OK | GNU C11 | TESTS | 47 | 93 | 4096000 | ||
| 319286055 | rainboy | D | May 11, 2025, 4:50 p.m. | OK | GNU C11 | TESTS | 47 | 249 | 9113600 | ||
| 319324037 | golions | D | May 12, 2025, 4:03 a.m. | OK | Java 8 | TESTS | 47 | 218 | 819200 | ||
| 319307211 | golions | D | May 11, 2025, 8:43 p.m. | OK | Java 8 | TESTS | 47 | 218 | 819200 | ||
| 319325013 | golions | D | May 12, 2025, 4:20 a.m. | OK | Java 8 | TESTS | 47 | 249 | 716800 | ||
| 319254559 | Tlatoani | D | May 11, 2025, 3:37 p.m. | OK | Kotlin 1.9 | TESTS | 47 | 593 | 16076800 | ||
| 319320891 | smilences | D | May 12, 2025, 3:08 a.m. | OK | PyPy 3-64 | TESTS | 47 | 546 | 27852800 | ||
| 319281993 | conqueror_of_tourist | D | May 11, 2025, 4:37 p.m. | OK | PyPy 3-64 | TESTS | 47 | 593 | 30208000 | ||
| 319280319 | titia | D | May 11, 2025, 4:32 p.m. | OK | PyPy 3-64 | TESTS | 47 | 858 | 27238400 | ||
| 319258492 | Egor | D | May 11, 2025, 3:42 p.m. | OK | Rust 2021 | TESTS | 47 | 765 | 14028800 |
Back to search problems