摘要: 杭电acm 2053 Switch Game2010-07-20 11:39Switch GameTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3425 Accepted Submission(s): 2007Problem DescriptionThere are many lamps in a line. All of them are off at first. A series of operations are carried o 阅读全文
posted @ 2011-11-28 22:24 狸の舞 阅读(357) 评论(0) 推荐(0) 编辑
摘要: Problem DescriptionGive you the width and height of the rectangle,darw it.InputInput contains a number of test cases.For each case ,there are two numbers n and m (0 < n,m < 75)indicate the width and height of the rectangle.Iuput ends of EOF.OutputFor each case,you should draw a rectangle with 阅读全文
posted @ 2011-11-28 21:31 狸の舞 阅读(222) 评论(0) 推荐(0) 编辑
摘要: while(n!=0) { num[i++]=n%2; n /= 2; //类似模拟除法的过程 } for(j=i-1;j>=0;j--) printf("%d",num[j]);BitsetTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6113Accepted Submission(s): 4738Problem DescriptionGive you a number on base ten,you should 阅读全文
posted @ 2011-11-28 15:39 狸の舞 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 第n条折线的两条边都与前n-1条折线的所有边都不平行,因为他们都是相交的;第n条折线的第一条边要与前n-1条折线的2*(n-1)条边都相交,每与 两个 边相交就增加一个分割开的部分,所以有2*(n-1)-1个被分割的部分在这里被增加,另外一条第n条折线的边也增加2*(n-1)-1个部分,另外最后 第n第折线的两边还要向外无限延伸,与它们相交的最后一个前n-1个折线中的边与其分别构成了一个多余的部分,而第n条折线的头部也是一个独立的部分,所 以2*(n-1)-1再+3,就是比n-1条折线分割成的部分多出的部分数,所以有:a[n]=(2*(n-1)-1)*2+3+a[n-1];画一下图,让每条边都 阅读全文
posted @ 2011-11-28 15:00 狸の舞 阅读(1565) 评论(0) 推荐(0) 编辑