# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1114988 | AdamGS | Fire (JOI20_ho_t5) | C++17 | 104 ms | 5704 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;
int tr[400000];
int n,q;
void add(int p,int w)
{
p+=n;
tr[p] = w;
p/=2;
while(p > 0)
{
tr[p] = max(tr[p*2],tr[p*2+1]);
p/=2;
}
}
int spr(int l,int r)
{
l+=n;r+=n;
int ans = 0;
ans = max(ans, tr[l]);
ans = max(ans, tr[r]);
while(l/2 != r/2)
{
if(l%2 == 0) ans = max(ans,tr[l+1]);
if(r%2 == 1) ans = max(ans,tr[r-1]);
l/=2;r/=2;
}
return ans;
}
# | 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... |