# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
422905 | 2021-06-10T13:54:06 Z | schse | Toy Train (IOI17_train) | C++17 | 1816 ms | 1332 KB |
#include "train.h" #ifndef EVAL #include "grader.cpp" #endif #define DEACTIVATED -1 #define UNKNOWN 0 #include <bits/stdc++.h> using namespace std; struct node { vector<int> edges; bool been; bool actice; int chargingsationsbefore = INT32_MAX; bool charging = false; bool owner; bool winningpos = false; }; vector<node> g; int dfs(int n, int charging) { if (g[n].actice && g[n].chargingsationsbefore < charging) return true; else if (g[n].been) return false; g[n].been = true; g[n].actice = true; g[n].chargingsationsbefore = charging; if (g[n].charging) charging++; bool b = false; for (int i : g[n].edges) { b |= dfs(i, charging); } g[n].actice = false; g[n].chargingsationsbefore = INT32_MAX; return b; } vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) { g.resize(a.size()); for (int i = 0; i < a.size(); i++) { g[i].owner = a[i]; g[i].charging = r[i]; } for (int i = 0; i < u.size(); i++) { g[u[i]].edges.push_back(v[i]); } vector<int> res(a.size(), 0); for (int i = 0; i < (int)a.size(); i++) { for (int i = 0; i < a.size(); i++) g[i].been = false; res[i] = dfs(i, 0); } return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 299 ms | 1104 KB | 3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 204 KB | 3rd lines differ - on the 8th token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 220 ms | 1332 KB | Output is correct |
2 | Correct | 225 ms | 1316 KB | Output is correct |
3 | Correct | 227 ms | 1228 KB | Output is correct |
4 | Correct | 1681 ms | 1252 KB | Output is correct |
5 | Correct | 1246 ms | 1196 KB | Output is correct |
6 | Correct | 831 ms | 1124 KB | Output is correct |
7 | Correct | 666 ms | 1100 KB | Output is correct |
8 | Incorrect | 396 ms | 1220 KB | 3rd lines differ - on the 27th token, expected: '1', found: '0' |
9 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1265 ms | 1080 KB | 3rd lines differ - on the 696th token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1816 ms | 1208 KB | 3rd lines differ - on the 2nd token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 299 ms | 1104 KB | 3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |