博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
codeforces Gym 100500 J. Bye Bye Russia
阅读量:6932 次
发布时间:2019-06-27

本文共 2327 字,大约阅读时间需要 7 分钟。

Problem J. Bye Bye Russia

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/gym/100500/attachments

Description

It was the last day at Russia, after the World Finals has ended. Coach fegla was travelling back to Cairo on the same day but later. Coach Fegla was really tired, and he had to sleep before he headed to the Airport. Due to an unknown reason his phone alarm was not working, and he needed something to wake him up. Fortunately his stopwatch was just working fine, and it worked in count down mode, and it supported only minutes. You will be given the current time, and the time he wished to wake up, help him determine the number of needed minutes to configure the stopwatch properly.

Input

The first line will be the number of test cases T. The following T lines each will contain 4 integers hc mc hw mw which represent the current time(hours, and minutes), and the wake up time(hours, minutes). 1 ≤ T ≤ 100 0 ≤ hc, hw ≤ 23 0 ≤ mc, mw ≤ 59 Note that both times will be on the same day, and the wake up time comes after the current time. Assume the day starts at 00:00 and ends at 23:59.

Output

For each test case print a single line containing: Case_x:_y x is the case number starting from 1. y is the required answer. Replace underscores with spaces.

Sample Input

2 1 22 13 21 2 35 21 35

Sample Output

Case 1: 719 Case 2: 1140

HINT

 

题意

给你两个时间,问你差了多少分钟

题解

水题……

代码

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef long long ll;using namespace std;//freopen("D.in","r",stdin);//freopen("D.out","w",stdout);#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)#define test freopen("test.txt","r",stdin)const int maxn=202501;#define mod 1000000007#define eps 1e-9const int inf=0x3f3f3f3f;const ll infll = 0x3f3f3f3f3f3f3f3fLL;inline ll read(){ ll x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){ if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f;}//*************************************************************************************int main(){ int t=read(); for(int cas=1;cas<=t;cas++) { int a=read(),b=read(),c=read(),d=read();; b=a*60+b,d=c*60+d; printf("Case %d: %d\n",cas,d-b); }}

 

转载地址:http://jpgjl.baihongyu.com/

你可能感兴趣的文章
python ftp的上传和下载
查看>>
python前端HTML和CSS入门
查看>>
关于Nginx支持.htaccess的分析
查看>>
GetSchema取得数据库架构,无法取得列的Description属性的解决方法
查看>>
document.body.scrollTop or document.documentElement.scrollTop
查看>>
【机器学习-西瓜书】一、绪论
查看>>
js 验证表单 js提交验证类
查看>>
Java中写入文件时换行符用"\r\n"、"\n"、"\r"?
查看>>
cmd for 循环拷贝文件
查看>>
[Cocoa]深入浅出Cocoa之多线程NSThread
查看>>
c++,不能声明为虚函数的函数
查看>>
WSHPSRS-匹克选择列表生成器-SRS(R12.2.3)
查看>>
Django REST framework API 指南(25):状态码
查看>>
浅谈 LiveData 的通知机制
查看>>
React App项目页面进出场动画
查看>>
XXL-CONF v1.4.1 发布,分布式配置管理平台
查看>>
JavaEE进阶知识学习-----SpringCloud(四)Eureka集群配置
查看>>
JB的测试之旅-今年的路,怎么走?
查看>>
mac系统下安装、启动、停止mongodb
查看>>
逐行阅读redux源码(二)combineReducers
查看>>