# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
199957 | zoooma13 | Vođe (COCI17_vode) | C++14 | 3094 ms | 23928 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n ,M ,k;
scanf("%d%d%d",&n,&M,&k);
vector <int> a(n);
for(int&i : a)
scanf("%d",&i);
auto nxt = [&](int i){
return i == n-1 ? 0 : i+1;
};
bool dp[M+1][n+1] = {0};
for(int m=M-1; m>0; m--){
for(int i=0; i<n; i++)
for(int j=m+1; j<=min(M ,m+k); j++)
dp[m][i] |= (dp[j][nxt(i)]^a[i]^a[nxt(i)]);
}
for(int i=0; i<n; i++){
printf("%d ",dp[1][i]^a[i]^1);
}
printf("\n");
}
Compilation message (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... |