# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
513845 | sliviu | Horses (IOI15_horses) | C++14 | 134 ms | 59196 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>
#include "horses.h"
using namespace std;
const int mod = 1e9 + 7;
int n, curx = 1, x[1 << 19], y[1 << 19], curinv;
long double rcurx = 0, rcurinv;
struct node {
int val = 1, lazy = 1;
long double rval, rlazy;
} st[1 << 20];
void Build(int node = 1, int left = 1, int right = n) {
if (left == right) {
curx = 1LL * curx * x[left - 1] % mod;
st[node].val = 1LL * curx * y[left - 1] % mod;
rcurx += log10(x[left - 1]);
st[node].rval = rcurx + log10(y[left - 1]);
return;
}
int m = (left + right) / 2;
Build(2 * node, left, m), Build(2 * node + 1, m + 1, right);
if (st[2 * node].rval > st[2 * node + 1].rval)
st[node].rval = st[2 * node].rval, st[node].val = st[2 * node].val;
else
st[node].rval = st[2 * node + 1].rval, st[node].val = st[2 * node + 1].val;
}
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... |