結果

問題 No.396 クラス替え
ユーザー O2MTO2MT
提出日時 2020-08-16 17:35:41
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 8,100 KB
最終ジャッジ日時 2023-08-01 19:20:56
合計ジャッジ時間 1,324 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,892 KB
testcase_01 AC 17 ms
7,992 KB
testcase_02 AC 18 ms
7,848 KB
testcase_03 AC 16 ms
7,900 KB
testcase_04 AC 16 ms
7,904 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 16 ms
7,924 KB
testcase_08 AC 16 ms
7,932 KB
testcase_09 AC 16 ms
7,820 KB
testcase_10 AC 16 ms
7,852 KB
testcase_11 AC 16 ms
7,824 KB
testcase_12 WA -
testcase_13 AC 16 ms
7,924 KB
testcase_14 AC 16 ms
7,868 KB
testcase_15 AC 17 ms
8,000 KB
testcase_16 AC 18 ms
7,876 KB
testcase_17 AC 16 ms
7,892 KB
testcase_18 AC 16 ms
7,892 KB
testcase_19 AC 16 ms
7,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import ceil
N,M = map(int,input().split())
X,Y = map(int,input().split())

MX,MY = ceil(X/M),ceil(Y/M)
ans = "NO"

if MX%2 == MY%2 == 0:
  if X%M == Y%M:
    ans = "YES"
elif MX%2 != 0 and MY%2 != 0:
  if X%M == Y%M:
    ans = "YES"
else:
  if X+1 == Y:
    ans = "YES"
  elif X%M == (Y+1)%M:
    ans = "YES"

print(ans)
0