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 |
|---|---|---|---|---|---|---|
| 2064 | Codeforces Round 1005 (Div. 2) | FINISHED | False | 7200 | 36689123 | Feb. 16, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 691 ) | F | We Be Summing | PROGRAMMING | binary search data structures two pointers |
You are given an array (a) of length (n) and an integer (k). Call a non-empty array (b) of length (m) epic if there exists an integer (i) where (1 \le i < m) and (\min(b_1,\ldots,b_i) + \max(b_{i + 1},\ldots,b_m) = k). Count the number of epic subarrays(^{\text{∗}}) of (a). (^{\text{∗}})An array (a) is a subarray of an array (b) if (a) can be obtained from (b) by the deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. The first line contains an integer (t) ((1 \le t \le 10^4)) — the number of testcases. The first line of each testcase contains integers (n) and (k) ((2 \le n \le 2 \cdot 10^5); (n < k < 2 \cdot n)) — the length of the array (a) and (k). The second line of each testcase contains (n) integers (a_1,a_2,\ldots,a_n) ((1 \le a_i \le n)). The sum of (n) across all testcases does not exceed (2 \cdot 10^5). For each testcase, output the number of epic contiguous subarrays of (a). These are all the epic subarrays in the first testcase: (2, 3, 4, 5), because (\min(2, 3) + \max(4, 5) = 2 + 5 = 7). (3, 4), because (\min(3) + \max(4) = 3 + 4 = 7). In the second test case, every subarray that contains at least one (6) and at least one (7) is epic. |
| Codeforces Round 1005 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 306469726 | tmwilliamlin168 | F | Feb. 17, 2025, 1:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 93 | 4096000 | ||
| 306441584 | TrendBattles | F | Feb. 16, 2025, 6:13 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 171 | 13824000 | ||
| 306471809 | yjx120921 | F | Feb. 17, 2025, 2:40 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 202 | 20070400 | ||
| 306428969 | Aftglw | F | Feb. 16, 2025, 4:34 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 202 | 20582400 | ||
| 306423247 | tmwilliamlin168 | F | Feb. 16, 2025, 4:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 218 | 26828800 | ||
| 306470856 | Sicko_Lasombra | F | Feb. 17, 2025, 2:21 a.m. | OK | C++17 (GCC 7-32) | TESTS | 27 | 233 | 15257600 | ||
| 306444799 | Code937 | F | Feb. 16, 2025, 6:38 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 234 | 52019200 | ||
| 306444513 | Code937 | F | Feb. 16, 2025, 6:35 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 234 | 53760000 | ||
| 306457405 | Noche_6 | F | Feb. 16, 2025, 8:58 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 249 | 18636800 | ||
| 306448404 | ywjylx | F | Feb. 16, 2025, 7:11 p.m. | OK | C++17 (GCC 7-32) | TESTS | 24 | 436 | 28876800 | ||
| 306470957 | SinhaSatwik | F | Feb. 17, 2025, 2:23 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 92 | 2048000 | ||
| 306474684 | ddwwwr | F | Feb. 17, 2025, 3:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 92 | 4096000 | ||
| 306437166 | turkhuu622 | F | Feb. 16, 2025, 5:40 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 139 | 8704000 | ||
| 306438395 | turkhuu622 | F | Feb. 16, 2025, 5:48 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 155 | 8704000 | ||
| 306428934 | physics0523 | F | Feb. 16, 2025, 4:34 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 156 | 6144000 | ||
| 306471743 | ji_114514 | F | Feb. 17, 2025, 2:39 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 156 | 9625600 | ||
| 306425801 | IanISam | F | Feb. 16, 2025, 4:28 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 156 | 14643200 | ||
| 306464433 | cuiaoxiang | F | Feb. 16, 2025, 11:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 156 | 25395200 | ||
| 306478455 | tin.le2 | F | Feb. 17, 2025, 4:33 a.m. | OK | C++20 (GCC 13-64) | TESTS | 27 | 171 | 13926400 | ||
| 306436736 | turkhuu622 | F | Feb. 16, 2025, 5:36 p.m. | OK | C++20 (GCC 13-64) | TESTS | 24 | 187 | 17408000 | ||
| 306436102 | rniya | F | Feb. 16, 2025, 5:32 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 108 | 4300800 | ||
| 306438913 | jiangly | F | Feb. 16, 2025, 5:52 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 124 | 7680000 | ||
| 306470279 | pengpeng_fudan | F | Feb. 17, 2025, 2:09 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 140 | 16793600 | ||
| 306432570 | PicACG | F | Feb. 16, 2025, 5:10 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 140 | 18022400 | ||
| 306484911 | wakaka | F | Feb. 17, 2025, 5:58 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 27 | 140 | 19763200 | ||
| 306464475 | tamthegod | F | Feb. 16, 2025, 11:25 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 156 | 83660800 | ||
| 306448906 | MahmoudBassem | F | Feb. 16, 2025, 7:16 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 186 | 21299200 | ||
| 306456517 | der_Kaizer | F | Feb. 16, 2025, 8:46 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 187 | 24371200 | ||
| 306435356 | _DRVGON_ | F | Feb. 16, 2025, 5:27 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 202 | 16384000 | ||
| 306448964 | MahmoudBassem | F | Feb. 16, 2025, 7:17 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 24 | 202 | 24678400 | ||
| 306428018 | Dukkha | F | Feb. 16, 2025, 4:33 p.m. | OK | Java 21 | TESTS | 24 | 358 | 17203200 | ||
| 306434879 | shardulisgapryongkim | F | Feb. 16, 2025, 5:23 p.m. | OK | Java 21 | TESTS | 24 | 827 | 80486400 | ||
| 306463870 | DarLam | F | Feb. 16, 2025, 11:05 p.m. | OK | Java 21 | TESTS | 24 | 1124 | 42803200 | ||
| 306431823 | TheAbbie | F | Feb. 16, 2025, 5:07 p.m. | OK | PyPy 3-64 | TESTS | 24 | 796 | 75161600 | ||
| 306423235 | harurun4635 | F | Feb. 16, 2025, 4:23 p.m. | OK | PyPy 3-64 | TESTS | 24 | 1327 | 45670400 |
Back to search problems