General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
224792948 Practice:
bkifhr6
616D - 18 C++20 (GCC 11-64) Accepted 748 ms 8184 KB 2023-09-23 21:24:00 2023-09-23 21:24:00
→ Source
#include<iostream>
int a[1<<20][2],l,r,i,j,d,n,k;
int main(){
    std::cin>>n>>k;
    for(i=j=1;j<=n;r-l<=j-i?l=i,r=j:0,++j)
        for(std::cin>>a[j][0],d+=++a[a[j][0]][1]==1;d>k;d-=--a[a[i++][0]][1]==0);
    std::cout<<l<<" "<<r;
}
		 	 	 	 		 	   	   			 		 		 	
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details