科技文化节-程序设计竞赛题.doc_第1页
科技文化节-程序设计竞赛题.doc_第2页
科技文化节-程序设计竞赛题.doc_第3页
科技文化节-程序设计竞赛题.doc_第4页
科技文化节-程序设计竞赛题.doc_第5页
已阅读5页,还剩7页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

P1: 进制转化Time Limit: 1000MS Memory Limit: 16000KDescription输入一个十进制数,转化成十六进制数,然后输出。Input含有多组测试数据,每组测试数据仅一个正整数N(N109),表示十进制数,读文件结束。Output对每个测试用例,输出N对应的十六进制数。Sample Input1125Sample OutputB19P2: 硬币问题Time Limit: 1000MS Memory Limit: 16000KDescription小明有n(n=30)枚硬币,每一枚硬币的面值不等。小明现在想要用这些硬币拼出一个最大的价值M,且1到M之间所有的数都能用这些硬币拼出来,对于组一个数,每一枚硬币只能用一次,不能多次使用。现在小明需要你帮他确定这个最大价值M,以及每枚硬币的面值。例如n=2时,最大价值为3,两枚硬币分别为1,2,这样1由1组成,2由2组成,3由1和2组成。Input含有多组测试数据,每组测试数据仅一个正整数n,读文件结束。Output对每个测试用例,输出两行。第一行输出M。第二行输出每一枚硬币的面值,从小到大排序,每个面值中间用空格隔开。Sample Input2Sample Output31 2P3: Bone CollectorTime Limit: 1000MS Memory Limit: 16000KDescriptionMany years ago , in Teddys hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dogs , cows , also he went to the grave The bone collector had a big bag with a volume of V ,and along his trip of collecting there are a lot of bones , obviously , different bone has different value and different volume, now given the each bones value along his trip , can you calculate out the maximum of the total value the bone collector can get ?InputThe first line contain a integer T , the number of cases.Followed by T cases , each case three lines , the first line contain two integer N , V, (N = 1000 , V = 1000 )representing the number of bones and the volume of his bag. And the second line contain N integers representing the value of each bone. The third line contain N integers representing the volume of each bone.OutputOne integer per line representing the maximum of the total value (this number will be less than 231).Sample Input15 101 2 3 4 55 4 3 2 1Sample Output14P4: 母猪的故事Time Limit: 1000MS Memory Limit: 16000KDescription话说现在猪肉价格这么贵,著名的ACBoy 0068 也开始了养猪生活。说来也奇怪,他养的猪一出生第二天开始就能每天中午生一只小猪,而且生下来的竟然都是母猪。不过光生小猪也不行,0068采用了一个很奇特的办法来管理他的养猪场:对于每头刚出生的小猪,在他生下第二头小猪后立马被杀掉,卖到超市里。假设在创业的第一天,0068只买了一头刚出生的小猪,请问,在第N天晚上,0068的养猪场里还存有多少头猪?Input测试数据的第一行包含有一个正整数T,代表测试数据的个数。接下来有T组测试,每组测试数据占一行,分别有一个正整数N代表0068创业的第N天。(0N20)。Output对于每组数据,请在一行里输出第N天晚上养猪场里猪的数目。Sample Input232Sample Output23P5: Oil DepositsTime Limit: 1000MS Memory Limit: 16000KDescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It then analyzes each plot separately, using sensing equipment to determine whether or not the plot contains oil. A plot containing oil is called a pocket. If two pockets are adjacent, then they are part of the same oil deposit. Oil deposits can be quite large and may contain numerous pockets. Your job is to determine how many different oil deposits are contained in a grid. InputThe input file contains one or more grids. Each grid begins with a line containing m and n, the number of rows and columns in the grid, separated by a single space. If m = 0 it signals the end of the input; otherwise 1 = m = 100 and 1 = n = 100. Following this are m lines of n characters each (not counting the end-of-line characters). Each character corresponds to one plot, and is either *, representing the absence of oil, or , representing an oil pocket.OutputFor each grid, output the number of distinct oil deposits. Two different pockets are part of the same oil deposit if they are adjacent horizontally, vertically, or diagonally. An oil deposit will not contain more than 100 pockets.Sample Input1 1*3 5*1 8*0 0Sample Output012P6: The kth great numberTime Limit: 1000MS Memory Limit: 16000KDescriptionXiao Ming and Xiao Bao are playing a simple Numbers game.In a round Xiao Ming can choose to write down a number, or ask Xiao Bao what the kth great number is. Because the number written by Xiao Ming is too much, Xiao Bao is feeling giddy. Now, try to help Xiao Bao.InputThere are several test cases. For each test case, the first line of input contains two positive integer n, k. Then n lines follow. If Xiao Ming choose to write down a number, there will be an I followed by a number that Xiao Ming will write down. If Xiao Ming choose to ask Xiao Bao, there will be a Q, then you need to output the kth great number. OutputThe output consists of one integer representing the largest number of islands that all lie on one line. Sample Input8 3I 1I 2I 3QI 5QI 4QSample Output123P7: 救援物资Time Limit: 1000MS Memory Limit: 16000KDescription台风“尤特”来袭,给广东带来大范围降雨,在潮汕某些地区地势较低,大水淹没了一些村庄,造成了交通的中断。村民们已经2天没有食物供应了,救援队只能通过飞机投放救援物质。飞机从A(0,y)出发以v米/秒速度匀速平行于X轴飞行,离投放区域的高度为h米,到达B(x,y)点进行投放。假设重力加速度g=10米/秒2,相邻坐标相隔为1米。为了让投放的物资必须要投放到没有被大水淹没的高地上(高地任何一个位置都是平坦的),您必须编写一个程序,按顺时针顺序输入高地的一些直线交点的坐标,计算物资是否能够准确落在高地上。物资投放过程中忽略其他因素,包括风速,落在边缘位置也算投放成功。Input第一行包含高地边缘坐标点的数目N;第2N+1行,包含每个坐标点(x1,y1);第N+2行,飞机投放的坐标,高度,速度(x,y,h,v)包含多组测试样例。Output投放成功,输出success投放失败,输出failSample Input88.0 11.011.0 7.010.0 4.05.0 1.02.0 3.04.0 5.04.0 9.05.0 8.07.0 9.0 5.0 1.0Sample OutputsuccessP8: 取余运算Time Limit: 1000MS Memory Limit: 16000KDescription输入b,p,k的值,求bp mod k的值。其中b,p,k*k为长整型数。Input含有多组测试数据,每组测试数据包含3个数据,即b ,p ,k(b,p,k 232)。Output对每个测试用例,输出所求运算的余数。Sample Input2 10 9Sample Output7P9: 逃离神庙Time Limit: 3000MS Memory Limit: 16000KDescription有批游客在非洲旅游的时候不小心误闯了某部落禁地神庙里,进了禁地后他们被分散到了神庙的不同方位。神庙里有一些门可以传送他们离开,但是每个门只能传送一个人,传送完毕后门的传送魔法就会失效,变成一个石块。他们必须找到属于自己最近的门,并且尽可能的让所有人以最快时间离开神庙,否则时间长了被部落的人发现会有生命危险.

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论