Educational Codeforces Round 7 B
Description
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
一个简单的模拟
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
#define INF 0x3f3f3f3f
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
int t;
int n,m;
int sum,ans,flag;
int a,b,c,d;
int main()
{
scanf("%d:%d",&a,&b);
scanf("%d",&n);
while(n--)
{
b++;
if(b==)
{
a++;
b=;
if(a==)
{
a=;
}
}
}
printf("%02d:%02d",a,b);
return ;
}
Educational Codeforces Round 7 B的更多相关文章
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 6 C. Pearls in a Row
Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...
- Educational Codeforces Round 9
Educational Codeforces Round 9 Longest Subsequence 题目描述:给出一个序列,从中抽出若干个数,使它们的公倍数小于等于\(m\),问最多能抽出多少个数, ...
- Educational Codeforces Round 37
Educational Codeforces Round 37 这场有点炸,题目比较水,但只做了3题QAQ.还是实力不够啊! 写下题解算了--(写的比较粗糙,细节或者bug可以私聊2333) A. W ...
- Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship
Problem Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...
- Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)
Problem Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...
随机推荐
- Linux服务器在外地,如何用eclipse连接hdfs
配置外网和内网的映射,内部所有配置全部用内网的IP 本地所有配置皆为外网地址 本地给服务器发指令全部由映射转换为内网指定IP,即可
- JS获取页面URL信息
下面我们举例一个URL,然后获得它的各个组成部分: http://i.cnblogs.com/EditPosts.aspx?opt=1 window.location.href (设置或获取整个 UR ...
- Cocos2d-x 网络编程
主要介绍内容:Http协议,Socket协议,webSocket协议, Cocos2d-x中的相关类和方法 1 Http协议 HTTP协议也叫超文本传输协议.是互联网广泛使用的通信协议,常用于B/S架 ...
- C++数组对象和构造函数
定义数组对象以后,对数组中的对象初始化的方式分为两种: 一种方式是在定义的时候用列表初始化 A a[5] = {A(1),A(2),A(3),A(4),A(5)}; 一种方式是在定义了数组对象以后,再 ...
- 面试题:struts 值栈 有用
一. 核心部分 1. [核心试题]完成当天课堂练习 2. [多选题] 阅读如下代码中,下列哪种方式可以在页面正确迭代获取集合中的数据 (ABC) public String add(){ ValueS ...
- 数字图像处理实验(5):PROJECT 04-01 [Multiple Uses],Two-Dimensional Fast Fourier Transform 标签: 图像处理MATLAB数字图像处理
实验要求: Objective: To further understand the well-known algorithm Fast Fourier Transform (FFT) and ver ...
- 51NOD1835 完全图
传送门 分析 令f(i,j)表示i点完全图有j个联通块的方案数. 讨论有i-1个点已经固定了,我们拉出一个代表元素然后讨论它的集合大小然后组合数算一下就可以了. $$ dp(i,j) = \sum_{ ...
- C#中对sqlserver进行增删改查操作(简单易懂)
1.添加引用using System.Data;using System.Data.SqlData; 2.建立于数据库的连接,建议将它做成一个方法,方便多次利用.string sqlconnectio ...
- SQL:bat批处理多个.sql文件
一.批处理文件 update.bat 设置sqlserver的实例 记得一定要配置logfile文件 @echo off :: #### B. #### set LOGFILE=& ...
- 公司内部Wiki及搭建wiki系统-confluence
Wiki 是一个协同著作平台或称开放编辑系统.我们可以用Wiki来建设帮助系统,知识库系统.国内公共wiki最著名就是百度百科.那公司内部为什么要使用wiki呢? 2.内部wiki的作用 1.鼓励分享 ...