链接: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. npm WARN uninstall not installed in /Users/hrt0kmt/node_modules: "xxx"

    You may meet this error on home directory. % npm uninstall appium npm WARN uninstall not installed i ...

  2. 查看 python安装目录

    打开终端 输入: which python 打开终端 依此输入: python import sys print sys.path

  3. 嵌入式开发之davinci---8148/8127/8168 中dsp c674的浮点和定点兼容

    c674: 是c67(浮点)+c64(定点) 兼容的 http://processors.wiki.ti.com/index.php/-mv_option_to_use_with_the_C674x ...

  4. MFC 的 Picture Control 加载 BMP/PNG 图片的方法

    1. 加载 BMP CStatic* pWnd = (CStatic*)GetDlgItem(IDC_PIC); // 得到 Picture Control 句柄 pWnd->ModifySty ...

  5. Spring Boot JPA 连接数据库

    本文将介绍怎样在Spring Boot project中加入JPA作为持久化方式. 改动 pom.xml 依赖 与上一篇介绍的 jdbc 不同的是 spring-boot-starter-jdbc 改 ...

  6. BZOJ 2115: [Wc2011] Xor DFS + 线性基

    2115: [Wc2011] Xor Time Limit: 10 Sec  Memory Limit: 259 MB Description Input 第一行包含两个整数N和 M, 表示该无向图中 ...

  7. MapReduce算法形式四:mapjoin

    案例四:mapjoin(对个map共同输入,一个reduce) 这个方法主要解决的是,几个表之间的比较,类似于数据库的内外连接,还有一些左右连接之类的,简而言之就是,A表没有的B表有,B表有的A没有或 ...

  8. React创建组件的三种方式比较和入门实例

    推荐文章: https://www.cnblogs.com/wonyun/p/5930333.html 创建组件的方式主要有: 1.function 方式 2.class App extends Re ...

  9. rails使用mysql数据库

    简单步骤 1,安装mysql 安裝 MySQL Ubuntu 上安裝 MySQL 請執行: $ sudo apt-get install mysql-server mysql-common mysql ...

  10. iOS 获取WIFI SSID及MAC地址

    NSString *ssid = @"Not Found"; NSString *macIp = @"Not Found"; CFArrayRef myArra ...