結果
問題 | No.48 ロボットの操縦 |
ユーザー |
|
提出日時 | 2016-10-23 20:36:16 |
言語 | Python2 (2.7.18) |
結果 |
AC
|
実行時間 | 13 ms / 5,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 326 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2024-11-24 02:06:33 |
合計ジャッジ時間 | 1,359 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 |
ソースコード
X, Y, L = int(raw_input()), int(raw_input()), int(raw_input())order = 0currentPosition = (0, 0)def countTurn(x, y):global orderif currentPosition == (x, y):order = 0else:if x == 0 and y > 0:order = 0else:if y >= 0:order += 1else:order += 2def countMoveFoward(n):global ordern = abs(n)if n != 0:if n <= L:order += 1else:if n % L == 0:order += n/Lelse:order += n/L + 1passcountTurn(X, Y)countMoveFoward(X)countMoveFoward(Y)print order