結果

問題 No.800 四平方定理
ユーザー hanami
提出日時 2019-04-09 20:03:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 229 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 73,344 KB
最終ジャッジ日時 2024-07-04 19:01:17
合計ジャッジ時間 35,619 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 TLE * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
zw_list=[0]*8000001
ans=0
p_list=[]
for i in range(1,N+1):
    p_list.append(i*i)
for z in p_list:
    for w in p_list:
        cal=D-z+w
        if cal>0:
            zw_list[cal]+=1            
for x in p_list:
    for y in p_list:
        ans+=zw_list[x+y]
print(ans)       
0