# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40283 | szawinis | Horses (IOI15_horses) | C++14 | 329 ms | 41912 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 <algorithm>
#include <cmath>
using namespace std;
using ll = long long;
const int N = 1 << 19;
const ll MOD = 1e9 + 7;
ll modPow(ll b, ll e) {
if (!e)
return 1;
if (e == 1)
return b;
return modPow(b * b % MOD, e >> 1) * modPow(b, e & 1) % MOD;
}
struct node {
double comp;
ll val;
void merge(node rhs) {
comp += rhs.comp;
val = 1ll * val * rhs.val % MOD;
}
bool operator>(const node &rhs) const {
return make_pair(comp, val) > make_pair(rhs.comp, rhs.val);
}
} t[2 * N], lz[2 * N];
void build(int i, int l, int r) {
lz[i] = {0, 1};
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... |