Submission #291074

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2910742020-09-04 16:05:40davi_bartWall (IOI14_wall)C++14
100 / 100
1598 ms166076 KiB
#include<bits/stdc++.h>
#include "wall.h"
using namespace std;
#define N 2000003
class SegmentTree {
const int inf = 1e9;
int n, n0;
int max_v[4*N], smax_v[4*N], max_c[4*N];
int min_v[4*N], smin_v[4*N], min_c[4*N];
int sum[4*N];
int ecnt[4*N], ladd[4*N];
void update_node_max(int k, int x) {
sum[k] += (x - max_v[k]) * max_c[k];
if(max_v[k] == min_v[k]) {
max_v[k] = min_v[k] = x;
} else if(max_v[k] == smin_v[k]) {
max_v[k] = smin_v[k] = x;
} else {
max_v[k] = x;
}
}
void update_node_min(int k, int x) {
sum[k] += (x - min_v[k]) * min_c[k];
if(max_v[k] == min_v[k]) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...