Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了!         为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的:         首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中:         然后,待所有字条加入完毕,每人从箱中取一个字条:         最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!”         大家可以想象一下当时的气氛之热烈,毕竟中奖者的奖品是…
Description In a k bit 2's complement number, where the bits are indexed from 0 to k-1, the weight of the most significant bit (i.e., in position k-1), is -2^(k-1), and the weight of a bit in any position i (0 ≤ i < k-1) is 2^i. For example, a 3 bit…
Description Sally Jones has a dozen Voyageur silver dollars. However, only eleven of the coins are true silver dollars; one coin is counterfeit even though its color and size make it indistinguishable from the real silver dollars. The counterfeit coi…
Description          在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数.         例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图:                  Input 输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2×n (0<n<=50).                  Output 对于每个测试实例,请输出铺放方案的总数,每个实例的输出占一行.              …
Description          有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行.请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数.         其中,蜂房的结构如下所示.         Input 输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50).                  Output 对于每个测试实例,请输出蜜蜂从蜂房a爬到蜂房b的可能路线数,每个实例的输出占一行.              …
Description Bessie is training for her next race by running on a path that includes hills so that she will be prepared for any terrain. She has planned a straight path and wants to run as far as she can -- but she must be back to the farm within M se…
Description Soon 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 satisf…
Description A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (up the page)         S south (down the page)     …
Description During his last sabbatical, professor M. A. Ya made a surprising discovery about the old Maya calendar. From an old knotted message, professor discovered that the Maya civilization used a 365 day long year, called Haab, which had 19 month…
Description          今年的ACM暑期集训队一共有18人,分为6支队伍.其中有一个叫做EOF的队伍,由04级的阿牛.XC以及05级的COY组成.在共同的集训生活中,大家建立了深厚的友谊,阿牛准备做点什么来纪念这段激情燃烧的岁月,想了一想,阿牛从家里拿来了一块上等的牛肉干,准备在上面刻下一个长度为n的只由"E" "O" "F"三种字符组成的字符串(可以只有其中一种或两种字符,但绝对不能有其他字符),阿牛同时禁止在串中出现O相邻的…
Description A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive integer numbers ranging from 1 to k, written on…
Description T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN = 10 6-1. T. Chur finds this range of SINs too lar…
Description The 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 contains two or more digits, those digits are summe…
Description The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105.                          Input Input will consist…
Description          国庆期间,省城HZ刚刚举行了一场盛大的集体婚礼,为了使婚礼进行的丰富一些,司仪临时想出了有一个有意思的节目,叫做"考新郎",具体的操作是这样的:         首先,给每位新娘打扮得几乎一模一样,并盖上大大的红盖头随机坐成一排;         然后,让各位新郎寻找自己的新娘.每人只准找一个,并且不允许多人找一个.         最后,揭开盖头,如果找错了对象就要当众跪搓衣板...         看来做新郎也不是容易的事情...     …
Description Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".                         Input each test case contains two numbers A and B.                          Output for each case, if A is equa…
Description Give you a number on base ten,you should output it on base two.(0 < n < 1000)                         Input For each case there is a postive number n on base ten, end of file.                         Output For each case output a number…
Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.                          Input The first line of the input contains an integer T(1<=T<=20) which means the number of test cases.…
Description Problems involving the computation of exact values of very large magnitude and precision are common. For example, the computation of the national debt is a taxing experience for many computer systems.         This problem requires that yo…
Description 网上流传一句话:"常在网上飘啊,哪能不挨刀啊-".其实要想能安安心心地上网其实也不难,学点安全知识就可以.         首先,我们就要设置一个安全的密码.那什么样的密码才叫安全的呢?一般来说一个比较安全的密码至少应该满足下面两个条件:         (1).密码长度大于等于8,且不要超过16.         (2).密码中的字符应该来自下面“字符类别”中四组中的至少三组.         这四个字符类别分别为:         1.大写字母:A,B,C.…
Description          读入两个小于100的正整数A和B,计算A+B.                 需要注意的是:A和B的每一位数字由对应的英文单词给出.                          Input 测试输入包含若干测试用例,每个测试用例占一行,格式为"A + B =",相邻两字符串有一个空格间隔.当A和B同时为0时输入结束,相应的结果不要输出.                          Output 对每个测试用例输出1行,即A+B的值…
题目 解题思路:      典型的错排题目      首先求出所有的拿错的情况,然后求出错排的所有情况,以前者除以后者就是百分比      现在求对应的所有都拿错的情况.容易知道,f(1)=0,f(2)=1      然后,对于N个人,有n-1个人拿错票和n-2个人拿错票的情况     ① 当有n-1个拿错票时,在加入一个人,只要第n个人和前面任意的n-1个人其中一个调换票就可以了,所以有f(n-1)*(n-1). ②当有n-2个拿错票时,只能是没拿错的那个人与第n个交换票,而那个人可能是前面n…
#include<stdio.h> ] = { -,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,-,- }; ] = { }; long long jiecheng(int n) { ) { return b[n]; } )*n; } long long recrusion(int n) { ) return a[n]; )*(recrusion(n - ) + recrusion(n - )); } int main() { int n, m; int i;…
题目链接 Problem Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中:然后,待所有字条加入完毕,每人从箱中取一个字条:最后,如果取得的字条上写的就是自己的名字,那么“恭喜你,中奖了!”大家可以想象一下当时的气氛之热烈,毕竟中奖者的奖品是大家梦寐以求的Twins签名照呀!不过,正如所有试图设计的喜剧往…
神.上帝以及老天爷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 22063    Accepted Submission(s): 9286 Problem Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的:…
神.上帝以及老天爷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17381    Accepted Submission(s): 7409 Problem DescriptionHDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的:…
神.上帝以及老天爷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 22876    Accepted Submission(s): 9609 Problem Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样…
HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这样的: 首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中: 然后,待所有字条加入完毕,每人从箱中取一个字条: 最后,如果取得的字条上写的就是自己的名字,那么"恭喜你,中奖了!" 大家可以想象一下当时的气氛之热烈,毕竟中奖者的奖品是大家梦寐以求的Twins签名照呀!不过,正如所有试图设计的喜剧往往以悲剧结尾,这次抽奖活动最后…
神.上帝以及老天爷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51558    Accepted Submission(s): 20839 Problem Description HDU 2006'10 ACM contest的颁奖晚会隆重开始了! 为了活跃气氛,组织者举行了一个别开生面.奖品丰厚的抽奖活动,这个活动的具体要求是这…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=2048 神.上帝以及老天爷 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 50263    Accepted Submission(s): 20303 Problem Description HDU 2006'10 ACM contest的颁…