結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
73,216 KB
testcase_01 AC 146 ms
73,088 KB
testcase_02 AC 130 ms
73,344 KB
testcase_03 AC 132 ms
73,216 KB
testcase_04 AC 132 ms
73,216 KB
testcase_05 AC 134 ms
73,216 KB
testcase_06 AC 141 ms
73,344 KB
testcase_07 AC 147 ms
73,344 KB
testcase_08 AC 158 ms
73,088 KB
testcase_09 AC 134 ms
73,216 KB
testcase_10 AC 1,023 ms
73,088 KB
testcase_11 AC 1,079 ms
73,216 KB
testcase_12 AC 1,217 ms
73,216 KB
testcase_13 AC 909 ms
73,216 KB
testcase_14 AC 973 ms
73,088 KB
testcase_15 AC 1,142 ms
73,216 KB
testcase_16 AC 979 ms
73,216 KB
testcase_17 AC 955 ms
73,088 KB
testcase_18 AC 1,274 ms
73,216 KB
testcase_19 AC 1,280 ms
73,216 KB
testcase_20 AC 109 ms
73,088 KB
testcase_21 AC 108 ms
73,216 KB
testcase_22 AC 1,174 ms
73,344 KB
testcase_23 TLE -
testcase_24 AC 1,752 ms
73,216 KB
testcase_25 TLE -
testcase_26 AC 116 ms
73,088 KB
testcase_27 AC 118 ms
73,216 KB
testcase_28 AC 1,736 ms
73,216 KB
testcase_29 AC 1,838 ms
73,216 KB
testcase_30 AC 1,672 ms
73,216 KB
testcase_31 AC 1,612 ms
73,088 KB
testcase_32 AC 1,824 ms
73,344 KB
権限があれば一括ダウンロードができます

ソースコード

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 w in v:
    for z in v:
        n=w-z+D
        if n<1: break
        sm+=p[n]
print(sm)
0