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[]) {
vector<int> derecha(N);
vector<int> izquierda(N);
izquierda[0] = 0;
derecha[N-1] = 0;
for(int i = 1; i < N; ++i){
izquierda[i] = izquierda[i-1] + pp[i-1];
derecha[N-i-1] = derecha[N-i] + pp[N-i];
}
pair<int, int> act = make_pair(derecha[0], 0);
for(int i = 1; i < N; ++i){
act = min(act, make_pair(max(derecha[i], izquierda[i]), i));
}
return act.second;
}
# | 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... |