#include "train.h"
#include <bits/stdc++.h>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
std::vector<int> who_wins(std::vector<int> a, std::vector<int> r, std::vector<int> u, std::vector<int> v)
{
vi res(a.size());
set<int>s[6000];
for (int i=0;i<sz(u);i++)s[u[i]].ins(v[i]);;
for (int i=0;i<sz(a);i++)
{
ll k=i-1;
ll jem=0;
do
{
k++;
if (s[i].count(i)==1 && a[i]==0 && r[i]==0)
{
jem=0;
break;
}
if (s[i].count(i)==1 && a[i]==1 && r[i]==1)
{
jem=1;
break;
}
}while(s[k].count(k+1)==1);
res.pb(jem);
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
169 ms |
1528 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
640 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
2048 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
9 ms |
1664 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
2048 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
169 ms |
1528 KB |
WA in grader: Wrong returned array size |
2 |
Halted |
0 ms |
0 KB |
- |