結果

問題 No.800 四平方定理
ユーザー lumeffluxlumefflux
提出日時 2019-03-17 23:51:01
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
TLE  
実行時間 -
コード長 264 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 70,736 KB
最終ジャッジ日時 2023-09-22 15:51:45
合計ジャッジ時間 32,889 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
70,320 KB
testcase_01 AC 127 ms
70,296 KB
testcase_02 AC 117 ms
70,548 KB
testcase_03 AC 119 ms
70,504 KB
testcase_04 AC 118 ms
70,364 KB
testcase_05 AC 119 ms
70,388 KB
testcase_06 AC 132 ms
70,436 KB
testcase_07 AC 124 ms
70,360 KB
testcase_08 AC 132 ms
70,280 KB
testcase_09 AC 126 ms
70,384 KB
testcase_10 AC 1,089 ms
70,628 KB
testcase_11 AC 1,182 ms
70,436 KB
testcase_12 AC 1,212 ms
70,488 KB
testcase_13 AC 1,043 ms
70,564 KB
testcase_14 AC 1,123 ms
70,460 KB
testcase_15 AC 1,205 ms
70,512 KB
testcase_16 AC 1,134 ms
70,552 KB
testcase_17 AC 1,198 ms
70,412 KB
testcase_18 AC 1,259 ms
70,368 KB
testcase_19 AC 1,282 ms
70,488 KB
testcase_20 AC 96 ms
70,488 KB
testcase_21 AC 95 ms
70,516 KB
testcase_22 AC 1,278 ms
70,428 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 96 ms
70,352 KB
testcase_27 AC 96 ms
70,372 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,867 ms
70,736 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, D = map(int, input().split())
p = []
c = [0] * 8000001
for i in range(1, N + 1):
    p.append(i**2)
for i in p:
    for j in p:
        s = i - j + D
        if s >= 1:
            c[s] += 1
res = 0
for i in p:
    for j in p:
        res += c[i + j]
print(res)
0