#include <bits/stdc++.h>
using namespace std;
bool bo[5005], ol[5005];
vector<int> ans;
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v)
{
int n=a.size(), m=u.size();
bool subtask1=1;
for (int i=0; i<m; i++)
{
if (v[i]!=u[i] && v[i]!=u[i]+1)
{
subtask1=0;
break;
}
}
if (subtask1)
{
for (int i=0; i<m; i++)
{
if (v[i]==u[i])
bo[u[i]]=1;
else if (v[i]==u[i]+1)
ol[u[i]]=1;
}
for (int i=0; i<n; i++)
{
for (int j=i; j<n; j++)
{
if (bo[j] && a[j] && r[j])
{
ans.push_back(1);
break;
}
else if (bo[j] && !a[j] && !r[j])
{
ans.push_back(0);
break;
}
else if (!ol[j])
{
ans.push_back(r[j]);
break;
}
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
460 KB |
Output is correct |
2 |
Correct |
3 ms |
460 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
3 ms |
560 KB |
Output is correct |
5 |
Correct |
3 ms |
564 KB |
Output is correct |
6 |
Correct |
3 ms |
568 KB |
Output is correct |
7 |
Correct |
4 ms |
588 KB |
Output is correct |
8 |
Correct |
3 ms |
600 KB |
Output is correct |
9 |
Correct |
3 ms |
588 KB |
Output is correct |
10 |
Correct |
4 ms |
676 KB |
Output is correct |
11 |
Correct |
4 ms |
588 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
588 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
588 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
588 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
460 KB |
Output is correct |
2 |
Correct |
3 ms |
460 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
3 ms |
560 KB |
Output is correct |
5 |
Correct |
3 ms |
564 KB |
Output is correct |
6 |
Correct |
3 ms |
568 KB |
Output is correct |
7 |
Correct |
4 ms |
588 KB |
Output is correct |
8 |
Correct |
3 ms |
600 KB |
Output is correct |
9 |
Correct |
3 ms |
588 KB |
Output is correct |
10 |
Correct |
4 ms |
676 KB |
Output is correct |
11 |
Correct |
4 ms |
588 KB |
Output is correct |
12 |
Incorrect |
0 ms |
204 KB |
WA in grader: Wrong returned array size |
13 |
Halted |
0 ms |
0 KB |
- |