#include "train.h"
#include <bits/stdc++.h>
using namespace std;
vector <int> ke[5001],ke2[5001],ke3[5001],d,A,R;
int n,m,vis[5001],p[5001],sz[5001],ch[5001];
stack <int> st;
queue <int> q;
int f(int u){
if (A[u]){
if (ch[u]&&R[u])
return 1;
return f(ke[u][0]);
}
if (ch[u]&&!R[u])
return 0;
return f(ke[u][0]);
}
vector <int> who_wins(vector <int> a, vector <int> r, vector <int> u, vector <int> v){
A=a,R=r,n=a.size(),m=u.size();
for (int i=0;i<m;i++){
if (u[i]==v[i])
ch[u[i]]=1;
ke3[v[i]].push_back(u[i]);
ke[u[i]].push_back(v[i]);
ke2[v[i]].push_back(u[i]);
}
for (int i=0;i<n;i++)
d.push_back(f(i));
return d;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2037 ms |
1368 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2029 ms |
600 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2053 ms |
1884 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2033 ms |
1624 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2020 ms |
1624 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2037 ms |
1368 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |