結果

問題 No.800 四平方定理
ユーザー hanamihanami
提出日時 2019-04-09 20:03:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 132 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 70,760 KB
最終ジャッジ日時 2023-09-18 02:09:35
合計ジャッジ時間 34,471 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
70,440 KB
testcase_01 AC 128 ms
70,420 KB
testcase_02 AC 117 ms
70,328 KB
testcase_03 AC 119 ms
70,368 KB
testcase_04 AC 118 ms
70,360 KB
testcase_05 AC 119 ms
70,352 KB
testcase_06 AC 132 ms
70,548 KB
testcase_07 AC 128 ms
70,440 KB
testcase_08 AC 136 ms
70,520 KB
testcase_09 AC 126 ms
70,444 KB
testcase_10 AC 1,146 ms
70,380 KB
testcase_11 AC 1,271 ms
70,508 KB
testcase_12 AC 1,289 ms
70,376 KB
testcase_13 AC 1,120 ms
70,760 KB
testcase_14 AC 1,248 ms
70,420 KB
testcase_15 AC 1,244 ms
70,684 KB
testcase_16 AC 1,230 ms
70,704 KB
testcase_17 AC 1,235 ms
70,700 KB
testcase_18 AC 1,409 ms
70,528 KB
testcase_19 AC 1,332 ms
70,388 KB
testcase_20 AC 97 ms
70,568 KB
testcase_21 AC 96 ms
70,432 KB
testcase_22 AC 1,344 ms
70,392 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 95 ms
70,332 KB
testcase_27 AC 96 ms
70,488 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]*8000001
ans=0
p_list=[]
for i in range(1,N+1):
    p_list.append(i*i)
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