# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
499548 |
2021-12-28T15:24:53 Z |
Abito |
Lampice (COCI21_lampice) |
C++14 |
|
1 ms |
204 KB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
cin>>n>>k;
int a[n];
for (int i=0;i<n;i++)
{
cin>>a[i];
}
int x=1,y=-1;
bool b=0;
for (int i=n-1;i>=0;i--)
{
if (a[i]==a[i-1])
{
x++;
y=a[i];
}
else
{
if (x>=k)
{
b=1;
break;
}
else
x=1;
}
cout<<x<<endl;
}
if (k==1)
cout<<1<<endl<<a[0];
else if (b)
cout<<1<<endl<<y;
else
cout<<-1;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Sequence doesn't repeat k times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Sequence doesn't repeat k times |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Sequence doesn't repeat k times |
2 |
Halted |
0 ms |
0 KB |
- |