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;
const int MN=5000+100;
bool g[MN][MN];
vector<int> who_wins(vector<int> a,vector<int> r,vector<int> u,vector<int> v) {
vector<int> res(a.size());
int n=a.size(),m=v.size();
for(int i=0;i<m;i++){
g[u[i]][v[i]]=1;
}
for(int i=n-1;i>=0;i--){
if(a[i]){
if(r[i] && g[i][i]){
res[i]=1;
}
else if(g[i][i+1]){
res[i]=res[i+1];
}
else{
res[i]=0;
}
}
else{
if(r[i]==0 && g[i][i]){
res[i]=0;
}
else if(g[i][i+1]){
res[i]=res[i+1];
}
else{
res[i]=1;
}
}
}
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... |