結果

問題 No.1593 Perfect Distance
ユーザー aqua_tenhouaqua_tenhou
提出日時 2021-07-09 21:27:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 77,240 KB
最終ジャッジ日時 2023-09-14 07:44:21
合計ジャッジ時間 2,798 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,016 KB
testcase_01 AC 69 ms
71,284 KB
testcase_02 AC 68 ms
71,588 KB
testcase_03 AC 71 ms
71,596 KB
testcase_04 AC 73 ms
71,700 KB
testcase_05 AC 70 ms
71,696 KB
testcase_06 AC 71 ms
71,528 KB
testcase_07 AC 71 ms
71,476 KB
testcase_08 AC 78 ms
76,992 KB
testcase_09 AC 80 ms
76,828 KB
testcase_10 AC 84 ms
76,864 KB
testcase_11 AC 83 ms
76,832 KB
testcase_12 AC 91 ms
76,692 KB
testcase_13 AC 90 ms
76,792 KB
testcase_14 AC 92 ms
76,620 KB
testcase_15 AC 95 ms
76,708 KB
testcase_16 AC 103 ms
77,240 KB
testcase_17 AC 68 ms
71,392 KB
testcase_18 AC 69 ms
71,540 KB
testcase_19 AC 67 ms
71,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = 0
for i in range(1, n):
    y = n**2 - i**2
    k = int(pow(y,0.5))
    for j in range(-1,2):
        if (k+j)**2 + i**2 == n**2:
            ans += 1
            break
print(ans)

0