結果

問題 No.1593 Perfect Distance
ユーザー 8989
提出日時 2022-02-21 00:57:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 87,164 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2023-09-11 21:13:26
合計ジャッジ時間 3,327 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,188 KB
testcase_01 AC 79 ms
71,204 KB
testcase_02 AC 76 ms
71,448 KB
testcase_03 AC 75 ms
71,368 KB
testcase_04 AC 74 ms
71,452 KB
testcase_05 AC 75 ms
71,392 KB
testcase_06 AC 74 ms
71,328 KB
testcase_07 AC 74 ms
71,632 KB
testcase_08 AC 77 ms
71,532 KB
testcase_09 AC 91 ms
76,336 KB
testcase_10 AC 80 ms
76,484 KB
testcase_11 AC 83 ms
76,504 KB
testcase_12 AC 83 ms
76,460 KB
testcase_13 AC 82 ms
76,624 KB
testcase_14 AC 84 ms
76,588 KB
testcase_15 AC 85 ms
76,628 KB
testcase_16 AC 81 ms
76,560 KB
testcase_17 AC 73 ms
71,636 KB
testcase_18 AC 73 ms
71,368 KB
testcase_19 AC 74 ms
71,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
import math
res = 0
eps = 0.0000001
for i in range(1,n):
    #print(math.sqrt(n**2 - i**2))
    if abs(math.sqrt(n**2 - i**2) - math.floor(math.sqrt(n**2 - i**2))) < eps:
        res += 1
print(res)
0