#include <bits/stdc++.h>
#include "train.h"
#define N 20009
#define pii pair <int, int>
#define ff first
#define ss second
#define sz() size()
#define pb push_back
#define ll long long
using namespace std;
bool a[N];
vector<int>ans;
std::vector<int> who_wins(std::vector<int>o, std::vector<int>p, std::vector<int>u, std::vector<int>v){
int n=o.sz();
int m=u.sz();
vector<int>e[N];
int c[N];
map<int, int>M[N];
for(int i=0; i<m; i++){
e[u[i]].pb(v[i]), M[u[i]][v[i]]=1;
if(u[i]==v[i])
c[u[i]]=1;
}
for(int i=0; i<n; i++){
if(p[i]==1 and o[i]==1 and c[i]==1)
a[i]=1;
if(M[i][i+1])
a[i]=a[i+1];
ans.pb(a[i]);
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
2560 KB |
3rd lines differ - on the 14th token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1792 KB |
3rd lines differ - on the 2nd token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
12 ms |
3712 KB |
Output is correct |
2 |
Correct |
13 ms |
3712 KB |
Output is correct |
3 |
Correct |
12 ms |
3712 KB |
Output is correct |
4 |
Incorrect |
13 ms |
3712 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
17 ms |
3328 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
13 ms |
3712 KB |
3rd lines differ - on the 1st token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
2560 KB |
3rd lines differ - on the 14th token, expected: '1', found: '0' |
2 |
Halted |
0 ms |
0 KB |
- |