#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[1001000];
int v[100];
signed main()
{
int n,m,k;
cin>>n>>k>>m;
for(int i=1;i<=n;i++)
cin>>a[i];
int mn=1e9;
for(int vv=0;vv<m;vv++)
{
int x;
cin>>x;
if(x==1)
{
int y,z;
cin>>y>>z;
a[y]=z;
cout<<" ";
for(int i=1;i<=n;i++)
cout<<a[i]<<" ";
cout<<endl;
}
else
{ mn=1e9;
for(int i=1;i<=n;i++)
{ //cout<<" : "<<i<<endl;
int p=0;
for(int j=i;j<=n;j++)
{
v[a[j]]++;
if(v[a[j]]==1)
p++;
if(p==k)
{ // cout<<" "<<i<<" "<<j<<endl;
mn=min(mn,j-i+1);
break;
}
}
// cout<<" "<<i<<" "<<mn<< endl;
for(int ii=0;ii<=k;ii++)
{
v[ii]=0;
}
}
if(mn==1e9)
cout<<-1<<endl;
else cout<<mn<<endl;
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1277 ms |
16552 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3047 ms |
27832 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3085 ms |
20144 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3092 ms |
20964 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3088 ms |
20224 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3091 ms |
20620 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3095 ms |
17944 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3063 ms |
20592 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3096 ms |
18792 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3064 ms |
20784 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |