結果

問題 No.800 四平方定理
コンテスト
ユーザー pluto77
提出日時 2019-03-24 14:45:44
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 134 ms / 2,000 ms
+ 461µs
コード長 213 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 58 ms
コンパイル使用メモリ 81,404 KB
実行使用メモリ 145,024 KB
最終ジャッジ日時 2026-07-18 18:53:30
合計ジャッジ時間 4,847 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#yuki800

n,d=map(int,raw_input().split())
t=[]
u=[0]*8000001
for i in xrange(1,n+1):
 t.append(i*i)
for i in t:
 for j in t:
  s=i-j+d
  if s>=1:
   u[s]+=1
res=0
for i in t:
 for j in t:
  res+=u[i+j]
print res
0