For this Question: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute volume of water it is able to trap after raining.
Please refer to Sample test case for more details.The first line of input contains the size of the array, n
The following line of input contains n space-separated integers

Constraints:-
1 <= n <= 50000
0<=A[i]<=10<sup>10</sup>The first and only line of output contains integer, in accordance to the task.Sample Input:
6
3 0 0 2 0 4
Sample Output:
10, I have written this Solution Code: #include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;
 
#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
 
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

int a[N], l[N], r[N], ans;

signed main() {
	IOS;
	int n;	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> a[i];
		l[i] = max(l[i-1], a[i]);
	}	
	for(int i = n; i >= 1; i--)
		r[i] = max(r[i+1], a[i]);
	for(int i = 1; i <= n; i++)
		ans += (min(l[i], r[i]) - a[i]);
	cout << ans;
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?