結果
問題 | No.126 2基のエレベータ |
ユーザー |
![]() |
提出日時 | 2015-03-31 00:22:09 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 227 bytes |
コンパイル時間 | 116 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-07-03 22:59:25 |
合計ジャッジ時間 | 3,558 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 9 |
コンパイルメッセージ
Syntax OK
ソースコード
class Yukicoder def initialize a, b, s = gets.chomp.split(' ').map(&:to_i) route1 = (s - a).abs + s route2 = (s - b).abs + (s - a) + a + ((a.zero?) ? 1 : 0) puts [route1, route2].min end end Yukicoder.new