結果

問題 No.800 四平方定理
ユーザー hanamihanami
提出日時 2019-04-09 19:22:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 345 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 39,900 KB
最終ジャッジ日時 2023-09-17 22:58:34
合計ジャッジ時間 6,321 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 185 ms
35,536 KB
testcase_01 AC 232 ms
33,068 KB
testcase_02 AC 200 ms
31,944 KB
testcase_03 AC 209 ms
32,344 KB
testcase_04 AC 202 ms
31,940 KB
testcase_05 AC 212 ms
32,292 KB
testcase_06 AC 248 ms
33,552 KB
testcase_07 AC 251 ms
34,788 KB
testcase_08 AC 313 ms
39,900 KB
testcase_09 AC 235 ms
33,112 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
import numpy as np
xy_list=np.array([0]*(2*N**2+D+1))
zw_list=np.array([0]*(2*N**2+D+1))
for x in range(1,N+1):
    for y in range(1,N+1):
        xy_list[x**2+y**2]+=1
for z in range(1,N+1):
    for w in range(1,N+1):
        cal=D-z**2+w**2
        if cal>0:
            zw_list[cal]+=1
print(sum(xy_list*zw_list))
0