# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
198601 | ZwariowanyMarcin | Vođe (COCI17_vode) | C++14 | 239 ms | 504 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define ss(x) (int) x.size()
#define pb push_back
#define LL long long
#define ld long double
#define cat(x) cerr << #x << " = " << x << endl
#define FOR(i, j, n) for(int i = j; i <= n; ++i)
#define boost cin.tie(0), ios_base::sync_with_stdio(0);
using namespace std;
const int nax = 5010;
const int INF = 1e9 + 111;
int n, m, k;
int a[nax];
int win[nax];
int lose[nax];
int dp[nax];
int main() {
scanf ("%d%d%d", &n, &m, &k);
for (int i = 0; i < n; ++i) {
scanf ("%d", a + i);
win[i] = INF;
lose[i] = m - 1;
}
for (int i = m - 2; 0 <= i; --i) {
for (int j = 0; j < n; ++j) {
int g = (j + 1) % n;
if (a[j] == a[g]) {
if (win[g] <= i + k) {
dp[j] = 1;
}
else {
dp[j] = 0;
}
}
else {
if (lose[g] <= i + k) {
dp[j] = 1;
}
else {
dp[j] = 0;
}
}
}
for (int j = 0; j < n; ++j) {
if (dp[j]) win[j] = i;
else lose[j] = i;
}
}
for (int i = 0; i < n; ++i) {
if ((a[i] == 0 && dp[i] == 1) || (a[i] == 1 && dp[i] == 0))
printf ("0 ");
else
printf ("1 ");
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |