結果
| 問題 |
No.800 四平方定理
|
| コンテスト | |
| ユーザー |
neterukun
|
| 提出日時 | 2019-03-18 22:27:33 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 329 bytes |
| コンパイル時間 | 336 ms |
| コンパイル使用メモリ | 82,784 KB |
| 実行使用メモリ | 266,348 KB |
| 最終ジャッジ日時 | 2024-07-19 06:52:05 |
| 合計ジャッジ時間 | 28,578 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 2 WA * 26 TLE * 2 |
ソースコード
from collections import defaultdict
n,d = map(int,input().split())
half = defaultdict(int)
for i in range(1,n+1):
for j in range(i+1,n+1):
half[i**2+j**2] +=2
for i in range(1,n+1):
half[2*i**2+i**2] +=1
ans = 0
for i in range(1,n+1):
for j in range(1,n+1):
ans += half[d+i**2-j**2]
print(ans)
neterukun