摘要:
校门外的树 模拟写法 把在区间的所有都标记一下,没标记的计数 这个题数据范围不是很大,可以这样 #include<bits/stdc++.h> using namespace std; const int maxn=1e4+2; int cnt[maxn]; int main(){ int l,m; 阅读全文
摘要:
纪念品分组 贪心策略:最大的先和小的组合 先从小到大排列,然后从左右两边开始找符合条件的两件纪念品,如果不符合,就让右边的单独放一组 #include<bits/stdc++.h> #define maxn 30005 using namespace std; int a[maxn]; int ma 阅读全文