摘要:
DescriptionThe least common multiple (LCM) of a set of positive integers is the smallest positive integer which isdivisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105.InputInput will consist of multiple problem instances. The first line of the input file will contain a 阅读全文
摘要:
Description宣讲会上有连续编号为1...N的N个座位,每个座位只能坐一个人,有N个人,学校有M个不同专业,如果相邻座位的同学的专业相同,就会发生悄悄话现象,求有多少种情况可能发生悄悄话现象。(不一定每个专业都有人来)Input输入包括多组数据,以文件(EOF)结束。每组测试数据两个整数N(1int pow(int n,int m)//求m^n{ int sum=1; int i; for(i=0;i<n;i++) sum*=m; return sum;}int main(){ int n,m; while(scanf("%d%d",&n,&m 阅读全文
摘要:
Description期末成绩出来了,又是58,59,无奈啊,yobobobo无法接受这个现实,于是暗下决定:从此之后,5,8,9这些数字将在我的字典里消失!现在yobobobo的世界里没有5,8,9,所以他世界里的数值和我们不一样,在他的世界里,4之后就到了6(我们当然是5),所以yobobobo的世界是这样的:1,2,3,4,6,7,10,11,12,13,14,16,,17……..47,60……,现在给你一个yobobobo世界里的数值N,请输出他原来的数值(比如6,其实它本来是5)。Input输入包括多组数据,以文件(EOF)结束。每组测试数据一个整数N(0int pow(int n) 阅读全文
摘要:
Description德玛的经典台词:人在塔在。由于最近LOL增加了草丛数量(草丛伦怎能不开心?!)由于太过于兴奋,盖伦突然变成白痴了- -,连最经典的台词都变为:人在塔亡(变身剑圣?),德玛现在的症状是:如果该单词在句子中的序号为素数的话,他就会把这个单词反过来说(abcd -> dcba),为了治疗盖伦,你得和盖伦交流,寻求找到治疗他的方法。德玛说话完全变反了,现在你的任务是将盖伦的话翻译回他本来的意思,比如德玛说:i evil dna tower tsixe其实他的本意是i live and tower exist(因为2,3,5是素数,所以这些位置上的单词反过来了)注意:1不是素 阅读全文
摘要:
DescriptionRoy has just moved into a new apartment. Well, actually the apartment itself is not very new, even dating back to the days before people had electricity in their houses. Because of this, Roy's apartment has only one single wall outlet, so Roy can only power one of his electrical appli 阅读全文
摘要:
Description相传有一天,诸葛亮把将士们召集在一起,说:“你们中间不论谁,从1~1024中任意挑选一个整数,记在心里,我提十个问题,只要求回答'是'或'大于','小于'.十个问题全答完以后,我 就会‘算’出你心里记的那个数。”诸葛亮刚说完,一个谋士站起来说,他已经选好了一个数。诸葛亮问道:“你选的数大于512?”谋士答:“不是。”诸葛亮又接连向这,谋士提了九个问题,谋士一一作了回答。诸葛亮最后说:“你记的那个数是1。”谋士听了极为惊奇,因为这个数字真是他选的数。你知道诸葛亮是怎么妙算的吗?现在给你一个整数N,表示你要猜一个范围为【1,N】 阅读全文
摘要:
DescriptionAnna, Betty, Cindy and Zelda like playing the card game Euchre. Euchre is a game for two teams of two, and each time they meet the girls split off into different teams. They also keep overall records of the number of games each player has won and lost. Anna has misplaced her won-loss resu 阅读全文