# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
826541 | 2023-08-15T16:35:34 Z | caganyanmaz | Toy Train (IOI17_train) | C++17 | 4 ms | 832 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 468 KB | Output is correct |
2 | Correct | 3 ms | 572 KB | Output is correct |
3 | Correct | 2 ms | 596 KB | Output is correct |
4 | Correct | 2 ms | 564 KB | Output is correct |
5 | Correct | 3 ms | 572 KB | Output is correct |
6 | Correct | 2 ms | 596 KB | Output is correct |
7 | Correct | 3 ms | 468 KB | Output is correct |
8 | Correct | 2 ms | 472 KB | Output is correct |
9 | Correct | 2 ms | 468 KB | Output is correct |
10 | Correct | 2 ms | 468 KB | Output is correct |
11 | Correct | 2 ms | 444 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 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 | 4 ms | 624 KB | Output is correct |
2 | Correct | 4 ms | 832 KB | Output is correct |
3 | Correct | 4 ms | 824 KB | Output is correct |
4 | Incorrect | 4 ms | 808 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 | 3 ms | 596 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 | 4 ms | 640 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 | Correct | 2 ms | 468 KB | Output is correct |
2 | Correct | 3 ms | 572 KB | Output is correct |
3 | Correct | 2 ms | 596 KB | Output is correct |
4 | Correct | 2 ms | 564 KB | Output is correct |
5 | Correct | 3 ms | 572 KB | Output is correct |
6 | Correct | 2 ms | 596 KB | Output is correct |
7 | Correct | 3 ms | 468 KB | Output is correct |
8 | Correct | 2 ms | 472 KB | Output is correct |
9 | Correct | 2 ms | 468 KB | Output is correct |
10 | Correct | 2 ms | 468 KB | Output is correct |
11 | Correct | 2 ms | 444 KB | Output is correct |
12 | Incorrect | 0 ms | 212 KB | 3rd lines differ - on the 2nd token, expected: '1', found: '0' |
13 | Halted | 0 ms | 0 KB | - |