結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-13 21:43:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 354 bytes |
| コンパイル時間 | 334 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 186,368 KB |
| 最終ジャッジ日時 | 2024-09-21 21:16:39 |
| 合計ジャッジ時間 | 5,707 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 RE * 1 |
| other | AC * 27 RE * 3 |
ソースコード
N, D = map(int, input().split())
L = [i * i for i in range(1, N + 1)]
YZ = [0] * (2 * (N**2) + 1)
for i in L:
for j in L:
YZ[i + j] += 1
XW = [0] * (2 * (N**2) + 1)
for w in L:
for x in L:
if D + w - x < 0:
break
XW[D + w - x] += 1
ans = 0
for i in range(2 * (N**2) + 1):
ans += YZ[i] * XW[i]
print(ans)