結果
| 問題 |
No.48 ロボットの操縦
|
| コンテスト | |
| ユーザー |
match1997
|
| 提出日時 | 2020-08-05 16:07:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 5,000 ms |
| コード長 | 739 bytes |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-09-17 04:55:42 |
| 合計ジャッジ時間 | 1,703 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 |
ソースコード
X = int(input())
Y = int(input())
L = int(input())
def disx(x,L):
if abs(x) % L == 0:
a = abs(x) // L
else:
a = (abs(x) // L)+1
return int(a)
def disy(y,L):
if abs(y) % L == 0:
b = abs(y) // L
else:
b = (abs(y) // L)+1
return int(b)
if X > 0 and Y > 0 :
print( 1 + disx(X,L)+disy(Y,L))
if X > 0 and Y < 0 :
print( 2 + disx(X,L)+disy(Y,L))
if X < 0 and Y > 0:
print( 1 +disx(X,L)+disy(Y,L))
if X < 0 and Y < 0:
print( 2 +disx(X,L)+disy(Y,L))
if X == 0 :
if Y > 0:
print(disy(Y,L))
if Y < 0:
print(2+disy(Y,L))
if Y == 0:
if X != 0 :
print( 1 + disx(X,L))
if X == 0 and Y == 0:
print(0)
match1997