# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
585218 |
2022-06-28T12:41:52 Z |
Vanilla |
Toy Train (IOI17_train) |
C++17 |
|
69 ms |
728 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, 1);
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++){
int ct = 0;
for (int j = i; ct <= n; j = (j + 1) % n, ct++) {
if ((has_self[j] && a[j] == 0 && !r[j]) || (!has_next[j] && r[j])) {
rs[i] = 0;
break;
}
if (has_self[j] && a[j] == 1 && r[j]) break;
if (!has_next[j]) break;
}
}
return rs;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
468 KB |
3rd lines differ - on the 4997th token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 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 |
66 ms |
728 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 |
69 ms |
580 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 |
40 ms |
724 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 |
3 ms |
468 KB |
3rd lines differ - on the 4997th token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |