04 2013 档案
摘要:Problem Description每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 到、签离记录,请根据记录找出当天开门和关门的人。Input测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为证件号码 签到时间 签离时间其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。Output对每一天的记录输出1行,即当天开门和关门人的证件号码,中间用1空格分隔。 注意:在裁判的标准测试输入中,所有记录保证完整,每个人的签到
阅读全文
摘要:数据结构初解之单链表分析篇一、头文件例:#include<stdio.h>#include<stdlib.h>分析:1、stdio.h可以说是最基本的头文件,scanf和printf函数都在里面。2、stdlib.h中包含malloc()函数。二、宏定义例:#defineQUIT-1分析:1、QUIT是自定义的在链表中输入数据的结束符号。2、宏定义和类型定义符的功能很相似。但是宏定义是由预处理完成的,所以它带有预处理指令符#,而类型定义符typedef就没有。但是typedef语句后面要有“;”。3、关于#define更详细的知识可以查找其他资料。三、使用类型定义符ty
阅读全文
摘要:Problem 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 algor
阅读全文
摘要:Digital RootsProblem 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 summed and the process is repeated.
阅读全文
摘要:Problem DescriptionA simple mathematical formula for e iswhere n is allowed to go to infinity. This can actually yield very accurate approximations of e using relatively small values of n.OutputOutput the approximations of e generated by the above formula for the values of n from 0 to 9. The begi...
阅读全文
摘要:Problem DescriptionThe highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move down one floor. The
阅读全文