結果

問題 No.396 クラス替え
ユーザー adoth
提出日時 2017-11-14 14:04:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 1,000 ms
コード長 403 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-25 02:03:53
合計ジャッジ時間 1,405 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

# https://yukicoder.me/problems/no/396


def select_class(class_M, rank):
    ans = rank % (2 * class_M)
    if ans == 0:
        return 1
    elif ans > class_M:
        return ans - (2 * (ans - class_M) - 1)
    else:
        return ans


def main():
    _, M = map(int, input().split())
    X, Y = map(int, input().split())
    print(['NO', 'YES'][select_class(M, X) == select_class(M, Y)])


main()
0