Submission #621438

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6214382022-08-03 19:19:492fat2codeWall (IOI14_wall)C++17
100 / 100
803 ms93768 KiB
#include "wall.h"
#include <bits/stdc++.h>
#define fr first
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define sc second
#define all(s) s.begin(), s.end()
//#define int long long
#define rc(s) return cout << s, 0
using namespace std;
const int nmax = 2000005;
int mini[4*nmax], maxi[4*nmax], lazy[4*nmax];
vector<int>ans;
void push(int l, int r, int nod){
if(lazy[nod]){
if(maxi[nod] < mini[2 * nod]) mini[2 * nod] = maxi[nod];
else mini[2 * nod] = max(mini[2 * nod], mini[nod]);
if(mini[nod] > maxi[2 * nod]) maxi[2 * nod] = mini[nod];
else maxi[2 * nod] = min(maxi[2 * nod], maxi[nod]);
if(maxi[nod] < mini[2 * nod + 1]) mini[2 * nod + 1] = maxi[nod];
else mini[2 * nod + 1] = max(mini[2 * nod + 1], mini[nod]);
if(mini[nod] > maxi[2 * nod + 1]) maxi[2 * nod + 1] = mini[nod];
else maxi[2 * nod + 1] = min(maxi[2 * nod + 1], maxi[nod]);
int mid = l + (r - l) / 2;
if(l != mid) lazy[2 * nod] = 1;
if(mid + 1 != r) lazy[2 * nod + 1] = 1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...