結果

問題 No.800 四平方定理
ユーザー URechaRechaURechaRecha
提出日時 2019-09-05 17:07:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 226 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 70,720 KB
最終ジャッジ日時 2023-09-02 13:22:21
合計ジャッジ時間 34,915 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
70,492 KB
testcase_01 AC 125 ms
70,320 KB
testcase_02 AC 115 ms
70,544 KB
testcase_03 AC 118 ms
70,400 KB
testcase_04 AC 117 ms
70,452 KB
testcase_05 AC 120 ms
70,524 KB
testcase_06 AC 133 ms
70,492 KB
testcase_07 AC 125 ms
70,412 KB
testcase_08 AC 134 ms
70,532 KB
testcase_09 AC 125 ms
70,400 KB
testcase_10 AC 1,133 ms
70,492 KB
testcase_11 AC 1,276 ms
70,632 KB
testcase_12 AC 1,260 ms
70,592 KB
testcase_13 AC 1,121 ms
70,488 KB
testcase_14 AC 1,191 ms
70,720 KB
testcase_15 AC 1,274 ms
70,716 KB
testcase_16 AC 1,205 ms
70,628 KB
testcase_17 AC 1,201 ms
70,524 KB
testcase_18 AC 1,366 ms
70,476 KB
testcase_19 AC 1,317 ms
70,428 KB
testcase_20 AC 96 ms
70,484 KB
testcase_21 AC 96 ms
70,420 KB
testcase_22 AC 1,314 ms
70,384 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 97 ms
70,468 KB
testcase_27 AC 96 ms
70,352 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 1,972 ms
70,424 KB
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,D = map(int,input().split())
s = [i**2 for i in range(1,N+1)]
c = [0]*8000001
for w in s:
    for z in s:
        a = w-z+D
        if a >=1:
            c[a] +=1
A = 0
for x in s:
    for y in s:
        A +=c[x+y]
print(A)
0