# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1037511 | 2024-07-29T02:26:41 Z | sleepntsheep | Toy Train (IOI17_train) | C++17 | 4 ms | 980 KB |
#include "train.h" std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v) { int n = a.size(); int m = u.size(); std::vector<int> loop(n); for (int i = 0; i < m; ++i) if (u[i] == v[i]) loop[u[i]] = 1; std::vector<int> res(a.size()); int are = 0, bre = 0; if (r[n-1]) res[n-1] = 1, are = 1; else bre = 1; for (int i = n - 2; i >= 0; --i) { if (loop[i]) { if (r[i]) { res[i] = 1; } else { res[i] = 0; } } else { res[i] = res[i + 1]; } } return res; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 604 KB | 3rd lines differ - on the 27th token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | 3rd lines differ - on the 2nd token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 948 KB | Output is correct |
2 | Correct | 3 ms | 948 KB | Output is correct |
3 | Correct | 3 ms | 980 KB | Output is correct |
4 | Incorrect | 3 ms | 860 KB | 3rd lines differ - on the 1st token, expected: '1', found: '0' |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 860 KB | 3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 856 KB | 3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 604 KB | 3rd lines differ - on the 27th token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |