Submission #139981

#TimeUsernameProblemLanguageResultExecution timeMemory
139981shashwatchandraToy Train (IOI17_train)C++17
0 / 100
2066 ms636 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define REP(i,n) for(int i = 0;i < n;i++) const int N = 5001; int n,m; bool self[N]; bool nxt[N]; vector<int> who_wins(vector<int> a, vector<int> r,vector<int> u, vector<int> v) { n = a.size(); m = u.size(); vector<int> ans; REP(i,m){ if(u[i] == v[i])self[u[i]] = 1; else nxt[u[i]] = 1; } REP(i,n){ int cur = i; bool wins = 0; while(1){ if(a[i]){ if(r[i] and self[i]){ wins = 1; break; } if(!nxt[i]){ break; } cur++; } else{ if(!r[i] and self[i]){ break; } if(r[i] and !nxt[i]){ wins = 1; break; } cur++; } } ans.pb(wins); } return ans; }
#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...