Submission #557652

#TimeUsernameProblemLanguageResultExecution timeMemory
557652ojoConmigoTraffic (IOI10_traffic)C++17
50 / 100
340 ms37604 KiB
#include "traffic.h" int LocateCentre(int N, int pp[], int S[], int D[]) { long long pre[N]; pre[0] = pp[0]; for(int i=1; i<N; i++){ pre[i] = pre[i-1] + pp[i]; } int sol = 0; long long congestion = pre[N-1] - pre[0]; for(int i=1; i<N; i++){ long long mayor = (pre[i-1] > pre[N-1] - pre[i] ? pre[i-1] : pre[N-1] - pre[i]); //cout << mayor << endl; if(mayor < congestion){ congestion = mayor; sol = i; } } return sol; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...