codeforces Gym 100500 J. Bye Bye Russia
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 <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
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=;
#define mod 1000000007
#define eps 1e-9
const int inf=0x3f3f3f3f;
const ll infll = 0x3f3f3f3f3f3f3f3fLL;
inline ll read()
{
ll x=,f=;char ch=getchar();
while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
//************************************************************************************* int main()
{
int t=read();
for(int cas=;cas<=t;cas++)
{
int a=read(),b=read(),c=read(),d=read();;
b=a*+b,d=c*+d;
printf("Case %d: %d\n",cas,d-b);
}
}
codeforces Gym 100500 J. Bye Bye Russia的更多相关文章
- Codeforces gym 101343 J.Husam and the Broken Present 2【状压dp】
2017 JUST Programming Contest 2.0 题目链接:Codeforces gym 101343 J.Husam and the Broken Present 2 J. Hu ...
- Codeforces GYM 100876 J - Buying roads 题解
Codeforces GYM 100876 J - Buying roads 题解 才不是因为有了图床来测试一下呢,哼( 题意 给你\(N\)个点,\(M\)条带权边的无向图,选出\(K\)条边,使得 ...
- codeforces Gym 100187J J. Deck Shuffling dfs
J. Deck Shuffling Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/pro ...
- codeforces GYM 100114 J. Computer Network 无相图缩点+树的直径
题目链接: http://codeforces.com/gym/100114 Description The computer network of “Plunder & Flee Inc.” ...
- codeforces GYM 100114 J. Computer Network tarjan 树的直径 缩点
J. Computer Network Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Des ...
- codeforces gym 100947 J. Killing everything dp+二分
J. Killing everything time limit per test 4 seconds memory limit per test 64 megabytes input standar ...
- codeforces gym 100357 J (网络流)
题目大意 有n种物品,m种建筑,p个人. n,m,p∈[1,20] 每种建筑需要若干个若干种物品来建造.每个人打算建造一种建筑,拥有一些物品. 主角需要通过交易来建造自己的建筑,交易的前提是对方用多余 ...
- Codeforces Gym 100114 J. Computer Network
Description 给出一个图,求添加一条边使得添加后的图的桥(割边)最少. Sol Tarjan. 一遍Tarjan求割边. 我们发现连接的两个点一定是这两个点之间的路径上的桥最多,然后就可以贪 ...
- 【codeforces.com/gym/100240 J】
http://codeforces.com/gym/100240 J [分析] 这题我搞了好久才搞出样例的11.76....[期望没学好 然后好不容易弄成分数形式.然后我‘+’没打..[于是爆0... ...
随机推荐
- SQLlite(WebSQL)如何排序并分页查询(SQLlite语法)
SELECT * FROM Table ORDER BY ID DESC Limit 10,9 limit语义:跳过10行,取9行 参考: SQLite的limit用法 如果我要去11-20的Ac ...
- JAVA数据库处理(连接,数据查询,结果集返回)
package john import java.io.IOException; import java.util.*; public class QueryDataRow { public Hash ...
- C++中引用的本质是什么?
一般的教材上讲到引用时,都是说“引用是对象的一个别名”.我认为这种定义是不清晰的,不利于初学者理解引用.至少我自己曾经被这个定义困扰了一段时间.到底什么是“别名”? 实际上,引用的实质是位于xxxxx ...
- bjfu1164 Parity Game
简单规律题.首先想到的是,若01串中1有n个,则可以通过操作,使串中1的个数变为n-1.n-2……1.0个:第2个想到的是,如果n为奇数,可以通过操作,使串中1的个数最多变为n+1,而若n为偶数,则无 ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_labels(self, locator)
def get_selected_list_labels(self, locator): """Returns the visible labels of selecte ...
- 为移动Web应用创建快速响应按钮
英文原文出自 Google Deveploers<Creating Fast Buttons for Mobile Web Applications>,由XiaoYi_HD翻译,并首发于 ...
- 面向切面编程(AOP)及其作用
在OOP设计中,它导致了大量代码的重复,而不利于各个模块的重用. 1.面向切面编程(AOP) 面向切面编程(AOP)就是对软件系统不同关注点的分离,开发者通过拦截方法调用并在方法调用前后添加辅助代码. ...
- 一起刷LeetCode4-Median of Two Sorted Arrays
实验室太吵了...怎么办啊... ----------------------------------------------------------------------------------- ...
- the application could not be verified
在iphone上安装app时,提示the application could not be verified 解决方式: 将iphone已有的这个app卸载,然后安装就可以了.
- hibernate 连接数据库时报错
错误信息 : com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allo ...