Submission #72886

#TimeUsernameProblemLanguageResultExecution timeMemory
72886mr_bananaToy Train (IOI17_train)C++17
0 / 100
32 ms25544 KiB
#include "train.h" #include<bits/stdc++.h> using namespace std; const int MN=5000+100; bool g[MN][MN]; vector<int> who_wins(vector<int> a,vector<int> r,vector<int> u,vector<int> v) { vector<int> res(a.size()); int n=a.size(),m=v.size(); for(int i=0;i<m;i++){ g[u[i]][v[i]]=1; } for(int i=n-1;i>=0;i--){ if(a[i]){ if(r[i] && g[i][i]){ res[i]=1; } else if(g[i][i+1]){ res[i]=res[i+1]; } else{ res[i]=0; } } else{ if(r[i]==0 && g[i][i]){ res[i]=1; } else if(g[i][i+1]){ res[i]=res[i+1]; } else{ res[i]=1; } } } return res; }
#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...