Submission #24332704


Source Code Expand

from collections import*
_,K,*C=map(int,open(0).read().split())
a=c=len(D:=Counter(C[:K]))
for l,r in zip(C,C[K:]):c+=D[r]<1;D[r]+=1;D[l]-=1;c-=D[l]<1;a=max(a,c)
print(a)

Submission Info

Submission Time
Task C - Colorful Candies
User Pandruant
Language Python (3.8.2)
Score 300
Code Size 170 Byte
Status AC
Exec Time 439 ms
Memory 44828 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 24
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 27 ms 9288 KiB
001.txt AC 431 ms 44828 KiB
002.txt AC 439 ms 44824 KiB
003.txt AC 348 ms 44412 KiB
004.txt AC 349 ms 44396 KiB
005.txt AC 131 ms 44824 KiB
006.txt AC 138 ms 44824 KiB
007.txt AC 114 ms 44476 KiB
008.txt AC 287 ms 44412 KiB
009.txt AC 291 ms 44412 KiB
010.txt AC 298 ms 44240 KiB
011.txt AC 281 ms 44324 KiB
012.txt AC 355 ms 44292 KiB
013.txt AC 356 ms 44240 KiB
014.txt AC 343 ms 44324 KiB
015.txt AC 341 ms 44248 KiB
016.txt AC 86 ms 27844 KiB
017.txt AC 78 ms 21724 KiB
018.txt AC 171 ms 23320 KiB
019.txt AC 200 ms 29776 KiB
020.txt AC 117 ms 36220 KiB
example0.txt AC 22 ms 9204 KiB
example1.txt AC 23 ms 9124 KiB
example2.txt AC 27 ms 9128 KiB