結果
問題 |
No.48 ロボットの操縦
|
ユーザー |
|
提出日時 | 2025-08-31 08:39:03 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 745 bytes |
コンパイル時間 | 496 ms |
コンパイル使用メモリ | 8,192 KB |
実行使用メモリ | 13,184 KB |
最終ジャッジ日時 | 2025-08-31 08:39:08 |
合計ジャッジ時間 | 3,363 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 12 |
コンパイルメッセージ
Syntax OK
ソースコード
x=gets.to_i y=gets.to_i distance=gets.to_f order=0 if x == 0 && y == 0 puts order elsif y == 0 && x > 0 order += 1 puts order + (x / distance).ceil elsif y == 0 && x < 0 order += 1 puts order + (x.abs / distance).ceil elsif x == 0 && y > 0 puts order + (y / distance).ceil elsif x == 0 && y < 0 order += 2 puts order + (y.abs / distance).ceil elsif x > 0 && y > 0 order += 1 puts order + (x / distance).ceil + (y / distance).ceil elsif x < 0 && y > 0 order += 2 puts order + (x.abs / distance).ceil + (y / distance).ceil elsif x < 0 && y < 0 order += 2 puts order + (x.abs / distance).ceil + (y.abs / distance).ceil elsif x > 0 && y < 0 order += 2 puts order + (x / distance).ceil + (y.abs / distance).ceil end