結果

問題 No.800 四平方定理
ユーザー MShinyaMShinya
提出日時 2019-03-18 01:06:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 254 bytes
コンパイル時間 1,160 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 70,688 KB
最終ジャッジ日時 2023-09-22 16:23:38
合計ジャッジ時間 33,999 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
70,412 KB
testcase_01 AC 124 ms
70,428 KB
testcase_02 AC 118 ms
70,404 KB
testcase_03 AC 122 ms
70,396 KB
testcase_04 AC 116 ms
70,492 KB
testcase_05 AC 120 ms
70,332 KB
testcase_06 AC 136 ms
70,404 KB
testcase_07 AC 128 ms
70,388 KB
testcase_08 AC 135 ms
70,548 KB
testcase_09 AC 127 ms
70,364 KB
testcase_10 AC 1,130 ms
70,440 KB
testcase_11 AC 1,249 ms
70,632 KB
testcase_12 AC 1,275 ms
70,388 KB
testcase_13 AC 1,075 ms
70,412 KB
testcase_14 AC 1,226 ms
70,628 KB
testcase_15 AC 1,280 ms
70,504 KB
testcase_16 AC 1,221 ms
70,428 KB
testcase_17 AC 1,178 ms
70,536 KB
testcase_18 AC 1,383 ms
70,492 KB
testcase_19 AC 1,314 ms
70,436 KB
testcase_20 AC 96 ms
70,484 KB
testcase_21 AC 95 ms
70,476 KB
testcase_22 AC 1,373 ms
70,556 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 96 ms
70,432 KB
testcase_27 AC 96 ms
70,416 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,943 ms
70,488 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, D = map(int, input().split())
P = [i * i for i in range(1, N + 1)]
A = [0] * 8000001
for i in P:
    for j in P:
        tmp = i - j + D
        if tmp > 0:
            A[tmp] += 1
ans = 0
for i in P:
    for j in P:
        ans += A[i + j]
print(ans)
0