
数据结构
文章平均质量分 77
xtulollipop
这个作者很懒,什么都没留下…
展开
-
hdu5775Bubble Sort+数状数组求逆序数
Problem Description P is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble Sort in C++.for(int i=1;i<=N;++i) for(int j=N,t;j>i;—j) if(P[j-1] >原创 2016-07-30 20:44:53 · 511 阅读 · 0 评论 -
hdu5536Chip Factory+字典树
Problem Description John is a manager of a CPU chip factory, the factory produces lots of chips everyday. To manage large amounts of products, every processor has a serial number. More specifically, t原创 2016-09-14 15:45:45 · 457 阅读 · 0 评论 -
字典树模板
#include<bits/stdc++.h>using namespace std;#define LL long longconst int sigma_size=2;struct TireNode{ int pass; int last; TireNode *son[29]; TireNode(){ pass=0; last原创 2016-09-14 16:41:10 · 235 阅读 · 0 评论 -
hdu1251统计难题+字典树
Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input 输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连串的提问,每行一个提原创 2016-09-14 17:49:02 · 433 阅读 · 0 评论 -
hdu5918Sequence I+KMP
Problem Description Mr. Frog has two sequences a1,a2,⋯,an and b1,b2,⋯,bm and a number p. He wants to know the number of positions q such that sequence b1,b2,⋯,bm is exactly the sequence aq,aq+p,aq+2p,原创 2016-10-08 22:41:49 · 387 阅读 · 0 评论