# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
259309 | IOrtroiii | Horses (IOI15_horses) | C++14 | 374 ms | 59384 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 <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MX = 500500;
int N;
int X[MX], Y[MX];
namespace searcher {
pair<ld, int> best[MX << 1];
ld sum[MX << 1];
void pop(int v) {
best[v] = max(best[v << 1], make_pair(best[v << 1 | 1].first + sum[v << 1], best[v].second));
sum[v] = sum[v << 1] + sum[v << 1 | 1];
}
void modify(int p) {
p += N;
best[p] = make_pair(log(X[p - N]) + log(Y[p - N]), p - N);
sum[p] = log(X[p - N]);
for (p >>= 1; p > 0; p >>= 1) {
pop(p);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |