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 "traffic.h"
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll mx,pr[1000005];
int loc;
int LocateCentre(int N, int pp[], int S[], int D[]) {
mx=1e18;
loc=-1;
for(int i=1;i<=N;i++){
pr[i]=pr[i-1]+pp[i-1];
}
for(int i=1;i<=N;i++){
ll m=max(pr[N]-pr[i],pr[i-1]);
if(m<mx){
mx=m;
loc=i-1;
}
}
return loc;
}
# | 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... |