結果

問題 No.1593 Perfect Distance
ユーザー PSL24251284PSL24251284
提出日時 2021-07-10 18:08:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 182 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,884 KB
実行使用メモリ 142,972 KB
最終ジャッジ日時 2023-09-14 19:46:47
合計ジャッジ時間 3,565 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,632 KB
testcase_01 AC 89 ms
71,612 KB
testcase_02 AC 87 ms
71,384 KB
testcase_03 AC 92 ms
71,524 KB
testcase_04 AC 87 ms
71,284 KB
testcase_05 AC 89 ms
71,600 KB
testcase_06 AC 88 ms
71,272 KB
testcase_07 AC 87 ms
71,360 KB
testcase_08 AC 88 ms
71,516 KB
testcase_09 AC 112 ms
78,504 KB
testcase_10 AC 107 ms
85,044 KB
testcase_11 AC 114 ms
90,136 KB
testcase_12 AC 129 ms
100,268 KB
testcase_13 AC 130 ms
100,052 KB
testcase_14 AC 140 ms
108,644 KB
testcase_15 AC 160 ms
121,128 KB
testcase_16 AC 182 ms
142,972 KB
testcase_17 AC 90 ms
71,592 KB
testcase_18 AC 92 ms
71,664 KB
testcase_19 AC 91 ms
71,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())
d = defaultdict(lambda:False)
for i in range(1,N+1):
    d[i**2] = True
ans = 0
for x in range(1,N+1):
    if d[N**2-x**2]:
        ans += 1
print(ans)
0