# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
496512 |
2021-12-21T11:44:57 Z |
kappa |
Lampice (COCI21_lampice) |
C++14 |
|
0 ms |
204 KB |
#include <bits/stdc++.h>
using namespace std;
int n, k, d[55];
int main(){
cin >> n >> k;
for (int i = 0; i < n; i++)
{
cin >> d[i];
}
for (int l = 0; l < n; l++)
{
for (int r = l; r < n; r++)
{
int temp = 1, len = r - l + 1;
for (int i = 1; i < k && temp; i++)
{
for (int j = l; j <= r; i++)
{
if(j + i * len >= n || d[j + i * len] != d[j]){
temp = 0;
break;
}
}
}
if(temp){
cout << len << "\n";
for (int i = l; i <= r; i++)
{
cout << d[i] << " ";
return 0;
}
}
}
}
cout << "-1";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |