# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1107208 | ozner77 | Parachute rings (IOI12_rings) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "traffic.h"
#include <bits/stdc++.h>
using namespace std;
int LocateCentre(int n, int p[], int s[], int d[]){
vector<int> pref(n + 1);
f2(i, n, 0){
pref[i + 1] = p[i] + pref[i];
}
int ansa = 0, ma = pref[n];
f2(i, n + 1, 1){
int x = pref[i - 1];
int y = pref[n] - pref[i];
int t = max(x, y);
if(t < ma){
ansa = i - 1;
ma = t;
}
}
return ansa;
}