2022年7月5日
摘要: P1311 [NOIP2011 提高组] 选择客栈 阅读全文
posted @ 2022-07-05 11:18 我疯故我在 阅读(17) 评论(0) 推荐(0)
  2022年7月4日
摘要: 在1 ~ n / 2具有单调性,在n / 2 + 1 ~ n具有单调性。 在1 ~ n并不具有单调性,因此如果 l = 1, r = n + 1,将会导致答案偏大。 Interviewe 如 10 6 1 1 1 1 1 1 10 10 10 10 按理来说,分的组数越多,总和越大,比如分6组的要比 阅读全文
posted @ 2022-07-04 20:01 我疯故我在 阅读(38) 评论(0) 推荐(0)
  2022年7月2日
摘要: P3865 【模板】ST 表 #include <iostream> #include <cstdio> #include <cmath> using namespace std; const int N = 1e5 + 10; int n, m; int a[N]; int f[N][20]; i 阅读全文
posted @ 2022-07-02 20:23 我疯故我在 阅读(57) 评论(0) 推荐(0)
摘要: RMQ算法(区间最值问题) 阅读全文
posted @ 2022-07-02 19:58 我疯故我在 阅读(20) 评论(0) 推荐(0)
摘要: B. The Child and Set 阅读全文
posted @ 2022-07-02 19:46 我疯故我在 阅读(22) 评论(0) 推荐(0)
摘要: 两个相同的数异或得0 由此可以找出缺失的数 缺失的数据 阅读全文
posted @ 2022-07-02 19:45 我疯故我在 阅读(34) 评论(0) 推荐(0)
摘要: P2571 [SCOI2010]传送带 阅读全文
posted @ 2022-07-02 19:42 我疯故我在 阅读(16) 评论(0) 推荐(0)
  2022年6月30日
摘要: 1.二分注意l,r的取值是否有意义。 2.对于判断条件为:和某个值相差最小时。解决办法为:在二分过程中取最小值,二分结束时的l和r不一定是最小值。 3.check函数注意int溢出,多注意数据范围开long long。 阅读全文
posted @ 2022-06-30 16:32 我疯故我在 阅读(35) 评论(0) 推荐(0)
摘要: 高精度加法 P1601 A+B Problem(高精) 读入数据时,四种运算均从个位数开始push_back,输出时从vector最高位开始。需要取尾0:减(高位可能被减为0)、乘(乘以0后全为0)、除(得到的结果高位可能为0) vector<int> add(vector<int> a, vect 阅读全文
posted @ 2022-06-30 10:00 我疯故我在 阅读(131) 评论(0) 推荐(0)
  2022年5月17日
摘要: 区间加法,区间查询 #include<bits/stdc++.h> #define int long long using namespace std; const int N=1e5+5; struct SegmentTree { int l,r; int sum,add; #define l(x 阅读全文
posted @ 2022-05-17 22:59 我疯故我在 阅读(21) 评论(0) 推荐(0)