hzqjhhjq hzqjhhjq
关注数: 0 粉丝数: 88 发帖数: 636 关注贴吧数: 52
pat t1005求个思路 1005. Programming Pattern (35)时间限制600 ms 内存限制65536 kB 代码长度限制8000 B 判题程序Standard作者HOU, Qiming Programmers often have a preference among program constructs. For example, some may prefer "if(0==a)", while others may prefer "if(!a)". Analyzing such patterns can help to narrow down a programmer's identity, which is useful for detecting plagiarism. Now given some text sampled from someone's program, can you find the person's most commonly used pattern of a specific length? Input Specification: Each input file contains one test case. For each case, there is one line consisting of the pattern length N (1<=N<=1048576), followed by one line no less than N and no more than 1048576 characters in length, terminated by a carriage return '\n'. The entire input is case sensitive. Output Specification: For each test case, print in one line the length-N substring that occurs most frequently in the input, followed by a space and the number of times it has occurred in the input. If there are multiple such substrings, print the lexicographically smallest one. Whitespace characters in the input should be printed as they are. Also note that there may be multiple occurrences of the same substring overlapping each other. Sample Input 1: 4 //A can can can a can. Sample Output 1: can 4 Sample Input 2: 3 int a=~~~~~~~~~~~~~~~~~~~~~0; Sample Output 2: ~~~ 19 就是从一行字符串中找出长度为n(<=1048576)的子串中出现最多的那个 有两个点死活过不去 map超时。。unordered_map超内存。。 各位大神求个思路 谢谢!
【求助】 我现在只要在知道上提问 全部都违反知道规范 该怎么办 我总不能一个个申诉过去吧。。 附: 系统通知15 秒钟前 抱歉,您的提问:java 键盘监听 ,违反了知道规范,仅您自己可见。如果您认为判定有误,请发起申诉,帮助我们持续改进。 × 系统通知1 天前 抱歉,您的提问:java 多线程 awt ,违反了知道规范,仅您自己可见。如果您认为判定有误,请发起申诉,帮助我们持续改进。 × 系统通知3 天前 恭喜您!您关于提问:u盘打不开无法正常提交的投诉,已经成功通过审核,该提问已经恢复。知道感谢您的理解和支持。 × 系统通知4 天前 抱歉,您的提问:u盘打不开 ,违反了知道规范,仅您自己可见。如果您认为判定有误,请发起申诉,帮助我们持续改进。 × 系统通知2014-04-24 抱歉!您的提问:思想汇报是什么时候写的?可能违反了知道提问规范,暂时仅您自己可见,如有异议,可发起申诉,进行找回。 × 系统通知2014-04-21 抱歉!您的提问:蓝月亮手洗专用洗衣液 创新泵头设计那个 怎么打开可能违反了知道提问规范,暂时仅您自己可见,如有异议,可发起申诉,进行找回。 × 系统通知2014-04-21 恭喜您!您关于提问:蓝月亮手洗专用洗衣液 创新泵头设计那个 怎么打开无法正常提交的投诉,已经成功通过审核,该提问已经恢复。知道感谢您的理解和支持。
首页 1 2 下一页