結果
| 問題 | No.396 クラス替え |
| コンテスト | |
| ユーザー |
hirakich1048576
|
| 提出日時 | 2016-07-15 22:56:42 |
| 言語 | Ruby (4.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 292 bytes |
| 記録 | |
| コンパイル時間 | 62 ms |
| コンパイル使用メモリ | 9,088 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-05-02 23:08:41 |
| 合計ジャッジ時間 | 2,147 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 WA * 8 |
コンパイルメッセージ
Syntax OK
ソースコード
$n, $m = gets.chomp.split(' ').map{|i| i.to_i(10)}
$x, $y = gets.chomp.split(' ').map{|i| i.to_i(10)}
def find_class (x, m, n)
x -= 1
d = (x / m) & 1
if d == 0 then
(x % m) + 1
else
n - (x % m)
end
end
if find_class($x, $m, $n) == find_class($y, $m, $n) then
puts "YES"
else
puts "NO"
end
hirakich1048576