結果
| 問題 | No.800 四平方定理 |
| コンテスト | |
| ユーザー |
910_sendai
|
| 提出日時 | 2019-03-18 12:38:04 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 295 bytes |
| 記録 | |
| コンパイル時間 | 297 ms |
| コンパイル使用メモリ | 21,540 KB |
| 実行使用メモリ | 83,228 KB |
| 最終ジャッジ日時 | 2026-08-16 14:22:14 |
| 合計ジャッジ時間 | 31,708 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 RE * 2 TLE * 1 |
ソースコード
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)
910_sendai