Submission #725558

# Submission time Handle Problem Language Result Execution time Memory
725558 2023-04-17T16:25:03 Z allin27x Wall (IOI14_wall) C++17
Compilation error
0 ms 0 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]);
		}
	}
};

vi brute_force(int n, int k, vi op, vi l,vi r,vi h){
	vi ans(n,0);
	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]);
		} 
	}
	return ans;
}
vi buildWall(int n, int k, vi op, vi l,vi r,vi h){
	if (n<=10000) return brute_force(n,k,op,l,r,h);
	return {};
}

Compilation message

/usr/bin/ld: /tmp/cchxVpuh.o: in function `main':
grader.cpp:(.text.startup+0x133): undefined reference to `buildWall(int, int, int*, int*, int*, int*, int*)'
collect2: error: ld returned 1 exit status