加载中...

摘要: 技巧: 能用乘法就不用除法表示 1.进制 2.三元组 →注意到其中一个数可以枚举 3.贡献的作用 没做出来的rz题 1.让n尽量变少 有两种操作 减一个数 让一个数/2 错因:用了dfs 正确解法: while(n>0){ n=min(n/2,n-x); res++; } 2.区间分类讨论 操作一: 阅读全文
posted @ 2022-05-21 20:05 liang302 阅读(23) 评论(0) 推荐(0)
摘要: 单调修改区间查询(两者相减) ##离散化 +树状数组 +LIS 最大上升子序列和 需要查询 #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; typed 阅读全文
posted @ 2022-05-21 16:48 liang302 阅读(135) 评论(0) 推荐(0)
摘要: xs[i]存储w[i]的值 | |通过排序 去重 存储有顺序去重的 w[i]的值 | |通过find(w[i]) 函数 获得w[i]在原来数组的相对顺序 求出离散化的值 lower_bound(xs, xs + sz, w[i]) - xs + 1; 阅读全文
posted @ 2022-05-21 15:22 liang302 阅读(19) 评论(0) 推荐(0)