For this Question: Given an array of N integers, your task is to check if the array can be sorted in increasing order by doing only the given operation:-
Swap two adjacent elements.
Seems too easy? let's make it trickier. The number of operations done for each element should be even.The first line of input contains a single integer N. The next line of input contains N space separated integers depicting the given array.

Constraints:-
1 <= N <= 100000
0 <= Arr[i] <= 100000Print "Yes" if the array can be sorted by doing an even number of operations on each element. Else Print "No".Sample Input:-
4
4 3 2 5

Sample Output:-
Yes

Explanation:-
At step 0, we have: 4 3 2 5
 0 0 0 0

swap (3, 4), step 1: 3 4 2 5
 1 1 0 0

swap (4, 2), step 2: 3 2 4 5
 1 1 2 0

swap (3, 2), step 3: 2 3 4 5
 2 2 2 0

Hence, we get the required ordering. so print Yes

Sample Input:-
5
1 5 6 8 7

Sample Output:-
No, I have written this Solution Code: #include <bits/stdc++.h>

#define ll long long
#define FOR(i,n) for (int i=0; i<n; i++)

using namespace std;

void solve(bool);

int main () {

	ios_base::sync_with_stdio(0);
	cin.tie(0);

	solve(0);

	return 0;
}


void solve(bool T) {
	int t = 1;
	if (T)
		cin>>t;

	while(t--) {
		int n; cin >> n;
		vector<bool> used(n, 0);
		vector<int> criminals(n);
		for (auto &e: criminals) cin >> e;

		vector<int> sorted = criminals;
		sort(sorted.begin(), sorted.end());

		if (sorted[0] == sorted[n-1]) {
			cout << "Yes";
			continue;
		}

		string ans = "Yes";
		for (int i=0; i<n; i++) {
			auto it = lower_bound(sorted.begin(), sorted.end(), criminals[i]);
			bool succ = false;
			for (; *it == criminals[i]; it++) {
				int ind = (it - sorted.begin());
				if (abs(i-ind)%2==0 && !used[ind]) {
					used[ind] = 1;
					succ = true;
					break;
				}
			}
			if (!succ) {
				ans = "No";
				break;
			}
		}

		cout << ans;
	}
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?