摘要:
题目传送门 1 /* 2 题意:取长度不小于m的序列使得和最大 3 贪心:先来一个前缀和,只要长度不小于m,从m开始,更新起点k最小值和ans最大值 4 */ 5 #include 6 #include 7 using namespace std; 8 9 const int ... 阅读全文
摘要:
题目传送门 1 /* 2 数学:假设取了第i个,有C(n-1)(i-1)种取法 3 则ans = sum (C(n-1)(i-1)) (1 6 #include 7 #include 8 #include 9 using namespace std;10 11 type... 阅读全文
摘要:
题目传送门 题意:问区间内x的出现的次数分析:莫队算法:用一个cnt记录x的次数就可以了。还有二分查找的方法代码:#include #include #include #include using namespace std;const int MAXN = 1e5 + 10;const int I... 阅读全文