結果

問題 No.1593 Perfect Distance
ユーザー shotoyooshotoyoo
提出日時 2021-07-09 21:23:21
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 1,287 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 76,696 KB
最終ジャッジ日時 2023-09-14 07:28:38
合計ジャッジ時間 3,292 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,024 KB
testcase_01 AC 74 ms
71,764 KB
testcase_02 AC 73 ms
71,588 KB
testcase_03 AC 73 ms
71,428 KB
testcase_04 AC 72 ms
71,680 KB
testcase_05 AC 73 ms
71,592 KB
testcase_06 AC 73 ms
71,648 KB
testcase_07 AC 73 ms
71,328 KB
testcase_08 AC 79 ms
76,088 KB
testcase_09 AC 85 ms
76,564 KB
testcase_10 AC 85 ms
76,668 KB
testcase_11 AC 92 ms
76,376 KB
testcase_12 AC 99 ms
76,348 KB
testcase_13 AC 101 ms
76,284 KB
testcase_14 AC 102 ms
76,636 KB
testcase_15 AC 111 ms
76,696 KB
testcase_16 AC 118 ms
76,472 KB
testcase_17 AC 74 ms
71,708 KB
testcase_18 AC 74 ms
71,688 KB
testcase_19 AC 74 ms
71,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()

sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
writef = lambda x: print("{:.12f}".format(x))

ans = 0
n = int(input())
for x in range(1,2*n+10):
    y = n*n - x*x
    if y>0 and abs(y**0.5 - round(y**0.5))<1e-7:
        ans += 1
print(ans)
0