結果

問題 No.396 クラス替え
ユーザー brthyyjpbrthyyjp
提出日時 2021-07-30 18:04:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 1,000 ms
コード長 289 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 71,552 KB
最終ジャッジ日時 2023-10-13 17:28:24
合計ジャッジ時間 2,995 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,228 KB
testcase_01 AC 61 ms
71,344 KB
testcase_02 AC 62 ms
71,396 KB
testcase_03 AC 63 ms
71,096 KB
testcase_04 AC 66 ms
71,328 KB
testcase_05 AC 70 ms
71,316 KB
testcase_06 AC 63 ms
71,332 KB
testcase_07 AC 68 ms
71,552 KB
testcase_08 AC 64 ms
71,432 KB
testcase_09 AC 67 ms
71,328 KB
testcase_10 AC 64 ms
71,264 KB
testcase_11 AC 64 ms
71,548 KB
testcase_12 AC 62 ms
71,176 KB
testcase_13 AC 63 ms
71,400 KB
testcase_14 AC 64 ms
71,328 KB
testcase_15 AC 65 ms
71,384 KB
testcase_16 AC 64 ms
71,128 KB
testcase_17 AC 62 ms
71,352 KB
testcase_18 AC 63 ms
71,444 KB
testcase_19 AC 63 ms
71,196 KB
権限があれば一括ダウンロードができます

ソースコード

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