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 "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[i])
{
w[i] = !a[j];
break;
}
}
}
}
for (int &x : a)
if (!x)
{
subtask = 4;
break;
}
if (subtask == 3)
{
}
else
{
}
return w;
}
# | 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... |