Submission #1024174

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10241742024-07-15 14:33:55lucriSails (IOI07_sails)C++17
100 / 100
118 ms8016 KiB
#include <bits/stdc++.h>
using namespace std;
long long n;
long long ans;
pair<long long,long long>v[100010];
struct intervale{long long vmin,vmax,lazy;}aint[400010];
void propaga(long long poz,long long b,long long e)
{
if(b!=e)
{
aint[poz*2].lazy+=aint[poz].lazy;
aint[poz*2+1].lazy+=aint[poz].lazy;
}
aint[poz].vmax+=aint[poz].lazy;
aint[poz].vmin+=aint[poz].lazy;
aint[poz].lazy=0;
}
long long valoare(long long poz,long long b,long long e,long long pozc)
{
propaga(poz,b,e);
if(b==e)
return aint[poz].vmin;
if((b+e)/2>=pozc)
return valoare(poz*2,b,(b+e)/2,pozc);
else
return valoare(poz*2+1,(b+e)/2+1,e,pozc);
}
void adauga(long long poz,long long b,long long e,long long bi,long long ei)
{
if(b>ei||bi>e)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...