# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425735 | 2021-06-13T10:43:13 Z | MOUF_MAHMALAT | Toy Train (IOI17_train) | C++14 | 259 ms | 262148 KB |
#include "train.h" #include<bits/stdc++.h> using namespace std; typedef int ll; vector<vector<ll> >v; ll n; bool b[5009],c[5009]; bool best(ll d) { bool r=b[d]^1; for(auto z:v[d]) { if(z==d) { if(c[d]==b[d]) r=b[d]; } else { if(b[d]) r|=best(z); else r&=best(z); } } return r; } vector<int> who_wins(vector<int> A, vector<int> R, vector<int> from, vector<int> to) { n=A.size(); v.resize(n); for(ll i=0; i<to.size(); i++) v[from[i]].push_back(to[i]); for(ll i=0; i<n; i++) b[i]=A[i],c[i]=R[i]; vector<ll>ans; for(ll i=n-1; i>=0; i--) ans.push_back(best(i)); return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 259 ms | 1192 KB | 3rd lines differ - on the 5th token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 175 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 222 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 168 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 193 ms | 262148 KB | Execution killed with signal 9 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 259 ms | 1192 KB | 3rd lines differ - on the 5th token, expected: '0', found: '1' |
2 | Halted | 0 ms | 0 KB | - |