1099.前缀判断
Description
给定 n 个字符串,求有多少字符串是其他字符串的前缀。
Input
第一行为一个整数n(1 <= n <= 1000),之后n行,每行一个字符串,字符串只由26个小写字母组成,最大长度为100。
Output
一个整数,有多少字符串是其他字符串的前缀。
Sample Input
5 abcde ab bcde b cde
Sample Output
2
Source
Unknown
© 2012-2015 SDNU ACM-ICPC TEAM, v1.2 Beta
这道题师哥们规定了要用set来做。所以先自学set后再来做这个题,需要注意的都在备注上。
Source Code View
Run ID: 57517 / Problem ID: 1099 / Author: 2017Liushilei / Language: C++
Submit Time: 2017-11-11 18:22:57 / Judge Status: Accepted / Judge Time: 2017-11-11 18:23:00
Submit Time: 2017-11-11 18:22:57 / Judge Status: Accepted / Judge Time: 2017-11-11 18:23:00