# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1004426 | HasanV11010238 | Horses (IOI15_horses) | C++17 | 43 ms | 31772 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
#define mod 1000000007
using namespace std;
int n;
vector<ll> x, y, tr;
void build(int v, int l, int r){
if (l == r){
tr[v] = x[l];
return;
}
int mid = (l + r) / 2;
build(v * 2, l, mid);
build(v * 2 + 1, mid + 1, r);
tr[v] = (tr[v * 2] * tr[v * 2 + 1]) % mod;
}
void update(int v, int l, int r, int pos, ll val){
if (l == r){
tr[v] = val;
}
else{
int mid = (l + r) / 2;
if (pos <= mid){
update(v * 2, l, mid, pos, val);
}
else{
update(v * 2 + 1, mid + 1, r, pos, val);
}
tr[v] = (tr[v * 2] * tr[v * 2 + 1]) % 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... |