結果

問題 No.1593 Perfect Distance
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-07-09 21:25:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 107,312 KB
最終ジャッジ日時 2023-09-14 07:38:38
合計ジャッジ時間 2,878 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,472 KB
testcase_01 AC 70 ms
71,632 KB
testcase_02 AC 71 ms
71,544 KB
testcase_03 AC 71 ms
71,404 KB
testcase_04 AC 71 ms
71,576 KB
testcase_05 AC 73 ms
71,316 KB
testcase_06 AC 71 ms
71,508 KB
testcase_07 AC 71 ms
71,436 KB
testcase_08 AC 71 ms
71,480 KB
testcase_09 AC 79 ms
76,404 KB
testcase_10 AC 81 ms
78,888 KB
testcase_11 AC 86 ms
82,640 KB
testcase_12 AC 90 ms
87,412 KB
testcase_13 AC 91 ms
87,536 KB
testcase_14 AC 95 ms
90,412 KB
testcase_15 AC 105 ms
96,704 KB
testcase_16 AC 116 ms
107,312 KB
testcase_17 AC 69 ms
71,380 KB
testcase_18 AC 70 ms
71,456 KB
testcase_19 AC 69 ms
71,300 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