# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
417828 |
2021-06-04T11:08:27 Z |
Hegdahl |
Toy Train (IOI17_train) |
C++17 |
|
329 ms |
1100 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) {
const int n = (int)a.size();
const int m = (int)u.size();
vector<vector<int>> g(n);
for (int mm = 0; mm < m; ++mm)
g[u[mm]].push_back(v[mm]);
vector<int> nr(n);
for (int rep = 0; rep < n; ++rep) {
/*
for (int x : r) cerr << x << ' ';
cerr << '\n'; // */
for (int i = 0; i < n; ++i) {
if (a[i]) {
nr[i] = false;
for (int j : g[i])
nr[i] |= r[j];
} else {
nr[i] = true;
for (int j : g[i])
nr[i] &= r[j];
}
}
swap(r, nr);
}
return r;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
147 ms |
748 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 |
0 ms |
204 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 |
Incorrect |
211 ms |
1100 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 |
292 ms |
892 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 |
329 ms |
1020 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 |
147 ms |
748 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |