結果

問題 No.1593 Perfect Distance
ユーザー NSNS
提出日時 2021-07-10 12:02:49
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 144 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 107,084 KB
最終ジャッジ日時 2023-09-14 18:50:37
合計ジャッジ時間 2,927 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,308 KB
testcase_01 AC 72 ms
70,920 KB
testcase_02 AC 72 ms
71,208 KB
testcase_03 AC 71 ms
71,212 KB
testcase_04 AC 71 ms
71,104 KB
testcase_05 AC 71 ms
71,148 KB
testcase_06 AC 72 ms
71,308 KB
testcase_07 AC 71 ms
71,360 KB
testcase_08 AC 73 ms
71,356 KB
testcase_09 AC 81 ms
76,180 KB
testcase_10 AC 82 ms
78,584 KB
testcase_11 AC 86 ms
82,480 KB
testcase_12 AC 91 ms
87,336 KB
testcase_13 AC 93 ms
87,424 KB
testcase_14 AC 97 ms
90,260 KB
testcase_15 AC 110 ms
96,676 KB
testcase_16 AC 119 ms
107,084 KB
testcase_17 AC 73 ms
71,304 KB
testcase_18 AC 71 ms
71,376 KB
testcase_19 AC 73 ms
71,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
st=set()
for i in range(1,n+1):
    st.add(i**2)

ans=0
for x in range(1,n+1):
    y2=n**2-x**2
    if y2 in st:ans+=1
print(ans)
0