結果

問題 No.800 四平方定理
ユーザー pluto77pluto77
提出日時 2019-11-01 09:17:53
言語 PyPy2
(7.3.13)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 1,528 ms
コンパイル使用メモリ 77,660 KB
実行使用メモリ 141,516 KB
最終ジャッジ日時 2023-10-13 00:35:46
合計ジャッジ時間 8,851 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
140,896 KB
testcase_01 AC 124 ms
141,048 KB
testcase_02 AC 120 ms
141,116 KB
testcase_03 AC 122 ms
140,984 KB
testcase_04 AC 119 ms
140,940 KB
testcase_05 AC 120 ms
141,224 KB
testcase_06 AC 120 ms
141,264 KB
testcase_07 AC 127 ms
141,140 KB
testcase_08 AC 107 ms
141,180 KB
testcase_09 AC 107 ms
140,944 KB
testcase_10 AC 218 ms
141,240 KB
testcase_11 AC 193 ms
141,052 KB
testcase_12 AC 196 ms
141,292 KB
testcase_13 AC 169 ms
141,304 KB
testcase_14 AC 174 ms
141,460 KB
testcase_15 AC 200 ms
141,352 KB
testcase_16 AC 173 ms
141,056 KB
testcase_17 AC 187 ms
141,272 KB
testcase_18 AC 217 ms
141,284 KB
testcase_19 AC 203 ms
141,404 KB
testcase_20 AC 95 ms
138,932 KB
testcase_21 AC 94 ms
139,124 KB
testcase_22 AC 210 ms
141,188 KB
testcase_23 AC 316 ms
141,288 KB
testcase_24 AC 245 ms
141,332 KB
testcase_25 AC 297 ms
141,288 KB
testcase_26 AC 95 ms
139,076 KB
testcase_27 AC 102 ms
138,656 KB
testcase_28 AC 250 ms
141,184 KB
testcase_29 AC 267 ms
141,284 KB
testcase_30 AC 246 ms
141,516 KB
testcase_31 AC 232 ms
141,312 KB
testcase_32 AC 244 ms
141,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki800

n,d=map(int,raw_input().split())
sq=[i*i for i in range(1,n+1)]
cnt=[0]*8000001
for w in sq:
 for z in sq:
  a=w-z+d
  if a>=1:
   cnt[a]+=1
res=0
for x in sq:
 for y in sq:
  res+=cnt[x+y]
print res
0