結果

問題 No.396 クラス替え
ユーザー greentea011
提出日時 2019-03-20 15:19:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 240 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 65,016 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-19 00:41:27
合計ジャッジ時間 1,223 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main() {
    int n,m,x,y;
    std::cin >> n >> m >> x >> y;

    int a=(((x-1)/m)%2==0)?((x-1)%m+1):(m-(x-1)%m);
    int b=(((y-1)/m)%2==0)?((y-1)%m+1):(m-(y-1)%m);
    std::cout << (a==b?"YES":"NO") << std::endl;
}
0