# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1048099 |
2024-08-07T22:35:06 Z |
Trent |
Toy Train (IOI17_train) |
C++17 |
|
5 ms |
3420 KB |
#include "train.h"
#include "bits/stdc++.h"
using namespace std;
#define forR(i, x) for(int i = 0; i < (x); ++i)
#define REP(i, a, b) for(int i = (a); i < (b); ++i)
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
void dfs(int c, vb& vis, vvi& adj) {
assert(!vis[c]);
vis[c] = true;
for(int i : adj[c]) if(!vis[i]) {
dfs(i, vis, adj);
}
}
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(), m=u.size();
vvi adj(n);
vvi rAdj(n);
forR(i, m) {
adj[u[i]].push_back(v[i]);
rAdj[v[i]].push_back(u[i]);
}
vb vis(n, false);
forR(i, n) if(r[i]) dfs(i, vis, rAdj);
vector<int> ret(n);
forR(i, n) ret[i] = vis[i] ? 1 : 0;
return ret;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1112 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 |
Runtime error |
1 ms |
604 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
3420 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
2652 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
1628 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 |
2 ms |
1112 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |