摘要: 有数组$A[N], 1\le N \le 3 \cdot 105$, $P$次查询,对于每次查询给出$pos$和$k$,求$\sum\limits_{pos + m \cdot k \le N} A[pos + m \cdot k]$。 把所有查询按$k$分组,$k \le \sqrt N$的组$O 阅读全文
posted @ 2017-09-19 17:21 ToRapture 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 简单二维偏序 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <vector> #define DBG(x) cerr << #x << " = " << x << endl 阅读全文
posted @ 2017-09-19 17:06 ToRapture 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 有一个$N+1$个结点的树$T$。 现在有$Q$个信息,每条信息为$q:(u,v)$,表示$u$到$v$的路径不通。 问树$T$至少被破坏多少个节点才能达到当前这种局面。 #include <bits/stdc++.h> #define DBG(x) cerr << #x << " = " << x 阅读全文
posted @ 2017-09-19 17:05 ToRapture 阅读(110) 评论(0) 推荐(0) 编辑