主页
搜索
最近更新
数据统计
申请密钥
批量保存
开发版网站(新前端)
系统公告
1
/
1
请查看完所有公告
Solution of AT_tenka1_2018_e Equilateral
最后更新于 2025-08-27 19:23:22
作者
tder
分类
题解
题解
AT_tenka1_2018_e
复制 Markdown
查看原文
转到新前端
删除文章
更新内容
> 你可以浏览这个题解的[中文版本](https://www.luogu.com/article/7flpec5c/)。 > The images are hosted on Github, use an accelerator if it fails to load. Consider drawing the Huffman distance of three points.  Then we have $a+b+c=a+b+d=c+d$, i.e. $a+b=c=d$. This means that the slope of $\overline{BC}$ is $\pm1$ and $A$ is on a line parallel to it. We might as well $\mathcal{O}(n^2)$ enumerate $B$, $\mathcal{O}(n)$ enumerate $C$, and compute the number of legal $A$ by difference $\mathcal{O}(1)$. Complexity $\mathcal{O}(n^3)$ with large constants. Specifically, we enumerate $(i,j)$ and $k<i$, and the problem translates into finding the number of $a_{x,y}=1$ on the four lines. It is sufficient to preprocess the prefix sum for each line with slope $\pm1$.  Note that to avoid double counting , it may be worthwhile to count the special endpoint positions separately. [Code.](https://atcoder.jp/contests/tenka1-2018/submissions/60270468)
正在渲染内容...
点赞
0
收藏
0