# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
285079 | Shafin666 | Horses (IOI15_horses) | C++14 | 238 ms | 58488 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 "horses.h"
#include <bits/stdc++.h>
#define pb push_back
#define pii pair<ll, ll>
#define nyan "(=^・ω・^=)"
#define read_input freopen("in.txt","r", stdin)
#define print_output freopen("out.txt","w", stdout)
typedef long long ll;
typedef long double ld;
using namespace std;
const int maxn = 5e5+10, mod = 1e9+7;
ll x[maxn], y[maxn], n;
struct node {
double lg; // log x0 + log x1 + ...
double mxlg; // max log (x0 x1 x2 .... xi * yi)
ll mul; // x0 x1 x2 ... % mod
ll mxmul; // max x0 x1 ... xi * yi
} tree[4 * maxn];
node merge(node a, node b) {
node ret;
ret.lg = a.lg + b.lg;
ret.mul = (a.mul * b.mul) % mod;
if(a.mxlg <= a.lg + b.mxlg) {
ret.mxlg = a.lg + b.mxlg;
ret.mxmul = (a.mul * b.mxmul) % mod;
} else {
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... |