結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-16 20:23:51 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 352 bytes |
| コンパイル時間 | 223 ms |
| コンパイル使用メモリ | 82,564 KB |
| 実行使用メモリ | 349,236 KB |
| 最終ジャッジ日時 | 2024-06-22 03:34:06 |
| 合計ジャッジ時間 | 26,724 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 TLE * 1 |
| other | AC * 18 TLE * 3 -- * 9 |
ソースコード
import sys
input = sys.stdin.readline
def MI():
return map(int, input().split())
n,d=MI()
from collections import defaultdict
xydic=defaultdict(int)
wzdic=defaultdict(int)
for i in range(1,n+1):
for j in range(1,n+1):
wzdic[i**2-j**2+d]+=1
xydic[i**2+j**2]+=1
ans=0
for i in xydic.keys():
ans+=wzdic[i]*xydic[i]
print(ans)