結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 147 ms
73,216 KB
testcase_01 AC 163 ms
73,088 KB
testcase_02 AC 153 ms
73,216 KB
testcase_03 AC 154 ms
73,088 KB
testcase_04 AC 150 ms
73,344 KB
testcase_05 AC 152 ms
73,344 KB
testcase_06 AC 169 ms
73,088 KB
testcase_07 AC 161 ms
73,216 KB
testcase_08 AC 175 ms
73,216 KB
testcase_09 AC 162 ms
73,344 KB
testcase_10 AC 1,348 ms
73,216 KB
testcase_11 AC 1,472 ms
73,216 KB
testcase_12 AC 1,492 ms
73,216 KB
testcase_13 AC 1,278 ms
73,088 KB
testcase_14 AC 1,386 ms
73,344 KB
testcase_15 AC 1,538 ms
73,216 KB
testcase_16 AC 1,438 ms
73,216 KB
testcase_17 AC 1,412 ms
73,088 KB
testcase_18 AC 1,534 ms
73,216 KB
testcase_19 AC 1,557 ms
73,088 KB
testcase_20 AC 123 ms
73,088 KB
testcase_21 AC 124 ms
73,216 KB
testcase_22 AC 1,536 ms
73,088 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 128 ms
73,216 KB
testcase_27 AC 125 ms
73,216 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D=map(int,input().split())
v=[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 z in v:
    for w in v:
        n=w-z+D
        if n>0: sm+=p[n]
print(sm)
0