杭电 1234 和 杭电 2115

『杭电1234』开门人和关门人 Problem Description 每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 到、签离记录,请根据记录找出当天开门和关门的人。 Input 测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为 证件号码 签到时间 签离时间 其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。 Output 对每一天的记 阅读详情
由于这两个题很相似 就放在一块看吧 难点在对时间的类型不好定义 可以用char 也可以用string 我是用char定义的  

1234题
Problem Description
每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 
到、签离记录,请根据记录找出当天开门和关门的人。 
 

Input
测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 
每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为 

证件号码 签到时间 签离时间 

其中时间按“小时:分钟:秒钟”(各占2位)给出,证件号码是长度不超过15的字符串。
 

Output
对每一天的记录输出1行,即当天开门和关门人的证件号码,中间用1空格分隔。 
注意:在裁判的标准测试输入中,所有记录保证完整,每个人的签到时间在签离时间之前, 
且没有多人同时签到或者签离的情况。 
 

Sample Input
3 1 ME3021112225321 00:00:00 23:59:59 2 EE301218 08:05:35 20:56:35 MA301134 12:35:45 21:40:42 3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40
 

Sample Output
ME3021112225321 ME3021112225321 EE301218 MA301134 SC3021234 CS30113
代码如下:
#include<stdio.h>   #include<string.h>   #include<math.h>   #include<algorithm>   using namespace std;       struct person{           char name[1000];           char start[8];           char end [8];       };       int cmp1(person a,person b)       {           return (strcmp(a.start,b.start)<=0);       }           int cmp2(person a,person b)       {           return (strcmp(a.end,b.end)>=0);       }   int main()   {   person a[100];       int t,b,c;       scanf("%d",&t);       while(t--)       {           int n,i;           scanf("%d",&n);           for(i=0;i<n;i++)           {               scanf("%s %s %s",&a[i].name,&a[i].start,&a[i].end);           }           sort(a,a+n,cmp1);           b=a[0];           sort(a,a+n,cmp2);           c=a[0];   printf("%s %s\n",b.name,c.name);       }   }  
2115题
Problem Description
Do you like playing basketball ? If you are , you may know the NBA Skills Challenge . It is the content of the basketball skills . It include several parts , such as passing , shooting , and so on. After completion of the content , the player who takes the shortest time will be the winner . Now give you their names and the time of finishing the competition , your task is to give out the rank of them ; please output their name and the rank, if they have the same time , the rank of them will be the same ,but you should output their names in lexicographic order.You may assume the names of the players are unique. Is it a very simple problem for you? Please accept it in ten minutes.
 

Input
This problem contains multiple test cases! Ease test case contain a n(1<=n<=10) shows the number of players,then n lines will be given. Each line will contain the name of player and the time(mm:ss) of their finish.The end of the input will be indicated by an integer value of zero.
 

Output
The output format is shown as sample below. Please output the rank of all players, the output format is shown as sample below; Output a blank line between two cases.
 

Sample Input
10 Iverson 17:19 Bryant 07:03 Nash 09:33 Wade 07:03 Davies 11:13 Carter 14:28 Jordan 29:34 James 20:48 Parker 24:49 Kidd 26:46 0
 

Sample Output
Case #1 Bryant 1 Wade 1 Nash 3 Davies 4 Carter 5 Iverson 6 James 7 Parker 8 Kidd 9 Jordan 10


代码如下:
Problem Description
Do you like playing basketball ? If you are , you may know the NBA Skills Challenge . It is the content of the basketball skills . It include several parts , such as passing , shooting , and so on. After completion of the content , the player who takes the shortest time will be the winner . Now give you their names and the time of finishing the competition , your task is to give out the rank of them ; please output their name and the rank, if they have the same time , the rank of them will be the same ,but you should output their names in lexicographic order.You may assume the names of the players are unique.

Is it a very simple problem for you? Please accept it in ten minutes.
 

Input
This problem contains multiple test cases! Ease test case contain a n(1<=n<=10) shows the number of players,then n lines will be given. Each line will contain the name of player and the time(mm:ss) of their finish.The end of the input will be indicated by an integer value of zero.
 

Output
The output format is shown as sample below.
Please output the rank of all players, the output format is shown as sample below;
Output a blank line between two cases.
 

Sample Input
10 Iverson 17:19 Bryant 07:03 Nash 09:33 Wade 07:03 Davies 11:13 Carter 14:28 Jordan 29:34 James 20:48 Parker 24:49 Kidd 26:46 0
 

Sample Output
Case #1 Bryant 1 Wade 1 Nash 3 Davies 4 Carter 5 Iverson 6 James 7 Parker 8 Kidd 9 Jordan 10

#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
struct person
{
char name[1000];
char time[1000];
}
;
person a[6666];
bool cmp(person a,person b)
{
if(a.time!=b.time)
return strcmp(a.time,b.time)<0;
else
return strcmp(a.name,b.name)<0;
}
int main()
{
int n,i,j;
int c=0;
int t=1;
while(scanf("%d",&n)&&n)
{
if(t>1)
printf("\n");
for(i=1;i<=n;i++)
scanf("%s%s",a[i].name,a[i].time);
sort(a+1,a+n+1,cmp);
printf("Case #%d\n",++c);
for(i=1;i<=n;i++)
{
printf("%s %d\n",a[i].name,i);
if(strcmp(a[i].time,a[i+1].time)==0)
{
printf("%s %d\n",a[i+1].name,i);
i++;
}
}
t++;
}
return 0;
}
 
Problem Description
Do you like playing basketball ? If you are , you may know the NBA Skills Challenge . It is the content of the basketball skills . It include several parts , such as passing , shooting , and so on. After completion of the content , the player who takes the shortest time will be the winner . Now give you their names and the time of finishing the competition , your task is to give out the rank of them ; please output their name and the rank, if they have the same time , the rank of them will be the same ,but you should output their names in lexicographic order.You may assume the names of the players are unique.

Is it a very simple problem for you? Please accept it in ten minutes.
 

Input
This problem contains multiple test cases! Ease test case contain a n(1<=n<=10) shows the number of players,then n lines will be given. Each line will contain the name of player and the time(mm:ss) of their finish.The end of the input will be indicated by an integer value of zero.
 

Output
The output format is shown as sample below.
Please output the rank of all players, the output format is shown as sample below;
Output a blank line between two cases.
 

Sample Input
10 Iverson 17:19 Bryant 07:03 Nash 09:33 Wade 07:03 Davies 11:13 Carter 14:28 Jordan 29:34 James 20:48 Parker 24:49 Kidd 26:46 0
 

Sample Output
Case #1 Bryant 1 Wade 1 Nash 3 Davies 4 Carter 5 Iverson 6 James 7 Parker 8 Kidd 9 Jordan 10
【软碟通 | UltraISO】刻录光盘教程(制作U盘启动盘) 前言 今天老师说办公室的电脑有点卡,让我给重新安装一个 Windows 7 系统。于是就用软碟通(UltraISO)在 U 盘上刻录了一个 Windows 7 镜像,然后给老师重装了系统。顺便把制作 U 盘启动盘的教程也分享给大家。 软件 UltraISO v9.7.1.3519:点击跳转(密码:dd2k) 教程 将 U 盘插到电脑上,然后鼠标右击选择格式化(制作启动盘必须格式化) 点击文件-打开 选择下载好的系统镜像(如:Windows 7) 点击启动-写入硬盘映像 选择硬盘 阅读详情

相关推荐

从ST转国产ARM必看:GD32/APM32等5款芯片的SWD下载全攻略(含CH32特殊处理)

本文为从STM32转向国产ARM芯片的开发者提供了详细的SWD下载调试指南。针对GD32F103C8T6、APM32F103C8T6等五款热门国产芯片,详细说明了如何利用已有的ST-Link工具和Keil MDK环境进行程序烧录,并特别介绍了CH32F103芯片所需的独立器件库安装等特殊处理方法,帮助开发者实现平滑迁移,提升开发效率。

weixin_29195615的博客 278

杭电ACM基础题(2114、2115、2123、2131、2132、2133、2135、2136、2137、2138)

文章目录2114、Calculate S(n)2115、I Love This Game[利用结构排序]2123、An easy problem[输出n*n矩阵]2131、Probability2132、An easy problem[递归给出]2133、What day is it[计算给定日期是星期几]2135、Rolling table[对矩阵进行旋转]2136、Largest prime ...

柠檬超级酸 1492

Bioconductor核心包(GO.db等)安装失败排查指南:从版本冲突到网络优化

本文详细解析了Bioconductor核心包(如GO.db)安装失败的常见原因及解决方案,包括版本冲突、网络问题和依赖关系。通过版本检查、镜像配置和依赖管理等方法,帮助用户高效解决安装难题,提升R语言生物信息学分析的工作效率。

weixin_29066781的博客 427

杭电2115题解题报告

题目链接如下: http://acm.hdu.edu.cn/showproblem.php?pid=2115 #include #include int main() { long int a[10]; int i,j,k,n,b[10][2],t,s2[10],h; char s[10][50],s1[50]; k=0; h=1; while(1) {

傻笨 646

【Claude Code】Extra inputs are not permitted 报错:代理网关剥离 Beta 标头的修复

通过代理或 LLM 网关连接 Anthropic API 时,Claude Code 报 "Extra inputs are not permitted"?根因是中间件删除了 anthropic-beta 请求标头,导致 Beta 字段被 API 拒绝。本文详解标头转发配置和 CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS 回退方案。

多媒体编程、网络编程、系统编程、网络安全编程、驱动编程 125

innovus中如何设置cts参数

上面是设置cts的一般设置,如果需要对某些skew group或者某些clock tree设置不一样的参数,如需要对clk1这个clock设置不一样的inverter,可以使用。需要查询已经设置过的ccopt参数,可以使用get_ccopt_property去查询,方法和set_ccopt_property一致。言归正传,cts的设置命令是set_ccopt_property,获取命令是get_ccopt_property。另外,set_ccopt_property提供一套命令查询方法。

芯冰乐 544

HDUOJ1234开门人和关门人

开门人和关门人 Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7168Accepted Submission(s): 3667 Problem Description 每天第一个到机房的人要把门打开,最后一个离开的...

dianpuding9411的博客 673

torch.nn.rnn实现循环神经网络

------------------------------------nn.rnn模型实现。#------------------------------------模型实现。#-----------------------------------训练模型。#-----------------------------------训练模型。#--------------------------------读取数据。实现循环神经网络,并在至少一个数据集上进行实验,从训练时间、预测精度、...

matlab_python22的博客 2971

HDU 2115

略水

大咸鱼。。。 848

微信小程序 - 详细实现打开跳转第三方 H5 网页链接,在微信小程序内直接跳转打开第三方网站链接详细教程(支持跳转公众号文章等,直接复制代码即可)

小程序跳转h5,小程序-Taro小程序中打开h5页面链接,...小程序跳转h5链接(web-view)_微信小程序,小程序如何跳转h5页面,小程序跳转到第三方H5网页,微信小程序跳转第三方H5的方法,小程序-实现怎么跳转打开H5网页链接(或跳转至公众号文章,打开第三方网站,放校验文件,怎么配置业务域名,校验文件验证域名,把校验文件放到对面网站,别人的服务器也打不开没权限怎么放呢,勾选不校验合法域名,txt,打不开别人的网页怎么办,真机调试打不开,无法跳转,有什么其他办法不放校验文件吗,后台配置,怎么

🏆 前端领域优质创作者 3万+

用C#+Avalonia写跨平台串口工具:Windows/macOS/Linux通吃,还能解析Modbus+画实时曲线

不管是串口还是蓝牙,核心操作都是“打开连接、发数据、收数据、关连接”,先定义一个// 通信设备接口:统一串口/蓝牙的操作// 连接状态变化事件(UI层订阅)// 接收数据事件(收到数据后触发)// 通信配置(不同设备配置不同,用泛型)// 通信设备接口:统一串口/蓝牙的操作 public interface ICommDevice : IDisposable {// 连接状态变化事件(UI层订阅) event Action < bool > OnConnectionChanged;

这里只有干货:从 Modbus 通信到 MES 对接,从 YOLO 训练到工控机部署,带你搞定工业软件开发全流程。 998

HDUOJ2115I Love This Game

I Love This Game Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3600Accepted Submission(s): 1234 Problem Description Do you like pl...

dianpuding9411的博客 141

第 10 篇:深度学习的“军火库”——CNN、RNN与Transformer,AI如何看懂世界?

深度学习的革命,不是依赖单一的通用大脑,而是为不同任务打造了专属“军火库”:CNN用“局部感知”看懂图像,RNN用“循环记忆”理解序列,而Transformer则用“全局注意力”开启了AIGC时代。理解这些架构,不是记忆孤立的技术,而是洞察AI从“专才”走向“通才”的进化脉络。

maqh_csdn的博客 786

杭电OJ-2115(C)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=2115 #include <stdio.h> #include <string.h> typedef struct{ char name[30]; char time[30]; int mm,ss; }aa; aa player[13],a; void deal(int pos...

qq_40467670的博客 240

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

HDU杭电ACM1234 //成长日记

#include&lt;stdio.h&gt; #include&lt;string.h&gt; struct p { char a[20],b[8],c[8]; }p[100]; int main() { int t,i,j,n,k,g; scanf("%d",&amp;t); while(t--) { k=g=0; scanf("%d",&amp;n); for(i=0...

qq_44364131的博客 243

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

杭电 1234 开门人与关门人

开门人和关门人 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12296    Accepted Submission(s): 6222 Problem Description 每天第一个到机房的人要把门打开,最后一

巧克力华夫脆 492

poj2115

C Looooops Description A Compiler Mystery: We are given a C-language style for loop of type  for (variable = A; variable != B; variable += C) statement; I.e., a loop which starts by s

◆◇丶生如夏花。谁来订阅我的悲伤 574

ACM HDU 1234 开门人和关门人(简单水题)

开门人和关门人 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5372    Accepted Submission(s): 2773 Problem Description 每天第一个到机房的人要把门打开,最后一个离开的人要把门关...

weixin_34122548的博客 507

杭电Oj2015-2018(Java版)

OJ2015 import java.util.Scanner;   public class Main2015{     public static void main(String[] args) {         Scanner in = new Scanner(System.in);         while(in.hasNext()) {          double

眼里一片海 1114

开门人和关门人(杭电1234)

开门人和关门人 Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 1   Accepted Submission(s) : 1 Font: Times New Roman | Verdana | Georgia ...

weixin_33885676的博客 179

杭电 1234 开门人和关门人

由于很多情况下时间输入不一定会是按照正常的24小时方式输入,有时会输入25:100:30这种非常规时间,所以考虑这种情况的时候最好是把时间最终转换成秒,然后再排序。 杭电上这题   开门人和关门人:http://acm.hdu.edu.cn/showproblem.php?pid=1234  应该要考虑这种问题,我一开始写的代码是直接按小时、分钟和秒进行排序。 上次的腾讯马拉松的  小

蚕豆儿 1161

hdu 2115

I Love This Game Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4026    Accepted Submission(s): 1397 Problem Description Do you like p

ysc504的专栏 904

杭电ACM 2015

#include &lt;iostream&gt;using namespace std;void Average(double aq[],int n, int m){    int x1, x2, x3, j, k;    double average = 0;    int sum1 = 0;    x1 = n/m;    x3 = m*x1;    x2 = n - x3;    for(...

mPeter126的博客 380

杭电 ACM 1234 开门人和关门人

开门人和关门人 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14870    Accepted Submission(s): 7609 Problem Description 每天第一个到机房的人要把门打开,最

summerFanL的博客 844

【杭电】[1234]开门人和关门人

也是挺重要的一题 第一次用到的结构体 在一些地方纠结了好久而且第一次没接触到sort 所以写的比较长

BoilTask Talk Show 864

【杭电oj】1234 - 开门人和关门人

开门人和关门人原题链接:点击查看每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 到、签离记录,请根据记录找出当天开门和关门的人。 Input 测试输入的第一行给出记录的总天数N ( &gt; 0 )。下面列出了N天的记录。 每天的记录在第一行给出记录的条目数M ( &gt; 0 ),下面是M行,每行的格式为 证件号码 签到时间 签离时间 其中时间按“小时:分钟:秒...

Dicer_的博客 724
上一篇: 杭电2037
下一篇: 理工 动物统计
DOLEAM
博客等级 码龄11年 9粉丝 28原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值