Submission #554178

#TimeUsernameProblemLanguageResultExecution timeMemory
554178a_aguiloTraffic (IOI10_traffic)C++14
50 / 100
264 ms37728 KiB
#include "traffic.h" #include<bits/stdc++.h> using namespace std; int LocateCentre(int N, int pp[], int S[], int D[]) { vector<int> derecha(N); vector<int> izquierda(N); izquierda[0] = 0; derecha[N-1] = 0; for(int i = 1; i < N; ++i){ izquierda[i] = izquierda[i-1] + pp[i-1]; derecha[N-i-1] = derecha[N-i] + pp[N-i]; } pair<int, int> act = make_pair(derecha[0], 0); for(int i = 1; i < N; ++i){ act = min(act, make_pair(max(derecha[i], izquierda[i]), i)); } return act.second; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...