Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define double long double
- #define pb push_back
- signed main()
- {
- int t , n , k;
- cin >> t;
- while(t--){
- cin >> n;
- vector<int> x , y;
- for(int i = 0; i < n; i++){
- cin >> k;
- if(k % 2)
- x.pb(k);
- else
- y.pb(k);
- }/*
- bool ok = true;
- for(int i = 1; i < x.size(); i++){
- if(x[i] < x[i - 1]){
- ok = false;
- break;
- }
- }
- for(int i = 1; i < y.size(); i++){
- if(y[i] < y[i - 1]){
- ok = false;
- break;
- }
- }
- cout << (ok ? "Yes" : "No") << endl;*/
- cout << ((is_sorted(x.begin() , x.end()) && is_sorted(y.begin() , y.end()) ? "Yes" : "No")) << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement