摘要: 题目链接 "戳我" $Solution$ 令$gcd$为$x$,那么我们将整个序列$/x$,则序列的和就变成了$\frac{n}{x}$,所以$x$必定为$n$的约数所以现在就是要构造出一个序列长度为$k$,和为$\frac{n}{x}$。我们令前$k 1$个为$1,2....k 1$最后一个再用$ 阅读全文
posted @ 2019-08-26 21:18 撤云 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "戳我" $Solution$ 如果一个 要更改,那么一个四个格子的正方形只有他一个是 ,bfs弄一下就好了 $Code$ cpp include using namespace std; const int inf=1e9,mod=1e9+7; typedef long long ll; 阅读全文
posted @ 2019-08-26 15:06 撤云 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 题目链接 "戳我" $Solution$ 观察发现如果一个数两边都比他大,删掉他可以保证最优,这个应该是显然的。这个东西用单调栈维护一下,最后剩下的就是个单调递减或单调递增的数列,从小到大排个序取前面$n 2$个,$n$为数列长度 $Code$ cpp include define int long 阅读全文
posted @ 2019-08-26 08:10 撤云 阅读(316) 评论(0) 推荐(0) 编辑
……