# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
587906 | almothana05 | Comparing Plants (IOI20_plants) | C++14 | 1 ms | 468 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 "plants.h"
#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int seg[900000] , lazy[900000] , num[500000];
void mach(int id , int l , int r){
seg[id] += lazy[id];
if(l != r){
lazy[id * 2] += lazy[id];
lazy[id * 2 + 1] += lazy[id];
}
lazy[id] = 0;
}
int sucher(int id , int l , int r , int gewl , int gewr){
mach(id , l , r);
// cout << l << ' ' << r << "\n" << seg[id] << "\n";
int m = (l + r)/2;
if(l > gewr || gewl > r){
return mod;
}
if(gewl <= l && r <= gewr){
if(seg[id] == 0){
if(l == r){
return l - 1;
}
mach(id * 2 , l , m);
if(seg[id * 2] == 0){
return sucher(id * 2 , l , m , gewl , gewr);
}
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... |