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>
using namespace std;
int LocateCentre(int N, int pp[], int S[], int D[]) {
for(int i=1;i<N;i++){
pp[i]+=pp[i-1];
}
int menor=INT_MAX;
int ciudad=N;
for(int i=0;i<N;i++){
int maximo=max(pp[i-1],pp[N-1]-pp[i]);
if(menor>maximo){
ciudad=i;
menor=maximo;
}
}
return ciudad;
}
# | 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... |