文档详情

2011年四川理工ACM程序设计竞赛试题.doc

发布:2017-12-17约7.72千字共7页下载文档
文本预览下载声明
2011年四川理工学院 “达内杯”大学生程序设计竞赛试题 1、Big integer Problem Description Calculate the factorial of N Input Input a positive integer that less than 99. Output The factorial of N Sample Input 50 Sample Output 50! =30414093201713378043612608166064768844377641568960512000000000000 2、Look for treasures Problem Description There are some treasures and one exit in the maze. People would consume his physical strength while he is walking, and he will resume some physical strength when he picks a treasure. Because of the limit of physical strength, John must plot his physical strength properly if he wants to walk out the maze and get all the treasures in the maze at the same time. Now, you would write a program to help John to solve the problem. John抯 physical strength will decrease and if the physical strength is equal 0, he can not move. Input The input file is named as 搃n.dat? the content of this file is shown as follows: 100 1 4 1 4 2 2 4 2 4 4 2 5 3 2 5 5 1 1 0 1 0 0 1 1 1 0 0 1 0 0 1 0 1 1 1 0 0 1 1 1 1 5 5 The first line: the initializing physical strength of John and the consumed physicstal strength of each step. The second line: the total number of treasures Line 3 to line N+2: there are 3 numbers at each line, the front two numbers is the coordinate of treasure: X,Y, the third number is the physical strength that John will get while he pick the treasure. The next line: the number of line and row (A,B, A,B=50) of the maze The next A lines: the map of the maze, the number 0 means it can not pass, and 1 means can pass (the position of treasures is mark with 1 at some place) The last line: the coordinate of exit (the coordinate of origin is (1,1) ) Output If John can pick all of the treasures and walk out the maze, put out the remaining physical strength. On the other wise, put out 搉o, he can not? Sample Input Sample Output 92 3、Snooker Problem Description Background: Philip likes to play the QQ game of Snooker when he wants a relax, though he was just a little vegetable-bir
显示全部
相似文档