题目大意 Description 给你一个字符集合,你从其中找出一些字符串出来. 希望你找出来的这些字符串的最长公共前缀*字符串的总个数最大化. Input 第一行给出数字N.N在[2,1000000] 下面N行描述这些字符串,长度不超过20000 .保证输入文件不超过10MB Output 输出一行一个整数代表字符串的最长公共前缀*字符串的总个数的最大值. Sample Input 7 Jora de Sus Orhei Jora de Mijloc Joreni Jora de Jos Ja…
Let's call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different groups must contain different symbols). For example, ababa is adorable (you can transform it to aaab…
After waking up at hh:mm, Andrew realised that he had forgotten to feed his only cat for yet another time (guess why there's only one cat). The cat's current hunger level is H points, moreover each minute without food increases his hunger by D points…
题目链接:http://codeforces.com/problemset/problem/471/A 题目数据规模1 - 9,可以用一个数组进行计数,减掉出现四次的数,看看还有几个是非零数,有一个就是大象,有两个就是北极熊:如果没有四个数的,那就是Alien. AC代码: #include <cstdio> using namespace std; int cnt[10]; int x, id; int main() { id = 0; cnt[10] = {0}; for (int i =…