/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Wrong Answer 241ms 788.0 KiB
#3 Wrong Answer 304ms 656.0 KiB

Code

#include<bits/stdc++.h>
using namespace std;
int main()
{
   int t;
   cin >> t;
   while(t--){
    int n, m;
    cin >> n >> m;
    int x, y, a, b;
    cin >> x;
    cin >> y;
    cin >> a;
    cin >> b;

    int xDiff = x - 1;
    int yDiff = y - 1;
    if(a+xDiff == b+xDiff){
        cout << "Yes" << endl;
    } 
    else {
        if((x+y)%2 == 1){
            if((a+b)%2 == 1){
                cout << "Yes" << endl;
            } else {
            cout << "No" << endl;
        }
        } else if((x+y)%2 == 0){
            if((a+b)%2 == 0){
                cout << "Yes" << endl;
            } else {
            cout << "No" << endl;
        }
        } else {
            cout << "No" << endl;
        }
    }
   }
}

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:52:49
Judged At
2024-12-07 11:52:49
Judged By
Score
10
Total Time
304ms
Peak Memory
788.0 KiB