#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
bool loop[5005];
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 (u[i]==v[i])
loop[u[i]]=1;
for (int i=0; i<n; i++)
{
for (int j=i; j<n; j++)
{
if (loop[j] && a[j] && r[j])
{
ans.push_back(1);
break;
}
else if (loop[j] && !a[j] && !r[j])
{
ans.push_back(0);
break;
}
else if (j==n-1)
ans.push_back(r[j]);
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
560 KB |
Output is correct |
2 |
Correct |
3 ms |
564 KB |
Output is correct |
3 |
Incorrect |
4 ms |
588 KB |
3rd lines differ - on the 355th token, expected: '1', found: '0' |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
844 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
688 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
816 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
560 KB |
Output is correct |
2 |
Correct |
3 ms |
564 KB |
Output is correct |
3 |
Incorrect |
4 ms |
588 KB |
3rd lines differ - on the 355th token, expected: '1', found: '0' |
4 |
Halted |
0 ms |
0 KB |
- |