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

    1. #include <bits/stdc++.h>
    2. using namespace std;
    3. int main()
    4. {
    5. int t,i,n,c;
    6. cin>>t;
    7. while(t--)
    8. {
    9. cin>>n;
    10. int a[n+1];
    11. c=0;
    12. for(i=0; i<n; i++)
    13. cin>>a[i];
    14. if(n%2==0)
    15. cout<<"YES"<<endl;
    16. else
    17. {
    18. for(i=0; i<n-1; i++)
    19. {
    20. if(a[i+1]<=a[i])
    21. {
    22. c=1;
    23. break;
    24. }
    25.  
    26. }
    27. if(c==1)
    28. cout<<"YES"<<endl;
    29. else
    30. cout<<"NO"<<endl;
    31.  
    32. }
    33. }
    34. }

    No comments

    Most View Post

    Recent post

    Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

        Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

    Powered by Blogger.