
杭电
文章平均质量分 69
zyang008
这个作者很懒,什么都没留下…
展开
-
UVa:10167-birthday cake
#includeint x[500],y[500];int main(){ int n,a,b; scanf("%d",&n); int i; for(i=0;i scanf("%d%d",&x[i],&y[i]); for(a=-500;a for(b=0;b { int count=0; for(i=0;i if(x[i]*a+y[i]*b>0) count++; if(count==n) { printf("%d %d/n",a,b); return 0原创 2011-02-04 14:27:00 · 423 阅读 · 0 评论 -
HDU:1164
Problem DescriptionEddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to help hi原创 2011-03-30 14:21:00 · 800 阅读 · 0 评论 -
HDU1222:Wolf and Rabbit
Problem DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is the one signed with 0. Then he will get into原创 2011-03-30 14:59:00 · 1936 阅读 · 0 评论 -
1023:Train Problem II
Problem DescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing order, how many orders that all the trains can get out of the railway. InputThe input contains several te原创 2011-02-23 19:52:00 · 455 阅读 · 0 评论 -
1022:Train Problem I
Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over the world ^v^). But here comes a probl原创 2011-02-18 15:01:00 · 297 阅读 · 0 评论 -
1201:Fibonacci Again
Problem DescriptionThere are another kind of Fibonacci numbers: F(0) = 7, F(1) = 11, F(n) = F(n-1) + F(n-2) (n>=2). InputInput consists of a sequence of lines, each containing an integer n. (n OutputPrint the word "yes" if 3 divide evenly into F(n).Print原创 2011-02-17 19:53:00 · 391 阅读 · 0 评论 -
1013:Digital Roots
Problem DescriptionThe 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 summ原创 2011-02-12 13:26:00 · 372 阅读 · 0 评论 -
1016:Prime Ring Problem
Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime.Note: the number of first circle should always be 1. Inputn原创 2011-02-13 21:31:00 · 333 阅读 · 0 评论 -
1009:FatMouse' Trade
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contains J[i] pounds of JavaBeans and requires F[i] pounds of cat原创 2011-02-11 12:59:00 · 470 阅读 · 0 评论 -
1007:Quoit Design
Problem DescriptionHave you ever played quoit in a playground? Quoit is a game in which flat rings are pitched at some toys, with all the toys encircled awarded.In the field of Cyberground, the position of each toy is fixed, and the ring is carefully desig原创 2011-02-08 15:58:00 · 655 阅读 · 0 评论 -
HDU1286:找新朋友
Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。 Input第一行是测试数据的组数CN(Case number,1Output对于每一个N,输出一行新朋友的人数,这样共有CN行输出。 Sample Input22560824027 Sample Output7680原创 2011-03-30 16:42:00 · 3525 阅读 · 3 评论