結果

問題 No.396 クラス替え
ユーザー brthyyjp
提出日時 2021-07-30 18:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 289 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-09-15 13:22:41
合計ジャッジ時間 2,281 ms
ジャッジサーバーID
(参考情報)
judge6 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
x, y = map(int, input().split())
x, y = x-1, y-1
q1, r1 = divmod(x, m)
q2, r2 = divmod(y, m)
if q1%2 == q2%2:
    if r1 == r2:
        print('YES')
    else:
        print('NO')
else:
    if r1 == m-1-r2:
        print('YES')
    else:
        print('NO')
0