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[]) {
long long sum = 0 ;
for(int i = 0 ;i < N ; i ++)
sum += pp[i];
long long mn = sum , ans = 0 ;
long long sum2 = 0 ;
for(int i = 1 ; i < N ; i ++){
sum2 += pp[i - 1];
sum -= pp[i - 1] ;
if(max(sum , sum2) < mn)
mn = max(sum , sum2) , ans = i ;
}
return ans ;
return N/2;
}
# | 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... |