#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> rs (n, 1);
for (int i = 0; i < m; i++){
if (u[i] == v[i]) {
has_self[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]) {
rs[i] = 0;
break;
}
if (has_self[j] && a[j] == 1 && r[j]) break;
}
}
return rs;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Incorrect |
3 ms |
468 KB |
3rd lines differ - on the 4997th token, expected: '1', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
125 ms |
708 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
64 ms |
644 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
38 ms |
724 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
468 KB |
Output is correct |
2 |
Incorrect |
3 ms |
468 KB |
3rd lines differ - on the 4997th token, expected: '1', found: '0' |
3 |
Halted |
0 ms |
0 KB |
- |