Submission #556287

#TimeUsernameProblemLanguageResultExecution timeMemory
556287TruitadepatatesTraffic (IOI10_traffic)C++14
50 / 100
258 ms29812 KiB
#include <bits/stdc++.h> #include "traffic.h" using namespace std; int LocateCentre(int N, int P[], int S[], int D[]) { long long int sum = 0; for (int i = 0; i < N; i++){ sum += P[i]; } long long int ans = sum + 7; long long int r = sum; long long int l = 0; int ans_ = -1; for (int i = 0; i < N; i++){ r -= P[i]; if (max(l, r) < ans) ans = max(l, r), ans_ = i; l += P[i]; } return ans_; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...