Submission #725559

# Submission time Handle Problem Language Result Execution time Memory
725559 2023-04-17T16:28:13 Z allin27x Wall (IOI14_wall) C++17
8 / 100
139 ms 13932 KB
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;

struct SGT{
	int op;
	vector<int> t;
	int n;
	SGT(int sz, int op1){
		n= sz;
		op = op1;
		t.resize(2*n, -1);
	}
	void apply(int p, int x){
		if (t[p]==-1) {t[p] = x; return;}
		t[p] = abs(max(op*t[p], op*x));
	}
	void update(int l, int r, int x){
		for (l+=n, r+=n+1; l<r; l>>=1, r>>=1){
			if (l&1) apply(l++, x);
			if (r&1) apply(--r, x);
		}
	}
	void push(){
		for (int i=1; i<n; i++){
			apply(i<<1, t[i]);
			apply(i<<1|1, t[i]);
		}
	}
};

void brute_force(int n, int k, int op[], int l[],int r[],int h[], int ans[]){
	for (int i=0; i<k; i++){
		for(int j=l[i]; j<=r[i]; j++){
			if (op[i] == 1) ans[j] = max(ans[j] , h[i]);
			if (op[i] == 2) ans[j] = min(ans[j] , h[i]);
		} 
	}
}
void buildWall(int n, int k, int op[], int l[],int r[],int h[], int ans[]){
	if (n<=10000)  brute_force(n,k,op,l,r,h, ans);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 21 ms 496 KB Output is correct
5 Correct 24 ms 484 KB Output is correct
6 Correct 22 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 KB Output is correct
2 Correct 126 ms 13932 KB Output is correct
3 Incorrect 70 ms 7300 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 27 ms 500 KB Output is correct
5 Correct 24 ms 492 KB Output is correct
6 Correct 25 ms 492 KB Output is correct
7 Correct 1 ms 296 KB Output is correct
8 Correct 137 ms 13840 KB Output is correct
9 Incorrect 64 ms 7300 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 2 ms 436 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 22 ms 488 KB Output is correct
5 Correct 23 ms 440 KB Output is correct
6 Correct 28 ms 480 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 139 ms 13892 KB Output is correct
9 Incorrect 65 ms 7332 KB Output isn't correct
10 Halted 0 ms 0 KB -