#include <bits/stdc++.h>
using namespace std;
vector < int > who_wins(vector < int > a, vector < int > r, vector < int > u, vector < int > v){
vector < int > ans;
int n = a.size();
int m = u.size();
ans.resize(n);
vector < bool > repeat;
repeat.resize(n);
for (int i = 0; i < m; ++i)
{
if(u[i] == v[i]){
repeat[u[i]] = true;
}
}
for(int s = 0; s < n; s++){
for (int i = s; i < n; ++i)
{
if(repeat[i]){
if(a[i] == 1 and r[i]){
ans[s] = 1;
break;
}
if(a[i] == 0 and !r[i]){
ans[s] = 0;
break;
}
}
if(i == n - 1){
if(r[i] == 1){
ans[s] = 1;
}
else{
ans[s] = 0;
}
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
620 KB |
Output is correct |
2 |
Correct |
4 ms |
620 KB |
Output is correct |
3 |
Incorrect |
4 ms |
620 KB |
3rd lines differ - on the 355th token, expected: '1', found: '0' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
24 ms |
1004 KB |
Output is correct |
2 |
Correct |
21 ms |
944 KB |
Output is correct |
3 |
Correct |
23 ms |
1004 KB |
Output is correct |
4 |
Incorrect |
21 ms |
1004 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
13 ms |
876 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
19 ms |
1004 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
620 KB |
Output is correct |
2 |
Correct |
4 ms |
620 KB |
Output is correct |
3 |
Incorrect |
4 ms |
620 KB |
3rd lines differ - on the 355th token, expected: '1', found: '0' |
4 |
Halted |
0 ms |
0 KB |
- |