# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
393215 | Kenzo_1114 | Horses (IOI15_horses) | C++17 | 563 ms | 44324 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;
const int MAXN = 500010;
const long long int MOD = 1e9 + 7;
int n;
long long int x[MAXN], y[MAXN];
long long int seg[4 * MAXN], lz[4 * MAXN];
void refresh(int pos, int bg, int ed)
{
if(lz[pos] == 1) return;
long long int Lz = lz[pos]; lz[pos] = 1;
seg[pos] = (seg[pos] * Lz) % MOD;
if(bg == ed) return;
int mid = (bg + ed) >> 1, l = 2 * pos, r = l + 1;
lz[l] = (lz[l] * Lz) % MOD;
lz[r] = (lz[r] * Lz) % MOD;
}
void upd(int pos, int bg, int ed, int p, int q, long long int val)
{
refresh(pos, bg, ed);
if(q < p || q < bg || ed < p) return;
if(p <= bg && ed <= q)
{
lz[pos] = (lz[pos] * val) % MOD;
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... |