Submission #377693

#TimeUsernameProblemLanguageResultExecution timeMemory
377693Christopher_RdzTraffic (IOI10_traffic)C++17
0 / 100
1 ms364 KiB
#include "traffic.h" #include <bits/stdc++.h> using namespace std; int acumulado[1000002]; int LocateCentre(int N, int pp[], int S[], int D[]) { for (int i = 0; i < N; i++){ if (i == 0){ acumulado[i] = pp[i]; }else{ acumulado[i] = pp[i] + acumulado[i - 1]; } } int res = 0; int maxi = INT_MAX; int aux = 0; int der = 0; int izq = 0; for (int i = 0; i < N; i++){ der = acumulado[N - 1] - acumulado[i]; if (i == 0){ maxi = der; res = i; }else{ izq = acumulado[i - 1]; aux = min(izq, der); if (aux < maxi){ maxi = aux; res = i; } } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...