




已阅读5页,还剩26页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1002 A + B Problem II(大整数加法)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 60902Accepted Submission(s): 11165Problem DescriptionI have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe first line of the input contains an integer T(1=T=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you should not process them by using 32-bit integer. You may assume the length of each integer will not exceed 1000.OutputFor each test case, you should output two lines. The first line is Case #:, # means the number of the test case. The second line is the an equation A + B = Sum, Sum means the result of A + B. Note there are some spaces int the equation. Output a blank line between two test cases.Sample Input21 2112233445566778899 998877665544332211Sample OutputCase 1:1 + 2 = 3Case 2:112233445566778899 + 998877665544332211 = 11111111111111111101013Digital Roots(求各位数之和)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16597Accepted Submission(s): 4705Problem 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 contains two or more digits, those digits are summed and the process is repeated. This is continued as long as necessary to obtain a single digit.For example, consider the positive integer 24. Adding the 2 and the 4 yields a value of 6. Since 6 is a single digit, 6 is the digital root of 24. Now consider the positive integer 39. Adding the 3 and the 9 yields 12. Since 12 is not a single digit, the process must be repeated. Adding the 1 and the 2 yeilds 3, a single digit and also the digital root of 39.InputThe input file will contain a list of positive integers, one per line. The end of the input will be indicated by an integer value of zero.OutputFor each integer in the input, output its digital root on a separate line of the output.Sample Input24390Sample Output631018 Big Number(求N!位数)Time Limit: 20000/10000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8735Accepted Submission(s): 3872Problem 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.InputInput consists of several lines of integer numbers. The first line contains an integer n, which is the number of cases to be tested, followed by n lines, one integer 1 n 107 on each line.OutputThe output contains the number of digits in the factorial of the integers appearing in the input.Sample Input21020Sample Output7191019Least Common Multiple(最小公倍数)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9414Accepted Submission(s): 3346Problem DescriptionThe 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.InputInput will consist of multiple problem instances. The first line of the input will contain a single integer indicating the number of problem instances. Each instance will consist of a single line of the form m n1 n2 n3 . nm where m is the number of integers in the set and n1 . nm are the integers. All integers will be positive and lie within the range of a 32-bit integer.OutputFor each problem instance, output a single line containing the corresponding LCM. All results will lie in the range of a 32-bit integer.Sample Input23 5 7 156 4 10296 936 1287 792 1Sample Output105102961020 Encoding(字符串编码)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8570Accepted Submission(s): 3552Problem 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 sub-string is 1, 1 should be ignored.InputThe first line contains an integer N (1 = N = 100) which indicates the number of test cases. The next N lines contain N strings. Each string consists of only A - Z and the length is less than 10000.OutputFor each test case, output the encoded string in a line.Sample Input2ABCABBCCCSample OutputABCA2B3C2117Just a Numble(小数点后的位数计算)Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 908Accepted Submission(s): 377Problem DescriptionNow give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followedInputEach line of input will contain a pair of integers for n and m(1=n=107,1=m=105)OutputFor each line of input, your program should print a numble on a line,according to the above rulesSample Input4 25 7123 123Sample Output508AuthorYBBSourceHDU 2007-10 Programming Contest_WarmUp Recommend威士忌1197 Specialized Four-Digit Numbers(多进制位运算)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1038Accepted Submission(s): 737Problem DescriptionFind and list all four-digit numbers in decimal notation that have the property that the sum of its four digits equals the sum of its digits when represented in hexadecimal (base 16) notation and also equals the sum of its digits when represented in duodecimal (base 12) notation.For example, the number 2991 has the sum of (decimal) digits 2+9+9+1 = 21. Since 2991 = 1*1728 + 8*144 + 9*12 + 3, its duodecimal representation is 1893(12), and these digits also sum up to 21. But in hexadecimal 2991 is BAF16, and 11+10+15 = 36, so 2991 should be rejected by your program.The next number (2992), however, has digits that sum to 22 in all three representations (including BB016), so 2992 should be on the listed output. (We dont want decimal numbers with fewer than four digits - excluding leading zeroes - so that 2992 is the first correct answer.)InputThere is no input for this problem.OutputYour output is to be 2992 and all larger four-digit numbers that satisfy the requirements (in strictly increasing order), each on a separate line with no leading or trailing blanks, ending with a new-line character. There are to be no blank lines in the output. The first few lines of the output are shown below.Sample InputThere is no input for this problem.Sample Output29922993299429952010年10月24日1061 Rightmost DigitTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1817Accepted Submission(s): 739Problem DescriptionGiven a positive integer N, you should output the most right digit of NN.InputThe input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.Each test case contains a single positive integer N(1=N=1,000,000,000).OutputFor each test case, you should output the rightmost digit of NN.Sample Input234Sample Output76HintIn the first case, 3 * 3 * 3 = 27, so the rightmost digit is 7.In the second case, 4 * 4 * 4 * 4 = 256, so the rightmost digit is 6. AuthorIgnatius.L2035人见人爱ABTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1300Accepted Submission(s): 961Problem Description求AB的最后三位数表示的整数。说明:AB的含义是“A的B次方”Input输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1=A,B=10000),如果A=0, B=0,则表示输入数据的结束,不做处理。Output对于每个测试实例,请输出AB的最后三位表示的整数,每个输出占一行。Sample Input2 312 66789 100000 0Sample Output89841AuthorlcySourceACM程序设计期末考试(2006/06/07)Recommendlcy1425 sortTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2913Accepted Submission(s): 707Problem Description给你n个整数,请按从大到小的顺序输出其中前m大的数。Input每组测试数据有两行,第一行有两个数n,m(0n,m1000000),第二行包含n个各不相同,且都处于区间-500000,500000的整数。Output对每组测试数据按从大到小的顺序输出前m大的数。Sample Input5 33 -35 92 213 -644Sample Output213 92 3HintHint 请用VC/VC+提交AuthorLLSourceACM暑期集训队练习赛(三)Recommendlinle1205吃糖果Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 2000/1000 K (Java/Others)Total Submission(s): 1383Accepted Submission(s): 443Problem DescriptionHOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。Input第一行有一个整数T,接下来T组数据,每组数据占2行,第一行是一个整数N(0N=1000000),第二行是N个数,表示N种糖果的数目Mi(0Mi=1000000)。Output对于每组数据,输出一行,包含一个Yes或者No。Sample Input234 1 155 4 3 2 1Sample OutputNoYesHintHint Please use function scanfAuthorGardonSourceGardon - DYGGs contest 2RecommendJGShining1106 排序Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12778Accepted Submission(s): 3083Problem Description输入一行数字,如果我们把这行数字中的5都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以0开头,这些头部的0应该被忽略掉,除非这个整数就是由若干个0组成的,这时这个整数就是0)。你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。Input输入包含多组测试用例,每组输入数据只有一行数字(数字之间没有空格),这行数字的长度不大于1000。输入数据保证:分割得到的非负整数不会大于100000000;输入数据不可能全由5组成。Output对于每个测试用例,输出分割得到的整数排序的结果,相邻的两个整数之间用一个空格分开,每组输出占一行。Sample Input0051231232050775Sample Output0 77 12312320SourcePOJ RecommendEddy2010年10月31日星期日2046 骨牌铺方格Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8571Accepted Submission(s): 4112Problem Description在2n的一个长方形方格中,用一个1 2的骨牌铺满方格,输入n ,输出铺放方案的总数.例如n=3时,为2 3方格,骨牌的铺放方案有三种,如下图:Input输入数据由多行组成,每行包含一个整数n,表示该测试实例的长方形方格的规格是2n (0n=2).InputInput consists of a sequence of lines, each containing an integer n. (n 1,000,000).OutputPrint the word yes if 3 divide evenly into F(n).Print the word no if not.Sample Input012345Sample Outputnonoyesnonono1005 Number SequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 32275Accepted Submission(s): 6681Problem DescriptionA number sequence is defined as follows:f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2) mod 7.Given A, B, and n, you are to calculate the value of f(n).InputThe input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 = A, B = 1000, 1 = n = 100,000,000). Three zeros signal the end of input and this test case is not to be processed.OutputFor each test case, print the value of f(n) on a single line.Sample Input1 1 31 2 100 0 0Sample Output251031 Design T-Shirt(稳定排序stable_sort)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1091Accepted Submission(s): 550Problem 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 collect peoples opinions. Here are what he obtained: N people voted for M design elements (such as the ACM-ICPC logo, big names in computer science, well-known graphs, etc.). Everyone assigned each element a number of satisfaction. However, XKA can only put K (=M) elements into his design. He needs you to pick for him the K elements such that the total number of satisfaction is maximized.InputThe input consists of multiple test cases. For each case, the first line contains three positive integers N, M and K where N is the number of people, M is the number of design elements, and K is the number of elements XKA will put into his design. Then N lines follow, each contains M numbers. The j-th number in the i-th line represents the i-th persons satisfaction on the j-th element.OutputFor each test case, print in one line the indices of the K elements you would suggest XKA to take into consideration so that the total number of satisfaction is maximized. If there are more than one solutions, you must output the one with minimal indices. The indices start from 1 and must be printed in non-increasing order. There must be exactly one space between two adjacent indices, and no extra space at the end of the line.Sample Input3 6 42 2.5 5 1 3 45 1 3.5 2 2 21 1 1 1 1 103 3 21 2 32 3 13 1 2Sample Output6 5 3 12 1Author2010/11/71047 Integer Inquiry(字符串大整数加法)Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3021Accepted Submission(s): 716Problem DescriptionOne of the first users of BITs new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers. This supercomputer is great, remarked Chip. I only wish Timothy were here to see these results. (Chip moved to a new apartment, once one became available on the third floor of the Lemon Sky apartments on Third Street.) InputThe input will consist of at most 100 lines of text, each of which contains a single VeryLongInteger. Each VeryLongInteger will be 100 or fewer characters in length, and will only contain digits (no VeryLongInteger will be negative). The final input line will contain a single zero on a line by itself.OutputYour program should output the sum of the VeryLongIntegers given in the input. This problem contains multiple test cases!The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.The output format consists of N output blocks. There is a blank line between output blocks.Sample Input11234567890123456789012345678901234567890123456789012345678901234567890123456789012345678900Sample Output370370367037037036703703703670SourceEast Central North America 1996 1042 N!(整形数
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 情侣之间合租协议书
- 自行回家协议书范文
- 项目转让协议书封面
- 责任承担协议书建筑
- 学费优惠协议书范本
- 律师签订安置协议书
- 无解婚姻调解协议书
- 酒店签约商旅协议书
- 农村分地协议书范本
- 招聘技术入股协议书
- 国网技术学院触电急救课件
- 八大高危作业培训课件
- 中外建筑史-·-第4章-宋辽金元建筑
- 北京理工大学《操作系统》2023-2024学年第一学期期末试卷
- 甜品台合同范例
- 2024年水池承包合同
- 《田忌赛马》公开课一等奖创新教案
- 报销合同范本模板
- 学位英语4000词(开放大学)
- 2024年西北民族大学专职辅导员招聘10人历年高频难、易错点500题模拟试题附带答案详解
- 【中职专用】备战中职高考数学冲刺模拟卷六答案
评论
0/150
提交评论