09 2017 档案

摘要:有数组$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 阅读(157) 评论(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 阅读(126) 评论(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 阅读(114) 评论(0) 推荐(0)
摘要:1001 Apple 给了四个点$A,B,C,P$,问点$P$是否在$\Delta_$的外接圆外。 用C++被卡了精度,用Java过的。 import java.math.BigDecimal; import java.util.Scanner; /** * Created by ToRapture 阅读全文
posted @ 2017-09-17 20:28 ToRapture 阅读(228) 评论(0) 推荐(0)
摘要:求字符串$str$中包含某个字符的互不相同的子串个数。 #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <set> #define DBG(x) cerr << #x << 阅读全文
posted @ 2017-09-17 20:10 ToRapture 阅读(125) 评论(0) 推荐(0)
摘要:求至少可重叠重复$K$次的最长子串的长度。 解法为二分长度后对height数组分组。 #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <set> #define DBG(x) 阅读全文
posted @ 2017-09-17 20:05 ToRapture 阅读(92) 评论(0) 推荐(0)