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 |
---|---|---|---|---|---|---|
1955 | Codeforces Round 938 (Div. 3) | FINISHED | False | 8100 | 24593063 | April 8, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 15997 ) | D | Inaccurate Subsequence Search | PROGRAMMING | data structures two pointers |
B'Maxim has an array a of n integers and an array b of m integers ( m <= n ). Maxim considers an array c of length m to be good if the elements of array c can be rearranged in such a way that at least k of them match the elements of array b . For example, if b = [1, 2, 3, 4] and k = 3 , then the arrays [4, 1, 2, 3] and [2, 3, 4, 5] are good (they can be reordered as follows: [1, 2, 3, 4] and [5, 2, 3, 4] ), while the arrays [3, 4, 5, 6] and [3, 4, 3, 4] are not good. Maxim wants to choose every subsegment of array a of length m as the elements of array c . Help Maxim count how many selected arrays will be good. In other words, find the number of positions 1 <= l <= n - m + 1 such that the elements a_l, a_{l+1}, ... , a_{l + m - 1} form a good array. The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains three integers n , m , and k ( 1 <= k <= m <= n <= 2 cdot 10^5 ) -- the number of elements in arrays a and b , the required number of matching elements. The second line of each test case contains n integers a_1, a_2, ... , a_n ( 1 <= a_i <= 10^6 ) -- the elements of array a . Elements of the array a are not necessarily unique. The third line of each test case contains m integers b_1, b_2, ... , b_m ( 1 <= b_i <= 10^6 ) -- the elements of array b . Elements of the array b are not necessarily unique. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . Similarly, it is guaranteed that the sum of m over all test cases does not exceed 2 cdot 10^5 . For each test case, output the number of good subsegments of array a on a separate line. In the first example, all subsegments are good. '... |
128243 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
255808699 | xx1902 | D | April 9, 2024, 2:49 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 140 | 24166400 | ||
255790454 | xiufan | D | April 8, 2024, 9:31 p.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 156 | 9625600 | ||
255814518 | logicxiong | D | April 9, 2024, 4:02 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 156 | 16076800 | ||
255769509 | Tame2007 | D | April 8, 2024, 6 p.m. | OK | C++14 (GCC 6-32) | TESTS | 10 | 202 | 13926400 | ||
255806621 | suzukasan | D | April 9, 2024, 2:22 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 233 | 15155200 | ||
255769247 | Fedbxy | D | April 8, 2024, 5:59 p.m. | OK | C++14 (GCC 6-32) | TESTS | 10 | 249 | 3276800 | ||
255803451 | moyasser333 | D | April 9, 2024, 1:29 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 265 | 7577600 | ||
255803074 | tree__ | D | April 9, 2024, 1:23 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 265 | 7680000 | ||
255780595 | aryanrohit | D | April 8, 2024, 7:37 p.m. | OK | C++14 (GCC 6-32) | TESTS | 10 | 265 | 11776000 | ||
255803338 | Bree_Cui | D | April 9, 2024, 1:27 a.m. | OK | C++14 (GCC 6-32) | TESTS | 11 | 265 | 12083200 | ||
255766479 | berricto | D | April 8, 2024, 5:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 10 | 109 | 8089600 | ||
255772390 | betel_geuse | D | April 8, 2024, 6:22 p.m. | OK | C++17 (GCC 7-32) | TESTS | 10 | 124 | 1945600 | ||
255824441 | Mariam__Adel | D | April 9, 2024, 5:51 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 5939200 | ||
255809676 | Banis | D | April 9, 2024, 3:02 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 6656000 | ||
255817306 | BK_sky | D | April 9, 2024, 4:38 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255815855 | Super. | D | April 9, 2024, 4:20 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255813801 | QianHuiShaGui | D | April 9, 2024, 3:53 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255810711 | Darshanraj | D | April 9, 2024, 3:14 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255809571 | soulbloom | D | April 9, 2024, 3:01 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255801215 | Mohammed_Saeed | D | April 9, 2024, 12:52 a.m. | OK | C++17 (GCC 7-32) | TESTS | 11 | 124 | 9625600 | ||
255777622 | cebolinha | D | April 8, 2024, 7:07 p.m. | OK | C++20 (GCC 13-64) | TESTS | 10 | 109 | 5939200 | ||
255803676 | I_love_GSNQK | D | April 9, 2024, 1:33 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 109 | 8089600 | ||
255781256 | shengyomin | D | April 8, 2024, 7:43 p.m. | OK | C++20 (GCC 13-64) | TESTS | 10 | 109 | 8089600 | ||
255784989 | Chris_Black | D | April 8, 2024, 8:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 10 | 109 | 9625600 | ||
255788065 | MUSTAFA_MOHAMED | D | April 8, 2024, 8:59 p.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 109 | 16076800 | ||
255806878 | MagicalGirl | D | April 9, 2024, 2:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 124 | 7577600 | ||
255776286 | Moataz_Muhammed | D | April 8, 2024, 6:54 p.m. | OK | C++20 (GCC 13-64) | TESTS | 10 | 124 | 8089600 | ||
255819400 | Silencer76 | D | April 9, 2024, 5:02 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 124 | 9625600 | ||
255779381 | Koncloud | D | April 8, 2024, 7:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 10 | 124 | 11264000 | ||
255798790 | jotave | D | April 9, 2024, 12:07 a.m. | OK | C++20 (GCC 13-64) | TESTS | 11 | 124 | 16076800 | ||
255792725 | NenadDapic | D | April 8, 2024, 10:08 p.m. | OK | FPC | TESTS | 11 | 124 | 9625600 | ||
255814070 | Darshanraj | D | April 9, 2024, 3:56 a.m. | OK | GNU C11 | TESTS | 11 | 124 | 9625600 | ||
255811045 | Darshanraj | D | April 9, 2024, 3:19 a.m. | OK | GNU C11 | TESTS | 11 | 140 | 9728000 | ||
255773958 | Szzzp | D | April 8, 2024, 6:35 p.m. | OK | GNU C11 | TESTS | 10 | 155 | 3276800 | ||
255811315 | keutoi | D | April 9, 2024, 3:22 a.m. | OK | Haskell | TESTS | 11 | 811 | 65126400 | ||
255818870 | neilchetty | D | April 9, 2024, 4:56 a.m. | OK | Java 21 | TESTS | 11 | 530 | 18022400 | ||
255771526 | Switch9 | D | April 8, 2024, 6:15 p.m. | OK | Java 21 | TESTS | 10 | 546 | 35225600 | ||
255774569 | dineshchandran311 | D | April 8, 2024, 6:40 p.m. | OK | Java 21 | TESTS | 10 | 562 | 34918400 | ||
255786773 | vikash_45 | D | April 8, 2024, 8:44 p.m. | OK | Java 21 | TESTS | 11 | 578 | 29388800 | ||
255820377 | Siddharth_Singh_here | D | April 9, 2024, 5:12 a.m. | OK | Java 21 | TESTS | 11 | 592 | 31539200 | ||
255776447 | raja1102 | D | April 8, 2024, 6:56 p.m. | OK | Java 21 | TESTS | 10 | 593 | 23040000 | ||
255795033 | koolkartik | D | April 8, 2024, 10:49 p.m. | OK | Java 21 | TESTS | 11 | 593 | 25292800 | ||
255823867 | _ShenHua_ | D | April 9, 2024, 5:45 a.m. | OK | Java 21 | TESTS | 11 | 593 | 33996800 | ||
255784246 | vikash_45 | D | April 8, 2024, 8:16 p.m. | OK | Java 21 | TESTS | 10 | 608 | 40038400 | ||
255787719 | vikash_45 | D | April 8, 2024, 8:55 p.m. | OK | Java 21 | TESTS | 11 | 640 | 28672000 | ||
255809967 | Freedom_lifelong | D | April 9, 2024, 3:06 a.m. | OK | Java 8 | TESTS | 11 | 171 | 5939200 | ||
255802235 | NerfThis | D | April 9, 2024, 1:09 a.m. | OK | Java 8 | TESTS | 11 | 359 | 19865600 | ||
255825145 | coderman2004 | D | April 9, 2024, 5:57 a.m. | OK | Java 8 | TESTS | 11 | 437 | 22425600 | ||
255769903 | shubham202012 | D | April 8, 2024, 6:03 p.m. | OK | Java 8 | TESTS | 10 | 483 | 27545600 | ||
255771286 | iamcodebug | D | April 8, 2024, 6:13 p.m. | OK | Java 8 | TESTS | 10 | 499 | 25907200 | ||
255816362 | Safawt | D | April 9, 2024, 4:26 a.m. | OK | Java 8 | TESTS | 11 | 546 | 70860800 | ||
255816705 | Safawt | D | April 9, 2024, 4:31 a.m. | OK | Java 8 | TESTS | 11 | 546 | 71168000 | ||
255809857 | Aarush_Kinhikar | D | April 9, 2024, 3:05 a.m. | OK | Java 8 | TESTS | 11 | 812 | 5734400 | ||
255822828 | harsh_1806 | D | April 9, 2024, 5:35 a.m. | OK | Java 8 | TESTS | 11 | 843 | 16793600 | ||
255796988 | kirsh_kkm | D | April 8, 2024, 11:28 p.m. | OK | Java 8 | TESTS | 11 | 890 | 17305600 | ||
255824475 | lssl | D | April 9, 2024, 5:51 a.m. | OK | Node.js | TESTS | 11 | 327 | 77516800 | ||
255769082 | swapnil_diganta | D | April 8, 2024, 5:58 p.m. | OK | PHP | TESTS | 10 | 217 | 57036800 | ||
255821251 | kimsg125 | D | April 9, 2024, 5:21 a.m. | OK | PyPy 3 | TESTS | 11 | 421 | 22118400 | ||
255823929 | Niko-Bellic | D | April 9, 2024, 5:46 a.m. | OK | PyPy 3 | TESTS | 11 | 546 | 30515200 | ||
255782661 | vishruth_21 | D | April 8, 2024, 7:58 p.m. | OK | PyPy 3 | TESTS | 10 | 593 | 27238400 | ||
255782744 | vishruth_21 | D | April 8, 2024, 7:59 p.m. | OK | PyPy 3 | TESTS | 10 | 608 | 27648000 | ||
255817529 | _twi_nami | D | April 9, 2024, 4:41 a.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 48230400 | ||
255796487 | MassimoG | D | April 8, 2024, 11:18 p.m. | OK | PyPy 3-64 | TESTS | 11 | 218 | 64409600 | ||
255817730 | DAMPER | D | April 9, 2024, 4:43 a.m. | OK | PyPy 3-64 | TESTS | 11 | 249 | 38195200 | ||
255807167 | pratikagarwal4250 | D | April 9, 2024, 2:30 a.m. | OK | PyPy 3-64 | TESTS | 11 | 280 | 34508800 | ||
255802019 | samchen123 | D | April 9, 2024, 1:05 a.m. | OK | PyPy 3-64 | TESTS | 11 | 312 | 36352000 | ||
255768873 | DeepJ | D | April 8, 2024, 5:56 p.m. | OK | PyPy 3-64 | TESTS | 10 | 312 | 36864000 | ||
255792022 | OmarMoBadr | D | April 8, 2024, 9:56 p.m. | OK | PyPy 3-64 | TESTS | 11 | 328 | 33894400 | ||
255800044 | n_matari | D | April 9, 2024, 12:31 a.m. | OK | PyPy 3-64 | TESTS | 11 | 342 | 39731200 | ||
255814565 | demony | D | April 9, 2024, 4:03 a.m. | OK | PyPy 3-64 | TESTS | 11 | 342 | 41676800 | ||
255824384 | Taymyr | D | April 9, 2024, 5:50 a.m. | OK | PyPy 3-64 | TESTS | 11 | 343 | 35737600 | ||
255774185 | samyaksrivastava9 | D | April 8, 2024, 6:36 p.m. | OK | Python 3 | TESTS | 10 | 343 | 45363200 | ||
255772597 | 18o3 | D | April 8, 2024, 6:24 p.m. | OK | Python 3 | TESTS | 10 | 343 | 45363200 | ||
255781964 | medfadiabaidi1 | D | April 8, 2024, 7:51 p.m. | OK | Python 3 | TESTS | 10 | 437 | 44236800 | ||
255767252 | smugi | D | April 8, 2024, 5:45 p.m. | OK | Python 3 | TESTS | 10 | 483 | 57856000 | ||
255769400 | Jaideep19 | D | April 8, 2024, 6 p.m. | OK | Python 3 | TESTS | 10 | 515 | 47001600 | ||
255804505 | winter_l | D | April 9, 2024, 1:47 a.m. | OK | Rust 2021 | TESTS | 11 | 140 | 28262400 |
Back to search problems