結果

問題 No.396 クラス替え
ユーザー sima.tetteke
提出日時 2019-09-22 12:13:43
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 507 bytes
コンパイル時間 1,099 ms
コンパイル使用メモリ 158,216 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-19 03:30:06
合計ジャッジ時間 1,729 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
ll N;


int main(){

    ll N, M, X, Y;
    cin >> N >> M >> X >> Y;

    ll classA = (X - 1) % (2 * M);
    ll classB = (Y - 1) % (2 * M);

    if(classA >= M){
        classA = (2 * M - classA - 1) % M;
    }
    if(classB >= M){
        classB = (2 * M - classB - 1) % M;
    }

    //cout  << classA << ", " << classB << endl;

    if(classA == classB){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

} 
0