結果
| 問題 | No.800 四平方定理 |
| コンテスト | |
| ユーザー |
910_sendai
|
| 提出日時 | 2019-03-18 12:48:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 1,113 ms / 2,000 ms |
| コード長 | 375 bytes |
| 記録 | |
| コンパイル時間 | 152 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 73,344 KB |
| 最終ジャッジ日時 | 2024-07-18 06:41:32 |
| 合計ジャッジ時間 | 16,397 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
def solve():
N, D = map(int, input().split())
ans = 0
p = []
cnt =[0] * (8 * 10**6 + 1)
## 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)
solve()
910_sendai