結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2022-08-20 11:31:55 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 286 bytes |
| コンパイル時間 | 691 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 317,228 KB |
| 最終ジャッジ日時 | 2024-10-09 04:53:18 |
| 合計ジャッジ時間 | 30,870 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 TLE * 7 |
ソースコード
from collections import *
N, D = map(int, input().split())
S = defaultdict(int)
for i in range(1, N + 1):
for j in range(1, N + 1):
S[D + i * i - j * j] += 1
ans = 0
for i in range(1, N + 1):
for j in range(1, N + 1):
ans += S[i * i + j * j]
print(ans)
rlangevin