Submission #557643

#TimeUsernameProblemLanguageResultExecution timeMemory
557643ojoConmigoTraffic (IOI10_traffic)C++17
0 / 100
1 ms212 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 = -1; long long congestion = 1e18; for(int i=0; i<N; i++){ long long mayor = (pre[i] - pp[i] > pre[N-1] - pre[i] ? pre[i] - pp[i] : pre[N-1] - pre[i]); if(mayor < congestion){ mayor = congestion; 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...