传送门 Description 给出了N个单词,已经按长度排好了序.如果某单词i是某单词j的前缀,i->j算一次接龙(两个相同的单词不能算接龙). 你的任务是:对于输入的单词,找出最长的龙. Input 第一行为N(1<=N<=105).以下N行每行一个单词(由小写组成),已经按长度排序.(每个单词长度<50) Output 仅一个数,为最长的龙的长度. Sample Input 5 i a int able inter Sample Output 3 思路 某单词i是某单词j…
题目 Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, -, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we c…
You are given a function ff written in some basic language. The function accepts an integer value, which is immediately written into some variable xx. xx is an integer variable and can be assigned values from 00 to 232−1232−1. The function contains t…
传送门 Description As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a pr…