# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
559124 | cadmiumsky | Toy Train (IOI17_train) | C++14 | 1474 ms | 262144 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 "train.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using uset = unordered_set<int>;
const int nmax = 5e3 + 5;
vector<int> g[nmax], t[nmax];
vector<int> own, charge, rez, degree;
int n, m;
int cnt = 0;
void solve(uset& V) {
if(V.size() == 0)
return;
uset S;
for(auto x : V) {
if(charge[x])
S.insert(x);
for(int i = 0; i < g[x].size(); i++) {
if(V.count(g[x][i]) == 0)
swap(g[x][i], g[x].back()), g[x].pop_back(), i--;
}
for(int i = 0; i < t[x].size(); i++) {
if(V.count(t[x][i]) == 0)
swap(t[x][i], t[x].back()), t[x].pop_back(), i--;
}
}
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... |