- 博客(28)
- 资源 (7)
- 收藏
- 关注
原创 poj 1679 The Unique MST 求次小生成树(prime)
The Unique MSTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9446 Accepted: 3142<br />DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique. <br /><br />Definition 1 (Spanning Tree): Consider a connected, und
2011-03-31 21:14:00 477
原创 poj 2337 Catenyms 判断并输出欧拉路 判断N个字符串是否能够首尾相连全部输出(欧拉路)
A catenym is a pair of words separated by a period such that the last letter of the first word is the same as the last letter of the second.
2011-03-30 20:29:00 728
原创 poj 1639 Picnic Planning 最小K度限制生成树
Picnic PlanningTime Limit: 5000MS Memory Limit: 10000KTotal Submissions: 5846 Accepted: 1934<br />DescriptionThe Contortion Brothers are a famous set of circus clowns, known worldwide for their incredible ability to cram an unlimited number of themselves i
2011-03-26 21:11:00 691
原创 poj 3159 Candies 差分约束+SPFA+栈优化
CandiesTime Limit: 1500MS Memory Limit: 131072KTotal Submissions: 14575 Accepted: 3742DescriptionDuring the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag of candies
2011-03-26 16:55:00 819
原创 poj 3159 Candies 邻接表+优先级队列+dijkstra
CandiesTime Limit: 1500MS Memory Limit: 131072KTotal Submissions: 14571 Accepted: 3741<br />Description<br />During the kindergarten days, flymouse was the monitor of his class. Occasionally the head-teacher brought the kids of flymouse’s class a large bag
2011-03-26 16:29:00 712
原创 2414: Sightseeing tour 混合图欧拉回路+网络流
The city executive board in Lund wants to construct a sightseeing tour by bus in Lund, so that tourists can see every corner of the beautifu
2011-03-24 20:19:00 566
原创 2421: Margaritas on the River Walk 给定n件物品和一个背包,第i件物品的体积为Vi,背包容量为C.要求吧一些物品放入背包使得剩下的物品都放不下去,求方案数
2421: Margaritas on the River WalkResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K14543StandardOne of the more popular activities i
2011-03-23 22:42:00 1238
原创 2443: Confused 逆序数推排列数
<br /><br /><br />Consider a sequence of N integers where each integer between 1 and N appears exactly once. A pair of numbers in the sequence is confused if the number that comes earlier in the sequence is larger than the later number. The confusion of th
2011-03-22 19:14:00 749 2
原创 poj 1201 Intervals 差分约束系统+SPFA 给出一些区间, 告诉每个区间中至少需要取Ci个数。求出满足n个条件的集合C的最少的元素个数
<br />IntervalsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 12353 Accepted: 4558<br />DescriptionYou are given n clos
2011-03-17 21:21:00 970
原创 poj 1511 Invitation Cards SPFA
Invitation CardsTime Limit: 8000MS Memory Limit: 262144KTotal Submissions: 9544 Accepted: 3027DescriptionIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate
2011-03-16 21:58:00 572
原创 Bellman_ford 模板
#include#include#include#includeusing namespace std;const int INF=(1struct Graph{ int s,t,w;//s->t=w;};Graph edge[5201];int dis[501];int V,E;//点数[1-n] 边数[0-E)bool bellman_ford(int s0)//原点{ for(int i=1;i dis[i]=INF; dis[s0]=0; for(int i=1;i
2011-03-16 20:29:00 456
原创 poj 3294 Life Forms 求n(n>1)个字符串的最长的一个子串 后缀数组
Life FormsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4507 Accepted: 1168DescriptionYou may have wondered why most extraterres
2011-03-15 20:39:00 644
原创 ura 1297. Palindrome 最长回文子串 后缀数组+RMQ
1297. PalindromeTime Limit: 1.0 secondMemory Limit: 16 MBThe “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. Robots» security
2011-03-12 20:52:00 744
原创 poj 3261 Milk Patterns 最长的出现最少k次的重复(可重叠)子串 后缀数组
<br />Milk PatternsTime Limit: 5000MS Memory Limit: 65536KTotal Submissions: 4551 Accepted: 1942Case Time Limit: 2000MS<br />Description<br
2011-03-11 21:54:00 569
原创 pku 1743 Musical Theme 最长重复不重叠子串 后缀数组
<br />Musical ThemeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 7145 Accepted: 2539<br />DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the pian
2011-03-11 21:15:00 586
原创 poj 2774 Long Long Message 求两个字符串的最长公共子串 后缀数组
Long Long MessageTime Limit: 4000MS Memory Limit: 131072KTotal Submissions: 10949 Accepted: 4374Case Time Limit: 1000MSDescriptionThe little
2011-03-09 19:23:00 776
原创 最长重复子串(可重复) 后缀数组
最长重复子串时间限制:1000 ms | 内存限制:3000 KB 描述 对于一个字符串S1,其中S2是他的一个子串(长度严格小于S1长度),如果S2在S1中出现次数超过1次,那么S2就是一个重复子串,现在的要求是给定S1,请求出他的最长重复子串;如果有多个长度一样的最长子串,请输入字典序最小那个串;比如bbbaaaccc那么最长子串就是aa输入 第一行包含一个整数T,表示有T组数据对于每组数据包含一行,该行有一个字符串,长度小于10,000输出 对于每组数据请输出他的最长重复子串,保证每组数据都有;样
2011-03-08 20:03:00 2506 2
原创 Distinct Substrings 给出一个字符串,问它的不重复子串有多少个 后缀数组
694. Distinct SubstringsProblem code: DISUBSTR<br /> <br />Given a string, we need to find the total number of its distinct substrings.Input<br />T- number of test cases. T<=20;<br />Each test case consists of one string, whose length is <= 1000Output<br /
2011-03-08 19:01:00 774
原创 poj 1200 Crazy Search HASH 哈希表
Crazy SearchTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 13667 Accepted: 3753<br />DescriptionMany people like to solve hard puzzles some of which may lead them to madness. One such puzzle could be finding a hidden prime number in a given text
2011-03-04 18:06:00 657
原创 poj 2002 Squares 判断一些点能组成多少个正方形 二分查找
SquaresTime Limit: 3500MS Memory Limit: 65536KTotal Submissions: 8864 Accepted: 3088<br />DescriptionA square is a 4-sided polygon whose sides have equal length and adjacent sides form 90-degree angles. It is also a polygon such that rotating about its cen
2011-03-04 17:35:00 699
转载 HASH 题目汇总 转载自hqd_acm 膜拜hqd神牛
<br /><br />挺喜欢hash的,可能是因为hash的运用比较灵活吧。现在对就对ac的几个题做个分类。<br />大整数的hash,含多个整数(这类题的hash函数比较灵活)<br />poj2875 poj1840 poj3640 poj3349<br />poj2002 key=(abs(p[i].x)*99983+abs(p[i].y)*13)%77777;<br />poj1200 (将字符串看成26进制数)<br />字符串的hash(有许多现成函数,选择合适的就行)<br />po
2011-03-04 11:06:00 804
原创 poj 1056 判断前缀码
IMMEDIATE DECODABILITYTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6984 Accepted: 3349<br />DescriptionAn encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We
2011-03-04 09:24:00 798
原创 hdu 3724 Encoded Barcodes Ties树 求X的个数(A是X的前缀)
Encoded BarcodesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 92 Accepted Submission(s): 38Problem DescriptionAll the big malls need a powerful system for the products retrieval. Now you are empl
2011-03-03 17:24:00 953
原创 poj 3630 Phone List Ties树 判断是否存在前缀码 Ties树不用new 否则超时
Phone ListTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10252 Accepted: 3295<br />Description<br />Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue
2011-03-03 16:14:00 838
原创 poj 2513 Colored Sticks 并查集+Ties+欧拉回路
Colored SticksTime Limit: 5000MS Memory Limit: 128000KTotal Submissions: 18516 Accepted: 4808<br />DescriptionYou are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks in a straight l
2011-03-03 14:44:00 483
原创 poj 1186 poj 1840 方程的解数 hash+枚举 (n/2)
方程的解数Time Limit: 15000MS Memory Limit: 128000KTotal Submissions: 4851 Accepted: 1653Case Time Limit: 5000MSDescription已知一个n元高次方程: 其中:x1, x2,...,xn是未知数,k1,k2,...,kn是系数,p1,p2,...pn是指数。且方程中的所有数均为整数。 假设未知数1 1 方程的整数解的个数小于231。 ★本题中,指数Pi(i=1,2,...,n)均为正整数。 Input第
2011-03-02 15:17:00 712
原创 poj 2033 Alphacode 记忆化搜索
AlphacodeTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 9144 Accepted: 2806<br />DescriptionAlice and Bob need to send secret messages to each other and are discussing ways to encode their messages: <br />Alice: "Let's just use a very simple cod
2011-03-02 10:56:00 572
原创 poj 1183 反正切函数的应用
反正切函数的应用Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10739 Accepted: 3890<br />Description反正切函数可展开成无穷级数,有如下公式 <br /><br />(其中0 <= x <= 1) 公式(1) <br /><br />使用反正切函数计算PI是一种常用的方法。例如,最简单的计算PI的方法: <br /><br />PI=4arctan(1)=4(1-1/3+1/5-1/7+1/9-1/11+
2011-03-02 10:18:00 577
拓展 KMP edtend MP
2011-04-14
joj 部分题目答案 自己做的 仅供参考
2010-07-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人