Submission #971553

#TimeUsernameProblemLanguageResultExecution timeMemory
971553alo_54Traffic (IOI10_traffic)C++14
50 / 100
224 ms30288 KiB
#include "traffic.h" #include <bits/stdc++.h> using namespace std; int LocateCentre(int N, int P[], int S[], int D[]) { int sumR = 0, sumL = 0; for (int i = 1; i < N; i++) { sumR += P[i]; } int minW = sumR, maxL = -1, idxOpt = 0; for (int i = 1; i < N; i++) { sumL += P[i -1]; sumR -= P[i]; maxL = max(sumL, sumR); if (maxL < minW) { idxOpt = i; minW = maxL; } } return idxOpt; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...