Orz..跑得还挺快的#10自从会树链剖分后LCA就没写过倍增了...这道题用可持久化线段树..点x的线段树表示ROOT到x的这条路径上的权值线段树-------------------------------------------------------------------------#in...
分类:
其他好文 时间:
2015-07-30 00:27:32
阅读次数:
231
AMR10F - Cookies Pilesno tagsThe kids in my son's kindergarten made Christmas cookies with their teacher, and piled them up in columns. They then arra...
分类:
其他好文 时间:
2015-07-29 22:47:05
阅读次数:
210
题意:n个数 m个询问询问的是[l, r]区间内不同的数的和没有修改,静态的主席树即可与 SPOJ QUERY一样 将重复的元素建树即可注意范围:$N \le 50000$ 每个值不超过1000000也就是加起来会爆int 要用LL 1 #include 2 using namespace s...
分类:
其他好文 时间:
2015-07-25 10:38:41
阅读次数:
111
NUMTSN - 369 Numbers
no tags
7. 369 numbers
A number is said to be a 369 number if
The count of 3s is equal to count of 6s and the count of 6s is equal to count of 9s.The count of 3s ...
分类:
其他好文 时间:
2015-07-24 16:13:42
阅读次数:
454
LUCIFER - LUCIFER Number
no tags
Lucifer is the only human whi has defeated RA-ONE in a computer game ..
RA-One is after lucifer for revenge and G-One is there to protect him ...
All th...
分类:
其他好文 时间:
2015-07-24 14:19:59
阅读次数:
117
RAONE - Ra-One Numbers
no tags
In the War between good and evil . Ra-One is on the evil side and G-One on the good side.
Ra-One is fond of destroying cities and its G-one's duty to prote...
分类:
其他好文 时间:
2015-07-24 14:18:59
阅读次数:
456
题目:http://www.spoj.com/problems/ORDERS/ and http://acm.hdu.edu.cn/showproblem.php?pid=2852
题意:spoj227:告诉每个位置前面有多少个数比当前位置小,求出原序列。hdu2852 设计一个容器,支持几种操作:增加/删除元素,求比a大的数中第k小的数是多少。
分析:两个题思路都是求数组里面的第K小的数。开...
分类:
编程语言 时间:
2015-07-21 13:03:25
阅读次数:
158
给定n个从小到大排好序的数,要从中选出c个数,使得任意两个相邻数的间隔最小的值尽量的大。求最大的最小间隔。#include
#include
#include
using namespace std;
int a[111111];
int vis[111111];
int cha[11111];int n,k;int cheak(int...
分类:
其他好文 时间:
2015-07-21 12:54:16
阅读次数:
77
题目:求一个字符串中所有不同子串个数
后缀数组经典题,每一个子串一定是某个后缀的前缀,那么问题便等价于求所有后缀之间的不相同的前缀个数。我们按sa的顺序来考虑,当加入sa[k]的时候,sa[k]这个后缀的长度为n-sa[k]-1,那么便有n-sa[k]-1个前缀,但是由heigh数组可知sa[k]与sa[k-1]有height[k]个前缀是相同的,所以要除去。
注意的是这道题题意有点坑,一开始...
分类:
编程语言 时间:
2015-07-16 22:27:50
阅读次数:
136
题目链接
已经在代码中注释了变量含义,感觉不难
inf好像不止|1e9| inf设成0x3f 才过。。
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace...
分类:
其他好文 时间:
2015-07-14 15:43:06
阅读次数:
140