Codeforces 1604B - XOR Specia-LIS-t Solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///Abul Hasnat Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int t,i,n,c;
- cin>>t;
- while(t--)
- {
- cin>>n;
- int a[n+1];
- c=0;
- for(i=0; i<n; i++)
- cin>>a[i];
- if(n%2==0)
- cout<<"YES"<<endl;
- else
- {
- for(i=0; i<n-1; i++)
- {
- if(a[i+1]<=a[i])
- {
- c=1;
- break;
- }
- }
- if(c==1)
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- }
- }
- }
No comments