General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
116101199 Practice:
__algebra__
616D - 18 C++17 (GCC 7-32) Accepted 171 ms 11852 KB 2021-05-13 15:02:42 2021-05-13 15:02:42
→ Source
#include<iostream>
int a[1<<20],b[1<<20],l,r,i,j,d,n,k;
int main(){
    scanf("%d%d",&n,&k);
    for(i=j=1;j<=n;++j){
        for(scanf("%d",&a[j]),d+=++b[a[j]]==1;d>k;d-=--b[a[i++]]==0);
        if(r-l<=j-i)l=i,r=j;
    }
    printf("%d %d\n",l,r);
}
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details