Submission #199957

#TimeUsernameProblemLanguageResultExecution timeMemory
199957zoooma13Vođe (COCI17_vode)C++14
72 / 120
3094 ms23928 KiB
#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)

vode.cpp: In function 'int main()':
vode.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d%d",&n,&M,&k);
  ~~~~~^~~~~~~~~~~~~~~~~~~
vode.cpp:10:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&i);
   ~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...