# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
40907 | wzy | Sterilizing Spray (JOI15_sterilizing) | C++14 | 365 ms | 5292 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 <stdio.h>
#include <stdint.h>
#include <vector>
#define int long long
#define ll int
using namespace std;
int n , q, k ;
struct node{
ll sum = 0;
ll rmq = 0;
}st[1000000];
void build(int l = 0 , int r = n -1 , int curr = 1){
int mid = (l+r)/2;
if(l == r){
scanf("%lld" , &st[curr].sum);
st[curr].rmq = st[curr].sum;
return;
}
build(l , mid , 2*curr);
build(mid + 1 , r , 2*curr + 1);
st[curr].sum = st[2*curr].sum + st[2*curr + 1].sum;
st[curr].rmq = max(st[2*curr].rmq , st[2*curr + 1].rmq);
}
void set_value(int x , int v , int l = 0 , int r = n - 1 , int curr = 1){
int 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... |