上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 75 下一页
摘要: 原题链接 考察:思维 思路: 设和为$sum$,每次减少$n-1$,最多进行$\frac{sum+n-2}$次.但是存在$a[i]$彼此相差悬殊的情况.此时答案为$max(a[i])$. ##Code #include <iostream> #include <cstring> using name 阅读全文
posted @ 2021-07-24 00:10 acmloser 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:线性dp 思路: 想到了但三重循环以为会超时,实际是只有$j=1$时才有三重循环. ##Code #include <iostream> #include <cstring> using namespace std; const int N = 1010; int n,m,x,y,c 阅读全文
posted @ 2021-07-23 13:07 acmloser 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 原题链接 思路: 结论题,排序奇偶分组,均分,没想出怎么证明 ##Code #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 100010; int n,sum 阅读全文
posted @ 2021-07-23 11:00 acmloser 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:思维 or 搜索 错误思路: 二分模拟,精度爆炸 正确思路一: 搜索....我是fw 正确思路二: 双指针设置$l = 1,r = n$,如果$s[i]==l$,说明右边不会在有人,$s[i]==r$左边不会在有人. ##Code #include <iostream> #inclu 阅读全文
posted @ 2021-07-23 09:44 acmloser 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:贪心 思路: 死于读不懂题,对于每个仓库,求裁判到它的距离,排序,两类仓库分开求,因为题目是这么说的 ##Code #include <iostream> #include <cstring> #include <cmath> #include <queue> using names 阅读全文
posted @ 2021-07-23 01:10 acmloser 阅读(45) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:思维 思路: 类似RMQ的思想,对于每个点求往左,往右不减最远能到达处.求是否和会大于区间长度. ##Code #include <iostream> #include <cstring> using namespace std; const int N = 100010; int 阅读全文
posted @ 2021-07-22 11:59 acmloser 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:构造 思路: 很容易想到先构造$gcd(a,b) = 1$的两个数,最后两个位置构造剩余的$k$.剩余$k$最大到$k-\frac {105}{2}+1$.构造$k,k*2$不会超过$109$,剩下的1到质数里成对构造.最多需要$2*105$个质数,需要开到$107$ ##Code 阅读全文
posted @ 2021-07-22 10:05 acmloser 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:思维 思路: 制造$n$个$d$位互不相同的数字,$dfs$即可 ##Code #include <iostream> #include <cstring> #include <vector> using namespace std; typedef long long LL; co 阅读全文
posted @ 2021-07-21 08:34 acmloser 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 原题链接 考察:计算几何 思路: 已知两点和半径可以确定一个圆,最优解的圆一定可以偏移直到相交于两点.至于怎么求圆心看 GO 求正反两遍,求不用讨论谁上下问题. ##Code #include <iostream> #include <cstring> #include <cmath> using 阅读全文
posted @ 2021-07-20 21:10 acmloser 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 原题链接 错误思路: 枚举每一个人,优先队列贪心求最小的不重合区间组数. 思路: 实际上贪心不一定能贪到正解,这里类似背包需要枚举所有可能.背包体积是时间: $$f[i] = f[i-1],f[node[pos].l]+w $$ 需要按区间右端点排序. ##Code #include <iostre 阅读全文
posted @ 2021-07-20 19:31 acmloser 阅读(98) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 75 下一页