上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 190 下一页
摘要: 题意 "题目链接" 给出长度为$n$的序列$a$,序列中的元素取值为$[ 2e9, 2e9]$ 找到两个位置$(i, j) (i define LL long long // define int long long define uint unsigned int define chmax(a, 阅读全文
posted @ 2018-12-10 11:10 自为风月马前卒 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 首先不考虑$a$的限制 我们要求的是 $$\sum_{i = 1}^n \sum_{j = 1}^m \sigma(gcd(i, j))$$ 用常规的套路可以化到这个形式 $$\sum_{d = 1}^n \sigma (d) \sum_{k = 1}^{\frac{n} 阅读全文
posted @ 2018-12-10 10:24 自为风月马前卒 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 直接拿vector维护每种颜色的出现位置,然后二分一下。 cpp include using namespace std; const int MAXN = 3e5 + 10; inline int read() { char c = getchar(); int x = 阅读全文
posted @ 2018-12-07 12:55 自为风月马前卒 阅读(417) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol "杜教筛" 板子题。。 include define LL long long using namespace std; const int MAXN = 1e7 + 10; inline int read() { char c = getchar(); int x = 阅读全文
posted @ 2018-12-07 11:01 自为风月马前卒 阅读(303) 评论(2) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 紫色的线段树板子题??。。。 阅读全文
posted @ 2018-12-07 08:09 自为风月马前卒 阅读(380) 评论(0) 推荐(1) 编辑
摘要: 题意 "题目链接" Sol 很套路的题 直接考虑每个边的贡献,最后再把奇数点的贡献算上 cpp include define Pair pair define MP(x, y) make_pair(x, y) define fi first define se second define int l 阅读全文
posted @ 2018-12-06 21:50 自为风月马前卒 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 我是这样考虑的:从大到小考虑每个$l, r$,最大的$l$应该和最大的$r$匹配(不然就亏了),其次次大的$r$应该和次大的$l$匹配 然后就过了。。 cpp / / include define Pair pair define MP(x, y) make_pair(x 阅读全文
posted @ 2018-12-06 21:48 自为风月马前卒 阅读(267) 评论(0) 推荐(2) 编辑
摘要: 题意 "题目链接" Sol 好好读题 = 送分题 不好好读题 = 送命题 开始想了$30$min数据结构发现根本不会做,重新读了一遍题发现是个傻逼题。。。 $C_{i, j} = a[i] b[j]$ 根据乘法分配律,题目就变成了在数组$a, b$中分别选一段连续的区间,要求权值和相乘$ defin 阅读全文
posted @ 2018-12-06 21:46 自为风月马前卒 阅读(355) 评论(2) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 看完题不难想到最小路径覆盖,但是带权的咋做啊?qwqqq 首先冷静思考一下:最小路径覆盖 = $n \text{二分图最大匹配数}$ 为什么呢?首先最坏情况下是用$n$条路径去覆盖(就是$n$个点),根据二分图的性质,每个点只能有一个和他配对,这样就保证了,每多出一个匹配 阅读全文
posted @ 2018-12-06 18:44 自为风月马前卒 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 题意 "题目链接" Sol 不会做Orzzzz 想到了和题解一样的方程,但是根本不会转移 具体题解看 "这里" 吧 大致思路就是先推一波性质,然后对于最后一个位置上的数$i$,分两种情况讨论一下:与$i 1$相邻 / 不相邻, cpp include define chmin(x, y) (x = 阅读全文
posted @ 2018-12-06 16:48 自为风月马前卒 阅读(200) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 190 下一页

Contact with me