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 |
---|---|---|---|---|---|---|
1762 | Codeforces Round 838 (Div. 2) | FINISHED | False | 9000 | 66151463 | Dec. 15, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 699 ) | F | Good Pairs | PROGRAMMING | binary search data structures dp |
B'You are given an array a consisting of n integers and an integer k . A pair (l,r) is good if there exists a sequence of indices i_1, i_2, ... , i_m such that Find the number of pairs (l,r) ( 1 <= q l <= q r <= q n ) that are good. Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^5 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two space-separated integers n and k ( 1 <= q n <= q 5 cdot 10^5 ; 0 <= q k <= q 10^5 ) -- the length of the array a and the integer k . The second line of each test case contains n space-separated integers a_1,a_2, ldots,a_n ( 1 <= q a_i <= q 10^5 ) -- representing the array a . It is guaranteed that the sum of n over all test cases does not exceed 5 cdot 10^5 . For each test case, print the number of good pairs. In the first test case, good pairs are (1,1) , (1,2) , (1,3) , (2,2) , (2,3) , and (3,3) . In the second test case, good pairs are (1,1) , (1,3) , (1,4) , (2,2) , (2,3) , (2,4) , (3,3) , (3,4) and (4,4) . Pair (1,4) is good because there exists a sequence of indices 1, 3, 4 which satisfy the given conditions. '... |
Codeforces Round #838 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
185407830 | YeahPotato | F | Dec. 16, 2022, 3:10 a.m. | OK | GNU C++14 | TESTS | 36 | 842 | 5222400 | ||
185364441 | NoPotato | F | Dec. 15, 2022, 4:50 p.m. | OK | GNU C++14 | TESTS | 36 | 935 | 5222400 | ||
185383020 | tick | F | Dec. 15, 2022, 6:47 p.m. | OK | GNU C++17 | TESTS | 36 | 545 | 18022400 | ||
185376345 | ttbao2005 | F | Dec. 15, 2022, 5:53 p.m. | OK | GNU C++17 | TESTS | 36 | 561 | 6144000 | ||
185363011 | Andreikkaa | F | Dec. 15, 2022, 4:46 p.m. | OK | GNU C++17 | TESTS | 36 | 576 | 8294400 | ||
185395910 | MironRaisa | F | Dec. 15, 2022, 9:39 p.m. | OK | GNU C++17 | TESTS | 36 | 764 | 27852800 | ||
185401982 | MagentaCobra | F | Dec. 16, 2022, 12:31 a.m. | OK | GNU C++17 | TESTS | 36 | 857 | 5222400 | ||
185416463 | Cxny | F | Dec. 16, 2022, 5:39 a.m. | OK | GNU C++17 | TESTS | 36 | 951 | 25395200 | ||
185396888 | igor.lifar | F | Dec. 15, 2022, 10 p.m. | OK | GNU C++17 | TESTS | 36 | 951 | 80179200 | ||
185374160 | mguliyev12360 | F | Dec. 15, 2022, 5:38 p.m. | OK | GNU C++17 | TESTS | 36 | 982 | 34099200 | ||
185412891 | thunopro | F | Dec. 16, 2022, 4:48 a.m. | OK | GNU C++17 | TESTS | 36 | 1154 | 17408000 | ||
185398371 | patou | F | Dec. 15, 2022, 10:36 p.m. | OK | GNU C++17 | TESTS | 36 | 2963 | 49049600 | ||
185403770 | Origenes | F | Dec. 16, 2022, 1:24 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 436 | 10854400 | ||
185384229 | VegeDog | F | Dec. 15, 2022, 6:59 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 811 | 52121600 | ||
185408338 | Alex_Wei | F | Dec. 16, 2022, 3:21 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 1045 | 31129600 | ||
185411037 | yzc2005 | F | Dec. 16, 2022, 4:16 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 1106 | 34816000 | ||
185405149 | JoesSR | F | Dec. 16, 2022, 2:02 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 1201 | 3993600 | ||
185371771 | HNO2 | F | Dec. 15, 2022, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 1294 | 26214400 | ||
185405670 | zihouzhong | F | Dec. 16, 2022, 2:16 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 1309 | 136294400 | ||
185376558 | alexchist | F | Dec. 15, 2022, 5:55 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 1465 | 122982400 | ||
185407124 | wygzgyw | F | Dec. 16, 2022, 2:52 a.m. | OK | GNU C++17 (64) | TESTS | 36 | 1543 | 53452800 | ||
185362117 | Andreasyan | F | Dec. 15, 2022, 4:43 p.m. | OK | GNU C++17 (64) | TESTS | 36 | 1668 | 19353600 | ||
185394378 | magnus.hegdahl | F | Dec. 15, 2022, 9:09 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 421 | 17612800 | ||
185377456 | dmenezes | F | Dec. 15, 2022, 6:02 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 436 | 17305600 | ||
185393650 | magnus.hegdahl | F | Dec. 15, 2022, 8:56 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 452 | 17612800 | ||
185409316 | zqyyy | F | Dec. 16, 2022, 3:44 a.m. | OK | GNU C++20 (64) | TESTS | 36 | 483 | 7065600 | ||
185384433 | pakhandi98 | F | Dec. 15, 2022, 7:01 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 483 | 33587200 | ||
185393056 | magnus.hegdahl | F | Dec. 15, 2022, 8:48 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 499 | 19558400 | ||
185398127 | friendless | F | Dec. 15, 2022, 10:30 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 577 | 14028800 | ||
185406945 | FlyingChicken | F | Dec. 16, 2022, 2:47 a.m. | OK | GNU C++20 (64) | TESTS | 36 | 592 | 15462400 | ||
185400518 | satyam_343 | F | Dec. 15, 2022, 11:39 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 592 | 44646400 | ||
185392862 | magnus.hegdahl | F | Dec. 15, 2022, 8:45 p.m. | OK | GNU C++20 (64) | TESTS | 36 | 623 | 19353600 | ||
185376957 | arvindf232 | F | Dec. 15, 2022, 5:58 p.m. | OK | Kotlin 1.6 | TESTS | 36 | 2573 | 161996800 |
Back to search problems