# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
593301 | 2022-07-10T20:08:21 Z | AlperenT | Toy Train (IOI17_train) | C++17 | 5 ms | 908 KB |
#include <bits/stdc++.h> #include "train.h" using namespace std; vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v){ int n = a.size(); vector<bool> isself(n), isnext(n); for(int i = 0; i < u.size(); i++){ if(u[i] == v[i]) isself[u[i]] = true; else if(u[i] + 1 == v[i]) isself[u[i]] = true; } vector<int> ans(n); for(int i = n - 1; i >= 0; i--){ if(a[i]){ if(isself[i] && r[i]) ans[i] = true; if(isnext[i] && ans[i + 1]) ans[i] = true; } else{ ans[i] = true; if(isself[i] && !r[i]) ans[i] = false; if(isnext[i] && !ans[i + 1]) ans[i] = false; } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 468 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 | 1 ms | 212 KB | 3rd lines differ - on the 9th token, expected: '1', found: '0' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 852 KB | Output is correct |
2 | Correct | 5 ms | 908 KB | Output is correct |
3 | Incorrect | 5 ms | 852 KB | 3rd lines differ - on the 3440th token, expected: '0', found: '1' |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 724 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 | 5 ms | 852 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 | 3 ms | 468 KB | 3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |