/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 748.0 KiB
#2 Accepted 50ms 832.0 KiB
#3 Accepted 60ms 1.02 MiB
#4 Accepted 59ms 812.0 KiB

Code


#include<bits/stdc++.h>
#define ll long long int
#define endl '\n'
#define print(v) for(auto data : v) cout << data << " "; cout << endl;
using namespace std;
void solve()
{
    ll n, m;
    cin >> n >> m;
    ll x, y, p, q; cin >> x >> y >> p >> q;
    if(abs(x-p) == abs(y-q)) cout << "Yes" << endl;
    else if(x == p && abs(y-q)%2 == 0) cout << "Yes" << endl;
    else if(y == q && abs(x-p)%2 == 0) cout << "Yes" << endl;
    else if((abs(x-p)%2 == 0 && abs(y-q)%2 == 0) || (abs(x-p)%2 != 0 && abs(y-q)%2 != 0))  cout << "Yes" << endl;
    //else if(y == q && abs(x-p)%2 == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);

    int t; cin >> t;
    //int t = 1;
    while(t--) solve();

    return 0;
}

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 11:04:11
Judged At
2024-12-07 11:04:11
Judged By
Score
100
Total Time
60ms
Peak Memory
1.02 MiB