結果

問題 No.396 クラス替え
ユーザー wotsushiwotsushi
提出日時 2016-12-17 14:55:47
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 11,352 KB
実行使用メモリ 15,380 KB
最終ジャッジ日時 2023-08-20 21:49:36
合計ジャッジ時間 3,166 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,300 KB
testcase_01 AC 80 ms
15,344 KB
testcase_02 AC 80 ms
15,056 KB
testcase_03 AC 79 ms
15,048 KB
testcase_04 AC 79 ms
15,084 KB
testcase_05 AC 79 ms
15,240 KB
testcase_06 AC 80 ms
15,156 KB
testcase_07 WA -
testcase_08 AC 80 ms
15,128 KB
testcase_09 WA -
testcase_10 AC 80 ms
15,040 KB
testcase_11 AC 80 ms
15,380 KB
testcase_12 AC 81 ms
15,296 KB
testcase_13 AC 79 ms
15,044 KB
testcase_14 AC 79 ms
15,248 KB
testcase_15 AC 79 ms
15,344 KB
testcase_16 AC 78 ms
15,100 KB
testcase_17 AC 79 ms
15,248 KB
testcase_18 WA -
testcase_19 AC 80 ms
15,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N, M = gets.split.map(&:to_i)
X, Y = gets.split.map(&:to_i)
x, y = [X, Y].map {|a|
  b = a % (2 * M)
  if b <= M
    b
  else
    (2 * M + 1) - b
  end
}
ans = if x == y
        "YES"
      else
        "NO"
      end
puts ans
0