2023 rcpc
This commit is contained in:
26
2023/rcpc/d1/editorial/J. Triple Reverse Sort.cpp
Normal file
26
2023/rcpc/d1/editorial/J. Triple Reverse Sort.cpp
Normal file
@@ -0,0 +1,26 @@
|
||||
/// Gheorghies Alexandru
|
||||
#include<bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
typedef long long ll;
|
||||
typedef pair<ll,ll> pll;
|
||||
const ll NMAX=1e5+5;
|
||||
|
||||
void tc(){
|
||||
ll n;
|
||||
bool good=1;
|
||||
cin>>n;
|
||||
for(ll i=1;i<=n;i++){
|
||||
ll x; cin>>x;
|
||||
if(x%2!=i%2) good=0;
|
||||
}
|
||||
cout<<(good?"YES":"NO")<<'\n';
|
||||
}
|
||||
int main()
|
||||
{
|
||||
|
||||
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
|
||||
ll t; cin>>t; while(t--)
|
||||
tc();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user