Submission #585229

#TimeUsernameProblemLanguageResultExecution timeMemory
585229VanillaToy Train (IOI17_train)C++17
0 / 100
53 ms740 KiB
#include <bits/stdc++.h> #include "train.h" using namespace std; vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { int n = a.size(), m = u.size(); vector <int> has_self (n); vector <int> has_next (n); vector <int> rs (n, 0); for (int i = 0; i < m; i++){ if (u[i] == v[i]) has_self[u[i]] = 1; else has_next[u[i]] = 1; } for (int i = 0; i < n; i++){ for (int j = i; j >= 0; j--) { if (r[j] && ((has_self[j] && a[j]) || (!has_next[j] && has_self[j] && !a[j]))) { rs[i] = 1; break; } if (has_self[j] && !a[j] && !r[j]) break; if (!has_self[j] && !has_next[j]) break; } } return rs; }
#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...