結果

問題 No.800 四平方定理
ユーザー kurimupykurimupy
提出日時 2020-06-16 00:03:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 328 bytes
コンパイル時間 755 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 419,384 KB
最終ジャッジ日時 2023-09-16 10:44:53
合計ジャッジ時間 25,944 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
82,488 KB
testcase_01 AC 132 ms
89,292 KB
testcase_02 AC 120 ms
84,876 KB
testcase_03 AC 123 ms
88,028 KB
testcase_04 AC 120 ms
84,672 KB
testcase_05 AC 121 ms
86,812 KB
testcase_06 AC 133 ms
92,772 KB
testcase_07 AC 128 ms
88,260 KB
testcase_08 AC 133 ms
92,772 KB
testcase_09 AC 128 ms
89,772 KB
testcase_10 AC 1,092 ms
280,944 KB
testcase_11 AC 1,230 ms
272,832 KB
testcase_12 AC 1,219 ms
274,404 KB
testcase_13 AC 1,110 ms
276,188 KB
testcase_14 AC 1,201 ms
272,824 KB
testcase_15 AC 1,216 ms
276,704 KB
testcase_16 AC 1,235 ms
272,980 KB
testcase_17 AC 1,253 ms
272,740 KB
testcase_18 AC 1,210 ms
273,088 KB
testcase_19 AC 1,244 ms
272,800 KB
testcase_20 AC 88 ms
71,860 KB
testcase_21 AC 88 ms
71,632 KB
testcase_22 AC 1,224 ms
272,880 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 88 ms
71,556 KB
testcase_27 AC 89 ms
71,576 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#4平方定理
N,D=map(int,input().split())
from collections import defaultdict
d=defaultdict(int)
e=defaultdict(int)
for i in range(1,N+1):
    for j in range(1,N+1):
        d[i**2+j**2]+=1
for i in range(1,N+1):
    for j in range(1,N+1):
        e[i**2-j**2+D]+=1
ans=0
for key in d.keys():
    ans+=d[key]*e[key]
print(ans)
0