/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 50ms 856.0 KiB
#3 Accepted 56ms 788.0 KiB
#4 Accepted 58ms 1.031 MiB

Code

#include <iostream>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int T;
    cin >> T;
    while(T--){
        // Read grid dimensions, though they don't affect the answer as long as we stay in bounds.
        long long N, M;
        cin >> N >> M;
        
        // Read starting position (x, y) and destination (p, q)
        long long x, y, p, q;
        cin >> x >> y;
        cin >> p >> q;
        
        // Check if the parity of the sum of coordinates is the same.
        if ((x + y) % 2 == (p + q) % 2)
            cout << "Yes" << "\n";
        else
            cout << "No" << "\n";
    }
    
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1115 Destination
Language
C++17 (G++ 13.2.0)
Submit At
2025-02-17 18:47:32
Judged At
2025-02-17 18:47:32
Judged By
Score
100
Total Time
58ms
Peak Memory
1.031 MiB