摘要: Problem Description定义:一个词组中每个单词的首字母的大写组合称为该词组的缩写。比如,C语言里常用的EOF就是end of file的缩写。Input输入的第一行是一个整数T,表示一共有T组测试数据;接下来有T行,每组测试数据占一行,每行有一个词组,每个词组由一个或多个单词组成;每... 阅读全文
posted @ 2014-10-27 23:13 zqxLonely 阅读(1150) 评论(0) 推荐(0) 编辑
摘要: Problem Description给定一个长度为偶数位的0,1字符串,请编程实现串的奇偶位互换。Input输入包含多组测试数据;输入的第一行是一个整数C,表示有C测试数据;接下来是C组测试数据,每组数据输入均为0,1字符串,保证串长为偶数位(串长 2 #include 3 4 int mai... 阅读全文
posted @ 2014-10-27 20:34 zqxLonely 阅读(937) 评论(0) 推荐(0) 编辑
摘要: Problem Description求n个整数中倒数第二小的数。每一个整数都独立看成一个数,比如,有三个数分别是1,1,3,那么,第二小的数就是1。Input输入包含多组测试数据。输入的第一行是一个整数C,表示有C测试数据;每组测试数据的第一行是一个整数n,表示本组测试数据有n个整数(2 2 3... 阅读全文
posted @ 2014-10-27 20:08 zqxLonely 阅读(267) 评论(0) 推荐(0) 编辑
摘要: Problem Description给你2个分数,求他们的和,并要求和为最简形式。Input输入首先包含一个正整数T(T 2 3 int get_gcd(int a,int b); 4 5 int main(){ 6 int T; 7 int a; 8 int b; 9... 阅读全文
posted @ 2014-10-27 19:52 zqxLonely 阅读(327) 评论(0) 推荐(0) 编辑
摘要: Problem Description当寒月还在读大一的时候,他在一本武林秘籍中(据后来考证,估计是计算机基础,狂汗-ing),发现了神奇的二进制数。如果一个正整数m表示成二进制,它的位数为n(不包含前导0),寒月称它为一个n二进制数。所有的n二进制数中,1的总个数被称为n对应的月之数。例如,3二进... 阅读全文
posted @ 2014-10-27 19:34 zqxLonely 阅读(419) 评论(0) 推荐(0) 编辑
摘要: Problem Description做人要有一身正气,杭电学子都应该如此。比如我们今天的考试就应该做到“诚信”为上。每次考试的第一个题目总是很简单,今天也不例外,本题是要求输出指定大小的"HDU"字符串,特别地,为了体现“正气”二字,我们要求输出的字符串也是正方形的(行数和列数相等)。Input输... 阅读全文
posted @ 2014-10-27 19:13 zqxLonely 阅读(251) 评论(0) 推荐(0) 编辑
摘要: Problem Description有三个正整数a,b,c(0 2 3 int get_gcd(int a,int b); 4 5 int main(){ 6 int T; 7 int a; 8 int b; 9 int c;10 11 scan... 阅读全文
posted @ 2014-10-27 18:54 zqxLonely 阅读(247) 评论(0) 推荐(0) 编辑
摘要: Problem Description妈妈每天都要出去买菜,但是回来后,兜里的钱也懒得数一数,到底花了多少钱真是一笔糊涂帐。现在好了,作为好儿子(女儿)的你可以给她用程序算一下了,呵呵。Input输入含有一些数据组,每组数据包括菜种(字串),数量(计量单位不论,一律为double型数)和单价(dou... 阅读全文
posted @ 2014-10-27 18:21 zqxLonely 阅读(628) 评论(0) 推荐(0) 编辑
摘要: Problem Description求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1 2 3 int main(){ 4 int a; 5 int b; 6 int resul... 阅读全文
posted @ 2014-10-27 17:16 zqxLonely 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Problem Description参加过上个月月赛的同学一定还记得其中的一个最简单的题目,就是{A}+{B},那个题目求的是两个集合的并集,今天我们这个A-B求的是两个集合的差,就是做集合的减法运算。(当然,大家都知道集合的定义,就是同一个集合中不会有两个相同的元素,这里还是提醒大家一下)呵呵,... 阅读全文
posted @ 2014-10-27 17:07 zqxLonely 阅读(598) 评论(0) 推荐(0) 编辑
摘要: 描述现在给你一个正整数N,要你快速的找出在2.....N这些数里面所有的素数。输入给出一个正整数数N(N 2 #include 3 #include 4 #define N 2000001 5 6 int main(){ 7 int i; 8 int j; 9 ch... 阅读全文
posted @ 2014-10-27 16:36 zqxLonely 阅读(913) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionIn many applications very large integers numbers arerequired. Some of these applications are using keys for secure transmission ofd... 阅读全文
posted @ 2014-10-27 16:33 zqxLonely 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 输入第一行有一个整数m(1 2 #include 3 #define N 1000001 4 5 int main(){ 6 int T; 7 char number[N]; 8 int temp; 9 int i;10 int length;11 ... 阅读全文
posted @ 2014-10-27 16:31 zqxLonely 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 描述相传韩信才智过人,从不直接清点自己军队的人数,只要让士兵先后以三人一排、五人一排、七人一排地变换队形,而他每次只掠一眼队伍的排尾就知道总人数了。输入3个非负整数a,b,c ,表示每种队形排尾的人数(a 2 3 int main(){ 4 int a; 5 int b; 6 ... 阅读全文
posted @ 2014-10-27 16:29 zqxLonely 阅读(16734) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionContest time again! How excited it is to see balloonsfloating around. But to tell you a secret, the judges' favorite time isguessin... 阅读全文
posted @ 2014-10-27 16:27 zqxLonely 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at wh... 阅读全文
posted @ 2014-10-27 16:25 zqxLonely 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In... 阅读全文
posted @ 2014-10-27 16:24 zqxLonely 阅读(255) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same charac... 阅读全文
posted @ 2014-10-27 16:22 zqxLonely 阅读(301) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2).InputInput consists of a sequence o... 阅读全文
posted @ 2014-10-27 16:20 zqxLonely 阅读(214) 评论(0) 推荐(0) 编辑
摘要: Problem Description给定两个正整数,计算这两个数的最小公倍数。Input输入包含多组测试数据,每组只有一行,包括两个不大于1000的正整数.Output对于每个测试用例,给出这两个数的最小公倍数,每个实例输出一行。Sample Input10 14Sample Output70 1... 阅读全文
posted @ 2014-10-27 16:18 zqxLonely 阅读(269) 评论(0) 推荐(0) 编辑