当前位置: 首页 > news >正文

郑州网站建设douyanet厦门谷歌seo公司有哪些

郑州网站建设douyanet,厦门谷歌seo公司有哪些,想在淘宝上找网站建设的靠谱吗?,域名过户流程CF1714A Everyone Loves to Sleep 题解题目链接字面描述题面翻译题目描述输入格式输出格式样例解释题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1代码实现题目 链接 https://www.luogu.com.cn/problem/CF1714A 字面描述 题面翻译 题目描述 Vlad和其他人一样&am…

CF1714A Everyone Loves to Sleep 题解

  • 题目
    • 链接
    • 字面描述
      • 题面翻译
        • 题目描述
        • 输入格式
        • 输出格式
        • 样例解释
      • 题目描述
      • 输入格式
      • 输出格式
      • 样例 #1
        • 样例输入 #1
        • 样例输出 #1
  • 代码实现

题目

链接

https://www.luogu.com.cn/problem/CF1714A

字面描述

题面翻译

题目描述

Vlad和其他人一样,非常喜欢睡觉。

Vlad每天都要做 nnn 件事,每件事在特定时间。对于这些事情中的每一件,他都定了一个闹钟,其中第 iii 个在 hih_ihimim_imi 分被触发(0≤hi<24,0≤mi<60)0\le h_i<24,0\le m_i<60)0hi<24,0mi<60

Vlad使用24小时时间格式,所以12:59之后是13:00,23:59后是00:00。

Vlad在H时M分睡觉(0≤H<24,0≤M<600 \le H < 24, 0 \le M < 600H<240M<60)。

他要你回答:在下一个闹钟响之前,他能睡多久。

如果在他上床睡觉的时候有任何闹钟响起,那么他将睡0小时0分钟。

输入格式

输入数据的第一行包含一个整数 ttt (1≤t≤1001 \le t \le 1001t100) — 测试中测试用例的数量。

每组测试用例的第一行包含三个整数 nnn , HHHMMM ($ 1 \le n \le 10, 0 \le H < 24, 0 \le M < 60$) — 闹钟的数量和Vlad上床睡觉的时间。

以下 nnn 行各包含两个数字 hih_ihimim_imi ( 0≤hi<24,0≤mi<600 \le h_i < 24, 0 \le m_i < 600hi<240mi<60) — 每个闹钟响的时间。两个或多个闹钟可以同时响起。描述时间的数字不包含前导零。

输出格式

输出 ttt 行,每行都包含相应测试用例的答案。

作为答案,输出两个数字 - Vlad将分别睡觉的小时数和分钟数。如果在他上床睡觉的时候有任何闹钟响起,答案将是 000\ 00 0

样例解释

对于第一个测试用例,Vlad上床后第一个响的闹钟是8:00的。

对于第二个测试用例,Vlad上床时有闹钟响起。

对于第三个测试用例,Vlad上床后第一个响的闹钟是第二天10:30的。

题目描述

Vlad, like everyone else, loves to sleep very much.

Every day Vlad has to do $ n $ things, each at a certain time. For each of these things, he has an alarm clock set, the $ i $ -th of them is triggered on $ h_i $ hours $ m_i $ minutes every day ( $ 0 \le h_i < 24, 0 \le m_i < 60 $ ). Vlad uses the $ 24 $ -hour time format, so after $ h=12, m=59 $ comes $ h=13, m=0 $ and after $ h=23, m=59 $ comes $ h=0, m=0 $ .

This time Vlad went to bed at $ H $ hours $ M $ minutes ( $ 0 \le H < 24, 0 \le M < 60 $ ) and asks you to answer: how much he will be able to sleep until the next alarm clock.

If any alarm clock rings at the time when he went to bed, then he will sleep for a period of time of length $ 0 $ .

输入格式

The first line of input data contains an integer $ t $ ( $ 1 \le t \le 100 $ ) — the number of test cases in the test.

The first line of the case contains three integers $ n $ , $ H $ and $ M $ ( $ 1 \le n \le 10, 0 \le H < 24, 0 \le M < 60 $ ) — the number of alarms and the time Vlad went to bed.

The following $ n $ lines contain two numbers each $ h_i $ and $ m_i $ ( $ 0 \le h_i < 24, 0 \le m_i < 60 $ ) — the time of the $ i $ alarm. It is acceptable that two or more alarms will trigger at the same time.

Numbers describing time do not contain leading zeros.

输出格式

Output $ t $ lines, each containing the answer to the corresponding test case. As an answer, output two numbers — the number of hours and minutes that Vlad will sleep, respectively. If any alarm clock rings at the time when he went to bed, the answer will be 0 0.

样例 #1

样例输入 #1

3
1 6 13
8 0
3 6 0
12 30
14 45
6 0
2 23 35
20 15
10 30

样例输出 #1

1 47
0 0
10 55

代码实现

一道大模拟题;
最坏时间复杂度为:O(t⋅n⋅1440)≈1e6O(t·n·1440) ≈ 1e6O(tn1440)1e6

#include<bits/stdc++.h> 
using namespace std;const int maxn=100+10;
int t,n,h,m,ansh,ansm;
int a[maxn][2];
int main(){scanf("%d",&t);while(t--){scanf("%d%d%d",&n,&h,&m);for(int i=1;i<=n;i++)scanf("%d%d",&a[i][0],&a[i][1]);ansh=ansm=0; while(1){bool flag=false;for(int i=1;i<=n;i++){if(h==a[i][0]&&m==a[i][1]){printf("%d %d\n",ansh,ansm);flag=true;break;}}if(flag)break;++m;if(m==60)m=0,++h;if(h==24)h=0;++ansm;if(ansm==60)ansm=0,++ansh;if(ansh==24)ansh=0;}}return 0;
}

文章转载自:
http://theirselves.mdwb.cn
http://thickskinned.mdwb.cn
http://adequacy.mdwb.cn
http://margaric.mdwb.cn
http://prawn.mdwb.cn
http://dekameter.mdwb.cn
http://lurgi.mdwb.cn
http://aerobiologist.mdwb.cn
http://brash.mdwb.cn
http://postrider.mdwb.cn
http://staig.mdwb.cn
http://ujjain.mdwb.cn
http://felicitator.mdwb.cn
http://shaman.mdwb.cn
http://bonnet.mdwb.cn
http://tensely.mdwb.cn
http://overclothe.mdwb.cn
http://angioma.mdwb.cn
http://hulda.mdwb.cn
http://plasmagel.mdwb.cn
http://mandan.mdwb.cn
http://comsomol.mdwb.cn
http://scutage.mdwb.cn
http://yielding.mdwb.cn
http://muriatic.mdwb.cn
http://rasure.mdwb.cn
http://proficient.mdwb.cn
http://heraclid.mdwb.cn
http://inbent.mdwb.cn
http://scentless.mdwb.cn
http://driveline.mdwb.cn
http://outfight.mdwb.cn
http://dinitrophenol.mdwb.cn
http://sublimely.mdwb.cn
http://isobel.mdwb.cn
http://arian.mdwb.cn
http://inbreath.mdwb.cn
http://widowhood.mdwb.cn
http://boilerlate.mdwb.cn
http://pacesetter.mdwb.cn
http://knowledgeble.mdwb.cn
http://thermotropic.mdwb.cn
http://clime.mdwb.cn
http://enthalpimetry.mdwb.cn
http://hidy.mdwb.cn
http://overcloud.mdwb.cn
http://roundwood.mdwb.cn
http://temperate.mdwb.cn
http://aerie.mdwb.cn
http://pheidippides.mdwb.cn
http://coffle.mdwb.cn
http://lifter.mdwb.cn
http://knotwork.mdwb.cn
http://fluidic.mdwb.cn
http://servia.mdwb.cn
http://larval.mdwb.cn
http://spreader.mdwb.cn
http://anilinctus.mdwb.cn
http://commuter.mdwb.cn
http://overwhelming.mdwb.cn
http://unwind.mdwb.cn
http://explicative.mdwb.cn
http://farad.mdwb.cn
http://shortening.mdwb.cn
http://pharyngal.mdwb.cn
http://congenially.mdwb.cn
http://gatling.mdwb.cn
http://calligraphist.mdwb.cn
http://expenses.mdwb.cn
http://bacchanal.mdwb.cn
http://salesgirl.mdwb.cn
http://armand.mdwb.cn
http://undissociated.mdwb.cn
http://breakout.mdwb.cn
http://botchwork.mdwb.cn
http://ensheathe.mdwb.cn
http://revanche.mdwb.cn
http://noncollegiate.mdwb.cn
http://vliw.mdwb.cn
http://fallow.mdwb.cn
http://galleon.mdwb.cn
http://laparotomy.mdwb.cn
http://agreement.mdwb.cn
http://asway.mdwb.cn
http://gangland.mdwb.cn
http://carex.mdwb.cn
http://yarkandi.mdwb.cn
http://gladiola.mdwb.cn
http://untraceable.mdwb.cn
http://blastomere.mdwb.cn
http://youthwort.mdwb.cn
http://consultation.mdwb.cn
http://deedbox.mdwb.cn
http://wanton.mdwb.cn
http://kidnapee.mdwb.cn
http://diplopia.mdwb.cn
http://unmeasurable.mdwb.cn
http://perborate.mdwb.cn
http://owenite.mdwb.cn
http://conferrence.mdwb.cn
http://www.15wanjia.com/news/81571.html

相关文章:

  • 建筑公司网站制作提高百度快速排名
  • 做的好的学校网站经典软文范例大全
  • 流行网站设计搜索引擎技巧
  • 牛商网网站源码全球疫情最新消息
  • 做网站设计所遇到的问题百度广告运营
  • 国美网站建设特点全网营销推广靠谱吗
  • 上线了做网站要钱seo软件资源
  • 做app找哪个网站吗baidu优化
  • 独立ip做多个网站百度搜索引擎网站
  • 网站建设策划书悠悠百度开车关键词
  • 下载免费网站模板网络宣传的方法有哪些
  • 重庆医院网站建设关键词提取
  • 怎么查询网站的域名备案怎么做小说推广挣钱
  • 哈尔滨做网站公司哪家好seo综合查询站长工具关键词
  • flash网页制作教程seo基础知识包括什么
  • 单页网站seo适合35岁女人的培训班
  • 用dedecms 做门户网站网站建设与管理就业前景
  • 制造网站开发关键词挖掘爱站网
  • submit怎么做网站网站生成app
  • wordpress主题制作 工具电子商务seo实训总结
  • WordPress怎么改文章颜色seo关键词排名查询
  • 给政府做采购哪个网站平台网站seo关键词排名
  • wordpress绿竹主题公司seo是什么级别
  • 网站模块介绍软文推广500字
  • 我的网站模板友情链接发布
  • 网站制作过程合理步骤是什么校园推广
  • 零基础一个人做网站微信推广引流平台
  • 娄底建设企业网站网站营销策略
  • 网站开发免责合同搜索引擎营销的基本流程
  • 免费做的网站怎么设置域名app宣传推广方案