摘要: Input输入数据中含有一些符合C语言语法的代码行。Output输出不含有双斜杠注释的C语言代码,除了注释代码之外,原语句行格式不变,行尾也不应有空格。如果整一行只有注释,那么你应该忽略这一行。Sample Input//====================== // simplest program //====================== #include<stdio.h> #include<math.h> //---------------------- int main(){ printf("My World!\n"); retu 阅读全文
posted @ 2013-02-07 14:09 雷克雅未克 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Description你有n个部下,每个部下需要完成一项任务。第i个部下需要你花Bi分钟交待任务,然后他会立刻独立地、无间断地执行Ji分钟后完成任务。你需要选择交代任务的顺序,使得所有任务尽早执行完毕(即最后一个执行完成的任务应尽早结束)。注意,不能同时给两个部下交待任务,但部下们可以同时执行他们各自的任务。Input输入包含多组数据,每组数据的第一行为部下的个数N(1<=N<=1000);以下N行每行两个正整数B和J(1<=B<=10 000,1<=J<=10 000),即交待任务的时间和执行任务的时间。输入结束的标志为N=0。Output对于每组数据,先 阅读全文
posted @ 2013-02-07 14:03 雷克雅未克 阅读(260) 评论(0) 推荐(0) 编辑
摘要: DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property of an algorithm whose classification is not known for all possible inputs.Consider the following algorithm: 1.. 阅读全文
posted @ 2013-01-18 14:26 雷克雅未克 阅读(124) 评论(0) 推荐(0) 编辑
摘要: DescriptionLittle Johnny likes to draw a lot. A few days ago he painted lots of straight lines on his sheet of paper. Then he counted in how many zones the sheet of paper was split by these lines. He noticed that this number is not always the same. For instance, if he draws 2 lines, the sheet of pap 阅读全文
posted @ 2013-01-17 20:04 雷克雅未克 阅读(255) 评论(0) 推荐(0) 编辑