| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 647090 | Alma | Lampice (COCI21_lampice) | C++14 | 1 ms | 320 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
using ll = long long;
using ii = pair<int,int>;
const int INF = 1e9;
const ll LLINF = 1e18;
using vi = vector<int>;
using vvi = vector<vi>;
void setIO (string fileName) {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    if (fileName != "std") {
        freopen((fileName + ".in").c_str(), "r", stdin);
        freopen((fileName + ".out").c_str(), "w", stdout);
    }
}
int main() {
    setIO("std");
    int n, k;
	cin >> n >> k;
	vi lamp(n);
	for (int& i: lamp) cin >> i;
	for (int len = 1; len <= n; len++) {
		for (int i = 0; i < n and i + len*k <= n; i++) {
			bool pos = true;
			for (int t = 0; t < k and pos; t++) {
				for (int j = 0; j < len and pos; j++) {
					if (lamp[i+j] != lamp[i + len*t + j]) pos = false;
				}
			}
			if (pos) {
				cout << len << '\n';
				for (int j = 0; j < len; j++) {
					cout << lamp[i+j] << ' ';
				}
				return 0;
			}
		}
	}
	cout << "-1\n";
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
