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 |
|---|---|---|---|---|---|---|
| 2030 | Codeforces Round 979 (Div. 2) | FINISHED | False | 8100 | 47058923 | Oct. 19, 2024, 2:05 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 1155 ) | F | Orangutan Approved Subarrays | PROGRAMMING | binary search brute force data structures greedy two pointers |
Suppose you have an array (b). Initially, you also have a set (S) that contains all distinct elements of (b). The array (b) is called orangutan-approved if it can be emptied by repeatedly performing the following operation: In one operation, select indices (l) and (r) ((1 \leq l \leq r \leq |b|)) such that (v = b_l = b_{l+1} = \ldots = b_r) and (v) is present in (S). Remove (v) from (S), and simultaneously remove all (b_i) such that (l \leq i \leq r). Then, reindex the elements (b_{r+1}, b_{r+2}, \ldots) as (b_l, b_{l+1}, \ldots) accordingly. You are given an array (a) of length (n) and (q) queries. Each query consists of two indices (l) and (r) ((1 \le l \le r \le n)), and you need to determine whether or not the subarray (a_{l}, a_{l+1}, \ldots, a_r) is orangutan-approved . The first line contains (t) ((1 \leq t \leq 10^4)) — the number of test cases. The first line of each test case contains integers (n) and (q) ((1 \leq n,q \leq 2 \cdot 10^5)) — the size of (a) and the number of queries, respectively. The following line contains (n) integers (a_1, a_2, \ldots, a_n) ((1 \leq a_i \leq n)) — the elements of the array (a). The following (q) lines contain two integers (l) and (r) — the endpoints of the subarray for each query ((1 \leq l \leq r \leq n)). It is guaranteed that the sum of (n) and (q) over all test cases does not exceed (2 \cdot 10^5). For each query, output " YES " (without quotes) if the subarray from (l) to (r) is orangutan-approved , and " NO " (without quotes) otherwise. You can output " YES " and " NO " in any case (for example, strings " yES ", " yes " and " Yes " will be recognized as a positive response). In the first query of the first testcase, the answer is YES . Initially, (S=\{1,2\}) and (b=1,2,2,1) Select (l=2) and (r=3). Since (b_2=b_3=2) is |
| Codeforces Round 979 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 286859234 | lwm7708 | F | Oct. 20, 2024, 1:24 a.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 218 | 5324800 | ||
| 286856719 | Hosen_ba | F | Oct. 19, 2024, 11:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 233 | 4812800 | ||
| 286816180 | nhanhoang510 | F | Oct. 19, 2024, 4:15 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 234 | 8089600 | ||
| 286865517 | 3month7 | F | Oct. 20, 2024, 3:27 a.m. | OK | C++17 (GCC 7-32) | TESTS | 75 | 249 | 2764800 | ||
| 286822639 | Noobish_Monk | F | Oct. 19, 2024, 5:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 249 | 13516800 | ||
| 286816756 | becaido | F | Oct. 19, 2024, 4:16 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 264 | 7987200 | ||
| 286814120 | trp_hy | F | Oct. 19, 2024, 4:10 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 265 | 39116800 | ||
| 286837042 | vnedu | F | Oct. 19, 2024, 6:44 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 312 | 31232000 | ||
| 286812046 | happy_node | F | Oct. 19, 2024, 4:05 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 343 | 12697600 | ||
| 286856555 | Hosen_ba | F | Oct. 19, 2024, 11:53 p.m. | OK | C++17 (GCC 7-32) | TESTS | 74 | 452 | 8294400 | ||
| 286813682 | domjudge | F | Oct. 19, 2024, 4:09 p.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 140 | 12902400 | ||
| 286876051 | cutx86 | F | Oct. 20, 2024, 5:33 a.m. | OK | C++20 (GCC 13-64) | TESTS | 75 | 186 | 4608000 | ||
| 286832445 | Retired_Isaunoya | F | Oct. 19, 2024, 6:08 p.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 186 | 6041600 | ||
| 286876868 | Carucao | F | Oct. 20, 2024, 5:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 75 | 186 | 7270400 | ||
| 286837484 | woodywoody | F | Oct. 19, 2024, 6:48 p.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 187 | 10240000 | ||
| 286855940 | enslaved | F | Oct. 19, 2024, 11:32 p.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 187 | 13209600 | ||
| 286866866 | qingyu17sta | F | Oct. 20, 2024, 3:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 75 | 187 | 61132800 | ||
| 286870572 | wxgmjfhy | F | Oct. 20, 2024, 4:35 a.m. | OK | C++20 (GCC 13-64) | TESTS | 75 | 202 | 7065600 | ||
| 286840735 | JaberSH1 | F | Oct. 19, 2024, 7:19 p.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 218 | 6041600 | ||
| 286859868 | swoswoswo | F | Oct. 20, 2024, 1:40 a.m. | OK | C++20 (GCC 13-64) | TESTS | 74 | 218 | 7168000 | ||
| 286825864 | Hoks_ | F | Oct. 19, 2024, 5:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 124 | 30310400 | ||
| 286826929 | Hoks_ | F | Oct. 19, 2024, 5:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 140 | 22323200 | ||
| 286838229 | altnant | F | Oct. 19, 2024, 6:55 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 217 | 11264000 | ||
| 286847405 | papa-ka-para | F | Oct. 19, 2024, 8:39 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 233 | 11264000 | ||
| 286860251 | Error_Yuan | F | Oct. 20, 2024, 1:50 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 233 | 84070400 | ||
| 286860723 | ngocnho2605n | F | Oct. 20, 2024, 1:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 249 | 8908800 | ||
| 286849061 | papa-ka-para | F | Oct. 19, 2024, 9:02 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 74 | 249 | 11264000 | ||
| 286865092 | brute_forceCE | F | Oct. 20, 2024, 3:20 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 75 | 264 | 16179200 | ||
| 286871974 | Dominater069 | F | Oct. 20, 2024, 4:52 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 75 | 265 | 22937600 | ||
| 286872297 | chughtaisaeed | F | Oct. 20, 2024, 4:56 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 75 | 265 | 46592000 | ||
| 286853329 | golomb | F | Oct. 19, 2024, 10:19 p.m. | OK | PyPy 3-64 | TESTS | 74 | 1015 | 28672000 | ||
| 286878225 | 2200030476 | F | Oct. 20, 2024, 5:50 a.m. | OK | PyPy 3-64 | TESTS | 75 | 1124 | 29184000 | ||
| 286863021 | Mukundan314 | F | Oct. 20, 2024, 2:46 a.m. | OK | PyPy 3-64 | TESTS | 75 | 1156 | 35840000 | ||
| 286811122 | dyppp | F | Oct. 19, 2024, 4:02 p.m. | OK | PyPy 3-64 | TESTS | 74 | 2639 | 165990400 |
Back to search problems