結果
| 問題 | No.48 ロボットの操縦 |
| コンテスト | |
| ユーザー |
urutom
|
| 提出日時 | 2016-04-12 23:38:25 |
| 言語 | Ruby (3.4.1) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 5,000 ms |
| コード長 | 195 bytes |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 7,424 KB |
| 実行使用メモリ | 12,288 KB |
| 最終ジャッジ日時 | 2024-11-21 18:37:11 |
| 合計ジャッジ時間 | 3,327 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
コンパイルメッセージ
Syntax OK
ソースコード
x,y,l=3.times.map{gets.to_i}
ans=rot=0
if y>0
ans+=y/l
ans+=1 if y%l>0
end
if x!=0
rot=1
x=x.abs
ans+=x/l
ans+=1 if x%l>0
end
if y<0
rot=2
y=y.abs
ans+=y/l
ans+=1 if y%l>0
end
p ans+rot
urutom