結果

問題 No.800 四平方定理
ユーザー pluto77pluto77
提出日時 2019-11-01 09:17:12
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,792 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 6,732 KB
実行使用メモリ 68,488 KB
最終ジャッジ日時 2023-10-13 00:20:46
合計ジャッジ時間 28,484 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
68,296 KB
testcase_01 AC 121 ms
68,264 KB
testcase_02 AC 115 ms
68,068 KB
testcase_03 AC 115 ms
68,372 KB
testcase_04 AC 114 ms
68,104 KB
testcase_05 AC 116 ms
68,288 KB
testcase_06 AC 125 ms
68,244 KB
testcase_07 AC 122 ms
68,480 KB
testcase_08 AC 130 ms
68,352 KB
testcase_09 AC 122 ms
68,300 KB
testcase_10 AC 913 ms
68,292 KB
testcase_11 AC 973 ms
68,428 KB
testcase_12 AC 994 ms
68,432 KB
testcase_13 AC 877 ms
68,364 KB
testcase_14 AC 923 ms
68,376 KB
testcase_15 AC 996 ms
68,388 KB
testcase_16 AC 942 ms
68,124 KB
testcase_17 AC 940 ms
68,432 KB
testcase_18 AC 1,056 ms
68,336 KB
testcase_19 AC 1,059 ms
68,452 KB
testcase_20 AC 101 ms
68,176 KB
testcase_21 AC 99 ms
68,388 KB
testcase_22 AC 1,056 ms
68,392 KB
testcase_23 AC 1,785 ms
68,400 KB
testcase_24 AC 1,630 ms
68,240 KB
testcase_25 AC 1,792 ms
68,488 KB
testcase_26 AC 101 ms
68,120 KB
testcase_27 AC 100 ms
68,456 KB
testcase_28 AC 1,631 ms
68,468 KB
testcase_29 AC 1,725 ms
68,364 KB
testcase_30 AC 1,635 ms
68,476 KB
testcase_31 AC 1,512 ms
68,380 KB
testcase_32 AC 1,647 ms
68,404 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