链接:https://codeforces.com/contest/1133/problem/A

题意:

给两个时间点,求中间时间点。

思路:

数学

代码:

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

int main()
{
int h1, h2, m1, m2;
scanf("%d:%d", &h1, &m1);
scanf("%d:%d", &h2, &m2);
int h = h1 + h2;
int m = m1 + m2;
if (m >= 60)
m -= 60, h += 1;
if (h % 2 == 0)
{
printf("%02d:%02d\n", h / 2, m / 2);
}
else
{
h -= 1;
m += 60;
printf("%02d:%02d\n", h / 2, m / 2);
} return 0;
}

  

Codeforces Round #544 (Div. 3) A.Middle of the Contest的更多相关文章

  1. Codeforces Round #544 (Div. 3) 题解

    Codeforces Round #544 (Div. 3) D. Zero Quantity Maximization 题目链接:https://codeforces.com/contest/113 ...

  2. CodeForces Round #544 Div.3

    A. Middle of the Contest 代码: #include <bits/stdc++.h> using namespace std; int h1, m1, h2, m2; ...

  3. Codeforces Round #544 (Div. 3)解题报告

    A.Middle of the Contest 考虑把输入的时间单位化成分钟,相加除以2就好了 #include<bits/stdc++.h> using namespace std; # ...

  4. Codeforces Round #544 (Div. 3) dp + 双指针

    https://codeforces.com/contest/1133/problem/E 题意 给你n个数(n<=5000),你需要对其挑选并进行分组,总组数不能超过k(k<=5000) ...

  5. Codeforces Round #544 (Div. 3) D. Zero Quantity Maximization

    链接:https://codeforces.com/contest/1133/problem/D 题意: 给两个数组a,b. 同时ci = ai * d + bi. 找到一个d使c数组中的0最多. 求 ...

  6. Codeforces Round #544 (Div. 3) C. Balanced Team

    链接:https://codeforces.com/contest/1133/problem/C 题意: 给n个数, 在这n个数中选最多n个数,来组成一个队伍. 保证这n个数的最大最小差值不大于5. ...

  7. Codeforces Round #544 (Div. 3) B.Preparation for International Women's Day

    链接:https://codeforces.com/contest/1133/problem/B 题意: 给n个数,和一个k,在n个数中选几对数,保证没对数相加可以整除k. 求最大能选几个数. 思路: ...

  8. Codeforces Round #544 (Div. 3) Editorial C. Balanced Team

    http://codeforces.com/contest/1133/problem/Ctime limit per test 2 secondsmemory limit per test 256 m ...

  9. Codeforces Round #544 (Div. 3) D F1 F2

    题目链接:D. Zero Quantity Maximization #include <bits/stdc++.h> using namespace std; #define maxn ...

随机推荐

  1. Codeforces 3A-Shortest path of the king(BFS打印路径)

    A. Shortest path of the king time limit per test 1 second memory limit per test 64 megabytes input s ...

  2. Object类及其常用方法简介

    https://www.cnblogs.com/wxywxy/p/6740277.html Object类是一个特殊的类,是所有类的父类,如果一个类没有用extends明确指出继承于某个类,那么它默认 ...

  3. vue 开发前准备工作

    工欲善其事,必先利其器. 第一步,选择一个合适的编辑器: 看vue官网上,有推荐用HBuilder X这个编辑器,这个我在开发微信小程序的时候,就是用的这个编辑器,还可以,挺好用的,也可以用git做版 ...

  4. Android如果动态改变CursorAdapter Item个数

    //adapter内部类 private class SearchAdapter extends CursorAdapter { @Override public View newView(Conte ...

  5. configuration默认设置

    所以 上面的configuration的set可以省略,但是也可以自己改变设置,如下所示:

  6. 在Android Studio中修改应用包名

    紧凑模式下(包名中的每个字段紧贴在一起,例如),右键单击包名,Refactor -> Rename,只能修改包名最外层的字段 分离模式下(点击设置,将Hide Empty Middle Pack ...

  7. Http常用状态码及含义

    HTTP 400 – 请求无效 HTTP 404- 无法找到文件或目录 HTTP 500 – 内部服务器错误 HTTP 502 – 网关错误 HTTP 400 – 请求无效 HTTP 401.1 – ...

  8. amazon lightsail

    https://51.ruyo.net/6038.html https://aws.amazon.com/cn/lightsail/

  9. 优秀Java程序员必须了解的GC工作原理

    一个优秀的Java程序员必须了解GC的工作原理.如何优化GC的性能.如何与GC进行有限的交互,因为有一些应用程序对性能要求较高,例如嵌入式系统.实时系统等,只有全面提升内存的管理效率 ,才能提高整个应 ...

  10. asp.net下的cookieName

    https://stackoverflow.com/questions/1017144/rename-asp-net-sessionid Add to your web.config:- <sy ...