結果

問題 No.1593 Perfect Distance
ユーザー 👑 H20H20
提出日時 2021-07-09 21:42:36
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 186 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 143,220 KB
最終ジャッジ日時 2023-09-14 08:15:06
合計ジャッジ時間 3,595 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,484 KB
testcase_01 AC 89 ms
71,556 KB
testcase_02 AC 88 ms
71,680 KB
testcase_03 AC 88 ms
71,876 KB
testcase_04 AC 89 ms
71,720 KB
testcase_05 AC 93 ms
71,800 KB
testcase_06 AC 89 ms
71,844 KB
testcase_07 AC 88 ms
71,748 KB
testcase_08 AC 91 ms
71,392 KB
testcase_09 AC 100 ms
78,932 KB
testcase_10 AC 106 ms
85,336 KB
testcase_11 AC 117 ms
90,168 KB
testcase_12 AC 126 ms
100,612 KB
testcase_13 AC 128 ms
100,728 KB
testcase_14 AC 137 ms
108,708 KB
testcase_15 AC 153 ms
121,016 KB
testcase_16 AC 184 ms
143,220 KB
testcase_17 AC 90 ms
71,668 KB
testcase_18 AC 89 ms
71,540 KB
testcase_19 AC 92 ms
71,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

d = collections.defaultdict(int)
N = int(input())
i = 1
while i<N:
    d[i**2]=1
    i+=1
ans=0
for i in range(N+1):
    if d[N**2-i**2]==1:
        ans+=1
print(ans)
0