开门与关门人HDOJ

题目链接

http://acm.hdu.edu.cn/game/entry/problem/show.php?chapterid=1&sectionid=3&problemid=7



#include <iostream>
using namespace std;
struct Info{
	char name[17];
	int totals;//开始时间,时分秒
	int totale;
};
struct Info staff[100];
int main()
{
	int days;
	int npeop;
	cin>>days;
	while(days--)
	{
		cin>>npeop;
		for (int i = 0; i < npeop; ++i)
		{
			char strs[10],stre[10];
			int   hh,mm,ss;
			cin>>staff[i].name>>strs>>stre;
			sscanf(strs,"%d:%d:%d",&hh,&mm,&ss);
			staff[i].totals = hh*3600+mm*60+ss;
			sscanf(stre,"%d:%d:%d",&hh,&mm,&ss);
			staff[i].totale =  hh*3600+mm*60+ss;
		}
		int stand = staff[0].totals;
		int ans=0;
		for(int i=1;i<npeop;++i)
		{
			if (staff[i].totals <staff[ans].totals)
				ans = i;
		}
		cout<<staff[ans].name<<" ";
		 stand = staff[0].totale;
		 ans=0;
		for(int i=1;i<npeop;++i)
		{
			if (staff[i].totale >staff[ans].totale)
				ans = i;
		}
		cout<<staff[ans].name<<endl;
	}
	return 0;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器学习模型机器
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值