Submission #585213

#TimeUsernameProblemLanguageResultExecution timeMemory
585213VanillaToy Train (IOI17_train)C++17
0 / 100
125 ms724 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> rs (n, 1); for (int i = 0; i < m; i++){ if (u[i] == v[i]) { has_self[u[i]] = 1; } } for (int i = 0; i < n; i++){ int ct = 0; for (int j = i; ct <= n; j = (j + 1) % n, ct++) { if (has_self[j] && a[j] == 0 && !r[j]) { rs[i] = 0; break; } if (has_self[j] && a[j] == 1 && r[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...