結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
73,216 KB
testcase_01 AC 145 ms
73,216 KB
testcase_02 AC 136 ms
73,216 KB
testcase_03 AC 137 ms
73,216 KB
testcase_04 AC 136 ms
73,216 KB
testcase_05 AC 138 ms
73,216 KB
testcase_06 AC 151 ms
73,344 KB
testcase_07 AC 143 ms
73,216 KB
testcase_08 AC 154 ms
73,216 KB
testcase_09 AC 143 ms
73,216 KB
testcase_10 AC 1,191 ms
73,216 KB
testcase_11 AC 1,245 ms
73,216 KB
testcase_12 AC 1,352 ms
73,216 KB
testcase_13 AC 1,183 ms
73,216 KB
testcase_14 AC 1,242 ms
73,344 KB
testcase_15 AC 1,287 ms
73,344 KB
testcase_16 AC 1,249 ms
73,216 KB
testcase_17 AC 1,307 ms
73,344 KB
testcase_18 AC 1,351 ms
73,216 KB
testcase_19 AC 1,345 ms
73,216 KB
testcase_20 AC 117 ms
73,216 KB
testcase_21 AC 114 ms
73,216 KB
testcase_22 AC 1,406 ms
73,344 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 109 ms
73,216 KB
testcase_27 AC 111 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=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 z in v:
    for w in v:
        n=w-z+D
        if n>0: sm+=p[n]
print(sm)
0