/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 588.0 KiB
#2 Accepted 255ms 896.0 KiB
#3 Accepted 302ms 1012.0 KiB
#4 Accepted 299ms 828.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define all(v) v.begin(),v.end()
#define nl "\n"
#define FIO \
    ios_base::sync_with_stdio(false);\
    cin.tie(NULL);\
    cout.tie(NULL);

void solve()
{
    ll n, m, x, p, y, q; cin>>n>>m>>x>>y>>p>>q;
    if(x%2 && y%2){
        if(p%2 && q%2){
            cout<<"Yes"<<nl;
        }else if(p%2==0 && q%2==0){
            cout<<"Yes"<<nl;
        }else{
            cout<<"No"<<nl;
        }
    }else if(x%2==0 && y%2==0){
        if(p%2 && q%2){
            cout<<"Yes"<<nl;
        }else if(p%2==0 && q%2==0){
            cout<<"Yes"<<nl;
        }else{
            cout<<"No"<<nl;
        }
    }else{
        if(x%2 && y%2==0){
            if(p%2 && q%2==0){
                cout<<"Yes"<<nl;
            }else if(p%2==0 && q%2){
                cout<<"Yes"<<nl;
            }else{
                cout<<"No"<<nl;
            }
        }else if(x%2==0 && y%2){
            if(p%2 && q%2==0){
                cout<<"Yes"<<nl;
            }else if(p%2==0 && q%2){
                cout<<"Yes"<<nl;
            }else{
                cout<<"No"<<nl;
            }
        }else{
            cout<<"No"<<nl;
        }
    }
    
    //  cout<<"Yes"<<nl;
    // else cout<<"No"<<nl;
}

int32_t main()
{
    ll t=1;
    cin>>t;
    for(ll i=1;i<=t;i++)
    {
        // cout<<"Case "<<i<<": ";
        solve();
    }
}

Information

Submit By
Type
Submission
Problem
P1115 Destination
Contest
LU IUJPC : Sylhet Division 2024, Mock Round
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-07 10:56:10
Judged At
2024-12-07 10:56:10
Judged By
Score
100
Total Time
302ms
Peak Memory
1012.0 KiB