随笔分类 -  HDOJ

摘要:Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.Consider the following algori 阅读全文
posted @ 2013-04-10 18:14 cpoint
摘要:Problem DescriptionThese days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to sort these number ascending (升序).You should know how easy the proble 阅读全文
posted @ 2013-04-09 23:59 cpoint
摘要:Problem Description给你2个分数,求他们的和,并要求和为最简形式。Input输入首先包含一个正整数T(T<=1000),表示有T组测试数据,然后是T行数据,每行包含四个正整数a,b,c,d(0<a,b,c,d<1000),表示两个分数a/b 和 c/d。Output对于每组测试数据,输出两个整数e和f,表示a/b + c/d的最简化结果是e/f,每组输出占一行。Sample Input21 2 1 34 3 2 3Sample Output5 62 1 1 #include<stdio.h> 2 #include<math.h> 3 阅读全文
posted @ 2013-04-09 23:16 cpoint
摘要:Problem Description输入一个十进制数N,将它转换成R进制数输出。Input输入数据包含多个测试实例,每个测试实例包含两个整数N(32位整数)和R(2<=R<=16, R<>10)。Output为每个测试实例输出转换后的数,每个输出占一行。如果R大于10,则对应的数字规则参考16进制(比如,10用A表示,等等)。Sample Input7 223 12-4 3Sample Output1111B-11 1 #include <stdio.h> 2 #include <math.h> 3 #include <string.h& 阅读全文
posted @ 2013-04-09 23:00 cpoint
摘要:Problem Description有n(n<=100)个整数,已经按照从小到大顺序排列好,现在另外给一个整数x,请将该数插入到序列中,并使新的序列仍然有序。Input输入数据包含多个测试实例,每组数据由两行组成,第一行是n和m,第二行是已经有序的n个数的数列。n和m同时为0标示输入数据的结束,本行不做处理。Output对于每个测试实例,输出插入新的元素后的数列。Sample Input3 31 2 40 0Sample Output1 2 3 4 1 #include <stdio.h> 2 #include <math.h> 3 #include <s 阅读全文
posted @ 2013-04-09 22:53 cpoint
摘要:Problem Description给定三条边,请你判断一下能不能组成一个三角形。Input输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;Output对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。Sample Input2 1 2 32 2 2Sample OutputNOYES 1 #include<stdio.h> 2 #include<math.h> 3 #include<ctype.h> 4 #include<string.h> 5 6 阅读全文
posted @ 2013-04-09 22:14 cpoint
摘要:Big NumberProblem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are given a number, you have to determine the number of digits in the factorial of the number.In 阅读全文
posted @ 2013-02-17 10:04 cpoint
摘要:Digital RootsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThe digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value co 阅读全文
posted @ 2011-05-31 00:59 cpoint
摘要:Leftmost DigitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionGiven a positive integer N, you should output the leftmost digit of N^N.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of 阅读全文
posted @ 2011-05-31 00:00 cpoint
摘要:EncodingProblem DescriptionGiven a string containing only 'A' - 'Z', we could encode it using the following method:1. Each sub-string containing k same characters should be encoded to "kX" where "X" is the only character in this sub-string.2. If the length of the 阅读全文
posted @ 2011-05-30 19:39 cpoint
摘要:Design T-ShirtProblem DescriptionSoon after he decided to design a T-shirt for our Algorithm Board on Free-City BBS, XKA found that he was trapped by all kinds of suggestions from everyone on the board. It is indeed a mission-impossible to have everybody perfectly satisfied. So he took a poll to col 阅读全文
posted @ 2011-05-30 17:34 cpoint
摘要:{A} + {B}Time Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description给你两个集合,要求{A} + {B}.注:同一个集合中不会有两个相同的元素.Input每组输入数据分为三行,第一行有两个数字n,m(0<n,m<=10000),分别表示集合A和集合B的元素个数.后两行分别表示集合A和集合B.每个元素为不超出int范围的整数,每个元素之间有一个空格隔开.Output针对每组数据输出一行数据,表示合并后的集合,要求从小到大输出,每个元素之间 阅读全文
posted @ 2011-05-20 00:50 cpoint
摘要:完数Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description完数的定义:如果一个大于1的正整数的所有因子之和等于它的本身,则称这个数是完数,比如6,28都是完数:6=1+2+3;28=1+2+4+7+14。本题的任务是判断两个正整数之间完数的个数。Input输入数据包含多行,第一行是一个正整数n,表示测试实例的个数,然后就是n个测试实例,每个实例占一行,由两个正整数num1和num2组成,(1<num1,num2<10000) 。Output对 阅读全文
posted @ 2011-05-20 00:02 cpoint
摘要:测试你是否和LTC水平一样高Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Problem Description大家提到LTC都佩服的不行,不过,如果竞赛只有这一个题目,我敢保证你和他绝对在一个水平线上!你的任务是:计算方程x^2+y^2+z^2= num的一个正整数解。Input输入数据包含多个测试实例,每个实例占一行,仅仅包含一个小于等于10000的正整数num。Output对于每组测试数据,请按照x,y,z递增的顺序输出它的一个最小正整数解,每个实例的输出占一行,题目保证所有测 阅读全文
posted @ 2011-05-19 23:34 cpoint
摘要:Easier Done Than Said?Problem DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them an 阅读全文
posted @ 2011-05-19 00:35 cpoint
摘要:A == B ?Problem DescriptionGive you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two numbers A and B.Outputfor each case, if A is equal to B, you should print "YES", or print "NO".Sample Input1 2 2 阅读全文
posted @ 2011-04-25 01:00 cpoint
摘要:手机短号Problem Description大家都知道,手机号是一个11位长的数字串,同时,作为学生,还可以申请加入校园网,如果加入成功,你将另外拥有一个短号。假设所有的短号都是是 6+手机号的后5位,比如号码为13512345678的手机,对应的短号就是645678。现在,如果给你一个11位长的手机号码,你能找出对应的短号吗?Input输入数据的第一行是一个N(N <= 200),表示有N个数据,接下来的N行每一行为一个11位的手机号码。Output输出应包括N行,每行包括一个对应的短号,输出应与输入的顺序一致。Sample Input2 1351234567813787654321 阅读全文
posted @ 2011-04-25 00:47 cpoint
摘要:密码Problem Description网上流传一句话:"常在网上飘啊,哪能不挨刀啊~"。其实要想能安安心心地上网其实也不难,学点安全知识就可以。首先,我们就要设置一个安全的密码。那什么样的密码才叫安全的呢?一般来说一个比较安全的密码至少应该满足下面两个条件:(1).密码长度大于等于8,且不要超过16。(2).密码中的字符应该来自下面“字符类别”中四组中的至少三组。这四个字符类别分别为:1.大写字母:A,B,C...Z;2.小写字母:a,b,c...z;3.数字:0,1,2...9;4.特殊符号:~,!,@,#,$,%,^;给你一个密码,你的任务就是判断它是不是一个安全的 阅读全文
posted @ 2011-04-25 00:29 cpoint
摘要:一只小蜜蜂...Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。Input输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。Output对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行。Sample Input2 1 23 6Sample Output13AuthorlcySource递推求解专题练习(For Beginner)AC code:#include< 阅读全文
posted @ 2011-04-24 23:12 cpoint
摘要:汉字统计Problem Description统计给定文本文件中汉字的个数。Input输入文件首先包含一个整数n,表示测试实例的个数,然后是n段文本。Output对于每一段文本,输出其中的汉字的个数,每个测试实例的输出占一行。[Hint:]从汉字机内码的特点考虑~Sample Input2 WaHaHa! WaHaHa! 今年过节不说话要说只说普通话WaHaHa! WaHaHa! 马上就要期末考试了Are you ready?Sample Output14 9AC code:#include<stdio.h>#include<math.h>#include<cty 阅读全文
posted @ 2011-04-13 22:35 cpoint

浏览次数:travelocity promotion codes