Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//
int n;
vector<ll> px,py,qx,qy;
int dp[4100][4100];
vector<ll> compress(vector<ll> x1,vector<ll> x2){
	vector<ll> xs;
	for(int i=0;i<n;i++){
		for(int j=-1;j<=1;j++){
			xs.push_back(x1[i]+j);
			xs.push_back(x2[i]+j);
		}
	}
	xs.push_back(1e9+7);
	sort(xs.begin(),xs.end());
	xs.erase(unique(xs.begin(),xs.end()),xs.end());
	for(int i=0;i<n;i++){
		x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
		x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
	}
	return xs;
}
//
int main(){
	cin>>n;
	px.resize(n);
	py.resize(n);
	qx.resize(n);
	qy.resize(n);
	for(int i=0;i<n;i++){
		cin>>px[i]>>py[i]>>qx[i]>>qy[i];
	}
	vector<ll> X=compress(px,qx);
	vector<ll> Y=compress(py,qy);
	for(int i=0;i<n;i++){
		dp[px[i]][py[i]]++;
		dp[qx[i]][qy[i]]++;
		dp[px[i]][qy[i]]--;
		dp[qx[i]][py[i]]--;
	}
	for(int i=0;i<X.size()-1;i++){
		for(int j=1;j<Y.size()-1;j++){
			dp[i][j]+=dp[i][j-1];
		}
	}
	for(int i=0;i<Y.size()-1;i++){
		for(int j=1;j<X.size()-1;j++){
			dp[j][i]+=dp[j-1][i];
		}
	}
	ll ans=0;
	for(int i=0;i<X.size()-1;i++){
		for(int j=0;j<Y.size()-1;j++){
			if(dp[i][j]){
				ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
			}
		}
	}
	cout<<ans<<endl;
}


Compiler output:
a.cc:7:8: error: 'll' was not declared in this scope
    7 | vector<ll> px,py,qx,qy;
      |        ^~
a.cc:7:10: error: template argument 1 is invalid
    7 | vector<ll> px,py,qx,qy;
      |          ^
a.cc:7:10: error: template argument 2 is invalid
a.cc:9:8: error: 'll' was not declared in this scope
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |        ^~
a.cc:9:10: error: template argument 1 is invalid
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |          ^
a.cc:9:10: error: template argument 2 is invalid
a.cc:9:28: error: 'll' was not declared in this scope
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |                            ^~
a.cc:9:30: error: template argument 1 is invalid
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |                              ^
a.cc:9:30: error: template argument 2 is invalid
a.cc:9:42: error: 'll' was not declared in this scope
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |                                          ^~
a.cc:9:44: error: template argument 1 is invalid
    9 | vector<ll> compress(vector<ll> x1,vector<ll> x2){
      |                                            ^
a.cc:9:44: error: template argument 2 is invalid
a.cc: In function 'int compress(int, int)':
a.cc:10:16: error: 'll' was not declared in this scope
   10 |         vector<ll> xs;
      |                ^~
a.cc:10:18: error: template argument 1 is invalid
   10 |         vector<ll> xs;
      |                  ^
a.cc:10:18: error: template argument 2 is invalid
a.cc:13:28: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   13 |                         xs.push_back(x1[i]+j);
      |                            ^~~~~~~~~
a.cc:13:40: error: invalid types 'int[int]' for array subscript
   13 |                         xs.push_back(x1[i]+j);
      |                                        ^
a.cc:14:28: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   14 |                         xs.push_back(x2[i]+j);
      |                            ^~~~~~~~~
a.cc:14:40: error: invalid types 'int[int]' for array subscript
   14 |                         xs.push_back(x2[i]+j);
      |                                        ^
a.cc:17:12: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   17 |         xs.push_back(1e9+7);
      |            ^~~~~~~~~
a.cc:18:17: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   18 |         sort(xs.begin(),xs.end());
      |                 ^~~~~
a.cc:18:28: error: request for member 'end' in 'xs', which is of non-class type 'int'
   18 |         sort(xs.begin(),xs.end());
      |                            ^~~
a.cc:19:12: error: request for member 'erase' in 'xs', which is of non-class type 'int'
   19 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |            ^~~~~
a.cc:19:28: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   19 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                            ^~~~~
a.cc:19:39: error: request for member 'end' in 'xs', which is of non-class type 'int'
   19 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                                       ^~~
a.cc:19:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   19 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                                                 ^~~
a.cc:21:19: error: invalid types 'int[int]' for array subscript
   21 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                   ^
a.cc:21:38: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   21 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                      ^~~~~
a.cc:21:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   21 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                 ^~~
a.cc:21:57: error: invalid types 'int[int]' for array subscript
   21 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                         ^
a.cc:21:65: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   21 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                                 ^~~~~
a.cc:22:19: error: invalid types 'int[int]' for array subscript
   22 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                   ^
a.cc:22:38: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   22 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                      ^~~~~
a.cc:22:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   22 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                 ^~~
a.cc:22:57: error: invalid types 'int[int]' for array subscript
   22 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                         ^
a.cc:22:65: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   22 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                                 ^~~~~
a.cc: In function 'int main()':
a.cc:29:12: error: request for member 'resize' in 'px', which is of non-class type 'int'
   29 |         px.resize(n);
      |            ^~~~~~
a.cc:30:12: error: request for member 'resize' in 'py', which is of non-class type 'int'
   30 |         py.resize(n);
      |            ^~~~~~
a.cc:31:12: error: request for member 'resize' in 'qx', which is of non-class type 'int'
   31 |         qx.resize(n);
      |            ^~~~~~
a.cc:32:12: error: request for member 'resize' in 'qy', which is of non-class type 'int'
   32 |         qy.resize(n);
      |            ^~~~~~
a.cc:34:24: error: invalid types 'int[int]' for array subscript
   34 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                        ^
a.cc:34:31: error: invalid types 'int[int]' for array subscript
   34 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                               ^
a.cc:34:38: error: invalid types 'int[int]' for array subscript
   34 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                                      ^
a.cc:34:45: error: invalid types 'int[int]' for array subscript
   34 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                                             ^
a.cc:36:16: error: 'll' was not declared in this scope
   36 |         vector<ll> X=compress(px,qx);
      |                ^~
a.cc:36:18: error: template argument 1 is invalid
   36 |         vector<ll> X=compress(px,qx);
      |                  ^
a.cc:36:18: error: template argument 2 is invalid
a.cc:37:18: error: template argument 2 is invalid
   37 |         vector<ll> Y=compress(py,qy);
      |                  ^
a.cc:39:22: error: invalid types 'int[int]' for array subscript
   39 |                 dp[px[i]][py[i]]++;
      |                      ^
a.cc:39:29: error: invalid types 'int[int]' for array subscript
   39 |                 dp[px[i]][py[i]]++;
      |                             ^
a.cc:40:22: error: invalid types 'int[int]' for array subscript
   40 |                 dp[qx[i]][qy[i]]++;
      |                      ^
a.cc:40:29: error: invalid types 'int[int]' for array subscript
   40 |                 dp[qx[i]][qy[i]]++;
      |                             ^
a.cc:41:22: error: invalid types 'int[int]' for array subscript
   41 |                 dp[px[i]][qy[i]]--;
      |                      ^
a.cc:41:29: error: invalid types 'int[int]' for array subscript
   41 |                 dp[px[i]][qy[i]]--;
      |                             ^
a.cc:42:22: error: invalid types 'int[int]' for array subscript
   42 |                 dp[qx[i]][py[i]]--;
      |                      ^
a.cc:42:29: error: invalid types 'int[int]' for array subscript
   42 |                 dp[qx[i]][py[i]]--;
      |                             ^
a.cc:44:25: error: request for member 'size' in 'X', which is of non-class type 'int'
   44 |         for(int i=0;i<X.size()-1;i++){
      |                         ^~~~
a.cc:45:33: error: request for member 'size' in 'Y', which is of non-class type 'int'
   45 |                 for(int j=1;j<Y.size()-1;j++){
      |                                 ^~~~
a.cc:49:25: error: request for member 'size' in 'Y', which is of non-class type 'int'
   49 |         for(int i=0;i<Y.size()-1;i++){
      |                         ^~~~
a.cc:50:33: error: request for member 'size' in 'X', which is of non-class type 'int'
   50 |                 for(int j=1;j<X.size()-1;j++){
      |                                 ^~~~
a.cc:54:11: error: expected ';' before 'ans'
   54 |         ll ans=0;
      |           ^~~~
      |           ;
a.cc:55:25: error: request for member 'size' in 'X', which is of non-class type 'int'
   55 |         for(int i=0;i<X.size()-1;i++){
      |                         ^~~~
a.cc:56:33: error: request for member 'size' in 'Y', which is of non-class type 'int'
   56 |                 for(int j=0;j<Y.size()-1;j++){
      |                                 ^~~~
a.cc:58:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   58 |                                 ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
      |                                 ^~~
      |                                 abs
a.cc:58:40: error: invalid types 'int[int]' for array subscript
   58 |                                 ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
      |                                        ^
a.cc:58:47: error: invalid types 'int[int]' for array subscript
   58