結果

問題 No.1593 Perfect Distance
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-07-09 21:25:18
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 267 ms
使用メモリ 111,972 KB
最終ジャッジ日時 2023-02-01 21:57:10
合計ジャッジ時間 3,384 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 82 ms
75,732 KB
testcase_01 AC 81 ms
75,696 KB
testcase_02 AC 81 ms
75,780 KB
testcase_03 AC 81 ms
75,744 KB
testcase_04 AC 81 ms
75,472 KB
testcase_05 AC 81 ms
75,820 KB
testcase_06 AC 82 ms
75,540 KB
testcase_07 AC 83 ms
75,436 KB
testcase_08 AC 82 ms
75,644 KB
testcase_09 AC 89 ms
80,780 KB
testcase_10 AC 90 ms
83,472 KB
testcase_11 AC 95 ms
86,772 KB
testcase_12 AC 101 ms
92,196 KB
testcase_13 AC 101 ms
92,052 KB
testcase_14 AC 104 ms
94,976 KB
testcase_15 AC 116 ms
101,204 KB
testcase_16 AC 126 ms
111,972 KB
testcase_17 AC 82 ms
75,744 KB
testcase_18 AC 81 ms
75,680 KB
testcase_19 AC 79 ms
75,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
h=set()
i=1
while i<=n:
    h.add(i**2)
    i+=1

ans=0
x=1
while x<=n:
    y2=n**2-x**2
    if y2 in h:ans+=1
    x+=1

print(ans)
0