摘要:
非常经典的二分答案模型。 最小值最大,最大值最小,通常用二分答案,确定答案后,配合贪心,DP等算法检验答案是否合理, 将最优性问题转换为判定性问题。 本题中,可以发现,二分答案轰炸次数,显然满足单调性,然后进行简单判定就好了。 #include<cstdio> #include<cstring> # 阅读全文
摘要:
优先队列,没啥说的。 #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<cmath> #include<stack> #include<queue> using namespace s 阅读全文
摘要:
英文题解: 总之就是一个非常经典的优先队列问题,前K大和。 前缀和优化处理一下,时间复杂度(NlogN) #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<cmath> #includ 阅读全文
摘要:
AtCoder : Nasif_44th 阅读全文
摘要:
一共有四种情况。 一开始少考虑了第一种和第三种情况,一直WA。 代码就丑点吧。 #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<cmath> #include<stack> #inc 阅读全文