# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
347954 | lovro_nidogon1 | Matching (CEOI11_mat) | C++14 | 1008 ms | 65540 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>
#define breturn return
#define ll long long
using namespace std;
const ll b = 31337;
const ll mod = 1e9 + 7;
ll n, m,bn, arr[1000001], a, pb[20000001], che[1000001], chash, rhash, tour[40000001], laz[40000001], bre, act[40000001], cnt;
vector<pair<ll, ll> > perm;
vector<ll> odg;
map<ll, ll> maph;
ll mul(ll x, ll y) {
breturn (x * y)%mod;
}
ll ad(ll x, ll y) {
if(x + y >= mod) breturn x + y - mod;
else if(x + y < 0) breturn x + y + mod;
breturn x + y;
}
ll quer(ll ax, ll bx, ll x = 1, ll l = 0, ll r = bn - 1) {
if(l > bx or r < ax) breturn 0;
if(l >= ax and r <= bx) breturn tour[x];
ll mid = (l + r)/2;
breturn ad(quer(ax, bx, x * 2, l, mid), quer(ax, bx, x * 2 + 1, mid + 1, r));
}
ll smol(ll ax, ll bx, ll x = 1, ll l = 0, ll r = bn - 1) {
if(l > bx or r < ax) breturn 0;
if(l >= ax and r <= bx) breturn act[x];
ll mid = (l + r)/2;
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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |