Codeforces 622B The Time 【水题】
1 second
256 megabytes
standard input
standard output
You are given the current time in 24-hour format hh:mm. Find and print the time after a minutes.
Note that you should find only the time after a minutes, see the examples to clarify the problem statement.
You can read more about 24-hour format here https://en.wikipedia.org/wiki/24-hour_clock.
The first line contains the current time in the format hh:mm (0 ≤ hh < 24, 0 ≤ mm < 60). The hours and the minutes are given with two digits (the hours or the minutes less than 10 are given with the leading zeroes).
The second line contains integer a (0 ≤ a ≤ 104) — the number of the minutes passed.
The only line should contain the time after a minutes in the format described in the input. Note that you should print exactly two digits for the hours and the minutes (add leading zeroes to the numbers if needed).
See the examples to check the input/output format.
23:59
10
00:09
20:20
121
22:21
10:10
0
10:10
题意:给你一个时间问你n分钟后的时间
#include<stdio.h>
#include<string.h>
#include<string>
#include<math.h>
#include<algorithm>
#define LL long long
#define PI atan(1.0)*4
#define DD doublea
#define MAX 1010
#define mod 10007
using namespace std;
int n,m;
int main()
{
int j,i,sum,t;
int x,y,z;
while(scanf("%d:%d",&n,&m)!=EOF)
{
scanf("%d",&t);
x=y=z=0;
x=t%60;
z=t/60;
m=x+m;
if(m>=60)
{
y=m/60;
m=m%60;
}
n=n+z+y;
if(n%24==0)
n=0;
if(n%24!=0)
n=n%24;
printf("%02d:%02d\n",n,m);
}
return 0;
}
Codeforces 622B The Time 【水题】的更多相关文章
- Codeforces Gym 100531G Grave 水题
Problem G. Grave 题目连接: http://codeforces.com/gym/100531/attachments Description Gerard develops a Ha ...
- codeforces 706A A. Beru-taxi(水题)
题目链接: A. Beru-taxi 题意: 问那个taxi到他的时间最短,水题; AC代码: #include <iostream> #include <cstdio> #i ...
- codeforces 569B B. Inventory(水题)
题目链接: B. Inventory time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Codeforces 489A SwapSort (水题)
A. SwapSort time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...
- codeforces 688A A. Opponents(水题)
题目链接: A. Opponents time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- CodeForces 534B Covered Path (水题)
题意:给定两个速度,一个一初速度,一个末速度,然后给定 t 秒时间,还每秒速度最多变化多少,让你求最长距离. 析:其实这个题很水的,看一遍就知道怎么做了,很明显就是先从末速度开始算起,然后倒着推. 代 ...
- Codeforces Gym 100286I iSharp 水题
Problem I. iSharpTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...
- CodeForces 705A(训练水题)
题目链接:http://codeforces.com/problemset/problem/705/A 从第三个输出中可看出规律, I hate that I love that I hate it ...
- CodeForces Gym 100685C Cinderella (水题)
题意:给定 n 个杯子,里面有不同体积的水,然后问你要把所有的杯子的水的体积都一样,至少要倒少多少个杯子. 析:既然最后都一样,那么先求平均数然后再数一下,哪个杯子的开始的体积就大于平均数,这是一定要 ...
- CodeForces 931C Laboratory Work 水题,构造
*这种题好像不用写题解... 题意: 一个人要改动别人的实验记录,实验记录记录是一个集合 实验记录本身满足:$max(X)-min(X)<=2$ 改动结果要求: 1.新的集合平均值和之前的一样 ...
随机推荐
- Spring 事务中 readOnly 的解释
spring 中事务的PROPAGATION_REQUIRED,Readonly的解释 (2012-11-21 16:29:38) 转载▼ 标签: 杂谈 一. ...
- spring事务传播机制实例讲解
http://kingj.iteye.com/blog/1680350 spring事务传播机制实例讲解 博客分类: spring java历险 天温习spring的事务处理机制,总结 ...
- tc 2014 college tour 250 500
题意: You are given a long long n. Return the largest divisor of n that is a perfect square. That is, ...
- hdu 4861 Couple doubi (找规律 )
题目链接 可以瞎搞一下,找找规律 题意:两个人进行游戏,桌上有k个球,第i个球的值为1i+2i+⋯+(p−1)i%p,两个人轮流取,如果DouBiNan的值大的话就输出YES,否则输出NO. 分析:解 ...
- 宏HASH_SEARCH
/********************************************************************//** Looks for a struct in a ha ...
- ASP.NET MVC 学习7、为Model Class的字段添加验证属性(validation attribuate)
Adding Validation to the Model ,在Model中添加数据验证 参考:http://www.asp.net/mvc/tutorials/mvc-4/getting-star ...
- HDU 3749 Financial Crisis 经济危机(点双连通分量)
题意: 给一个图n个点m条边(不一定连通),接下来又q个询问,询问两个点是为“不相连”,“仅有一条路径可达”,“有两条及以上的不同路径可达”三种情况中的哪一种.注:两条以上的路径指的是路径上的点连1个 ...
- DrawDib函数组的使用
Microsoft的针对与设备无关位图(DIB位图),在其WIN32 SDK的Multimedia中提供了一组绘制DIB位图的高性能函数组──DrawDib函数组.DrawDib函数组是一组不依赖于图 ...
- 流媒体相关知识介绍 及其 RTP 应用
一.流媒体简介 随着Internet的日益普及,在网络上传输的数据已经不再局限于文字和图形,而是逐渐向声音和视频等多媒体格式过渡.目前在网络上传输音频/视频(Audio/Video,简称A/V)等多媒 ...
- TCP/IP详解学习笔记(8)-DNS域名系统
前面已经提到了访问一台机器要靠IP地址和MAC地址,其中,MAC地址可以通过ARP协议得到,所以这对用户是透明的,但是IP地址就不行,无论如何用户都需要用一个指定的IP来访问一台计算机,而IP地址又非 ...