結果

問題 No.1593 Perfect Distance
ユーザー ShirotsumeShirotsume
提出日時 2021-07-09 21:53:22
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 175 ms / 2,000 ms
コード長 181 bytes
コンパイル時間 64 ms
実行使用メモリ 7,972 KB
最終ジャッジ日時 2023-02-01 23:11:50
合計ジャッジ時間 2,088 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,904 KB
testcase_01 AC 15 ms
7,856 KB
testcase_02 AC 15 ms
7,912 KB
testcase_03 AC 14 ms
7,852 KB
testcase_04 AC 15 ms
7,944 KB
testcase_05 AC 14 ms
7,972 KB
testcase_06 AC 15 ms
7,908 KB
testcase_07 AC 15 ms
7,856 KB
testcase_08 AC 16 ms
7,808 KB
testcase_09 AC 21 ms
7,856 KB
testcase_10 AC 36 ms
7,968 KB
testcase_11 AC 50 ms
7,912 KB
testcase_12 AC 76 ms
7,808 KB
testcase_13 AC 79 ms
7,784 KB
testcase_14 AC 92 ms
7,784 KB
testcase_15 AC 127 ms
7,808 KB
testcase_16 AC 175 ms
7,860 KB
testcase_17 AC 14 ms
7,800 KB
testcase_18 AC 15 ms
7,864 KB
testcase_19 AC 14 ms
7,772 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
for x in range(1, n + 1):
    yy = n * n - x * x
    y = int(yy ** 0.5 + 10 ** (-14))
    if x * x + y * y == n * n and y > 0:
        ans += 1

print(ans)
0