結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-12-14 01:27:52 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 95 ms / 5,000 ms |
| コード長 | 209 bytes |
| コンパイル時間 | 309 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-07-23 01:36:59 |
| 合計ジャッジ時間 | 3,423 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 y < 0 puts inst