随笔分类 - 杂题
摘要:Problem DescriptionLittle Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytim...
阅读全文
摘要:题目描述 Apojacsleam喜欢数组。 他现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次操作: 操作一:将a[L]-a[R]内的元素都加上P 操作二:将a[L]-a[R]内的元素都减去P 最后询问a[...
阅读全文
摘要:For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to kno...
阅读全文
摘要:Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file ...
阅读全文
摘要:Time limit 1000 ms Memory limit 32768 kB The digital root of a positive integer is found by summing the digits of the integer....
阅读全文
摘要:Time limit 2000 ms Memory limit 262144 kBKefa decided to make some money doing business on the Internet for exactly n days. He...
阅读全文
摘要:Time limit 1000 ms Memory limit 512000 kB 《Shui Hu Zhuan》,also 《Water Margin》was written by Shi Nai'an -- an writer of Yuan a...
阅读全文
摘要:Time limit 1000 ms Memory limit 32768 kBRock-paper-scissors is a zero-sum hand game usually played between two people, in whic...
阅读全文
摘要:Time limit 1000 ms Memory limit 32768 kB统计给定文本文件中汉字的个数。Input 输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。 Output 对于每一段文本,输出其中的汉字的个...
阅读全文
摘要:Time limit 1000 ms Memory limit 32768 kB 今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考...
阅读全文
摘要:Time limit 10000 msMemory limit 262144 kB小Ho根据最近在密码学课上学习到的知识,开发出了一款hiho密码,这款密码的秘钥是这样生成的:对于一种有N个字母的语言,选择一个长度为M的单词;将组成这个单词的所有字母按...
阅读全文
摘要:体育老师小明要将自己班上的学生按顺序排队。他首先让学生按学号从小到大的顺序排成一排,学号小的排在前面,然后进行多次调整。一次调整小明可能让一位同学出队,向前或者向后移动一段距离后再插入队列。 例如,下面给出了一组移动的例子,例子中学生的人数为8人。 0)初始队...
阅读全文
摘要:给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度.回文就是正反读都是一样的字符串,如aba, abba等 Input 输入有多组case,不超过120组,每组输入为一行小写英文字符a,b,c…y,z组成的字符串S ...
阅读全文
摘要:吉哥又想出了一个新的完美队形游戏! 假设有n个人按顺序站在他的面前,他们的身高分别是h[1], h[2] ... h[n],吉哥希望从中挑出一些人,让这些人形成一个新的队形,新的队形若满足以下三点要求,则就是新的完美队形: 1、挑出的人保持原队形的相对顺序不变,...
阅读全文
摘要:KazaQ wears socks everyday.At the beginning, he has n pairs of socks numbered from 1 to n in his closets.Every morning, he puts on a p...
阅读全文
摘要:ztr loves lucky numbers. Everybody knows that positive integers are lucky if their decimal representation doesn’t contain digits other...
阅读全文