# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
58504 | ngkan146 | Horses (IOI15_horses) | C++11 | 1116 ms | 62524 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 ll long long
using namespace std;
typedef pair<int,int> ii;
const ll mod = (ll) 1e9+7;
struct segTreeMul{
ll node[2000005];
segTreeMul(){
for(int i=1;i<=2000000;i++) node[i] = 1;
}
void upd(int id,int l,int r,int pos,int val){
if (r < pos || pos < l) return;
if (l == r){
node[id] = val;
return;
}
upd(2*id,l,(l+r)/2,pos,val);
upd(2*id+1,(l+r)/2+1,r,pos,val);
node[id] = node[2*id] * node[2*id+1] % mod;
}
ll get(int id,int l,int r,int u,int v){
if (r < u || v < l) return 1;
if (u <= l && r <= v) return node[id];
return get(2*id, l, (l+r)/2, u, v) * get(2*id+1, (l+r)/2+1, r, u, v) % mod;
}
};
struct segTreeMax{
ll node[2000005];
segTreeMax(){
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... |