POJ水题题目
部编数学九年级上册专题11二次函数的实际应用—喷水问题(解析版)含答案
![部编数学九年级上册专题11二次函数的实际应用—喷水问题(解析版)含答案](https://img.taocdn.com/s3/m/c3a01670abea998fcc22bcd126fff705cc175c9f.png)
答卷时应注意事项1、拿到试卷,要认真仔细的先填好自己的考生信息。
2、拿到试卷不要提笔就写,先大致的浏览一遍,有多少大题,每个大题里有几个小题,有什么题型,哪些容易,哪些难,做到心里有底;3、审题,每个题目都要多读几遍,不仅要读大题,还要读小题,不放过每一个字,遇到暂时弄不懂题意的题目,手指点读,多读几遍题目,就能理解题意了;容易混乱的地方也应该多读几遍,比如从小到大,从左到右这样的题;4、每个题目做完了以后,把自己的手从试卷上完全移开,好好的看看有没有被自己的手臂挡住而遗漏的题;试卷第1页和第2页上下衔接的地方一定要注意,仔细看看有没有遗漏的小题;5、中途遇到真的解决不了的难题,注意安排好时间,先把后面会做的做完,再来重新读题,结合平时课堂上所学的知识,解答难题;一定要镇定,不能因此慌了手脚,影响下面的答题;6、卷面要清洁,字迹要清工整,非常重要;7、做完的试卷要检查,这样可以发现刚才可能留下的错误或是可以检查是否有漏题,检查的时候,用手指点读题目,不要管自己的答案,重新分析题意,所有计算题重新计算,判断题重新判断,填空题重新填空,之后把检查的结果与先前做的结果进行对比分析。
亲爱的小朋友,你们好!经过两个月的学习,你们一定有不小的收获吧,用你的自信和智慧,认真答题,相信你一定会闯关成功。
相信你是最棒的!2022-2023学年人教版数学九年级上册压轴题专题精选汇编专题11 二次函数的实际应用—喷水问题考试时间:120分钟试卷满分:100分一.选择题(共10小题,满分20分,每小题2分)1.(2分)(2021九上·和平期末)如图,要修建一个圆形喷水池,在池中心竖直安装一根水管,在水管的顶端安一个喷水头,使喷出的抛物线形水柱在与池中心的水平距离为1m处达到最高,高度为3m,水柱落地处离池中心3m,水管的长为( )A.9m4B.19m8C.39m16D.45m16【答案】A【完整解答】解:由题意可知点(1,3)是抛物线的顶点,∴设这段抛物线的解析式为y=a(x-1)2+3.∵该抛物线过点(3,0),∴0=a(3-1)2+3,解得:a=-34.∴y=-34(x-1)2+3.∵当x=0时,y=-34(0-1)2+3=-34+3=94,∴水管应长94 m.故答案为:A【分析】由题意可知点(1,3)是抛物线的顶点,可设顶点式为y=a(x-1)2+3,将(3,0)代入解析式中求出a值即得解析式,再求出x=0时的y值即可.2.(2分)(2021九上·长兴月考)学校卫生间的洗手盘台面上有一瓶洗手液(如图①).小丽经过测量发现:洗手液瓶子的截面图下部分是矩形CGHD,洗手液瓶子的底面直径GH=12cm,D,H与喷嘴位置点B三点共线.当小丽按住顶部A下压至如图②位置时,洗手液从喷口B流出(此时喷嘴位置点B距台面的距离为16cm),路线近似呈抛物线状,小丽在距离台面15cm处接洗手液时,手心Q到直线DH的水平距离为4cm,若小丽不去接,则洗手液落在台面的位置距DH的水平距离是16cm.根据小丽测量所得数据,可得洗手液喷出时的抛物线函数解析式的二次项系数是( )A.﹣118B.118C.﹣116D.116【答案】C【完整解答】解:根据题意:GH所在直线为x轴,GH的垂直平分线所在直线为y轴建立如图所示的平面直角坐标系,喷口B为抛物线顶点,共线的三点B、D、H所在直线为抛物线的对称轴,根据题意,OH=6,B(6,16),Q(10,15),设抛物线解析式为y=a(x﹣6)2+16,把Q(10,15)代入解析式得:15=a(10﹣6)2+16,解得:a=﹣116,故答案为:C.【分析】如图以GH 所在直线为x 轴,GH 的垂直平分线所在直线为y 轴建立如图所示的平面直角坐标系,喷口B 为抛物线顶点,共线的三点B 、D 、H 所在直线为抛物线的对称轴,然后写出顶点B 及Q 的坐标,利用顶点式求出抛物线解析式即可.3.(2分)(2021九上·青县月考)如图,水从山坡下的水管的小孔喷出,喷洒在山坡上,已知山坡AB :OB=1:2,若把小孔处设为原点,喷出的水柱的路线近似地用函数y=−12x 2+4x 来刻画,下列结论错误的是( ) A .山坡可以用正比例函数 12y x = 来刻画B .若水柱到水平地面的距离为1.875米,则此时距离原点水平距离为0.5米或7.5米C .水柱落到斜面时距O 点的距离为7米D .水柱距O 点水平距离超过4米呈下降趋势【答案】C【完整解答】解:A.∵山坡AB :OB=1:2,∴斜坡可以用正比例函数y=12 x 刻画,不符合题意;B.当y=1.875时,即− 12x 2+4x=1.875,解得:x 1=0.5,x 2=7.5,∴若水柱到水平地面的距离为1.875米,则此时距离原点水平距离为0.5米或7.5米,不符合题意;C.解方程组 212142y x y x x ⎧=⎪⎪⎨⎪=-+⎪⎩ 得, 1100x y =⎧⎨=⎩ , 22772x y =⎧⎪⎨=⎪⎩ ,∴当小球落在斜坡上时,它离O 点的水平距离是7m ,符合题意;D.∵y=− 12 x 2+4x=- 12(x-4)2+8,则抛物线的对称轴为x=4,∴当x >4时,y 随x 的增大而减小,即小球距O 点水平距离超过4米呈下降趋势,不符合题意;故答案为:C .【分析】根据二次函数的图象与性质对每个选项一一判断即可。
POJ Grids基本练习题 资料
![POJ Grids基本练习题 资料](https://img.taocdn.com/s3/m/52336d816bec0975f465e283.png)
POJ Grids基本练习题资料POJ——1004 Financial Management .............................................. - 3 -POJ——1664 放苹果 ........................................................................ - 5 -POJ——2675 计算书费...................................................................... - 7 -POJ——2676 整数的个数................................................................... - 9 -POJ——2679 整数的立方和.............................................................. - 11 -POJ——2680化验诊断 .................................................................... - 12 -POJ——2684 求阶乘的和................................................................. - 15 -POJ——2687数组逆序重放............................................................... - 16 -POJ——2688求字母的个数............................................................... - 17 -POJ——2689 大小写字母互换 ........................................................... - 18 -POJ——2694逆波兰表达式............................................................... - 19 -POJ——2696 计算表达式的值 ........................................................... - 20 -POJ——2699自整除数 .................................................................... - 22 -POJ——2701 与7无关的数 ............................................................. - 23 -POJ——2702密码翻译 .................................................................... - 24 -POJ——2703骑车与走路.................................................................. - 26 -POJ——2707求一元二次方程的根....................................................... - 27 -POJ——2714求平均年龄.................................................................. - 29 -POJ——2715 谁拿了最多的奖学金...................................................... - 30 -POJ——2718晶晶赴约会.................................................................. - 32 -POJ——2719陶陶摘苹果.................................................................. - 33 -POJ——2720 大象喝水.................................................................... - 34 -POJ——2722 学分绩点.................................................................... - 35 -POJ——2733判断闰年 .................................................................... - 37 -POJ——2734十进制到八进制............................................................ - 38 -POJ——2750 鸡兔同笼.................................................................... - 39 -POJ——2753菲波那契数列............................................................... - 40 -POJ——2758 菲波那契数列(2) ......................................................... - 41 -POJ——2764数根.......................................................................... - 42 -POJ——2767简单密码 .................................................................... - 44 -POJ——2780 Eva’s Problem ......................................................... - 47 -POJ——2786 Pell数列................................................................... - 48 -POJ——2796数字求和 .................................................................... - 49 -POJ——2807两倍.......................................................................... - 50 -POJ ——2808校门外的树................................................................. - 52 -POJ——2856 计算邮资.................................................................... - 54 -POJ——2870 求矩阵的加法.............................................................. - 56 -POJ——2871 整数奇偶排序.............................................................. - 58 -POJ——2882 Program I ............................................................... - 60 -POJ——2883 checking order ........................................................ - 62 -POJ——2886能被3除尽的数之和...................................................... - 64 -POJ——2887 能被3、5、7整除的数 ................................................. - 65 -POJ——2888字符串中的数字............................................................ - 67 -POJ——2926算数运算 .................................................................... - 69 -POJ——2927判断数字个数............................................................... - 70 -POJ——2930 加减乘除.................................................................... - 72 -POJ——2933停车场收费.................................................................. - 74 -POJ——2938 按顺序输出................................................................. - 76 -POJ——2943 小白鼠排队................................................................. - 77 -POJ——3142 球弹跳高度的计算......................................................... - 79 -POJ——3164 奇偶排序.................................................................... - 80 -POJ——3195最大公约数.................................................................. - 81 -POJ——3248 最大公约数................................................................. - 82 -POJ——3255 十进制到六进制 ........................................................... - 84 -POJ——3670 计算鞍点.................................................................... - 86 -POJ——3708 1的个数.................................................................... - 88 -POJ——3756多边形内角和............................................................... - 90 -POJ——1004 Financial Management思路:这道题就是计算一下12个月的平均工资。
OJ水题(适合新手)
![OJ水题(适合新手)](https://img.taocdn.com/s3/m/17578d4633687e21af45a91f.png)
3299HumidexTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 7634 Accepted: 2967 DescriptionAdapted from Wikipedia, the free encyclopediaThe humidex is a measurement used by Canadian meteorologists to reflect the combined effect of heat and humidity. It differs from the heat index used in the United States in using dew point rather than relative humidity.When the temperature is 30°C (86°F) and the dew point is 15°C (59°F), the humidex is 34 (note that humidex is a dimensionless number, but that the number indicates an approximate temperature in C). If the temperature remains 30°C and the dew point rises to 25°C (77°F), the humidex rises to 42.3.The humidex tends to be higher than the U.S. heat index at equal temperature and relative humidity.The current formula for determining the humidex was developed by J.M. Masterton and F.A. Richardson of Canada's Atmospheric Environment Service in 1979.According to the Meteorological Service of Canada, a humidex of at least 40 causes "great discomfort" and above 45 is "dangerous." When the humidex hits 54, heat stroke is imminent.The record humidex in Canada occurred on June 20, 1953, when Windsor, Ontario hit 52.1. (The residents of Windsor would not have known this at the time, since the humidex had yet to be invented.) More recently, the humidex reached 50 on July 14, 1995 in both Windsor and Toronto.The humidex formula is as follows:humidex = temperature + hh = (0.5555)× (e - 10.0)e = 6.11 × exp [5417.7530 × ((1/273.16) - (1/(dewpoint+273.16)))] where exp(x) is 2.718281828 raised to the exponent x.While humidex is just a number, radio announcers often announce it as if it were the temperature, e.g. "It's 47 degrees out there ... [pause] .. with the humidex,".Sometimes weather reports give the temperature and dewpoint, or the temperature and humidex, but rarely do they report all three measurements. Write a program that, given any two of the measurements, will calculate the third.You may assume that for all inputs, the temperature, dewpoint, and humidex are all between -100°C and 100°C.InputInput will consist of a number of lines. Each line except the last will consist of four items separated by spaces: a letter, a number, a second letter, and a second number. Each letter specifies the meaning of the number that follows it, and will be either T, indicating temperature, D, indicating dewpoint, or H, indicating humidex. The last line of input will consist of the single letter E.OutputFor each line of input except the last, produce one line of output. Each line of output should have the form:T number D number H numberwhere the three numbers are replaced with the temperature, dewpoint, and humidex. Each value should be expressed rounded to the nearest tenth of a degree, with exactly one digit after the decimal point. All temperatures are in degrees celsius. Sample InputT 30 D 15T 30.0 D 25.0ESample OutputT 30.0 D 15.0 H 34.0T 30.0 D 25.0 H 42.3Source2159Ancient CipherTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16328 Accepted: 5631 DescriptionAncient Roman empire had a strong government system with various departments, including a secret service department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers in those times were so called substitution cipher and permutation cipher.Substitution cipher changes all occurrences of each letter to some other letter. Substitutes for all letters must be different. For some letters substitute letter may coincide with the original letter. For example, applying substitution cipher that changes all letters from 'A' to 'Y' to the next ones in the alphabet, and changes 'Z' to 'A', to the message "VICTORIOUS" one gets the message "WJDUPSJPVT". Permutation cipher applies some permutation to the letters of the message. For example, applying the permutation <2, 1, 5, 4, 3, 7, 6, 10, 9, 8> to the message "VICTORIOUS" one gets the message "IVOTCIRSUO".It was quickly noticed that being applied separately, both substitution cipher and permutation cipher were rather weak. But when being combined, they were strong enough for those times. Thus, the most important messages were first encrypted using substitution cipher, and then the result was encrypted using permutation cipher. Encrypting the message "VICTORIOUS" with the combination of the ciphers described above one gets the message "JWPUDJSTVP".Archeologists have recently found the message engraved on a stone plate. At the first glance it seemed completely meaningless, so it was suggested that the message was encrypted with some substitution and permutation ciphers. They have conjectured the possible text of the original message that was encrypted, and now they want to check their conjecture. They need a computer program to do it, so you have to write one.InputInput contains two lines. The first line contains the message engraved on the plate. Before encrypting, all spaces and punctuation marks were removed, so the encrypted message contains only capital letters of the English alphabet. The second line contains the original message that is conjectured to be encrypted in the message on the first line. It also contains only capital letters of the English alphabet.The lengths of both lines of the input are equal and do not exceed 100.OutputOutput "YES" if the message on the first line of the input file could be the result of encrypting the message on the second line, or "NO" in the other case.Sample InputJWPUDJSTVPVICTORIOUSSample OutputYES2739Sum of Consecutive Prime NumbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10121 Accepted: 5743 DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integer 53 has two representations 5 + 7 + 11 + 13 + 17 and 53. The integer 41 has three representations 2+3+5+7+11+13, 11+13+17, and 41. The integer 3 has only one representation, which is 3. The integer 20 has no such representations. Note that summands must be consecutive primenumbers, so neither 7 + 13 nor 3 + 5 + 5 + 7 is a valid representation for the integer 20.Your mission is to write a program that reports the number of representations for the given positive integer.InputThe input is a sequence of positive integers each in a separate line. The integers are between 2 and 10 000, inclusive. The end of the input is indicated by a zero. OutputThe output should be composed of lines each corresponding to an input line except the last zero. An output line includes the number of representations for the input integer as the sum of one or more consecutive prime numbers. No other characters should be inserted in the output.Sample Input231741206661253Sample Output1123121083Moving TablesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15442 Accepted: 5038 DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its system. The reform includes moving a lot of tables between rooms. Because the corridor is narrow and all the tables are big, only one table can pass through the corridor. Some plan is needed to make the moving efficient. The manager figured out the following plan: Moving a table from a room to another room can be done within 10 minutes. When moving a table from room i to room j, the part of the corridor between the front of room i and the front of room j is used. So, during each 10 minutes, several moving between two rooms not sharing the same part of the corridor will be done simultaneously. To make it clear the manager illustrated the possible cases and impossible cases of simultaneous moving.For each room, at most one table will be either moved in or moved out. Now, the manager seeks out a method to minimize the time to move all the tables. Your job isto write a program to solve the manager's problem.InputThe input consists of T test cases. The number of test cases ) (T is given in the first line of the input file. Each test case begins with a line containing an integer N , 1 <=N <= 200, that represents the number of tables to move.Each of the following N lines contains two positive integers s and t, representing that a table is to move from room number s to room number t each room number appears at most once in the N lines). From the 3 + N -rdline, the remaining test cases are listed in the same manner as above.OutputThe output should contain the minimum time in minutes to complete the moving, one per line.Sample Input3410 2030 4050 6070 8021 32 200310 10020 8030 50Sample Output1020302262Goldbach's ConjectureTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 21791 Accepted: 8677 DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture:Every even number greater than 4 can bewritten as the sum of two odd prime numbers.For example:8 = 3 + 5. Both 3 and 5 are odd prime numbers.20 = 3 + 17 = 7 + 13.42 = 5 + 37 = 11 + 31 = 13 + 29 = 19 + 23.Today it is still unproven whether the conjecture is right. (Oh wait, I have the proof of course, but it is too long to write it on the margin of this page.)Anyway, your task is now to verify Goldbach's conjecture for all even numbers less than a million.InputThe input will contain one or more test cases.Each test case consists of one even integer n with 6 <= n < 1000000.Input will be terminated by a value of 0 for n.OutputFor each test case, print one line of the form n = a + b, where a and b are odd primes. Numbers and operators should be separated by exactly one blank like in the sample output below. If there is more than one pair of odd primes adding up to n, choose the pair where the difference b - a is maximized. If there is no such pair, print a line saying "Goldbach's conjecture is wrong."Sample Input82042Sample Output8 = 3 + 520 = 3 + 1742 = 5 + 371503Integer InquiryTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18304 Accepted: 7176 DescriptionOne of the first users of BIT's 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. Sample Input123456789012345678901234567890 123456789012345678901234567890 123456789012345678901234567890Sample Output3703703670370370367037037036703006Dirichlet's Theorem on Arithmetic Progressions Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9221 Accepted: 4601 DescriptionIf a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime numbers. This fact is known as Dirichlet's Theorem on Arithmetic Progressions, which had been conjectured by Johann Carl Friedrich Gauss (1777 - 1855) and was proved by Johann Peter Gustav Lejeune Dirichlet (1805 - 1859) in 1837.For example, the arithmetic sequence beginning with 2 and increasing by 3, i.e.,2, 5, 8, 11, 14, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74, 77, 80, 83, 86, 89, 92, 95, 98, ... ,contains infinitely many prime numbers2, 5, 11, 17, 23, 29, 41, 47, 53, 59, 71, 83, 89, ... .Your mission, should you decide to accept it, is to write a program to find the n th prime number in this arithmetic sequence for given positive integers a, d, and n. InputThe input is a sequence of datasets. A dataset is a line containing three positive integers a, d, and n separated by a space. a and d are relatively prime. You may assume a <= 9307, d <= 346, and n <= 210.The end of the input is indicated by a line containing three zeros separated by a space. It is not a dataset.OutputThe output should be composed of as many lines as the number of the input datasets. Each line should contain a single integer and should never contain extra characters.The output integer corresponding to a dataset a, d, n should be the n th prime number among those contained in the arithmetic sequence beginning with a and increasing by d.FYI, it is known that the result is always less than 106 (one million) under this input condition.Sample Input367 186 151179 10 203271 37 39103 230 127 104 185253 50 851 1 19075 337 210307 24 79331 221 177259 170 40269 58 1020 0 0Sample Output9280967091203710393523145032899429510741271722699256732255Tree RecoveryTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4999 Accepted: 3330 DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes.This is an example of one of her creations:D/ \/ \B E/ \ \/ \ \A C G//FTo record her trees for future generations, she wrote down two strings for each tree: a preorder traversal (root, left subtree, right subtree) and an inorder traversal (left subtree, root, right subtree). For the tree drawn above the preorder traversal is DBACEGF and the inorder traversal is ABCDEFG.She thought that such a pair of strings would give enough information to reconstruct the tree later (but she never tried it).Now, years later, looking again at the strings, she realized that reconstructing the trees was indeed possible, but only because she never had used the same letter twice in the same tree.However, doing the reconstruction by hand, soon turned out to be tedious.So now she asks you to write a program that does the job for her!InputThe input will contain one or more test cases.Each test case consists of one line containing two strings preord and inord, representing the preorder traversal and inorder traversal of a binary tree. Both strings consist of unique capital letters. (Thus they are not longer than 26 characters.)Input is terminated by end of file.OutputFor each test case, recover Valentine's binary tree and print one line containing the tree's postorder traversal (left subtree, right subtree, root).Sample InputDBACEGF ABCDEFGBCAD CBADSample OutputACBFGEDCDABSource3094QuicksumTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 8033 Accepted: 5592 DescriptionA checksum is an algorithm that scans a packet of data and returns a single number. The idea is that if the packet is changed, the checksum will also change, so checksums are often used for detecting transmission errors, validating document contents, and in many other situations where it is necessary to detect undesirable changes in data.For this problem, you will implement a checksum algorithm called Quicksum. A Quicksum packet allows only uppercase letters and spaces. It always begins and ends with an uppercase letter. Otherwise, spaces and letters can occur in any combination, including consecutive spaces.A Quicksum is the sum of the products of each character's position in the packet times the character's value. A space has a value of zero, while letters have a value equal to their position in the alphabet. So, A=1, B=2, etc., through Z=26. Here are example Quicksum calculations for the packets "ACM" and "MID CENTRAL":ACM: 1*1 + 2*3 + 3*13 = 46MID CENTRAL: 1*13 + 2*9 + 3*4 + 4*0 + 5*3 + 6*5 + 7*14 + 8*20 + 9*18 + 10*1 + 11*12 = 650InputThe input consists of one or more packets followed by a line containing only # that signals the end of the input. Each packet is on a line by itself, does not begin or end with a space, and contains from 1 to 255 characters.OutputFor each packet, output its Quicksum on a separate line in the output.Sample InputACMMID CENTRALREGIONAL PROGRAMMING CONTESTACNA C MABCBBC#Sample Output46650469049751415 Source。
POJ部分水题代码(C++) (一)
![POJ部分水题代码(C++) (一)](https://img.taocdn.com/s3/m/d2e2db868762caaedd33d46e.png)
P O J1000p r o g r a m p1000(I n p u t,O u t p u t);v a ra,b:I n t e g e r;b e g i nR e a d l n(a,b);W r i t e l n(a+b);e n d.P O J1004#i n c l u d e<i o s t r e a m>#i n c l u d e<i o m a n i p>u s i n g n a m e s p a c e s t d;i n t m a i n(){f l o a t a,b;u n s i g n e d i n t c;c i n>>a;b=a;f o r(c=1;c<12;c++){c i n>>b;a+=b;}b=a/12;c o u t<<"$"<<b<<f i x e d<<s e t p r e c i s i o n(2)<<e nd l;r e t u r n0;}/**********************author KINGRAIN@EECS_PKUtime May 16,2010dormpoj1013称硬币***********************/#include <iostream>#include <cstring>using namespace std;bool isLight(char);bool isHeavy(char);char Left[3][7]={0},Right[3][7]={0};int result[3];int main(){int n=0,k,j; char letter,resul[5];cin >> n;for (int i=0; i<n; i++){for (j=0; j<3; j++){cin >> Left[j] >> Right[j] >> resul;if (strcmp(resul,"up")==0)result[j] = 1;if (strcmp(resul,"even")==0)result[j] = 2;if (strcmp(resul,"down")==0)result[j] = 3;}for (letter='A'; letter<='L'; letter++){if (isLight(letter)){cout << letter << " is the counterfeit coin and it is light.\n";break;}else if (isHeavy(letter)){cout << letter << " is the counterfeit coin and it is heavy.\n";break;}}}return 0;}bool isLight(char ch){for (int i=0; i<3; i++){switch(result[i]){case 1: if (strchr(Right[i],ch)==0)return 0;break;case 2: if ((strchr(Right[i],ch)!=0)||(strchr(Left[i],ch)!=0))return 0;break;case 3: if (strchr(Left[i],ch)==0)return 0;break;}}return 1;}bool isHeavy(char ch){for (int i=0; i<3; i++){switch(result[i]){case 1: if (strchr(Left[i],ch)==0)return 0;break;case 2: if ((strchr(Right[i],ch)!=0)||(strchr(Left[i],ch)!=0))return 0;break;case 3: if (strchr(Right[i],ch)==0)return 0;break;}return 1;}/**********************author KINGRAIN@EECS_PKUtime Mar.5,2010dormpoj1017装箱问题***********************/#include <iostream>#include <cstring>using namespace std;int main(){int b[6],i,nTotal=0,roomForBox2[4]={0,5,3,1},maxBox2=0,maxBox1_1=0;do{for (i=0; i<6; i++)cin >> b[i];if ((b[0]==0)&&(b[1]==0)&&(b[2]==0)&&(b[3]==0)&&(b[4]==0)&&(b[5]==0))break;nTotal = b[5]+b[4]+b[3]+(b[2]+3)/4;maxBox2 = 5*b[3]+roomForBox2[(b[2])%4];if (b[1]>maxBox2)nTotal += (b[1]-maxBox2+8)/9;maxBox1_1 = nTotal*36-36*b[5]-25*b[4]-16*b[3]-9*b[2]-4*b[1];if (b[0]>maxBox1_1)nTotal += (b[0]-maxBox1_1+35)/36;printf("%d\n",nTotal);} while (1);return 0;}/**********************author KINGRAIN@EECS_PKUdormpoj1088滑雪***********************/#include <iostream>using namespace std;const int SIZE = 110;struct POINT{int height;int x;int y;} position[SIZE*SIZE] = {0}; // 记录点的高度坐标int length[SIZE][SIZE]={0},height[SIZE][SIZE]={0};int Mycompare(const void *,const void *);int Max(int,int);// 算法就是先找出凹点将其长度值为一// 点length[i][j] = max{点length[i-1][j],点length[i+1][j],点length[i][j-1],点length[i][j+1]} 前提是这些点比它高……int main(){int R=0,C=0,i=0,n=0,j=0,k=0,LONGEST = 0;cin >> R >> C;for (i=1; i<=R; i++)for (j=1; j<=C; j++){cin >> height[i][j];position[k].height = height[i][j];position[k].x = j;position[k++].y = i;}qsort(position,k,sizeof(position[0]),Mycompare); // 将点按高度排列for (j=0; j<=C; j++) // 将边沿置为最大值在后面处理较为方便height[0][j] = 999999, height[R+1][j] = 999999;for (j=0; j<=R; j++)height[j][0] = 999999, height[j][C+1] = 999999;for (i=1; i<=R; i++)for (j=1; j<=C; j++){if ((height[i][j]<=height[i+1][j])&&(height[i][j]<=height[i-1][j]) // 对于凹点长度就为一&&(height[i][j]<=height[i][1+j])&&(height[i][j]<=height[i][j-1]))length[i][j] = 1;}for (i=0; i<k; i++){if (length[position[i].y][position[i].x]==1)continue;else{if (height[position[i].y][position[i].x]>height[position[i].y][position[i].x+1])length[position[i].y][position[i].x] = length[position[i].y][position[i].x+1] + 1;if (height[position[i].y][position[i].x]>height[position[i].y][position[i].x-1])length[position[i].y][position[i].x]= Max(length[position[i].y][position[i].x],length[position[i].y][position[i].x-1]+1);if (height[position[i].y][position[i].x]>height[position[i].y+1][position[i].x])length[position[i].y][position[i].x]= Max(length[position[i].y][position[i].x],length[position[i].y+1][position[i].x]+1);if (height[position[i].y][position[i].x]>height[position[i].y-1][position[i].x])length[position[i].y][position[i].x]= Max(length[position[i].y][position[i].x],length[position[i].y-1][position[i].x]+1);}}for (i=1; i<=R; i++)for (j=1; j<=C; j++)if (LONGEST<length[i][j])LONGEST = length[i][j];printf("%d\n",LONGEST);return 0;}int Mycompare(const void *elem1,const void *elem2) // 按升序排列{POINT *ptr1,*ptr2;ptr1 = (POINT *) elem1;ptr2 = (POINT *) elem2;return (ptr1->height-ptr2->height);}int Max(int a, int b){if (a>=b)return a;elsereturn b; }/**********************author KINGRAIN@EECS_PKUtime May 22,2010computer room 159poj1095Trees made to order***********************/#include <iostream>using namespace std;void Creat_Tree(int );int Trees_amount[25]={0};int Tree_last_order[25]={0};int wmain(){int i=0,j=0,m=0,n=0;Trees_amount[0] = Trees_amount[1] = 1;Trees_amount[2] = 2;Tree_last_order[0] = 0;Tree_last_order[1] = 1;Tree_last_order[2] = 3;for (i=3; i<25; i++){for (j=0; j<i; j++)Trees_amount[i] += Trees_amount[j]*Trees_amount[i-1-j];Tree_last_order[i] = Tree_last_order[i-1] + Trees_amount[i];}while (cin>>n){if (n==0)break;Creat_Tree(n);cout << endl;}return 0;}void Creat_Tree(int n){int i,j;for (i=0; n>Tree_last_order[i]; i++); // 循环结束时此棵树上共有i 个节点n -= Tree_last_order[i-1]; // 这是i 个节点的第n棵树for (j=0; j<i; j++) // 右树一共有i-1-j个节点左树一共有j个节点{if (n<=Trees_amount[i-1-j]*Trees_amount[j])break;elsen -= Trees_amount[i-1-j]*Trees_amount[j];}if (j!=0){cout << '(';Creat_Tree((n-1)/Trees_amount[i-1-j]+1+Tree_last_order[j-1]);cout << ')';}cout << 'X';if ((i-1-j)!=0){cout << '(';Creat_Tree((n-1)%Trees_amount[i-j-1]+1+Tree_last_order[i-j-2]);cout << ')';}}/**********************author KINGRAIN@EECS_PKUtime April 2,2010classroompoj1163The Triangle***********************/#include <iostream>using namespace std;const int MAX = 110;int highestSum[MAX][MAX] = {0},position[MAX][MAX]={0}; // high[] 记录最大值,position[]记录位置存储的值inline int Max(int, int);int main(){int n=0,j=0,i=0;cin >> n;for (i=0; i<n; i++)for (j=0; j<=i; j++)cin >> position[i][j];for (i=0; i<n; i++)highestSum[n-1][i] = position[n-1][i]; // 初始化最底层的最大值for (i=n-2; i>=0; i--)for (j=0; j<=i; j++) // 递推关系式当前的最大值等于上一步的最大值加当前节点数值highestSum[i][j] = Max(highestSum[i+1][j],highestSum[i+1][j+1]) + position[i][j];printf("%d\n",highestSum[0][0]);return 0;}inline int Max(int a, int b){if (a>b)return a;elsereturn b;}/**********************author KINGRAIN@EECS_PKUtime April 2,2010computerroompoj2815城堡问题***********************/#include <iostream>using namespace std;int Move(int, int, bool);const int M=55,N=55;int CASTLE[M][N]={0},m=0,n=0,state[M][N]={0},Room=0;int main(){int j=0,i=0,k=0,t=0,Max_area=0,area=0;cin >> m >> n;for (i=0; i<m; i++)for (j=0; j<n; j++)cin >> CASTLE[i][j];for (i=0; i<m; i++)for (j=0; j<n; j++) // 以每个位置为出发点,让假想的小人出发。
POJ题目分类
![POJ题目分类](https://img.taocdn.com/s3/m/61ee1c0bf78a6529647d5310.png)
1000 A+B Problem 送分题1001 Exponentiation 高精度1003 Hangover 送分题1004 Financial Management 送分题1005 I Think I Need a Houseboat 几何1006 Biorhythms 送分题1007 DNA Sorting 送分题1008 Maya Calendar 日期处理1010 STAMPS 搜索+DP1011 Sticks 搜索1012 Joseph 模拟/数学方法1014 Dividing 数论/DP?/组合数学->母函数?1015 Jury Compromise DP1016 Numbers That Count 送分题1017 Packets 贪心1018 Communication System 贪心1019 Number Sequence 送分题1020 Anniversary Cake 搜索1023 The Fun Number System 数论1025 Department 模拟1026 Cipher 组合数学1027 The Same Game 模拟1028 Web Navigation 送分题1031 Fence 计算几何1034 The dog task 计算几何1037 A decorative fence DP/组合数学1039 Pipe 几何1042 Gone Fishing 贪心/DP1045 Bode Plot 送分题(用物理知识)1046 Color Me Less 送分题1047 Round and Round We Go 高精度1048 Follow My Logic 模拟1049 Microprocessor Simulation 模拟1050 To the Max DP1053 Set Me 送分题1054 The Troublesome Frog 搜索1060 Modular multiplication of polynomials 高精度1061 青蛙的约会数论1062 昂贵的聘礼DP1064 Cable master DP/二分查找1065 Wooden Sticks DP1067 取石子游戏博弈论1068 Parencodings 送分题1069 The Bermuda Triangle 搜索1070 Deformed Wheel 几何1071 Illusive Chase 送分题1072 Puzzle Out 搜索1073 The Willy Memorial Program 模拟1074 Parallel Expectations DP1075 University Entrance Examination 模拟1080 Human Gene Functions DP->LCS变形1082 Calendar Game 博弈论1084 Square Destroyer 搜索?1085 Triangle War 博弈论1086 Unscrambling Images 模拟?1087 A Plug for UNIX 图论->最大流1088 滑雪DFS/DP1090 Chain ->格雷码和二进制码的转换1091 跳蚤数论1092 Farmland 几何1093 Formatting Text DP1094 Sorting It All Out 图论->拓扑排序1095 Trees Made to Order 组合数学1096 Space Station Shielding 送分题1097 Roads Scholar 图论1098 Robots 模拟1099 Square Ice 送分题1100 Dreisam Equations 搜索1101 The Game 搜索->BFS1102 LC-Display 送分题1103 Maze 模拟1104 Robbery 递推1106 Transmitters 几何1107 W's Cipher 送分题1110 Double Vision 搜索1111 Image Perimeters 搜索1112 Team Them Up! DP1113 Wall 计算几何->convex hull1119 Start Up the Startup 送分题1120 A New Growth Industry 模拟1122 FDNY to the Rescue! 图论->Dijkstra 1125 Stockbroker Grapevine 图论->Dijkstra 1128 Frame Stacking 搜索1129 Channel Allocation 搜索(图的最大独立集)1131 Octal Fractions 高精度1135 Domino Effect 图论->Dijkstra1137 The New Villa 搜索->BFS1141 Brackets Sequence DP1142 Smith Numbers 搜索1143 Number Game 博弈论1147 Binary codes 构造1148 Utopia Divided 构造1149 PIGS 图论->网络流1151 Atlantis 计算几何->同等安置矩形的并的面积->离散化1152 An Easy Problem! 数论1157 LITTLE SHOP OF FLOWERS DP1158 TRAFFIC LIGHTS 图论->Dijkstra变形1159 Palindrome DP->LCS1160 Post Office DP1161 Walls 图论1162 Building with Blocks 搜索1163 The Triangle DP1170 Shopping Offers DP1177 Picture 计算几何->同等安置矩形的并的周长->线段树1179 Polygon DP1180 Batch Scheduling DP1182 食物链数据结构->并查集1183 反正切函数的应用搜索1184 聪明的打字员搜索1185 炮兵阵地DP->数据压缩1187 陨石的秘密DP(BalkanOI99 Par的拓展)1189 钉子和小球递推?1190 生日蛋糕搜索/DP1191 棋盘分割DP1192 最优连通子集图论->无负权回路的有向图的最长路->BellmanFord 1193 内存分配模拟1194 HIDDEN CODES 搜索+DP1197 Depot 数据结构->Young T ableau1201 Intervals 贪心/图论->最长路->差分约束系统1202 Family 高精度1209 Calendar 日期处理1217 FOUR QUARTERS 递推1218 THE DRUNK JAILER 送分题1233 Street Crossing 搜索->BFS1245 Programmer, Rank Thyself 送分题1247 Magnificent Meatballs 送分题1248 Safecracker 搜索1250 T anning Salon 送分题1251 Jungle Roads 图论->最小生成树1271 Nice Milk 计算几何1273 Drainage Ditches 图论->最大流1274 The Perfect Stall 图论->二分图的最大匹配1275 Cashier Employment 图论->差分约束系统->无负权回路的有向图的最长路->Bellman-Ford1280 Game 递推1281 MANAGER 模拟1286 Necklace of Beads 组合数学->Polya定理1288 Sly Number 数论->解模线性方程组1293 Duty Free Shop DP1298 The Hardest Problem Ever 送分题1316 Self Numbers 递推同Humble Number一样1322 Chocolate 递推/组合数学1323 Game Prediction 贪心1324 Holedox Moving BFS+压缩储存1325 Machine Schedule 图论->二分图的最大匹配1326 Mileage Bank 送分题1327 Moving Object Recognition 模拟?1328 Radar Installation 贪心(差分约束系统的特例)1338 Ugly Numbers 递推(有O(n)算法)1364 King 图论->无负权回路的有向图的最长路->BellmanFord1370 Gossiping (数论->模线性方程有无解的判断)+(图论->DFS)2184 Cow Exhibition DP2190 ISBN 送分题2191 Mersenne Composite Numbers 数论2192 Zipper DP->LCS变形2193 Lenny's Lucky Lotto Lists DP2194 Stacking Cylinders 几何2195 Going Home 图论->二分图的最大权匹配2196 Specialized Four-Digit Numbers 送分题2197 Jill's Tour Paths 图论->2199 Rate of Return 高精度2200 A Card Trick 模拟2210 Metric Time 日期处理2239 Selecting Courses 图论->二分图的最大匹配2243 Knight Moves 搜索->BFS2247 Humble Numbers 递推(最优O(n)算法)2253 Frogger 图论->Dijkstra变形(和1295是一样的)2254 Globetrotter 几何2261 France '98 递推2275 Flipping Pancake 构造2284 That Nice Euler Circuit 计算几何2289 Jamie's Contact Groups 图论->网络流?2291 Rotten Ropes 送分题2292 Optimal Keypad DP2299 Ultra-QuickSort 排序->归并排序2304 Combination Lock 送分题2309 BST 送分题2311 Cutting Game 博弈论2312 Battle City 搜索->BFS2314 POJ language 模拟2315 Football Game 几何2346 Lucky tickets 组合数学2351 Time Zones 时间处理2379 ACM Rank T able 模拟+排序2381 Random Gap 数论2385 Apple Catching DP(像NOI98“免费馅饼”)2388 Who's in the Middle 送分题(排序)2390 Bank Interest 送分题2395 Out of Hay 图论->Dijkstra变形2400 Supervisor, Supervisee 图论->二分图的最大权匹配?2403 Hay Points 送分题2409 Let it Bead 组合数学->Polya定理2416 Return of the Jedi 图论->2417 Discrete Logging 数论2418 Hardwood Species 二分查找2419 Forests 枚举2421 Constructing Roads 图论->最小生成树2423 The Parallel Challenge Ballgame 几何2424 Flo's Restaurant 数据结构->堆2425 A Chess Game 博弈论2426 Remainder BFS2430 Lazy Cows DP->数据压缩1375 Intervals 几何1379 Run Away 计算几何->1380 Equipment Box 几何1383 Labyrinth 图论->树的最长路1394 Railroad 图论->Dijkstra1395 Cog-Wheels 数学->解正系数的线性方程组1408 Fishnet 几何1411 Calling Extraterrestrial Intelligence Again 送分题1430 Binary Stirling Numbers 日期处理1431 Calendar of Maya 模拟1432 Decoding Morse Sequences DP1434 Fill the Cisterns! 计算几何->离散化/1445 Random number 数据结构->碓1447 Ambiguous Dates 日期处理1450 Gridland 图论(本来TSP问题是NP难的,但这个图比较特殊,由现成的构造方法)1458 Common Subsequence DP->LCS1459 Power Network 图论->最大流1462 Random Walk 模拟+解线性方程组1463 Strategic game 贪心1466 Girls and Boys 图论->n/a1469 COURSES 贪心1475 Pushing Boxes DP1476 Always On the Run 搜索->BFS1480 Optimal Programs 搜索->BFS1481 The Die Is Cast 送分题1482 It's not a Bug, It's a Feature! 搜索->BFS1483 Going in Circles on Alpha Centauri 模拟1484 Blowing Fuses 送分题1485 Fast Food DP(似乎就是ioi2000的postoffice)1486 Sorting Slides 图论->拓扑排序1505 Copying Books DP+二分查找1510 Hares and Foxes 数论1512 Keeps Going and Going and ... 模拟1513 Scheduling Lectures DP1514 Metal Cutting 几何1515 Street Directions 图论->把一个无向连通图改造成为有向强连通图1517 u Calculate e 送分题1518 Problem Bee 几何1519 Digital Roots 送分题(位数可能很大)1520 Scramble Sort 排序1547 Clay Bully 送分题1555 Polynomial Showdown 送分题(非常阴险)1563 The Snail 送分题1601 Pizza Anyone? 搜索1604 Just the Facts 送分题1605 Horse Shoe Scoring 几何1606 Jugs 数论/搜索1631 Bridging signals DP+二分查找1632 Vase collection 图论->最大完全图1633 Gladiators DP1634 Who's the boss? 排序1635 Subway tree systems 图论->不同表示法的二叉树判同1637 Sightseeing tour 图论->欧拉回路1638 A number game 博弈论1639 Picnic Planning 图论->1641 Rational Approximation 数论1646 Double Trouble 高精度1654 Area 几何1657 Distance on Chessboard 送分题1658 Eva's Problem 送分题1660 Princess FroG 构造1661 Help Jimmy DP1663 Number Steps 送分题1664 放苹果组合数学->递推1677 Girls' Day 送分题1688 Dolphin Pool 计算几何1690 (Your)((Term)((Project))) 送分题1691 Painting A Board 搜索/DP1692 Crossed Matchings DP1693 Counting Rectangles 几何1694 An Old Stone Game 博弈论?1695 Magazine Delivery 图论->1712 Flying Stars DP1713 Divide et unita 搜索1714 The Cave 搜索/DP1717 Dominoes DP1718 River Crossing DP1719 Shooting Contest 贪心1729 Jack and Jill 图论->1730 Perfect Pth Powers 数论1732 Phone numbers DP1734 Sightseeing trip 图论->Euler回路1738 An old Stone Game 博弈论?1741 Tree 博弈论?1745 Divisibility DP1751 Highways 图论->1752 Advertisement 贪心/图论->差分约束系统1753 Flip Game 搜索->BFS1755 Triathlon 计算几何?1770 Special Experiment 树形DP1771 Elevator Stopping Plan DP1772 New Go Game 构造?1773 Outernet 模拟1774 Fold Paper Strips 几何1775 Sum of Factorials 送分题1776 T ask Sequences DP1777 Vivian's Problem 数论1870 Bee Breeding 送分题1871 Bullet Hole 几何1872 A Dicey Problem BFS1873 The Fortified Forest 几何+回溯1874 Trade on Verweggistan DP1875 Robot 几何1876 The Letter Carrier's Rounds 模拟1877 Flooded! 数据结构->堆1879 Tempus et mobilius Time and motion 模拟+组合数学->Polya定理1882 Stamps 搜索+DP1883 Theseus and the Minotaur 模拟1887 Testing the CATCHER DP1889 Package Pricing DP1893 Monitoring Wheelchair Patients 模拟+几何1915 Knight Moves 搜索->BFS1916 Rat Attack 数据结构->?1936 All in All DP?1946 Cow Cycling DP1947 Rebuilding Roads 二分1985 Cow Marathon 图论->有向无环图的最长路1995 Raising Modulo Numbers 数论->大数的幂求余2049 Finding Nemo 图论->最短路2050 Searching the Web 模拟(需要高效实现)2051 Argus 送分题(最好用堆,不用也可以过)2054 Color a Tree 贪心2061 Pseudo-random Numbers 数论2080 Calendar 日期处理2082 Terrible Sets 分治/2083 Fractal 递归2084 Game of Connections 递推(不必高精度)2105 IP Address 送分题2115 C Looooops 数论->解模线性方程2136 Vertical Histogram 送分题2165 Gunman 计算几何2179 Inlay Cutters 枚举2181 Jumping Cows 递推2182 Lost Cows ->线段树/=============================================1370 Gossiping (数论->模线性方程有无解的判断)+(图论->DFS)1090 Chain ->格雷码和二进制码的转换2182 Lost Cows ->线段树/2426 Remainder BFS1872 A Dicey Problem BFS1324 Holedox Moving BFS+压缩储存1088 滑雪DFS/DP1015 Jury Compromise DP1050 To the Max DP1062 昂贵的聘礼DP1065 Wooden Sticks DP1074 Parallel Expectations DP1093 Formatting Text DP1112 Team Them Up! DP1141 Brackets Sequence DP1157 LITTLE SHOP OF FLOWERS DP1160 Post Office DP1163 The Triangle DP1170 Shopping Offers DP1179 Polygon DP1180 Batch Scheduling DP1191 棋盘分割DP1293 Duty Free Shop DP2184 Cow Exhibition DP2193 Lenny's Lucky Lotto Lists DP2292 Optimal Keypad DP1432 Decoding Morse Sequences DP1475 Pushing Boxes DP1513 Scheduling Lectures DP1633 Gladiators DP1661 Help Jimmy DP1692 Crossed Matchings DP1712 Flying Stars DP1717 Dominoes DP1718 River Crossing DP1732 Phone numbers DP1745 Divisibility DP1771 Elevator Stopping Plan DP1776 T ask Sequences DP1874 Trade on Verweggistan DP1887 Testing the CATCHER DP1889 Package Pricing DP1946 Cow Cycling DP1187 陨石的秘密DP(BalkanOI99 Par的拓展)1485 Fast Food DP(似乎就是ioi2000的postoffice) 2385 Apple Catching DP(像NOI98“免费馅饼”) 1064 Cable master DP/二分查找1037 A decorative fence DP/组合数学1936 All in All DP?1505 Copying Books DP+二分查找1631 Bridging signals DP+二分查找1159 Palindrome DP->LCS1458 Common Subsequence DP->LCS1080 Human Gene Functions DP->LCS变形2192 Zipper DP->LCS变形1185 炮兵阵地DP->数据压缩2430 Lazy Cows DP->数据压缩1067 取石子游戏博弈论1082 Calendar Game 博弈论1085 Triangle War 博弈论1143 Number Game 博弈论2311 Cutting Game 博弈论2425 A Chess Game 博弈论1638 A number game 博弈论1694 An Old Stone Game 博弈论?1738 An old Stone Game 博弈论?1741 Tree 博弈论?2083 Fractal 递归1104 Robbery 递推1217 FOUR QUARTERS 递推1280 Game 递推2261 France '98 递推2181 Jumping Cows 递推1316 Self Numbers 递推同Humble Number一样2084 Game of Connections 递推(不必高精度) 1338 Ugly Numbers 递推(有O(n)算法)2247 Humble Numbers 递推(最优O(n)算法)1322 Chocolate 递推/组合数学1189 钉子和小球递推?1947 Rebuilding Roads 二分2418 Hardwood Species 二分查找2082 Terrible Sets 分治/1001 Exponentiation 高精度1047 Round and Round We Go 高精度1060 Modular multiplication of polynomials 高精度1131 Octal Fractions 高精度1202 Family 高精度2199 Rate of Return 高精度1646 Double Trouble 高精度1147 Binary codes 构造1148 Utopia Divided 构造2275 Flipping Pancake 构造1660 Princess FroG 构造1772 New Go Game 构造?1005 I Think I Need a Houseboat 几何1039 Pipe 几何1070 Deformed Wheel 几何1092 Farmland 几何1106 Transmitters 几何2194 Stacking Cylinders 几何2254 Globetrotter 几何2315 Football Game 几何2423 The Parallel Challenge Ballgame 几何1375 Intervals 几何1380 Equipment Box 几何1408 Fishnet 几何1514 Metal Cutting 几何1518 Problem Bee 几何1605 Horse Shoe Scoring 几何1654 Area 几何1693 Counting Rectangles 几何1774 Fold Paper Strips 几何1871 Bullet Hole 几何1875 Robot 几何1873 The Fortified Forest 几何+回溯1031 Fence 计算几何1034 The dog task 计算几何1271 Nice Milk 计算几何2284 That Nice Euler Circuit 计算几何1688 Dolphin Pool 计算几何2165 Gunman 计算几何1755 Triathlon 计算几何?1379 Run Away 计算几何->1113 Wall 计算几何->convex hull1434 Fill the Cisterns! 计算几何->离散化/1151 Atlantis 计算几何->同等安置矩形的并的面积->离散化1177 Picture 计算几何->同等安置矩形的并的周长->线段树2419 Forests 枚举2179 Inlay Cutters 枚举1025 Department 模拟1027 The Same Game 模拟1048 Follow My Logic 模拟1049 Microprocessor Simulation 模拟1073 The Willy Memorial Program 模拟1075 University Entrance Examination 模拟1098 Robots 模拟1103 Maze 模拟1120 A New Growth Industry 模拟1193 内存分配模拟1281 MANAGER 模拟2200 A Card Trick 模拟2314 POJ language 模拟1431 Calendar of Maya 模拟1483 Going in Circles on Alpha Centauri 模拟1512 Keeps Going and Going and ... 模拟1773 Outernet 模拟1876 The Letter Carrier's Rounds 模拟1883 Theseus and the Minotaur 模拟2050 Searching the Web 模拟(需要高效实现)1012 Joseph 模拟/数学方法1086 Unscrambling Images 模拟?1327 Moving Object Recognition 模拟?1893 Monitoring Wheelchair Patients 模拟+几何1462 Random Walk 模拟+解线性方程组2379 ACM Rank T able 模拟+排序1879 Tempus et mobilius Time and motion 模拟+组合数学->Polya定理1520 Scramble Sort 排序1634 Who's the boss? 排序2299 Ultra-QuickSort 排序->归并排序1008 Maya Calendar 日期处理1209 Calendar 日期处理2210 Metric Time 日期处理1430 Binary Stirling Numbers 日期处理1447 Ambiguous Dates 日期处理2080 Calendar 日期处理2351 Time Zones 时间处理1770 Special Experiment 树形DP1916 Rat Attack 数据结构->?1197 Depot 数据结构->Young T ableau1182 食物链数据结构->并查集2424 Flo's Restaurant 数据结构->堆1877 Flooded! 数据结构->堆1445 Random number 数据结构->碓1023 The Fun Number System 数论1061 青蛙的约会数论1091 跳蚤数论1152 An Easy Problem! 数论2191 Mersenne Composite Numbers 数论2381 Random Gap 数论2417 Discrete Logging 数论1510 Hares and Foxes 数论1641 Rational Approximation 数论1730 Perfect Pth Powers 数论1777 Vivian's Problem 数论2061 Pseudo-random Numbers 数论1014 Dividing 数论/DP?/组合数学->母函数?1606 Jugs 数论/搜索1995 Raising Modulo Numbers 数论->大数的幂求余2115 C Looooops 数论->解模线性方程1288 Sly Number 数论->解模线性方程组1395 Cog-Wheels 数学->解正系数的线性方程组1000 A+B Problem 送分题1003 Hangover 送分题1004 Financial Management 送分题1006 Biorhythms 送分题1007 DNA Sorting 送分题1016 Numbers That Count 送分题1019 Number Sequence 送分题1028 Web Navigation 送分题1046 Color Me Less 送分题1053 Set Me 送分题1068 Parencodings 送分题1071 Illusive Chase 送分题1096 Space Station Shielding 送分题1099 Square Ice 送分题1102 LC-Display 送分题1107 W's Cipher 送分题1119 Start Up the Startup 送分题1218 THE DRUNK JAILER 送分题1245 Programmer, Rank Thyself 送分题1247 Magnificent Meatballs 送分题1250 T anning Salon 送分题1298 The Hardest Problem Ever 送分题1326 Mileage Bank 送分题2190 ISBN 送分题2196 Specialized Four-Digit Numbers 送分题2291 Rotten Ropes 送分题2304 Combination Lock 送分题2309 BST 送分题2390 Bank Interest 送分题2403 Hay Points 送分题1411 Calling Extraterrestrial Intelligence Again 送分题1481 The Die Is Cast 送分题1484 Blowing Fuses 送分题1517 u Calculate e 送分题1547 Clay Bully 送分题1563 The Snail 送分题1604 Just the Facts 送分题1657 Distance on Chessboard 送分题1658 Eva's Problem 送分题1663 Number Steps 送分题1677 Girls' Day 送分题1690 (Your)((Term)((Project))) 送分题1775 Sum of Factorials 送分题1870 Bee Breeding 送分题2105 IP Address 送分题2136 Vertical Histogram 送分题1555 Polynomial Showdown 送分题(非常阴险) 2388 Who's in the Middle 送分题(排序)1519 Digital Roots 送分题(位数可能很大)1045 Bode Plot 送分题(用物理知识)2051 Argus 送分题(最好用堆,不用也可以过) 1011 Sticks 搜索1020 Anniversary Cake 搜索1054 The Troublesome Frog 搜索1069 The Bermuda Triangle 搜索1072 Puzzle Out 搜索1100 Dreisam Equations 搜索1110 Double Vision 搜索1111 Image Perimeters 搜索1128 Frame Stacking 搜索1142 Smith Numbers 搜索1162 Building with Blocks 搜索1183 反正切函数的应用搜索1184 聪明的打字员搜索1248 Safecracker 搜索1601 Pizza Anyone? 搜索1713 Divide et unita 搜索1129 Channel Allocation 搜索(图的最大独立集)1190 生日蛋糕搜索/DP1691 Painting A Board 搜索/DP1714 The Cave 搜索/DP1084 Square Destroyer 搜索?1010 STAMPS 搜索+DP1194 HIDDEN CODES 搜索+DP1882 Stamps 搜索+DP1101 The Game 搜索->BFS1137 The New Villa 搜索->BFS1233 Street Crossing 搜索->BFS2243 Knight Moves 搜索->BFS2312 Battle City 搜索->BFS1476 Always On the Run 搜索->BFS1480 Optimal Programs 搜索->BFS1482 It's not a Bug, It's a Feature! 搜索->BFS 1753 Flip Game 搜索->BFS1915 Knight Moves 搜索->BFS1017 Packets 贪心1018 Communication System 贪心1323 Game Prediction 贪心1463 Strategic game 贪心1469 COURSES 贪心1719 Shooting Contest 贪心2054 Color a Tree 贪心1328 Radar Installation 贪心(差分约束系统的特例)1042 Gone Fishing 贪心/DP1752 Advertisement 贪心/图论->差分约束系统1201 Intervals 贪心/图论->最长路->差分约束系统1097 Roads Scholar 图论1161 Walls 图论1450 Gridland 图论(本来TSP问题是NP难的,但这个图比较特殊,由现成的构造方法)2197 Jill's Tour Paths 图论->2416 Return of the Jedi 图论->1639 Picnic Planning 图论->1695 Magazine Delivery 图论->1729 Jack and Jill 图论->1751 Highways 图论->1122 FDNY to the Rescue! 图论->Dijkstra1125 Stockbroker Grapevine 图论->Dijkstra1135 Domino Effect 图论->Dijkstra1394 Railroad 图论->Dijkstra1158 TRAFFIC LIGHTS 图论->Dijkstra变形2395 Out of Hay 图论->Dijkstra变形2253 Frogger 图论->Dijkstra变形(和1295是一样的)1734 Sightseeing trip 图论->Euler回路1466 Girls and Boys 图论->n/a1515 Street Directions 图论->把一个无向连通图改造成为有向强连通图1635 Subway tree systems 图论->不同表示法的二叉树判同1275 Cashier Employment 图论->差分约束系统->无负权回路的有向图的最长路->Bellman-Ford1274 The Perfect Stall 图论->二分图的最大匹配1325 Machine Schedule 图论->二分图的最大匹配2239 Selecting Courses 图论->二分图的最大匹配2195 Going Home 图论->二分图的最大权匹配2400 Supervisor, Supervisee 图论->二分图的最大权匹配?1637 Sightseeing tour 图论->欧拉回路1383 Labyrinth 图论->树的最长路1094 Sorting It All Out 图论->拓扑排序1486 Sorting Slides 图论->拓扑排序1149 PIGS 图论->网络流2289 Jamie's Contact Groups 图论->网络流?1192 最优连通子集图论->无负权回路的有向图的最长路->BellmanFord 1364 King 图论->无负权回路的有向图的最长路->BellmanFord1985 Cow Marathon 图论->有向无环图的最长路1087 A Plug for UNIX 图论->最大流1273 Drainage Ditches 图论->最大流1459 Power Network 图论->最大流1632 Vase collection 图论->最大完全图2049 Finding Nemo 图论->最短路1251 Jungle Roads 图论->最小生成树2421 Constructing Roads 图论->最小生成树1026 Cipher 组合数学1095 Trees Made to Order 组合数学2346 Lucky tickets 组合数学1286 Necklace of Beads 组合数学->Polya定理2409 Let it Bead 组合数学->Polya定理1664 放苹果组合数学->递推。
注水问题的奥数题及答案参考
![注水问题的奥数题及答案参考](https://img.taocdn.com/s3/m/7fa5b53b82c4bb4cf7ec4afe04a1b0717fd5b345.png)
注水问题的奥数题及答案参考
一个水池,底部装有一个常开的排水管,上部装有假设干个同样粗细的进水管。
当翻开4个进水管时,需要5小时才能注满水池;当翻开2个进水管时,需要15小时才能注满水池;现在要用2小时将水池注满,至少要翻开多少个进水管?
答案与解析:注(排)水问题是一类特殊的工程问题。
往水池注水或从水池排水相当于一项工程,水的流量就是工作量,单位时间内水的流量就是工作效率。
要2小时内将水池注满,即要使2小时内的进水量与排水量之差刚好是一池水。
为此需要知道进水管、排水管的工作效率及总工作量(一池水)。
只要设某一个量为单位1,其余两个量便可由条件推出。
我们设每个同样的进水管每小时注水量为1,那么4个进水管5小时注水量为(1×4×5),2个进水管15小时注水量为
(1×2×15),从而可知
每小时的排水量为(1×2×15-1×4×5)÷(15-5)=1
即一个排水管与每个进水管的工作效率相同。
由此可知
一池水的总工作量为1×4×5-1×5=15
又因为在2小时内,每个进水管的注水量为1×2,
所以,2小时内注满一池水
至少需要多少个进水管? (15+1×2)÷(1×2)=8.5≈9(个)
答:至少需要9个进水管。
POJ部分题目分类
![POJ部分题目分类](https://img.taocdn.com/s3/m/3056ccad284ac850ad02429b.png)
POJ部分题目分类张棋00448129算法入门(简单题)1000 1003 1004 1005 1006 1007 1015(学会dp)1016 1017 1018 1042(dp)1046(简单数学)1054(简单的剪枝)1062(dp)1068 1095 1113(凸包,但规模小,O(n^2)的也行)1125 1127 1152 1154 1183(用笔算算)1218 1221 1244 1281 1312 1313(找找规律)1315(学会搜索)1321(同1315)1323(dp) 1326 1331 14911493(找规律)1503(高精度)1504 1517 1519 1547 15521563(考虑仔细一点,还要注意精度)1650(不是好题)1651(dp)16561657 1658 1663 1675(计算几何)1681 1702(三进制运算)1799 1828 1862(简单数学)1887 1906(实战好题)1914 1915(宽搜)1928 1936 1978 1979 2000 2019(dp好题)2027(垃圾题)2028 2078(不要重复搜索)2080 2081 2083 2140 2141 2184(活用dp)2190 2192 2193 2196 2199 2209 2211 2243 2248(搜索)2260 2261 2262 2291 2301 2304 2309(找规律)2316 2317 2318 2325 2355 2357 2363 2378(树的dp)2381 2385 2393 2394 2395 2413(高精度基础)2418 2419经典1011(搜索好题)1012(学会打表)10131019(它体现了很多此类问题的特点)1050(绝对经典的dp)1088(dp好题)1157(花店,经典的dp)1163(怎么经典的dp那么多呀???)1328(贪心)1458(最长公共子序列)1647(很好的真题,考临场分析准确和下手迅速)1654(学会多边形面积的三角形求法)1655(一类无根树的dp问题)1804(逆序对)2084(经典组合数学问题)2187(用凸包求最远点对,求出凸包后应该有O(N)的求法,可我就是调不出来)2195(二分图的最佳匹配)2242(计算几何经典)2295(等式处理)2353(dp,但要记录最佳路径)2354(立体解析几何)2362(搜索好题)2410(读懂题是关键)2411(经典dp)趣味1067(很难的数学,但仔细研究,是一片广阔的领域)1147(有O(n)的算法,需要思考)1240(直到一棵树的先序和后序遍历,那么有几种中序遍历呢?dp)1426(是数论吗?错,是图论!)1648(别用计算几何,用整点这个特点绕过精度的障碍吧)1833(找规律)1844(貌似dp或是搜索,其实是道有趣的数学题)1922(贪心,哈哈)22312305(不需要高精度噢)2328(要仔细噢)2356(数论知识)2359(约瑟夫问题变种)2392(有趣的问题)很繁的题100110081087(构图很烦,还有二分图的最大匹配)1128(USACO)124513291550(考的是读题和理解能力)1649(dp)2200(字符串处理+枚举)2358(枚举和避免重复都很烦)2361(仔细仔细再仔细)难题1014(数学证明比较难,但有那种想法更重要)1037(比较难的dp)1405(高精度算法也分有等级之分,不断改进吧)2002(不知道有没有比O(n^2*logn)更有的算法?)2054(极难,很强的思考能力)2085(组合数学)2414(dp,但要剪枝)2415(搜索)2423(计算几何+统计)多解题1002(可以用排序,也可以用统计的方法)1338(搜索和dp都可以)1664(搜索和dp都练一练吧)2082(这可是我讲的题噢)2352(桶排和二叉树都行)。
人教版九年级上册数学22.3实际问题与二次函数(喷水问题)同步训练(含答案)
![人教版九年级上册数学22.3实际问题与二次函数(喷水问题)同步训练(含答案)](https://img.taocdn.com/s3/m/8072a725a200a6c30c22590102020740be1ecd05.png)
人教版九年级上册数学22.3实际问题与二次函数(喷水问题)同步训练(含答案)人教版九年级上册数学22.3实际问题与二次函数(喷水问题)同步训练一、单选题1.某景点的“喷水巨龙”口中C处的水流量抛物线形,该水流喷出的高度y(m)与水平距离x(m)之间的关系如图所示,D为该水流的最高点,,垂足为A.已知,,则该水流距水平面的最大高度AD的长度为()A.B.C.D.2.如图,一个移动喷灌架喷射出的水流可以近似地看成抛物线,喷水头的高度(即的长度)是1米.当喷射出的水流距离喷水头米时,达到最大高度米,水流喷射的最远水平距离是()A.6米B.1米C.5米D.4米3.某广场有一个小型喷泉,水流从垂直于地面的水管喷出,长为.水流在各个方向上沿形状相同的抛物线路径落到地面上,某方向上抛物线路径的形状如图所示,落点到的距离为.建立平面直角坐标系,水流喷出的高度与水平距离之间近似满足函数关系,则水流喷出的最大高度为()A.B.C.D.4.某地要建造一个圆形喷水池,在水池上都垂直于地面安装一个柱子恰为水面中心,安置在柱子顶端处的喷头向外喷水,水流在各个方向上沿形状相同的抛物线路径落下,在过的任一平面上,建立平面直角坐标系(如图),水流喷出的高度与水平距离之间的关系式是,则下列结论错误的是()A.柱子的高度为B.喷出的水流距柱子处达到最大高度C.喷出的水流距水平面的最大高度是D.水池的半径至少要才能使喷出的水流不至于落在池外5.如图,小明的父亲在相距2米的两棵树间拴了一根绳子,给小明做了一个简易的秋千,拴绳子的地方距地面都是2.5米,绳子自然下垂呈抛物线状,身高1米的小明距较近的那棵树0.5米时,头部刚好接触到绳子,则绳子的最低点距地面的距离为()A.0.5米B.米C.米D.0.85米6.如图,始终盛满水的圆柱体水桶水面离地面的高度为20cm,如果在离水面竖直距离为h(单位:cm)的地方开大小合适的小孔,那么从小孔射出水的射程(水流落地点离小孔的水平距离)s(单位:cm)与h的关系式为.如果想通过垫高水桶,使射出水的最大射程增加10cm,则小孔离水面的距离是()A.14cm B.15cm C.16cm D.18cm7.如图,池中心竖直水管的顶端安一个喷水头,使喷出的抛物线形水柱在与池中心的水平距离为1m处达到最高,高度为3m,水柱落地处离池中心3m,水管的长为()A.2.1m B.2.2m C.2.3m D.2.25m8.广场上水池中的喷头微露水面,喷出的水线呈一条抛物线,水线上水珠的高度y(米)关于水珠和喷头的水平距离(米)的函数解析式是,那么水珠的高度达到最大时,水珠与喷头的水平距离是()A.1米B.2米C.5米D.6米二、填空题9.要修建一个圆形喷水池,在池中心竖直安装一根水管,在水管的顶端安装一个喷水头,使喷出的抛物线形水柱如图所示.现以水管与地面交点为原点,原点与水柱落地处所在直线为轴,水管所在直线为轴,建立直角坐标系,喷出的抛物线水柱对应的函数解析式是,则水管长为.10.广场上喷水池中的喷头微露水面,喷出的水线呈一条抛物线,水线上水珠的高度y(米)关于水珠和喷头的水平距离x(米)的函数解析式是,那么水珠达到的最大高度为米.11.某游乐园有一圆形喷水池(如图),中心立柱AM上有一喷水头A,其喷出的水柱距池中心3米处达到最高,最远落点到中心M的距离为9米,距立柱4米处地面上有一射灯C,现将喷水头A向上移动1.5米至点B(其余条件均不变),若此时水柱最高处D与A,C在同一直线上,则水柱最远落点到中心M的距离增加了米.12.某幢建筑物,从5米高的窗口A用水管向外喷水,喷的水流呈抛物线的最高点M离墙1米,离地面米,则水流下落点B离墙距离是米.13.如图,要修建一个圆形喷水池,在池中心竖直安装一根水管,在水管的顶端点安一个喷水头,使喷出的抛物线形水柱在与池中心的水平距离为处达到最高,高度为,水柱落地处离池中心距离为,则水管的长度是.14.如图,在喷水池的中心A处竖直安装一个水管AB,水管的顶端B处有一个喷水孔,喷出的抛物线形水柱在与池中心A的水平距离为1m处达到最高点C,高度为3m,水柱落地点D离池中心A处3m,则水管AB的长为m.15.某广场有一个半径8米的圆形喷水池,喷水池的周边有一圈喷水头(喷水头高度忽略不计),各方向喷出的水柱恰好在喷水池中心的装饰物的顶端处汇合,水柱离中心点3米处达最高5米,如图所示建立平面直角坐标系.王师傅在喷水池内维修设备期间,喷水管意外喷水,为了不被淋湿,身高1.8的他站立时必须在离水池中心点米以内.16.消防员的水枪喷出的水流可以用抛物线来描述,已知水流的最大高度为,则的值为.三、解答题17.一名运动员在高的跳台进行跳水,身体(看成一点)在空中的运动轨迹是一条抛物线,运动员离水面的高度与离起跳点A的水平距离之间的函数关系如图所示,运动员离起跳点A的水平距离为时达到最高点,当运动员离起跳点A的水平距离为时离水面的距离为.(1)求y关于x的函数表达式;(2)求运动员从起跳点到入水点的水平距离的长.18.一个圆形喷水池的上都竖直安装了一个柱形喷水装置,A处的喷头向外喷水,水流在各个方向上沿形状相同的抛物线路径落下.建立平面直角坐标系如图所示,的高度为,水柱在距喷水头A水平距离处达到最高,最高点距地面.(1)求抛物线的表达式;(2)身高的小明在水柱下方运动,当他的头顶恰好接触到水柱时,求他到喷水头A的水平距离.19.某游乐场的圆形喷水池中心有一喷水管,从点A向四周喷水,喷出的水柱为抛物线,且形状相同.如图,以水平方向为轴,点为原点建立平面直角坐标系(单位长度为),点A在轴上,水柱所在的抛物线(第一象限部分)的函数表达式为.(1)求喷水管高.(2)身高为的小明站在距离喷水管的地方,他会被水喷到吗?20.如图,抛物线,是某喷水器喷出的水抽象而成,抛物线由抛物线向左平移得到,把汽车横截面抽象为矩形,其中米,米,米,抛物线表达式为,,且点A,,,,均在坐标轴上.(1)求抛物线表达式.(2)求点的坐标.(3)要使喷水器喷出的水能洒到整个汽车,记长为米,直接写出的取值范围.参考答案:1.C2.C3.D4.C5.A6.B7.D8.B9.10.611.12.313.14.15.716.±217.(1)y关于x的函数表达式为;(2)运动员从起跳点到入水点的水平距离的长为.18.(1)(2)或19.(1)(2)不会20.(1)(2)(3)答案第2页,共2页。
西工大noj答案
![西工大noj答案](https://img.taocdn.com/s3/m/5cdfe953f46527d3240ce05f.png)
西工大noj答案【篇一:西工大poj100题(全新)】圆及圆球等的相关计算#includestdio.hint main(){int a,b,sum;scanf(%d %d,a,b);sum=a+b;printf(%d,sum); }#includestdio.hint main(){float r,h,l,s,sq,vq,vz,pi=3.141592653; scanf(%f %f,r,h);l=2*pi*r;s=pi*r*r;【篇二:西北工业大学 c语言 poj题目及答案_第一季】>毋庸置疑,学习程序设计就是奔着“程序员梦”去的。
编程本质是运用计算机科学的基本思想求解问题、设计系统以及理解人类的思维行为和普适技能,核心是“实现”。
因此,诸如“中国梦”、“程序员梦”是编写出来,即“coding now,programming future”。
在这个学期,你将尝试用“编写”的方式去“实现”,体验与过去完全不同的“实现”。
在这个过程中,有太多的“if”不确定、有太多的“for”死循环、有太多的“bug”愁断魂,“实现”并不容易。
有人的地方就有江湖,有江湖的地方就有武林大会。
poj(problems online judge)是学编程的江湖。
在这里,做习题叫做“刷题”,习题做错叫做“被挖”(wa=wrong answer,结果错误),习题通过叫做“a了”(ac=accepted,结果通过),简单习题称为“水题”,“刷一圈”指连续刷题12小时以上。
总会有人用一、两周的时间完成100题的oj,这不叫“刷题”,叫“梦游”。
2012学年,一个大三的哥哥将100题的源码整理出版了(长安校区超市旁的复印店),大一亲们蜂拥而至,一时间“a4纸贵”,交叉着下载、复制、粘贴、上传的能力训练,唯独不见“编写”。
待到期末上机考试,亲们那双瞠目的眼睛与希望工程那双大眼睛神似,最终贡献了两位数的gdp。
有道是出来混的,迟早要还,哥哥今昔完美毕业,亲们继续“梦游”。
多次倒水问题的题目
![多次倒水问题的题目](https://img.taocdn.com/s3/m/3893e7d7f80f76c66137ee06eff9aef8941e483b.png)
多次倒水问题的题目请让第一次倒水的时间间隔多少秒?怎样计算?题干中给出了6次共12次的倒水时间,其中第2次是第一次倒水,第1次是第一个水量最少的时候,此时水中有多个杂质;第3、4两次倒水。
求多次加在一起一共多少遍。
一、在盛满水的容器中,每增加一滴水,容器内的水量就减少一点,如果把装满水的容器向右倾倒3次,需要使杯子中的水量为多少?答:水的体积为2×3=32×16÷4。
所以,从第一次倒水开始算起,水的体积就减少了32 ml。
所以第一次倒3次,杯子中装水量为32 ml;第二次倒1个,容器内装水量为30 ml;第三次倒2个,容器内装水量为60 ml。
因此,第三次向右倾倒时杯子中的用量是42m3/s.1、根据向右倾倒时,杯底中心的深度为6 cm2,则杯子中水的体积是(60×6×6÷4)=(60×6)×2=36 ml答:在倒水过程中,水的体积是不断变化的。
这就是“三次倒水”(60×6×2=60ml)÷3=6 cm2。
所以喝水一次就可以带走杯子里的剩余水量。
所以多次倒水之后。
杯子中只剩32 ml。
2、如果从第一次倒水开始计算,杯底的容积是?答:杯底容积=水体积÷水的体积。
例2:一个杯子装满水,杯子底长80 cm,宽10 cm,高6 cm重10 kg,杯子底部的容积是20 L??解答:按杯底容积即80×12=32 ml×20÷12=20 ml.答案解析:该杯子容积为10 L。
所以最小倒倒时杯子中的量为42 L×10×20=186个。
3、第二次倒水时,杯子中的水量是多少?答:“1个杯子里的水量为30 ml”。
由于要使杯子中的水量是从第一次倒水开始算起,但杯子中只能有一滴水,因此水的体积为30 ml。
而第一次倾倒的时候杯子中的水量是34+36=57m3/s.故要使第二次向右倾倒杯子的水量为52×36÷36=1 ((54+56) x 4+54)。
奥数卷 水管问题
![奥数卷 水管问题](https://img.taocdn.com/s3/m/a120051e700abb68a882fb00.png)
水管问题初级题1、一根甲种水管30分钟可以灌满水池,一根乙种水管40分钟可以灌满水池。
现先用3根甲种水管放5分钟,然后再打开若干根乙种水管,2分30秒就灌满水池。
问:打开了( )根乙种水管?2、甲、乙两管同时打开,9分钟能注满水池,现在先打开甲管,10分钟后再打开乙管,经过3分钟就注满了水池。
已知甲管比乙管每分钟多注入0.6立方米水。
这个水池的容积是( )立方米?3、一个水池安装有三个水管,打开甲、乙两个水管5小时可灌满一池水,打开乙、丙两管4小时可灌满一池水。
如果乙管先打开6小时后,再打开甲、丙两水管(此时乙管关闭)1小时,水池里灌了710的水,那么,打开乙管单独灌满一池水要( )小时?4、放满一个水池的水,如果同时打开1、2、3号阀门,20分钟可以完成,如果同时打开2、3、4号阀门,21分钟可以完成,如果同时打开1、3、4号阀门,28分钟可以完成,如果同时打开1、2、4号阀门,30分钟可以完成。
如果同时打开1、2、3、4号阀门,( )分钟可以完成?5、某水池可以用甲、乙两个水管注水,单放甲管注满水池需12小时,单放乙管注满水池需24小时。
现在要求10小时注满水池,并且甲、乙两管合放的时间尽可能地少。
那么甲、乙管合放最少需要( )小时?6、灌满一个水池,只打开A 管要8小时,只打开B 管要10小时,只打开C 管要15小时。
开始只打开A 与B 两管,中途关掉A 管和B 管,然后打开C 管,前后用了10小时15分后灌满了水池,C 管打开了( )时间?7、一个蓄水池装了一根进水管和三根放水速度一样的出水管,单开一根进水管20分钟可注满空池,单开一根出水管,65分可以放完满池的水,现有13池水,如果四管齐开,( )分钟后水有25?8、蓄水池有甲、乙、丙三个进水管,灌满一池水,单开甲管需10小时,单开乙管需12小时,单开丙管需15小时,上午8时三个管同时开,中间甲管因故关闭,结果到下午2时水池灌满,甲管在( )时被关闭?9、要用甲、乙两根水管来灌满水池。
杭电OJ水题答案
![杭电OJ水题答案](https://img.taocdn.com/s3/m/9d173925ed630b1c58eeb501.png)
Hdu1000,1090#include<stdio.h>int main(){int a,b;while (scanf("%d %d",&a,&b)==2)printf("%d\n",a+b);return 0;}Hdu1008#include<stdio.h>int main(){int n,i,j;int t;while(scanf("%d",&n)!=EOF){t=5*n;j=0;if(n==0)break;while(n--){scanf("%d",&i);if(i>j)t+=(i-j)*6;if(i<j)t+=(j-i)*4;j=i;}printf("%d\n",t);}}Hdu1021#include <stdio.h>int main(){int n;while(scanf("%d",&n)!=EOF){n=n%8;if(n==2||n==6)printf("yes\n");elseprintf("no\n");}return 0;}Hdu1040#include<stdio.h>int main(){int i,j,n,m,a[2000],t;scanf("%d",&n);while(n--){scanf("%d",&m);for(i=0;i<m;i++)scanf("%d",&a[i]);for(i=0;i<m;i++)for(j=0;j<m-1-i;j++)if(a[j]>a[j+1]){t=a[j];a[j]=a[j+1];a[j+1]=t;}printf("%d",a[0]);for(i=1;i<m;i++)printf(" %d",a[i]);printf("\n");}}Hdu1076#include<stdio.h>int main(){int count=0,i,n,j,a,b;while(scanf("%d",&n)!=EOF){for(i=0;i<n;i++){scanf("%d %d",&a,&b);for(j=a;;j++){if((j%100==0&&j%400==0)||(j%100!=0&&j%4==0)){ count++; }if(count==b) break;}printf("%d\n",j);count=0;}}}Hdu1091#include<stdio.h>int main(){double a;double b;while(scanf("%lf %lf",&a,&b))if(a==0 && b==0)break;elseprintf("%.0lf\n",a+b);return 0;}Hdu1092#include<stdio.h>void main(){int n,i,a,sum=0;while(scanf("%d",&n)!=EOF){if(n==0)continue;elsefor(i=1;i<=n;i++){scanf("%d",&a);sum+=a;}printf("%d\n",sum);sum=0;}}}Hdu1093#include<stdio.h>int main(){int n,i,j,a,sum=0;scanf("%d",&j);for(int b=0;b<j;b++){while(scanf("%d",&n)!=EOF){for(i=1;i<=n;i++){scanf("%d",&a);sum+=a;}printf("%d\n",sum);sum=0;}}}Hdu1094#include<stdio.h>int main(){int n,i,a,sum=0;while(scanf("%d",&n)!=EOF) {for(i=1;i<=n;i++)scanf("%d",&a);sum+=a;}printf("%d\n",sum);sum=0;}}Hdu1095#include<stdio.h>int main(){int a,b;while (scanf("%d %d",&a,&b)==2)printf("%d\n\n",a+b);return 0;}Hdu1096#include<stdio.h>int main(){int N;scanf("%d",&N);while(N--){int M,i,a,sum=0;scanf("%d",&M);for(i=0;i<M;i++){scanf("%d",&a);sum+=a;}if(N!=0)printf("%d\n\n",sum);elseprintf("%d\n",sum);}}Hdu1108#include<stdio.h>void main (){unsigned int b, a, i=1;while(scanf("%d %d",&a,&b)!=EOF){for(i=1;;i++){if(i%a==0&&i%b==0){printf("%d\n",i);break;}}}}Hdu1201#include<stdio.h>void main(){int a,b,c,i,n,count1,count2,sum;while(scanf("%d",&n)!=EOF){while(n--){scanf("%d-%d-%d",&a,&b,&c);if(b==2&&c==29){ printf("-1\n"); }else{count1=0;sum=0;for(i=a;i<a+18;i++){if((((i%100!=0&&i%4==0)||(i%400==0))&&b<=2)||((((i+1)%100!=0&&(i+1)%4==0)||((i+1) %400==0))&&b>2))sum+=366;elsesum+=365;}printf("%d\n",sum);}}}}Hdu1235#include<stdio.h>void main(){int a,b,c,i,n,f[1000],count=0;while(scanf("%d",&n)>0){if(n==0) break;for(i=0;i<n;i++)scanf("%d",&f[i]);scanf("%d",&c);for(i=0;i<n;i++){if(f[i]==c)count++;}printf("%d\n",count);count=0;}}Hdu1046#include<stdio.h>int f(int x){int j,sum=0;for(j=1;j<x;j++){if(x%j==0)sum+=j;}if(x==sum)return 1;else return 0;sum=0;}void main(){unsigned int i,n,a,b,t,x,count=0;while(scanf("%d",&n)>0){while(n--){scanf("%d%d",&a,&b);if(a>b) {t=a;a=b;b=t; }for(i=a;i<=b;i++){x=f(i);if(x==1) //1是完数count++;}printf("%d\n",count);count=0;}}}。
水题(暑假作业)
![水题(暑假作业)](https://img.taocdn.com/s3/m/d992986d0b1c59eef8c7b4cb.png)
水仙花数时间限制:1000 ms | 内存限制:65535 KB难度:0描述请判断一个数是不是水仙花数。
其中水仙花数定义各个位数立方和等于它本身的三位数。
输入有多组测试数据,每组测试数据以包含一个整数n(100<=n<1000)输入0表示程序输入结束。
输出如果n是水仙花数就输出Yes否则输出No样例输入153154样例输出YesNoTake it easy时间限制:1000 ms | 内存限制:65535 KB难度:0描述小蜗牛是一名ACMer,他特别想加入校ACM队,为此他开始废寝忘食的刷题。
小蜗牛不是神,也会因为做不对题目而烦恼。
假设小蜗牛做对一道题,他的愉悦值会加一;如果做错一题,他的愉悦值会减一。
给定一个初始的愉悦值N(0<=N<=10),当小蜗牛的愉悦值为0时他就会停止做题,转身去做其他的事情。
但是他想知道自己这一天做了多少题,现在请你告诉他结果。
输入有多组数据。
每组数据第一行给定一个N,表示小蜗牛的初始愉悦值。
第二行给定10个数字,表示有10个做题结果。
其中做题结果只会是1或者-1(1表示做对一题,-1表示做错一题)。
输出每组数据请输出一行,输出小蜗牛做了多少题。
21 1 1 1 1 -1 -1 -1 -1 -14-1 -1 -1 -1 -1 1 1 1 1 1样例输出104谁是最好的Coder时间限制:1000 ms | 内存限制:65535 KB难度:0描述计科班有很多Coder,帅帅想知道自己是不是综合实力最强的coder。
帅帅喜欢帅,所以他选了帅气和编程水平作为评选标准。
每个同学的综合得分是帅气程度得分与编程水平得分的和。
他希望你能写一个程序帮他一下。
输入数据有多组。
输入一个数n,代表计科班的总人数。
接下来有n行数,一行数有两个数a,b。
其中a代表该同学的编程水平,b代表该同学的帅气程度。
n=0表示输入结束。
输出每组数据占一行,输出所有同学中综合得分最高的分数。
poj题号与题目
![poj题号与题目](https://img.taocdn.com/s3/m/69d28cd63186bceb19e8bb12.png)
1000 第一次练习2728 输出字符串分支与循环2675 计算书费2676 整数的个数2679 整数的立方和2680 化验诊断2683 求分数的序列和2684 求解阶乘的和2686 打印完数2687 逆序存放数组2697 迭代法解方程2701 与7无关的数2703 骑车与走路2707 求一元二次方程的根2709 求出e的值2712 细菌繁殖2714 求平均年龄2718 赴约会2719 摘苹果2720 大象喝水2733 判断闰年2748 全排列2796 数字求和2803 碎纸机2804 词典2805 正方形2807 两倍2810 完美立方2817 木棒2854 点和正方形2856 计算邮资2868 牛顿迭代2869 计算费马数2870 矩阵加法2871 奇偶排序、循环2882 求商和余数,循环2883 检查并排序、5个数2885 计算反序数(如24和42)2886 被3整除的数之和2887 能被3,5,7整除的数2888 字符串中的数字,排序2911 受限完全平方数2912 三个完全平方数2926 算术运算2928 素数回文数的个数2930 加减乘除2933 停车场收费2936 试剂配制2938 按顺序输出2940 求和2941 满足条件的整数2943 小白鼠排队2946 玩游戏2964 日历问题2965 玛雅历2966 时区转换2967 特殊日历计算2972 确定进制2976 All in All2977 生理周期3142 球弹跳高度的计算3143 验证歌德巴赫猜想3146 小球运动(1/2h)3177 判决素数个数3178 开关电灯3179 最长单词3180 整数减法3237 鸡兔同笼数组1830 开关问题,一维数组2670 求鞍点2677 肿瘤的个数二维数组2687 数组逆序存放2691 打印极值点下标2692 识别假币2693 最远距离2695 最大商2704 竞赛评分2705 跳绳游戏2708 平衡饮食2715 谁拿了最多奖学金2722 学分绩点2723 不吉利日期2724 生日相同2742 统计字符(分类统计问题)2745 显示器2746 约瑟夫问题2800 垂直直方图2801 填词2811 熄灯问题2812 恼人的青蛙2813 画家问题2816 红与黑2870 矩阵加法2871 奇偶排序、循环2899 矩阵行交换2929 扩号匹配2937 异常细胞检测2949 平板着色排列2996 选课2989 钻石游戏字符串字符串2678 基因检测,子串比较。
地球上的水试题
![地球上的水试题](https://img.taocdn.com/s3/m/80ad485fcc22bcd127ff0c12.png)
地球上的水试题 Revised by Petrel at 2021一、选择题下图为水圈的构成示意图,读图回答1~2题。
1.图中字母所表示的各水体,分布最广的是()A.A B.BC.C D.D2.下列说法中,正确的是()A.在水的三态中,固态水数量最多B.热带地区没有固体状态的水C.陆地上的各种水体之间具有水源相互补给的关系D.我国内流区域没有参与海陆间水循环过程解析:本题组主要考查地球上水体的组成。
第1题,气态水数量最少但分布最广。
第2题,在陆地上的各种水体之间具有水源相互补给的关系。
液态水数量最多。
答案: 1.A 2.C(2016·腾冲高一检测)“一滴水可以汇入大海的波涛,可以化为高山的彩虹,可以变为地面的积雪。
”结合所学知识,完成3~4题。
3.这段话涉及了水循环的哪些环节()①径流②蒸发③降水④水汽输送A.②③④B.①③④C.①②④D.①②③4.这段话说明水循环联系的圈层有()①水圈②岩石圈③大气圈④软流层A.②③④B.①③④C.①②④D.①②③解析:第3题,“汇入大海”是径流,“化为彩虹”需要蒸发,“变为积雪”为降水。
第4题,“大海”为水圈,“彩虹”为大气圈,“高山”和“地面”为岩石圈。
答案: 3.D 4.D下图为在人工模拟降雨条件下,不同性质的城市下垫面水量入渗随时间变化。
据此,回答5~6题。
5.不同性质的下垫面,对水循环影响差异较大的环节是()A.下渗B.降水C.水汽输送D.蒸发6.为了美化环境并减轻城市内涝的发生,城市下垫面最适宜增加() A.绿地B.草皮空心砖C.普通混凝土砖D.透水混凝土砖解析:第5题,不同性质的地表,水的下渗量不同,其对水循环的影响较大,进而还可以影响地表径流等。
第6题,为了美化环境和减轻城市内涝,城市的下垫面既需要硬化还要增加下渗量,所以选透水混凝土砖最好。
答案: 5.A 6.D下图表示重庆附近某水文站的气温、降水状况及该江段补给类型。
读图回答7~8题。
注水放水测试题及答案
![注水放水测试题及答案](https://img.taocdn.com/s3/m/f7be681b26284b73f242336c1eb91a37f11132ac.png)
注水放水测试题及答案1. 一个水池有甲乙两个水龙头,甲水龙头注满水池需要6小时,乙水龙头放空水池需要8小时。
如果甲乙两个水龙头同时打开,水池何时能被注满?答案:设水池的容量为1单位,甲水龙头每小时注水量为1/6单位,乙水龙头每小时放水量为1/8单位。
当甲乙同时打开时,每小时净注水量为1/6 - 1/8 = 1/24单位。
因此,注满水池需要1 ÷ (1/24) = 24小时。
2. 一个水池有甲乙丙三个水龙头,甲水龙头注满水池需要5小时,乙水龙头放空水池需要10小时,丙水龙头注满水池需要3小时。
如果甲丙两个水龙头同时打开,乙水龙头放水,水池何时能被注满?答案:甲水龙头每小时注水量为1/5单位,丙水龙头每小时注水量为1/3单位,乙水龙头每小时放水量为1/10单位。
甲丙同时打开时,每小时净注水量为1/5 + 1/3 - 1/10 = 1/2单位。
因此,注满水池需要1 ÷ (1/2) = 2小时。
3. 一个水池有甲乙两个水龙头,甲水龙头注满水池需要4小时,乙水龙头放空水池需要12小时。
如果甲水龙头注水2小时后关闭,乙水龙头开始放水,水池何时能被完全放空?答案:甲水龙头注水2小时后,水池的水量为2 × (1/4) = 1/2单位。
乙水龙头每小时放水量为1/12单位。
因此,放空水池需要(1/2) ÷(1/12) = 6小时。
4. 一个水池有甲乙两个水龙头,甲水龙头注满水池需要3小时,乙水龙头放空水池需要9小时。
如果甲水龙头注水1小时后关闭,乙水龙头开始放水,水池何时能被完全放空?答案:甲水龙头注水1小时后,水池的水量为1 × (1/3) = 1/3单位。
乙水龙头每小时放水量为1/9单位。
因此,放空水池需要(1/3) ÷(1/9) = 3小时。
结束语:以上为注水放水测试题及答案,希望对同学们理解和掌握注水放水问题有所帮助。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
POJ 1247 Magnificent MeatballsMagnificent MeatballsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5719Accepted: 3837DescriptionSam and Ella run a catering service. They like to put on a show when serving meatballs to guests seated at round tables. They march out of the kitchen with pots of meatballs and start serving adjacent guests. Ella goes counterclockwise and Sam goes clockwise, until they both plop down their last meatball, at the same time, again at adjacent guests. This impressive routine can only be accomplished if they can divide the table into two sections, each having the same number of meatballs. You are to write a program to assist them.At these catering events, each table seats 2 <= N <= 30 guests. Each guest orders at least one and at most nine meatballs. Each place at the table is numbered from 1 to N, with the host at position 1 and the host's spouse at position N. Sam always serves the host first then proceeds to serve guests in increasing order. Ella serves the spouse first, then serves guests in decreasing order. The figures illustrate the first two example input cases.InputInput consists of one or more test cases. Each test case contains the number of guests N followed by meatballs ordered by each guest, from guest 1 to guest N. The end of the input is a line with a single zero.OutputFor each table, output a single line with the ending positions for Sam and Ella, or the sentence indicating an equal partitioning isn't possible. Use the exact formatting shown below.Sample Input5 9 4 2 8 35 3 9 4 2 86 1 2 1 2 1 26 1 2 1 2 1 1Sample OutputSam stops at position 2 and Ella stops at position 3.No equal partitioning.No equal partitioning.Sam stops at position 3 and Ella stops at position 4.SourceMid-Central USA 2002POJ 1316 Self NumbersSelf NumbersTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 18000Accepted: 10125DescriptionIn 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for digitadition, a term coined by Kaprekar.) For example, d(75) = 75 + 7 + 5 = 87. Given any positive integer n as a starting point, you can construct the infinite increasing sequence of integers n, d(n), d(d(n)), d(d(d(n))), .... For example, if you start with 33, the next number is 33 + 3 + 3 = 39, the next is 39 + 3 + 9 = 51, the next is 51 + 5 + 1 = 57, and so you generate the sequence33, 39, 51, 57, 69, 84, 96, 111, 114, 120, 123, 129, 141, ...The number n is called a generator of d(n). In the sequence above, 33 is a generator of 39, 39 is a generator of 51, 51 is a generator of 57, and so on. Some numbers have more than one generator: for example, 101 has two generators, 91 and 100. A number with no generators is a self-number.There are thirteen self-numbers less than 100: 1, 3, 5, 7, 9, 20, 31, 42, 53, 64, 75, 86, and 97.InputNo input for this problem.OutputWrite a program to output all positive self-numbers less than 10000 in increasing order, one per line.Sample InputSample Output135792031425364|| <-- a lot more numbers|9903991499259927993899499960997199829993SourceMid-Central USA 1998POJ 1488 TEX QuotesTEX QuotesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7464Accepted: 3925DescriptionTEX is a typesetting language developed by Donald Knuth. It takes source text together with a few typesetting instructions and produces, one hopes, a beautiful document. Beautiful documents use double-left-quote and double-right-quote to delimit quotations, rather than the mundane " which is what is provided by most keyboards. Keyboards typically do not have an oriented double-quote, but they do have a left-single-quote ` and a right-single-quote '. Check your keyboard now to locate the left-single-quote key ` (sometimes called the "backquote key") and the right-single-quote key ' (sometimes called the "apostrophe" or just "quote"). Be careful not to confuse the left-single-quote ` with the "backslash" key \. TEX lets the user type two left-single-quotes `` to create a left-double-quote and two right-single-quotes '' to create a right-double-quote. Most typists, however, are accustomed to delimiting their quotations with the un-oriented double-quote ".If the source contained"To be or not to be," quoth the bard, "that is the question."then the typeset document produced by TEX would not contain the desired form: "To be or not to be," quoth the bard, "that is the question." In order to produce the desired form, the source file must contain the sequence:``To be or not to be,'' quoth the bard, ``that is the question.''You are to write a program which converts text containing double-quote (") characters into text that is identical except that double-quotes have been replaced by the two-character sequences required by TEX for delimiting quotations with oriented double-quotes. The double-quote (") characters should be replaced appropriately by either `` if the " opens a quotation and by '' if the " closes a quotation. Notice that the question of nested quotations does not arise: The first " must be replaced by ``, the next by '', the next by ``, the next by '', the next by ``, the next by '', and so on.InputInput will consist of several lines of text containing an even number of double-quote (") characters. Input is ended with an end-of-file character.OutputThe text must be output exactly as it was input except that:∙the first " in each pair is replaced by two ` characters: `` and∙the second " in each pair is replaced by two ' characters: ''.Sample Input"To be or not to be," quoth the Bard, "thatis the question".The programming contestant replied: "I must disagree.To `C' or not to `C', that is The Question!"Sample Output``To be or not to be,'' quoth the Bard, ``thatis the question''.The programming contestant replied: ``I must disagree.To `C' or not to `C', that is The Question!''SourceEast Central North America 1994POJ 1493 Machined SurfacesMachined SurfacesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2173Accepted: 1408DescriptionAn imaging device furnishes digital images of two machined surfaces that eventually will be assembled in contact with each other. The roughness of this final contact is to be estimated.A digital image is composed of the two characters, "X" and " " (space). There are always 25 columns to an image, but the number of rows, N, is variable. Column one (1) will always have an "X" in it and will be part of the left surface. The left surface can extend to the right from column one (1) as contiguous X's.Similarly, column 25 will always have an "X" in it and will be part of the right surface. The right surface can extend to the left from column 25 as contiguous X's.Digital-Image View of SurfacesLeft RightXXXX XXXXX ←1XXX XXXXXXXXXXXX XXXXXX XXXXXX. .. .. .XXXX XXXXXXX XXXXX ←N↑↑1 25In each row of the image, there can be zero or more space characters separating the left surface from the right surface. There will never be more than a single blank region in any row.For each image given, you are to determine the total ``void" that will exist after the left surface has been brought into contact with the right surface. The ``void" is the total count of the spaces that remains between the left and right surfaces after theyhave been brought into contact.The two surfaces are brought into contact by displacing them strictly horizontally towards each other until a rightmost "X" of the left surface of some row is immediately to the left of the leftmost "X" of the right surface of that row. There is no rotation or twisting of these two surfaces as they are brought into contact; they remain rigid, and only move horizontally.Note: The original image may show the two surfaces already in contact, in which case no displacement enters into the contact roughness estimation.InputThe input consists of a series of digital images. Each image data set has the following format:First line -A single unsigned integer, N, with value greater than zero (0) and less than 13. The first digit of N will be the first character on a line.Next N lines -Each line has exactly 25 characters; one or more X's, then zero or more spaces, then one or more X's.The end of data is signaled by a null data set having a zero on the first line of an image data set and no further data.OutputFor each image you receive as a data set, you are to reply with the total void (count of spaces remaining after the surfaces are brought into contact). Use the default output for a single integer on a line.Sample Input4XXXX XXXXXXXX XXXXXXXXXXXX XXXXXX XXXXXX2XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXXXXXXX XXSample OutputSourceEast Central North America 1995POJ 1517 u Calculate eu Calculate eTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 15876 Accepted: 9555 Special Judge DescriptionA simple mathematical formula for e ise=Σ0<=i<=n1/i!where n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.InputNo inputOutputOutput the approximations of e generated by the above formula for the values of n from 0 to 9. The beginning of your output should appear similar to that shown below. Sample Inputno inputSample Outputn e- -----------0 11 22 2.53 2.6666666674 2.708333333...POJ 1519 Digital RootsDigital RootsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 23459Accepted: 7790DescriptionThe 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 Input2439Sample Output63SourceGreater New York 2000POJ 1545 Galactic ImportGalactic ImportTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 276Accepted: 143DescriptionWith the introduction of the new ThrustoZoom gigadimensional drive, it has become possible for HyperCommodities, the import/export conglomerate from New Jersey, to begin trading with even the most remote galaxies in the universe. HyperCommodities wants to import goods from some of the galaxies in the Plural Z sector. Planets within these galaxies export valuable products and raw materials like vacuuseal, transparent aluminum, digraphite, and quantum steel. Preliminary reports have revealed the following facts:∙Each galaxy contains at least one and at most 26 planets. Each planet within a galaxy is identified by a unique letter from A to Z.∙Each planet specializes in the production and export of one good. Different planets within the same galaxy export different goods.∙Some pairs of planets are connected by hyperspace shipping lines. If planets A and B are connected, they can trade goods freely. If planet C is connected to B but not to A, then Aand C can still trade goods with each other through B, but B keeps 5% of the shipment asa shipping fee. (Thus A only receives 95% of what C shipped, and C receives only 95% ofwhat A shipped.) In general, any two planets can trade goods as long as they areconnected by some set of shipping lines, but each intermediate planet along the shippingroute keeps 5% of what it shipped (which is not necessarily equal to 5% of the originalshipment).∙At least one planet in each galaxy is willing to open a ThrustoZoom shipping line to Earth.A ThrustoZoom line is the same as any other shipping line within the galaxy, as far asbusiness is concerned. For example, if planet K opens a ThrustoZoom line to Earth, thenthe Earth can trade goods freely with K, or it can trade goods with any planet connectedto K, subject to the usual shipping fees.HyperCommodities has assigned a relative value (a positive real number less than 10) to each planet's chief export. The higher the number, the more valuable the product. More valuable products can be resold with a higher profit margin in domestic markets. The problem is to determine which planet has the most valuable export when shipping fees are taken into account.InputThe input consists of one or more galaxy descriptions. Each galaxy description begins with a line containing an integer N which specifies the number of planets in the galaxy. The next N lines contain descriptions of each planet, which consist of:1.The letter used to represent the planet.2. A space.3.The relative value of the planet's export, in the form d.dd.4. A space.5. A string containing letters and/or the character `*'; a letter indicates a shipping line to thatplanet, and a `*' indicates a willingness to open a ThrustoZoom shipping line to Earth. OutputFor each galaxy description, output a single line which reads "Import from P" where P is the letter of the planet with the most valuable export, once shipping fees have been taken into account. (If more than one planet have the same most valuable export value then output the plant which is alphabetically first).Sample Input1F 0.81 *5E 0.01 *AD 0.01 A*C 0.01 *AA 1.00 EDCBB 0.01 A*10S 2.23 Q*A 9.76 CK 5.88 MIE 7.54 GCM 5.01 OKG 7.43 IEI 6.09 KGC 8.42 EAO 4.55 QMQ 3.21 SOSample OutputImport from FImport from AImport from ASourceMid-Central USA 1995POJ 1547 Clay BullyClay BullyTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 7660Accepted: 4309DescriptionMs. Terry is a pre-school art teacher who likes to have her students work with clay. One of her assignments is to form a lump of clay into a block and then measure the dimensions of the block. However, in every class, there is always one child who insists on taking some clay from some other child. Since Ms. Terry always gives every child in a class the same amount of clay to begin with, you can write a program that helps Ms. Terry find the bully and victim after she measures each child's finished block.InputThere are one or more classes of students, followed by a final line containing only the value -1. Each class starts with a line containing an integer, n, which is the number of students in the class, followed by n lines of student information. Each line of student information consists of three positive integers, representing the dimensions of the clay block, followed by the student's first name. There can never be more than 9 students nor less than 2 students in any class. Each student's name is at most 8 characters. Ms. Terry always gives each student at most 250 cubic units of clay. There is exactly one bully and one victim in each class.OutputFor each class print a single line exactly as shown in the sample output.Sample Input310 10 2 Jill5 3 10 Will5 5 10 Bill42 4 10 Cam4 3 7 Sam8 11 1 Graham6 27 Pam-1Sample OutputBill took clay from Will.Graham took clay from Cam.SourceMid-Central USA 2003POJ 1552 DoublesDoublesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 16404Accepted: 9390DescriptionAs part of an arithmetic competency program, your students will be given randomly generated lists of from 2 to 15 unique positive integers and asked to determine how many items in each list are twice some other item in the same list. You will need a program to help you with the grading. This program should be able to scan the lists and output the correct answer for each one. For example, given the list1 4 32 9 7 18 22your program should answer 3, as 2 is twice 1, 4 is twice 2, and 18 is twice 9.InputThe input will consist of one or more lists of numbers. There will be one list of numbers per line. Each list will contain from 2 to 15 unique positive integers. No integer will be larger than 99. Each line will be terminated with the integer 0, which is not considered part of the list. A line with the single number -1 will mark the end of the file. The example input below shows 3 separate lists. Some lists may not contain any doubles.OutputThe output will consist of one line per input list, containing a count of the items that are double some other item.Sample Input1 4 32 9 7 18 22 02 4 8 10 07 5 11 13 1 3 0-1Sample Output32SourceMid-Central USA 2003POJ 1575 Easier Done Than Said?Easier Done Than Said?Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3711Accepted: 2068DescriptionPassword security is a tricky thing. Users prefer simple passwords that are easy to remember (like buddy), but such passwords are often insecure. Some sites use random computer-generated passwords (like xvtpzyo), but users have a hard time remembering them and sometimes leave them written on notes stuck to their computer. One potential solution is to generate "pronounceable" passwords that are relatively secure but still easy to remember.FnordCom is developing such a password generator. You work in the quality control department, and it's your job to test the generator and make sure that the passwords are acceptable. To be acceptable, a password must satisfy these three rules:It must contain at least one vowel.It cannot contain three consecutive vowels or three consecutive consonants.It cannot contain two consecutive occurrences of the same letter, except for 'ee' or 'oo'.(For the purposes of this problem, the vowels are 'a', 'e', 'i', 'o', and 'u'; all other letters are consonants.) Note that these rules are not perfect; there are many common/pronounceable words that are not acceptable.InputThe input consists of one or more potential passwords, one per line, followed by a line containing only the word 'end' that signals the end of the file. Each password is at least one and at most twenty letters long and consists only of lowercase letters.OutputFor each password, output whether or not it is acceptable, using the precise format shown in the example.Sample InputatvptouibontreszoggaxwiinqeephouctuhendSample Output<a> is acceptable.<tv> is not acceptable.<ptoui> is not acceptable.<bontres> is not acceptable.<zoggax> is not acceptable.<wiinq> is not acceptable.<eep> is acceptable.<houctuh> is acceptable.SourceMid-Central USA 2000POJ 1657 Distance on ChessboardDistance on ChessboardTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 21169Accepted: 7296 Description国际象棋的棋盘是黑白相间的8 * 8的方格,棋子放在格子中间。