| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 697457 | delrey | Lampice (COCI21_lampice) | C++14 | 1 ms | 300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
int n, k, a[50];
int main()
{
cin>>n>>k;
for(int i = 0; i < n; i++)
cin>>a[i];
for(int b = 0; b < n; b++)
{
for(int i = 1; b + i * k <= n; i++)
{
int patterns = 1;
for(int j = 1; j < k; j++)
{
bool matches = true;
for(int t = 0; t < i; t++)
if(a[b + t] != a[b + j * i + t])
{
matches = false;
break;
}
if(!matches)
break;
patterns++;
}
if(patterns == k)
{
cout<<i<<endl;
for(int t = 0; t < i; t++)
cout<<a[b + t]<<" ";
return 0;
}
}
}
cout<<-1<<endl;
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
