結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
AEn
|
| 提出日時 | 2022-05-16 10:23:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 289 bytes |
| コンパイル時間 | 165 ms |
| コンパイル使用メモリ | 82,088 KB |
| 実行使用メモリ | 357,084 KB |
| 最終ジャッジ日時 | 2024-09-14 02:13:20 |
| 合計ジャッジ時間 | 26,675 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 TLE * 3 -- * 9 |
ソースコード
from collections import defaultdict
N, D = map(int, input().split())
p, n = defaultdict(int), defaultdict(int)
for i in range(1, N+1):
for j in range(1, N+1):
p[i**2 + j**2] += 1
n[i**2 - j**2] += 1
res = 0
for key in p.keys():
res += p[key]*n[D-key]
print(res)
AEn