結果

問題 No.396 クラス替え
ユーザー rlangevin
提出日時 2023-01-19 00:12:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 240 bytes
コンパイル時間 753 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 53,512 KB
最終ジャッジ日時 2024-06-11 23:43:37
合計ジャッジ時間 2,107 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(x):
    q = x // M
    if q % 2:
        return M - 1 - x % M
    else:
        return x % M
    

N, M = map(int, input().split())
X, Y = map(int, input().split())
X, Y = X - 1, Y - 1
print("YES") if f(X) == f(Y) else print("NO")    
0