1896A - Jagged Swaps - CodeForces Solution


sortings

Please click on ads to support us..

C++ Code:

#include <bits/stdc++.h>
#define txt freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define mostafa ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define ll long long
#define for0(i,n) for(ll i=0;i<n;i++)
#define for1(i,n) for(ll i=1;i<=n;i++)
#define for01(i,n) for(ll i=0;i<=n;i++)
#define forR0(i, n) for(ll i=n-1;i>=0;i--)
#define forR1(i, n) for(ll i=n;i>=1;i--)
#define pp(n) push_back(n)
#define mem(v,x) memset(v,x,sizeof(v));
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define sz(a) a.size()
#define pii pair<ll,ll>
#define vi vector<ll>
#define vv vector<vector<ll>>
#define f first
#define s second
#define init int n ; cin>> n  ; vi v(n); for0(i,n) cin>>v[i] ;

using namespace std;

int main() {
    mostafa
    int t; cin >> t;

    while (t--) {
        init
        if(v[0] == 1 ) yes
        else no
    }

    return 0;
}


Comments

Submit
0 Comments
More Questions

834A - The Useless Toy
1407D - Discrete Centrifugal Jumps
1095B - Array Stabilization
291B - Command Line Arguments
1174B - Ehab Is an Odd Person
624B - Making a String
1064C - Oh Those Palindromes
1471A - Strange Partition
1746A - Maxmina
1746B - Rebellion
66C - Petya and File System
1746C - Permutation Operations
1199B - Water Lily
570B - Simple Game
599C - Day at the Beach
862A - Mahmoud and Ehab and the MEX
1525A - Potion-making
1744D - Divisibility by 2n
1744C - Traffic Light
1744A - Number Replacement
1744B - Even-Odd Increments
637B - Chat Order
546C - Soldier and Cards
18D - Seller Bob
842B - Gleb And Pizza
1746D - Paths on the Tree
1651E - Sum of Matchings
19A - World Football Cup
630P - Area of a Star
1030C - Vasya and Golden Ticket