結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-14 01:21:03 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 5,000 ms |
| コード長 | 248 bytes |
| コンパイル時間 | 319 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-07-23 01:35:01 |
| 合計ジャッジ時間 | 3,641 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
x = gets.chomp!.to_i.abs y = gets.chomp!.to_i l = gets.chomp!.to_i inst = x / l inst += 1 if x % l > 0 inst += y.abs / l inst += 1 if y.abs % l > 0 inst += 1 if x != 0 && y >= 0 inst += 2 if x == 0 && y < 0 inst += 2 if x != 0 && y < 0 puts inst