結果

問題 No.396 クラス替え
ユーザー TANIGUCHI Kousuke
提出日時 2020-02-07 18:49:20
言語 Ruby
(3.4.1)
結果
AC  
実行時間 95 ms / 1,000 ms
コード長 180 bytes
コンパイル時間 39 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-09-25 07:24:54
合計ジャッジ時間 2,708 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def classnum(x)
  m = (x - 1) % (2 * M)
  m < M ? (m + 1) : (2 * M - m)
end
N,M = gets.split.map(&:to_i)
X,Y = gets.split.map(&:to_i)
puts classnum(X) == classnum(Y) ? 'YES' : 'NO'
0