This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 < n; j++) {
if (has_self[j] && a[j] && r[j]) {
rs[i] = 1;
break;
}
if (!has_next[j] && !a[j] && r[j]) {
rs[i] = 1;
break;
}
if (has_self[j] && !a[j]) break;
}
}
return rs;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |