結果

問題 No.800 四平方定理
ユーザー _matumo__matumo_
提出日時 2020-08-25 17:57:53
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 220 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 73,344 KB
最終ジャッジ日時 2024-04-24 04:42:33
合計ジャッジ時間 34,536 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
73,216 KB
testcase_01 AC 159 ms
73,216 KB
testcase_02 AC 143 ms
73,216 KB
testcase_03 AC 146 ms
73,344 KB
testcase_04 AC 146 ms
73,344 KB
testcase_05 AC 149 ms
73,216 KB
testcase_06 AC 156 ms
73,216 KB
testcase_07 AC 160 ms
73,088 KB
testcase_08 AC 171 ms
73,088 KB
testcase_09 AC 152 ms
73,216 KB
testcase_10 AC 1,191 ms
73,088 KB
testcase_11 AC 1,244 ms
73,088 KB
testcase_12 AC 1,358 ms
73,088 KB
testcase_13 AC 1,051 ms
73,088 KB
testcase_14 AC 1,129 ms
73,216 KB
testcase_15 AC 1,379 ms
73,088 KB
testcase_16 AC 1,135 ms
73,216 KB
testcase_17 AC 1,140 ms
73,216 KB
testcase_18 AC 1,483 ms
73,216 KB
testcase_19 AC 1,519 ms
73,216 KB
testcase_20 AC 123 ms
73,216 KB
testcase_21 AC 124 ms
73,088 KB
testcase_22 AC 1,525 ms
73,216 KB
testcase_23 TLE -
testcase_24 AC 1,967 ms
73,344 KB
testcase_25 TLE -
testcase_26 AC 124 ms
73,216 KB
testcase_27 AC 127 ms
73,088 KB
testcase_28 AC 1,985 ms
73,216 KB
testcase_29 TLE -
testcase_30 AC 1,966 ms
73,216 KB
testcase_31 AC 1,866 ms
73,216 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
v=list(n*n for n in range(1,N+1))
p=[0]*8000001
for x in v:
    for y in v:
        p[x+y]+=1
sm=0
for w in v:
    for z in v:
        n=w-z+D
        if n<1: break
        sm+=p[n]
print(sm)
0