Phone List Description 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 listed these numbers: Emergency 911 Alice 97 625 999 Bob 91 12 54 26 In this case,…
题目: 给定 n 个长度不超过 10 的数字串,问其中是否存在两个数字串 S, T ,使得 S 是 T 的前缀.多组数据,数据组数不超过 40. 题解: 前缀问题一般都用Trie树解决: 所以跑一个Tire树,记录一下每个节点是不是结尾就好 #include<cstdio> #include<algorithm> #include<cstring> #define N 100010 #define Z 10 using namespace std; int T,n,to…
Hardwood Species Time Limit: 10000MS Memory Limit: 65536K Total Submissions: 17986 Accepted: 7138 Description Hardwoods are the botanical group of trees that have broad leaves, produce a fruit or nut, and generally go dormant in the winter. Amer…
Description Word puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using table covers with word puzzles printed on them, possibly with the intent to minimise their client's percepti…
点击打开链接 Colored Sticks Time Limit: 5000MS Memory Limit: 128000K Total Submissions: 27955 Accepted: 7403 Description You are given a bunch of wooden sticks. Each endpoint of each stick is colored with some color. Is it possible to align the sticks…