#include <bits/stdc++.h>
using namespace std;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u , vector<int> v){
int n = a.size();
int m = u.size();
vector<int > w(n);
vector<int> iscycle(n, 0);
for(int i =0; i< m; i++){
if(u[i] == v[i]){
iscycle[i] = true;
}
}
for(int i =0; i< n; i++){
int winner = -1;
int energy = n;
int curstation = i;
while(curstation < n){
if(a[i] && iscycle[i] && r[i]){//arezou owns
winner = 1;
break;
}
else if(!a[i] && iscycle[i] && !r[i] ){
winner = 0;
break;
}
if(energy == 0){
winner = 0;
break;
}
energy--;
curstation++;
}
for(i = i; i<= min(curstation, n-1); i++){
w[i] = winner;
}
}
return w;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
460 KB |
3rd lines differ - on the 1st token, expected: '0', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
3rd lines differ - on the 1st token, expected: '0', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
612 KB |
3rd lines differ - on the 1st token, expected: '0', found: '1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
588 KB |
3rd lines differ - on the 1st token, expected: '1', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
716 KB |
3rd lines differ - on the 1st token, expected: '1', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
460 KB |
3rd lines differ - on the 1st token, expected: '0', found: '-1' |
2 |
Halted |
0 ms |
0 KB |
- |