Submission #72853

#TimeUsernameProblemLanguageResultExecution timeMemory
72853Sa1378Toy Train (IOI17_train)C++17
5 / 100
14 ms1980 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; #define N ((int)11*1000) int n,m; bool self[N],nex[N],ans[N]; vector<int> who_wins(vector<int> a,vector<int> r,vector<int> u,vector<int> v) { n=a.size();m=u.size(); for(int i=0;i<m;i++) { if(u[i]==v[i]) self[u[i]]=1; else nex[min(u[i],v[i])]=1; } for(int i=n-1;i>=0;i--) { if(!nex[i]) { ans[i]=r[i]; continue; } if(self[i] && a[i]==r[i])ans[i]=a[i]; else ans[i]=ans[i+1]; } vector <int> res; for(int i=0;i<n;i++)res.push_back(ans[i]); 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...