A Famous Stone CollectorProblem DescriptionMr. B loves to play with colorful stones. There are n colors of stones in his collection. Two stones with the same color are indistinguishable. Mr. B would like toselect some stones and arrange them in line to form a beautiful pattern. After several arrange Read More
posted @ 2012-07-24 17:37 jiai Views(230) Comments(0) Diggs(0) Edit
A Famous CityProblem DescriptionAfter Mr. B arrived in Warsaw, he was shocked by the skyscrapers and took several photos. But now when he looks at these photos, he finds in surprise that he isn't able to point out even the number of buildings in it. So he decides to work it out as follows:- divi Read More
posted @ 2012-07-24 17:33 jiai Views(162) Comments(0) Diggs(0) Edit
周正虎的难题Problem Description自从周正虎被告知山上并没有老虎后就成为了当地一名伐木工人。这一次他需要砍下M米的木材,当然,自从有了新的伐木工具之后,这对他来说简直就是一件轻而易举的事情。周正虎的伐木工具的使用说明书上这样写道:机器需要设定一个高度参数H(米),然后机器就会升高到H(米),砍下所有高于H(米)的树。对于高度没有达到H(米)的树,我们认为它是幸运的,在这次砍伐中它将免受威胁。例如:现有树的高度为 20, 15, 10, 17 将机器设置为15,那么我们将砍伐到第一和第四棵树,得到的木材长度为(20-15) + (17-15) = 7。周正虎是一个爱好环境的人,所 Read More
posted @ 2012-07-24 17:13 jiai Views(224) Comments(0) Diggs(0) Edit
BetProblem DescriptionMirko doesn’t like Latin homeworks so he made a bet with Slavko. Loser will be writing homeworks for both of them the entire month. Mirko wants to win so he designed this problem they could have something to bet on.At his desk he found a cube, with numbers 1 to 6 on its faces. Read More
posted @ 2012-07-24 17:03 jiai Views(231) Comments(0) Diggs(0) Edit
DNA-AND-DNAProblem Description生物学家们发现了一个奇怪的DNA分子,可以将它们看作一个由集合{A,B} 中的元素组成的N个字符的序列。由于一系列的突变使得DNA链只包含A。生物学家发现这很奇怪,所以他们开始研究更详细的基因突变。他们发现了两种类型的基因突变。一种类型是改变单个字符的序列(A→B或B→A)。第二类改变了整个序列的前缀,从1到K(1和N之间)。计算数量尽可能少的突变,可以是起始分子转化到它的最终状态(只包含A字符)。突变可以在任何顺序发生。Input输入有多组数据。输入的第一行包含一个正整数N(1≤N≤1000 000),表示分子的长度。输入第二行包含 Read More
posted @ 2012-07-24 16:56 jiai Views(194) Comments(0) Diggs(0) Edit
The window of the dazzlingProblem DescriptionNow that spring is here and the sun is shining bright, people are starting to lower their blinds. Stefica is an elderly woman who likes to keep track of what other people in the neighbourhood are doing and then talk about it behind their backs. This year, Read More
posted @ 2012-07-24 16:45 jiai Views(158) Comments(0) Diggs(0) Edit
Sum of numberProblem DescriptionInputThe input consists of multiple test cases.The first line of input contains an integer N (3 ≤ N ≤ 100), the number of cards, and M (10 ≤ M ≤ 300 000), the number that we must not exceed.The following line contains numbers written on Mirko‘s cards: N distinct space Read More
posted @ 2012-07-24 16:33 jiai Views(160) Comments(0) Diggs(0) Edit
数字游戏续Problem Description自从小艾上次在和小牛的游戏中取得了信心之后,这次他又想到了一个问题,他要去计算两个数A和B的最大公约数。由于这两个数非常的大,于是小牛把数字A拆成了N个数,这N个数相乘的结果是A,把B拆成了M个数,同样这M个数的乘积等于B,小艾迫不及待地想去计算出这两个数的最大公约数,这次你能帮帮他吗?如果结果超过了9位数,输出最后的9位数。Input输入有多组数据。第一行包含一个正整数N ( 1 <= N <= 1000 )。第二行包含N个以空格隔开的小于 1 000 000 000的正整数,它们的乘积是A。第三行包含一个正整数M ( 1 < Read More
posted @ 2012-07-24 16:15 jiai Views(308) Comments(0) Diggs(0) Edit