摘要: Building BlockTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1982Accepted Submission(s): 598Problem DescriptionJohn are playing with blocks. There are N blocks (1 2 #include 3 #include 4 #define maxlen 30010 5 using namespace std; 6 int father[ma. 阅读全文
posted @ 2013-07-12 19:33 默默如潮 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题目大意:一开始有一条语句printf("Hello World!\n");你可以选择复制粘贴,问要输出n行Hello World!最少要复制几次?分析:大水题,每次复制粘贴当前所有的语句则可以使次数最少,所以答案就是ceil(l(logn)/(log2))。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int main() 7 { 8 int n,Case=1; 9 while(scanf("%d",&n)==1)10 {11 if(n 2 #incl 阅读全文
posted @ 2013-07-12 19:16 默默如潮 阅读(314) 评论(0) 推荐(0) 编辑