# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826537 | caganyanmaz | Toy Train (IOI17_train) | C++17 | 4 ms | 852 KiB |
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;
constexpr static int MXN = 5000;
bitset<MXN> sl;
bitset<MXN> cc;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v)
{
vector<int> res(a.size());
for (int i = 0; i < u.size(); i++)
{
if (u[i] == v[i] - 1)
cc[u[i]] = true;
if (u[i] == v[i])
sl[u[i]] = true;
}
for (int i = a.size()-1; i >= 0; i--)
{
if (r[i] && sl[i] && (a[i] || !cc[i]))
res[i] = 1;
else if (!r[i] && sl[i] && (!a[i] || !cc[i]))
res[i] = 0;
else
res[i] = res[i]+1;
}
return res;
}
Compilation message (stderr)
# | 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... |