結果

問題 No.800 四平方定理
ユーザー pluto77pluto77
提出日時 2019-03-24 14:45:44
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,908 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 68,916 KB
最終ジャッジ日時 2024-04-10 06:19:40
合計ジャッジ時間 28,538 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
68,688 KB
testcase_01 AC 126 ms
68,564 KB
testcase_02 AC 117 ms
68,708 KB
testcase_03 AC 120 ms
68,784 KB
testcase_04 AC 118 ms
68,696 KB
testcase_05 AC 120 ms
68,644 KB
testcase_06 AC 131 ms
68,564 KB
testcase_07 AC 127 ms
68,788 KB
testcase_08 AC 135 ms
68,680 KB
testcase_09 AC 125 ms
68,680 KB
testcase_10 AC 946 ms
68,828 KB
testcase_11 AC 999 ms
68,684 KB
testcase_12 AC 1,036 ms
68,752 KB
testcase_13 AC 916 ms
68,768 KB
testcase_14 AC 982 ms
68,812 KB
testcase_15 AC 1,078 ms
68,560 KB
testcase_16 AC 947 ms
68,772 KB
testcase_17 AC 961 ms
68,916 KB
testcase_18 AC 1,122 ms
68,844 KB
testcase_19 AC 1,116 ms
68,764 KB
testcase_20 AC 101 ms
68,692 KB
testcase_21 AC 101 ms
68,688 KB
testcase_22 AC 1,095 ms
68,748 KB
testcase_23 AC 1,880 ms
68,696 KB
testcase_24 AC 1,716 ms
68,772 KB
testcase_25 AC 1,908 ms
68,696 KB
testcase_26 AC 102 ms
68,752 KB
testcase_27 AC 102 ms
68,692 KB
testcase_28 AC 1,770 ms
68,796 KB
testcase_29 AC 1,882 ms
68,560 KB
testcase_30 AC 1,689 ms
68,908 KB
testcase_31 AC 1,580 ms
68,692 KB
testcase_32 AC 1,764 ms
68,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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