# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
585226 |
2022-06-28T12:53:21 Z |
Vanilla |
Toy Train (IOI17_train) |
C++17 |
|
54 ms |
744 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(), m = u.size();
vector <int> has_self (n);
vector <int> has_next (n);
vector <int> rs (n, 0);
for (int i = 0; i < m; i++){
if (u[i] == v[i]) has_self[u[i]] = 1;
else has_next[u[i]] = 1;
}
for (int i = 0; i < n; i++){
for (int j = i; j < n; j++) {
if (r[j] && ((has_self[j] && a[j]) || (!has_next[j] && has_self[j] && !a[j]))) {
rs[i] = 1;
break;
}
if (has_self[j] && !a[j] && !r[j]) break;
if (!has_self[j] && !has_next[j]) break;
}
}
return rs;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
468 KB |
Output is correct |
2 |
Correct |
3 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Incorrect |
3 ms |
468 KB |
3rd lines differ - on the 1462nd token, expected: '0', found: '1' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
31 ms |
732 KB |
Output is correct |
2 |
Correct |
40 ms |
724 KB |
Output is correct |
3 |
Correct |
54 ms |
724 KB |
Output is correct |
4 |
Incorrect |
53 ms |
728 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 |
27 ms |
664 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 |
12 ms |
744 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 |
5 ms |
468 KB |
Output is correct |
2 |
Correct |
3 ms |
468 KB |
Output is correct |
3 |
Correct |
3 ms |
468 KB |
Output is correct |
4 |
Incorrect |
3 ms |
468 KB |
3rd lines differ - on the 1462nd token, expected: '0', found: '1' |
5 |
Halted |
0 ms |
0 KB |
- |