結果

問題 No.1593 Perfect Distance
ユーザー KudeKude
提出日時 2021-07-09 21:23:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 169 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 107,244 KB
最終ジャッジ日時 2023-09-14 07:30:32
合計ジャッジ時間 2,856 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,300 KB
testcase_01 AC 71 ms
71,300 KB
testcase_02 AC 69 ms
71,392 KB
testcase_03 AC 70 ms
71,184 KB
testcase_04 AC 73 ms
70,976 KB
testcase_05 AC 70 ms
71,308 KB
testcase_06 AC 70 ms
71,388 KB
testcase_07 AC 70 ms
70,936 KB
testcase_08 AC 70 ms
71,364 KB
testcase_09 AC 76 ms
76,184 KB
testcase_10 AC 78 ms
78,980 KB
testcase_11 AC 84 ms
82,300 KB
testcase_12 AC 91 ms
87,400 KB
testcase_13 AC 94 ms
87,220 KB
testcase_14 AC 93 ms
90,356 KB
testcase_15 AC 104 ms
96,184 KB
testcase_16 AC 113 ms
107,244 KB
testcase_17 AC 68 ms
71,304 KB
testcase_18 AC 75 ms
71,344 KB
testcase_19 AC 70 ms
71,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
n2 = n ** 2
ans = 0
sqs = set()
for i in range(1, n + 1):
    sqs.add(i * i)
for x in range(1, n + 1):
    r = n2 - x * x
    ans += r in sqs
print(ans)
0