Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 12731 Accepted: 5442 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16782 Accepted: 7286 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
1.链接地址: http://bailian.openjudge.cn/practice/2001 http://poj.org/problem?id=2001 2.题目: Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 12208 Accepted: 5210 Description A prefix of a string is a substring starting at t…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 15948 Accepted: 6887 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21651 Accepted: 9277 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 21642 Accepted: 9269 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 15574 Accepted: 6719 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 18724 Accepted: 8101 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 15610 Accepted: 6734 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that t…
主题链接:http://poj.org/problem?id=2001 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo",…
Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that t…
题目链接:POJ 2001 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon"…
Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", "ca", "car", "carb", "carbo", and "carbon". Note that t…
读入建立一棵字母树,并且每到一个节点就增加这个节点的覆盖数. 然后再重新扫一遍,一旦碰到某个覆盖数为1就是这个单词的最短前缀了. 不知为何下面的程序一直有bug……不知是读入的问题? type node=record w:longint; go:array['a'..'z'] of longint; end; var i,n,tot:longint; s:string; a,ans:..] of string; t:..] of node; procedure getintree(s:strin…
直接用Trie树即可. 每个节点统计经过该点的单词数,遍历时当经过的单词数为1时即为合法的前缀. type arr=record next:array['a'..'z'] of longint; w:longint; end; ; ..maxn] of arr; s:..maxn] of ansistring; i,j,m,n,now,num:longint; begin while not eof do begin inc(n); readln(s[n]); end; num:=; to n…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 17683 Accepted: 7686 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 18687 Accepted: 8087 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…
描述 http://poj.org/problem?id=2001 给出一组单词,求每个单词的最小唯一前缀. 最小唯一前缀:该前缀不能是其他单词的前缀,并且最小,如果不存在,则为该单词本身. Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 16921 Accepted: 7338 Description A prefix of a string is a substring star…
Shortest Prefixes Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 17608 Accepted: 7658 Description A prefix of a string is a substring starting at the beginning of the given string. The prefixes of "carbon" are: "c", &qu…