結果
問題 | No.172 UFOを捕まえろ |
ユーザー | aka_satana_ha |
提出日時 | 2017-11-25 16:23:10 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 425 bytes |
コンパイル時間 | 96 ms |
コンパイル使用メモリ | 10,884 KB |
実行使用メモリ | 8,088 KB |
最終ジャッジ日時 | 2023-08-18 06:36:02 |
合計ジャッジ時間 | 2,110 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 17 ms
7,884 KB |
testcase_01 | AC | 18 ms
7,948 KB |
testcase_02 | AC | 17 ms
7,776 KB |
testcase_03 | AC | 17 ms
7,924 KB |
testcase_04 | WA | - |
testcase_05 | AC | 16 ms
7,876 KB |
testcase_06 | AC | 17 ms
7,856 KB |
testcase_07 | AC | 17 ms
7,892 KB |
testcase_08 | AC | 17 ms
7,968 KB |
testcase_09 | AC | 16 ms
7,860 KB |
testcase_10 | WA | - |
testcase_11 | AC | 16 ms
7,840 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 17 ms
7,920 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 17 ms
7,876 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 16 ms
7,892 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
ソースコード
import math x,y,r = [int(i) for i in input().split()] x_sign = -1 if(x<0) else 1 y_sign = -1 if(y<0) else 1 if x==0 and y!=0 : x_max = 0 y_max = y+r elif x!=0 and y==0 : x_max = x+r y_max = 0 elif x==0 and y==0 : x_max = r/math.sqrt(2) y_max = x_max else: x_max = x+r/(math.sqrt(1+(y*1.0/x)**2))*x_sign y_max = y+r/(math.sqrt(1+(x*1.0/y)**2))*y_sign print(math.ceil(abs(x_max)+abs(y_max)))