# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
160265 | bortoz | Horses (IOI15_horses) | C++17 | 383 ms | 31864 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>
using namespace std;
typedef long long ll;
#define fi first
#define se second
constexpr int MAXN = 1 << 19;
constexpr int MOD = 1e9 + 7;
pair<int, bool> segX[2 * MAXN];
int segM[2 * MAXN];
int Y[MAXN];
pair<int, bool> joinX(pair<int, bool>& a, pair<int, bool>& b) {
ll r = 1ll * a.fi * b.fi;
bool o = (r >= MOD) || a.se || b.se;
return make_pair(r % MOD, o);
}
pair<int, bool> queryX(int l, int r) {
pair<int, bool> ans{1, false};
for (l += MAXN, r += MAXN; l < r; l /= 2, r /= 2) {
if (l & 1) ans = joinX(ans, segX[l++]);
if (r & 1) ans = joinX(ans, segX[--r]);
}
return ans;
}
int joinM(int a, int b) {
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... |