随笔分类 - OJ HDU
摘要:题目链接: "HDU 2010" Description 春天是鲜花的季节,水仙花就是其中最迷人的代表,数学上有个水仙花数,他是这样定义的: “水仙花数”是指一个三位数,它的各位数字的立方和等于其本身,比如:153=1^3+5^3+3^3。 现在要求输出所有在m和n范围内的水仙花数。 Input 输
阅读全文
摘要:题目链接: "HDU 2009" Description 数列的定义如下: 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和。 Input 输入数据有多组,每组占一行,由两个整数n(n0){ ans+=s; s=Math.sqrt(s); } System.out.format("%.
阅读全文
摘要:题目链接: "HDU 2008" Description 统计给定的n个数中,负数、零和正数的个数。 Input 输入数据有多组,每组占一行,每行的第一个数是整数n(n0){ t=read.nextDouble(); if(t 0) ans1++; else if(t==0) ans2++; els
阅读全文
摘要:题目链接: "HDU 2006" Description 给你n个整数,求他们中所有奇数的乘积。 Input 输入数据包含多个测试实例,每个测试实例占一行,每行的第一个数为n,表示本组数据一共有n个,接着是n个整数,你可以假设每组数据必定至少存在一个奇数。 Output 输出每组数中的所有奇数的乘积
阅读全文
摘要:题目链接: "HDU 2007" Description 给定一段连续的整数,求出他们中所有偶数的平方和以及所有奇数的立方和。 Input 输入数据包含多组测试实例,每组测试实例包含一行,由两个整数m和n组成。 Output 对于每组输入数据,输出一行,应包括两个整数x和y,分别表示该段连续的整数中
阅读全文
摘要:题目链接: "HDU 2005" Description 给定一个日期,输出这个日期是该年的第几天。 Input 输入数据有多组,每组占一行,数据格式为YYYY/MM/DD组成,具体参见sample input ,另外,可以向你确保所有的输入数据是合法的。 Output 对于每组输入数据,输出一行,
阅读全文
摘要:题目链接: "HDU 2004" Description 输入一个百分制的成绩t,将其转换成对应的等级,具体转换规则如下: 90~100为A; 80~89为B; 70~79为C; 60~69为D; 0~59为E; Input 输入数据有多组,每组占一行,由一个整数组成。 Output 对于每组输入数
阅读全文
摘要:题目链接: "HDU 2003" Description 求实数的绝对值。 Input 输入数据有多组,每组占一行,每行包含一个实数。 Output 对于每组输入数据,输出它的绝对值,要求每组数据输出一行,结果保留两位小数。 Sample Input 123 234.00 Sample Output
阅读全文
摘要:题目链接: "HDU 2002" Description 根据输入的半径值,计算球的体积。 Input 输入数据有多组,每组占一行,每行包括一个实数,表示球的半径。 Output 输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。 Sample Input 1 1.5 Sampl
阅读全文
摘要:题目链接: "HDU 2001" Description 输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离。 Input 输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开。 Output 对于每组输入数据,输出一行,结果保留两位小数。
阅读全文
摘要:题目链接: "HDU 2000" Description 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。 Input 输入数据有多组,每组占一行,有三个字符组成,之间无空格。 Output 对于每组输入数据,输出一行,字符中间用一个空格分开。 Sample Input qwe
阅读全文
摘要:题目链接: "HDU 4920" Description Given two matrices A and B of size n×n, find the product of them. bobo hates big integers. So you are only asked to find
阅读全文
摘要:题目链接: "HDU 1004" Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite tim
阅读全文
摘要:题目链接: "HDU 1069" Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a b
阅读全文
摘要:题目链接: "HDU 1548" Description There is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 include include incl
阅读全文
摘要:题目链接: "HDU 1501" Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the first
阅读全文
摘要:题目链接: "HDU 1426" Description 自从2006年3月10日至11日的首届数独世界锦标赛以后,数独这项游戏越来越受到人们的喜爱和重视。 据说,在2008北京奥运会上,会将数独列为一个单独的项目进行比赛,冠军将有可能获得的一份巨大的奖品———HDU免费七日游外加lcy亲笔签名以及
阅读全文
摘要:题目链接: "HDU 1728" Description 给定一个m × n (m行, n列)的迷宫,迷宫中有两个位置,gloria想从迷宫的一个位置走到另外一个位置,当然迷宫中有些地方是空地,gloria可以穿越,有些地方是障碍,她必须绕行,从迷宫的一个位置,只能走到与它相邻的4个位置中,当然在行
阅读全文
摘要:题目链接: "HDU 1016" Description A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the
阅读全文
摘要:题目链接: "HDU 1312" Description There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a
阅读全文