SUBST1 - New Distinct Substrings
no tags
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of test cases. T
Output
For each test case ou...
分类:
编程语言 时间:
2015-08-21 19:27:35
阅读次数:
168
SPOJ PGCD - Primes in GCD Table (好题! 莫比乌斯反演+分块求和优化)...
分类:
其他好文 时间:
2015-08-20 13:12:34
阅读次数:
172
AMR11E - Distinct Primes
no tags
Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger is in his class, and she is better than him at it. ...
分类:
其他好文 时间:
2015-08-20 10:33:00
阅读次数:
176
Array DiversityTime Limit:404MSMemory Limit:1572864KB64bit IO Format:%lld & %lluSubmitStatusDescriptionHere we go!Let's define the diversity of a list...
分类:
其他好文 时间:
2015-08-20 06:40:46
阅读次数:
125
树链剖分的入门题目,自己写了下感觉还是挺好写的,不过真的有点长...spoj 375 边有权值: 1 #include 2 #include 3 #include 4 using namespace std; 5 6 const int INF = -999999999; 7 ...
分类:
其他好文 时间:
2015-08-19 19:16:17
阅读次数:
181
Distinct Primes
Arithmancy is Draco Malfoy's favorite subject, but what spoils it for him is that Hermione Granger is in his class, and she is better than him at it. Prime numbers are of mystical im...
分类:
其他好文 时间:
2015-08-19 14:52:58
阅读次数:
109
题意:已知一个数列,现在有多次查询(a,b),查询区间[a,b]的最大连续和。
分析:
这道题没有更新操作,只有区间查询操作。动态在于待查询区间不同,最大连续和也不同。所以其实相当于每次查询的时候要计算一次待查询区间的最大连续和。
有3种情况:
1.待查询区间包含当前区间。那么就直接返回当前区间的最大连续和;
2.待查询区间在当前区间的左区间或右区间。那么在左或右区间递归查询即可;
3...
分类:
其他好文 时间:
2015-08-19 02:00:37
阅读次数:
109
DISUBSTR - Distinct Substrings
no tags
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of test cases. T
Each test case consists of one st...
分类:
编程语言 时间:
2015-08-18 22:48:38
阅读次数:
154
题目大意:给出一棵树,3种操作
DIST u,v 询问u到v的距离
KTH k, u, v 询问u到v的路径上的第k大的边的权值解题思路:刚开始以为会爆,结果发现不会
直接暴力存储u到v的路上的所有边,再进行排序,输出第k大的边即可#include
#include #define N 10010struct Edge{
int to, next...
分类:
其他好文 时间:
2015-08-18 01:15:27
阅读次数:
117
VLATTICE - Visible Lattice Points
no tags
Consider a N*N*N lattice. One corner is at (0,0,0) and the opposite one is at (N,N,N). How many lattice points are visible from corner at (0,0...
分类:
其他好文 时间:
2015-08-17 23:46:45
阅读次数:
111