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 <bits/stdc++.h>
#include "traffic.h"
using namespace std;
int LocateCentre(int N, int P[], int S[], int D[]) {
long long int sum = 0;
for (int i = 0; i < N; i++){
sum += P[i];
}
long long int ans = sum + 7;
long long int r = sum;
long long int l = 0;
int ans_ = -1;
for (int i = 0; i < N; i++){
r -= P[i];
if (max(l, r) < ans) ans = max(l, r), ans_ = i;
l += P[i];
}
return ans_;
}
# | 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... |