Submission #519130

#TimeUsernameProblemLanguageResultExecution timeMemory
519130leakedVođe (COCI17_vode)C++14
72 / 120
3091 ms23952 KiB
#include <bits/stdc++.h> #define f first #define s second #define m_p make_pair #define vec vector #define pb push_back #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define sz(x) (int)(x).size() #define fast_izho ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define pw(x) (1<<(x)) //#pragma GCC optimize("unroll-loops") //#pragma GCC optimize("-O3") using namespace std; typedef pair<int,int> pii; typedef long long ll; template <class T> bool umax(T &a,const T &b){return (a<b?a=b,1:0);} template <class T> bool umin(T &a,const T &b){return (a>b?a=b,1:0);} const int N=5001; bool dp[N][N]; signed main(){ fast_izho; int n,m,k; cin>>n>>m>>k; vec<int>a(n); for(int i=0;i<n;i++){ cin>>a[i]; // for(int j=m;j>m-k;j--) // dp[i][j]=1; } for(int j=m-1;j>=0;j--){ for(int i=0;i<n;i++){ int nx=(i+1)%n; for(int x=j;x<=min(m,j+k-1);x++){ if(dp[nx][x+1]==(a[i]==a[nx])) dp[i][j]=1; } // cout<<"WIN "<<i<<' '<<j<<' '<<dp[i][j]<<endl; } } for(int i=0;i<n;i++){ cout<<(a[i]^dp[i][1]^1)<<' '; } return 0; } /* */
#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...