結果

問題 No.800 四平方定理
ユーザー hanamihanami
提出日時 2019-04-09 20:00:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 313 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 10,584 KB
実行使用メモリ 78,512 KB
最終ジャッジ日時 2023-09-18 01:59:26
合計ジャッジ時間 33,823 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
8,660 KB
testcase_01 AC 47 ms
9,008 KB
testcase_02 AC 38 ms
8,736 KB
testcase_03 AC 41 ms
9,008 KB
testcase_04 AC 37 ms
8,780 KB
testcase_05 AC 40 ms
9,040 KB
testcase_06 AC 53 ms
9,304 KB
testcase_07 AC 49 ms
9,896 KB
testcase_08 AC 59 ms
11,532 KB
testcase_09 AC 51 ms
9,272 KB
testcase_10 AC 1,096 ms
42,512 KB
testcase_11 AC 1,251 ms
44,620 KB
testcase_12 AC 1,236 ms
46,704 KB
testcase_13 AC 1,152 ms
40,380 KB
testcase_14 AC 1,194 ms
42,868 KB
testcase_15 AC 1,279 ms
46,572 KB
testcase_16 AC 1,233 ms
43,216 KB
testcase_17 AC 1,195 ms
43,172 KB
testcase_18 AC 1,357 ms
51,020 KB
testcase_19 AC 1,369 ms
51,092 KB
testcase_20 AC 15 ms
7,836 KB
testcase_21 AC 16 ms
7,888 KB
testcase_22 AC 1,350 ms
51,072 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 15 ms
7,776 KB
testcase_27 AC 27 ms
15,700 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
zw_list=[0]*(2*N**2+D+1)
ans=0
p_list=[]
for i in range(1,N+1):
    p_list.append(i**2)
for z in p_list:
    for w in p_list:
        cal=D-z+w
        if cal>0:
            zw_list[cal]+=1            
for x in p_list:
    for y in p_list:
        ans+=zw_list[x+y]
print(ans)       
0