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