Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
//
int n;
vector<ll> px,py,qx,qy;
int dp[4100][4100];
struct vevev{
	vector<ll> a;vector<ll> b;vector<ll> ab;
};
vevev compress(vector<ll> x1,vector<ll> x2){
	vector<ll> xs;
	for(int i=0;i<n;i++){
		for(int j=0;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();
	}
	vevev v;
	v.a=x1;v.b=x2;v.ab=xs;
	return v;
}
//
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];
	}
	vevev x=compress(px,qx);
	vevev y=compress(py,qy);
	px=x.a;qx=x.b;vector<int> X=x.ab;
	py=y.a;qy=y.b;vector<int> Y=y.ab;
	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:10:16: error: 'll' was not declared in this scope
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                ^~
a.cc:10:18: error: template argument 1 is invalid
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                  ^
a.cc:10:18: error: template argument 2 is invalid
a.cc:10:29: error: 'll' was not declared in this scope
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                             ^~
a.cc:10:31: error: template argument 1 is invalid
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                               ^
a.cc:10:31: error: template argument 2 is invalid
a.cc:10:42: error: 'll' was not declared in this scope
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                                          ^~
a.cc:10:44: error: template argument 1 is invalid
   10 |         vector<ll> a;vector<ll> b;vector<ll> ab;
      |                                            ^
a.cc:10:44: error: template argument 2 is invalid
a.cc:12:23: error: 'll' was not declared in this scope
   12 | vevev compress(vector<ll> x1,vector<ll> x2){
      |                       ^~
a.cc:12:25: error: template argument 1 is invalid
   12 | vevev compress(vector<ll> x1,vector<ll> x2){
      |                         ^
a.cc:12:25: error: template argument 2 is invalid
a.cc:12:37: error: 'll' was not declared in this scope
   12 | vevev compress(vector<ll> x1,vector<ll> x2){
      |                                     ^~
a.cc:12:39: error: template argument 1 is invalid
   12 | vevev compress(vector<ll> x1,vector<ll> x2){
      |                                       ^
a.cc:12:39: error: template argument 2 is invalid
a.cc: In function 'vevev compress(int, int)':
a.cc:13:16: error: 'll' was not declared in this scope
   13 |         vector<ll> xs;
      |                ^~
a.cc:13:18: error: template argument 1 is invalid
   13 |         vector<ll> xs;
      |                  ^
a.cc:13:18: error: template argument 2 is invalid
a.cc:16:28: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   16 |                         xs.push_back(x1[i]+j);
      |                            ^~~~~~~~~
a.cc:16:40: error: invalid types 'int[int]' for array subscript
   16 |                         xs.push_back(x1[i]+j);
      |                                        ^
a.cc:17:28: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   17 |                         xs.push_back(x2[i]+j);
      |                            ^~~~~~~~~
a.cc:17:40: error: invalid types 'int[int]' for array subscript
   17 |                         xs.push_back(x2[i]+j);
      |                                        ^
a.cc:20:12: error: request for member 'push_back' in 'xs', which is of non-class type 'int'
   20 |         xs.push_back(1e9+7);
      |            ^~~~~~~~~
a.cc:21:17: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   21 |         sort(xs.begin(),xs.end());
      |                 ^~~~~
a.cc:21:28: error: request for member 'end' in 'xs', which is of non-class type 'int'
   21 |         sort(xs.begin(),xs.end());
      |                            ^~~
a.cc:22:12: error: request for member 'erase' in 'xs', which is of non-class type 'int'
   22 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |            ^~~~~
a.cc:22:28: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   22 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                            ^~~~~
a.cc:22:39: error: request for member 'end' in 'xs', which is of non-class type 'int'
   22 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                                       ^~~
a.cc:22:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   22 |         xs.erase(unique(xs.begin(),xs.end()),xs.end());
      |                                                 ^~~
a.cc:24:19: error: invalid types 'int[int]' for array subscript
   24 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                   ^
a.cc:24:38: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   24 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                      ^~~~~
a.cc:24:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   24 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                 ^~~
a.cc:24:57: error: invalid types 'int[int]' for array subscript
   24 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                         ^
a.cc:24:65: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   24 |                 x1[i]=lower_bound(xs.begin(),xs.end(),x1[i])-xs.begin();
      |                                                                 ^~~~~
a.cc:25:19: error: invalid types 'int[int]' for array subscript
   25 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                   ^
a.cc:25:38: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   25 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                      ^~~~~
a.cc:25:49: error: request for member 'end' in 'xs', which is of non-class type 'int'
   25 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                 ^~~
a.cc:25:57: error: invalid types 'int[int]' for array subscript
   25 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                         ^
a.cc:25:65: error: request for member 'begin' in 'xs', which is of non-class type 'int'
   25 |                 x2[i]=lower_bound(xs.begin(),xs.end(),x2[i])-xs.begin();
      |                                                                 ^~~~~
a.cc: In function 'int main()':
a.cc:34:12: error: request for member 'resize' in 'px', which is of non-class type 'int'
   34 |         px.resize(n);
      |            ^~~~~~
a.cc:35:12: error: request for member 'resize' in 'py', which is of non-class type 'int'
   35 |         py.resize(n);
      |            ^~~~~~
a.cc:36:12: error: request for member 'resize' in 'qx', which is of non-class type 'int'
   36 |         qx.resize(n);
      |            ^~~~~~
a.cc:37:12: error: request for member 'resize' in 'qy', which is of non-class type 'int'
   37 |         qy.resize(n);
      |            ^~~~~~
a.cc:39:24: error: invalid types 'int[int]' for array subscript
   39 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                        ^
a.cc:39:31: error: invalid types 'int[int]' for array subscript
   39 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                               ^
a.cc:39:38: error: invalid types 'int[int]' for array subscript
   39 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                                      ^
a.cc:39:45: error: invalid types 'int[int]' for array subscript
   39 |                 cin>>px[i]>>py[i]>>qx[i]>>qy[i];
      |                                             ^
a.cc:43:39: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
   43 |         px=x.a;qx=x.b;vector<int> X=x.ab;
      |                                     ~~^~
a.cc:44:39: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
   44 |         py=y.a;qy=y.b;vector<int> Y=y.ab;
      |                                     ~~^~
a.cc:46:22: error: invalid types 'int[int]' for array subscript
   46 |                 dp[px[i]][py[i]]++;
      |                      ^
a.cc:46:29: error: invalid types 'int[int]' for array subscript
   46 |                 dp[px[i]][py[i]]++;
      |                             ^
a.cc:47:22: error: invalid types 'int[int]' for array subscript
   47 |                 dp[qx[i]][qy[i]]++;
      |                      ^
a.cc:47:29: error: invalid types 'int[int]' for array subscript
   47 |                 dp[qx[i]][qy[i]]++;
      |                             ^
a.cc:48:22: error: invalid types 'int[int]' for array subscript
   48 |                 dp[px[i]][qy[i]]--;
      |                      ^
a.cc:48:29: error: invalid types 'int[int]' for array subscript
   48 |                 dp[px[i]][qy[i]]--;
      |                             ^
a.cc:49:22: error: invalid types 'int[int]' for array subscript
   49 |                 dp[qx[i]][py[i]]--;
      |                      ^
a.cc:49:29: error: invalid types 'int[int]' for array subscript
   49 |                 dp[qx[i]][py[i]]--;
      |                             ^
a.cc:61:9: error: 'll' was not declared in this scope
   61 |         ll ans=0;
      |         ^~
a.cc:65:33: error: 'ans' was not declared in this scope; did you mean 'abs'?
   65 |                                 ans+=(X[i+1]-X[i])*(Y[j+1]-Y[j]);
      |                                 ^~~
      |                                 abs
a.cc:69:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   69 |         cout<<ans<<endl;
      |               ^~~
      |               abs