結果

問題 No.800 四平方定理
ユーザー 910_sendai910_sendai
提出日時 2019-03-18 12:38:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 295 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 10,500 KB
実行使用メモリ 70,680 KB
最終ジャッジ日時 2023-09-25 07:48:30
合計ジャッジ時間 35,737 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
70,408 KB
testcase_01 AC 127 ms
70,340 KB
testcase_02 AC 119 ms
70,332 KB
testcase_03 AC 122 ms
70,408 KB
testcase_04 AC 118 ms
70,520 KB
testcase_05 AC 120 ms
70,352 KB
testcase_06 AC 132 ms
70,296 KB
testcase_07 AC 126 ms
70,484 KB
testcase_08 AC 138 ms
70,380 KB
testcase_09 AC 131 ms
70,412 KB
testcase_10 AC 1,179 ms
70,400 KB
testcase_11 AC 1,278 ms
70,412 KB
testcase_12 AC 1,338 ms
70,432 KB
testcase_13 AC 1,144 ms
70,524 KB
testcase_14 AC 1,231 ms
70,608 KB
testcase_15 AC 1,314 ms
70,680 KB
testcase_16 AC 1,291 ms
70,504 KB
testcase_17 AC 1,249 ms
70,476 KB
testcase_18 AC 1,355 ms
70,508 KB
testcase_19 AC 1,357 ms
70,408 KB
testcase_20 AC 96 ms
70,356 KB
testcase_21 AC 97 ms
70,468 KB
testcase_22 AC 1,379 ms
70,356 KB
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 96 ms
70,408 KB
testcase_27 AC 96 ms
70,332 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, D = map(int, input().split())
ans = 0
p = []
cnt =[0] * 8 * 10**6
## x*x + y*y = s 
for i in range(1, N+1):
    p.append(i*i)

for z in p:
    for w in p:
        s = w - z + D
        if s >= 0:
            cnt[s] += 1

for x in p:
    for y in p:
        ans += cnt[x+y]
        
print(ans)
0