01 2013 档案

摘要:DescriptionTrung is bored with his mathematics homeworks. He takes a piece of chalk and starts writing a sequence of consecutive integers starting with 1 to N (1 < N < 10000) . After that, he counts the number of times each digit (0 to 9) appears in the sequence. For example, with N = 13 , the 阅读全文
posted @ 2013-01-30 15:02 Joyee 阅读(578) 评论(1) 推荐(0)
摘要:Description You: What's the score? Did I miss much? Me: It's 2-1 for elAhli and the second half just started. The first half was quite boring. You: Who scored first? elAhli or ezZamalek? Me: What difference does it make? You: Big difference! I can predict the outcome of the match if I knew t 阅读全文
posted @ 2013-01-30 14:51 Joyee 阅读(518) 评论(0) 推荐(0)
摘要:DescriptionAn abundant number is a positive integer n for which Sigma(n) – 2n > 0, Where Sigma(n) is defined as the sum of all the divisors of n. And the quantity Sigma(n) – 2n is called abundance.Given the range of n, you should find out the maximum abundance value that can be reached. For examp 阅读全文
posted @ 2013-01-30 03:32 Joyee 阅读(371) 评论(0) 推荐(0)
摘要:DescriptionIn sixth grade, students are presented with different ways to calculate the Least Common Multiple (LCM) and the Greatest Common Factor (GCF) of two integers. The LCM of two integers a and b is the smallest positive integer that is a multiple of both a and b . The GCF of two non-zero integ 阅读全文
posted @ 2013-01-30 03:19 Joyee 阅读(336) 评论(0) 推荐(0)
摘要:DescriptionWell, how do you feel about mobile phone? Your answer would probably be something like that “It’s so convenient and benefits people a lot”.... 阅读全文
posted @ 2013-01-26 03:22 Joyee 阅读(954) 评论(1) 推荐(0)
摘要:DescriptionLong long ago, there was a super computer that could deal with VeryLongIntegers(no VeryLongInteger will be negative). Do you know how this computer stores the VeryLongIntegers? This computer has a set of n positive integers: b1,b2,...,bn, which is called a basis for the computer.The basis 阅读全文
posted @ 2013-01-25 19:54 Joyee 阅读(592) 评论(1) 推荐(0)
摘要:Description The columnar encryption scheme scrambles the letters in a message (or plaintext) using a keyword as illustrated in the following example: Suppose BATBOY is the keyword and our message is MEET ME BY THE OLD OAK TREE. Since the keyword has 6 letters, we write the message (ignoring spacing 阅读全文
posted @ 2013-01-22 12:31 Joyee 阅读(709) 评论(0) 推荐(0)
摘要:DescriptionThe rabbits have powerful reproduction ability. One pair of adult rabbits can give birth to one pair of kid rabbits every month. And after ... 阅读全文
posted @ 2013-01-22 10:33 Joyee 阅读(847) 评论(0) 推荐(0)
摘要:Description歌手The Pancakes到幼儿园跟小朋友玩耍,她到达的时候小朋友们已经争着积木玩了。小朋友都想要更多的积木砌一个自己喜欢的图形,砌完就可以和The Pancakes合照。同时,The Pancakes手上还有一些积木,她可以把手上的这些积木全部给一个小朋友,然后等该小朋友砌完后就可以收回所发的积木和该小朋友原先手上的积木。但她不知道能否让所有的小朋友都和她合照,聪明的你可以帮助她吗?Input输入包含多个数据。每个数据的第一行是两个正整数n和s,1≤n≤10000,1≤s≤1000000,表示一共有n位小朋友,The Pancakes手上有s块积木。以下有n行,每行有 阅读全文
posted @ 2013-01-19 16:02 Joyee 阅读(531) 评论(0) 推荐(0)
摘要:Description有三根杆子A,B,C。A杆上有n个(n>1)穿孔圆盘,盘的尺寸由下到上依次变小。要求按下列规则将所有圆盘移至C杆:1.每次只能移动一个圆盘;2.大盘不能叠在小盘上面。可将圆盘临时置于B杆,也可将从A杆移出的圆盘重新移回A杆,其间也可借助C杆,但都必须遵循上述两条规则。传说印度某间寺院也有这样三根柱子,上串64个金盘。寺院里的僧侣依照一个古老的预言,以上述规则移动这些盘子;预言说当这些盘子移动完毕,世界就会灭亡。这个传说叫做梵天寺之塔问题(Tower of Brahma puzzle)。可以证明,当盘子的个数为n时,移动的次数最少为2^n – 1,现给出n,并对盘子从 阅读全文
posted @ 2013-01-19 15:48 Joyee 阅读(261) 评论(0) 推荐(0)
摘要:Description图行变换是计算机图行 学中经常遇到的问题,在计算机中,一个图像通过一些点和它们之间的关系来表示。在这里为了简化问题,我们仅考虑二维图像中的三角形,且只考虑两种变换—— 旋转变换和平移变换。给出一个三角形三个点的坐标和它绕原点逆时针旋转的角度,以及沿x和y方向上平移的距离,求最后三角形各点的坐标。Input输入包括多组测试用例,第一行为一个数T,表示测试用例的个数。对于每组测试用例包括四行,第一行为三个整数r, h, k,分别表示三角形绕原点逆时针旋转的角度,沿x轴移动的距离,沿y轴移动的距离。接下来三行,每行两个数,分别表示三角形的三个点A、B、C的x, y坐标(保证输入 阅读全文
posted @ 2013-01-19 15:43 Joyee 阅读(301) 评论(0) 推荐(0)
摘要:Description编写一个程序,把一个非负的十进制数转换为任意base(2<=base<=16)进制的数。Input输入包括多组测试用例,通过EOF结束。每组测试用例包含两个数,以空格隔开,第一个为需要转换的十进制数,第二个为转换的进制。Output每组测试用例输出一行,为转换后的数的表示,如果转换后的数的某个数位上的数大于等于10,则分别用A, B, C……来表示。考完机试做了下法师班上的题,发现比我们的作业实用+科学很多啊,囧……一直想写一个这个不过各种拖,期末考也有一题类似的,不过不超过10进制。用了白书上的方法,使用字符串常量来简化输出。 1 #include<s 阅读全文
posted @ 2013-01-19 14:35 Joyee 阅读(228) 评论(0) 推荐(0)