Submission #832323

#TimeUsernameProblemLanguageResultExecution timeMemory
832323finn__Toy Train (IOI17_train)C++17
5 / 100
4 ms616 KiB
#include "train.h" #include <bits/stdc++.h> using namespace std; vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { size_t const n = a.size(), m = u.size(); int subtask = 1; for (size_t i = 0; i < m; ++i) if (u[i] != v[i] && u[i] + 1 != v[i]) { subtask = 3; break; } vector<int> w(n); if (subtask == 1) { vector<bool> has_edge(n), has_loop(n); for (size_t i = 0; i < m; ++i) { if (u[i] == v[i]) has_loop[u[i]] = 1; else has_edge[u[i]] = 1; } for (size_t i = 0; i < n; ++i) { for (size_t j = i; j < n; ++j) if (has_loop[j]) { if (!(a[j] ^ r[j])) { w[i] = a[j]; break; } if (!has_edge[j]) { w[i] = !a[j]; break; } } } } for (int &x : a) if (!x) { subtask = 4; break; } if (subtask == 3) { } else { } return w; }
#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...