This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "train.h"
#include <bits/stdc++.h>
using namespace std;
#define N ((int)11*1000)
int n,m;
bool self[N],nex[N],ans[N];
vector<int> who_wins(vector<int> a,vector<int> r,vector<int> u,vector<int> v)
{
n=a.size();m=u.size();
for(int i=0;i<m;i++)
{
if(u[i]==v[i])
self[u[i]]=1;
else nex[min(u[i],v[i])]=1;
}
for(int i=n-1;i>=0;i--)
{
if(!nex[i])
{
ans[i]=r[i];
continue;
}
if(self[i] && a[i]==r[i])ans[i]=a[i];
else ans[i]=ans[i+1];
}
vector <int> res;
for(int i=0;i<n;i++)res.push_back(ans[i]);
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |