AtCoder Beginner Contest 082 A - Round Up the Mean
题目链接:https://abc082.contest.atcoder.jp/tasks/abc082_a
Time limit : 2sec / Memory limit : 256MB
Score : 100 points
Problem Statement
You are given two positive integers a and b. Let x be the average of a and b. Print x rounded up to the nearest integer.
Constraints
- a and b are integers.
- 1≤a,b≤100
Input
Input is given from Standard Input in the following format:
a b
Output
Print x rounded up to the nearest integer.
Sample Input 1
1 3
Sample Output 1
2
The average of 1 and 3 is 2.0, and it will be rounded up to the nearest integer, 2.
Sample Input 2
7 4
Sample Output 2
6
The average of 7 and 4 is 5.5, and it will be rounded up to the nearest integer, 6.
Sample Input 3
5 5
Sample Output 3
5
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
int a,b;
while(cin>>a>>b){
if((a+b)%==) cout<<(a+b)/<<endl;
else{
int c=(a+b)/;
if(a+b-*c<=) cout<<c+<<endl;
else cout<<c<<endl;
}
}
return ;
}
AtCoder Beginner Contest 082 A - Round Up the Mean的更多相关文章
- AtCoder Beginner Contest 082 B - Two Anagrams
题目链接:https://abc082.contest.atcoder.jp/tasks/abc082_b Time limit : 2sec / Memory limit : 256MB Score ...
- AtCoder Beginner Contest 100 2018/06/16
A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...
- AtCoder Beginner Contest 068 ABCD题
A - ABCxxx Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement This contes ...
- AtCoder Beginner Contest 148 题解
目录 AtCoder Beginner Contest 148 题解 前言 A - Round One 题意 做法 程序 B - Strings with the Same Length 题意 做法 ...
- AtCoder Beginner Contest 052
没看到Beginner,然后就做啊做,发现A,B太简单了...然后想想做完算了..没想到C卡了一下,然后还是做出来了.D的话瞎想了一下,然后感觉也没问题.假装all kill.2333 AtCoder ...
- AtCoder Beginner Contest 053 ABCD题
A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has ...
- AtCoder Beginner Contest 136
AtCoder Beginner Contest 136 题目链接 A - +-x 直接取\(max\)即可. Code #include <bits/stdc++.h> using na ...
- AtCoder Beginner Contest 137 F
AtCoder Beginner Contest 137 F 数论鬼题(虽然不算特别数论) 希望你在浏览这篇题解前已经知道了费马小定理 利用用费马小定理构造函数\(g(x)=(x-i)^{P-1}\) ...
- AtCoder Beginner Contest 076
A - Rating Goal Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Takaha ...
随机推荐
- MongoDB pymongo模块 删除数据
使用user集合,删除user集合的数据 import pymongo mongo_client = pymongo.MongoClient( host='192.168.0.112', port=2 ...
- wordpress去掉category怎么操作让url更简洁友好
用wordpress建站是比较流行的,全球将近25%的站点是用wordpress搭建的.有很多的模板.插件可以选择,当然最好还是能自己优化.URL固定链接就是之中一个基础的技巧.有网友问如何去掉url ...
- Emmagee——开源Android性能测试工具
工具:Emmagee作者:孔庆云 网易(杭州)质量保证部 开源地址:https://github.com/NetEase/Emmagee Wiki:https://github.com/NetEase ...
- PXE安装操作系统
TFTP服务 用PXE安装操作系统依赖于DHCP服务和TFTP服务 网卡一般都内置的TFTP客户端的程序 systemctl enable tftp systemctl enable dhc ...
- Oracle下SQL学习笔记
主机字符串:as sysdba alter user scott account unlock;//解锁scott,不会就谷歌检索 DML语句,增.删.查.改 select语句:熟悉表结构 desc ...
- mysql 分组 列转行
SELECT aa.type,CONCAT('(',GROUP_CONCAT('\'',aa.user_id separator '\'\,'),'\')') FROM (select aa.typ ...
- eos 空投列表网址 及 工具网站列表
https://eosdrops.io https://www.shensi.com/#/eos eos 区块链浏览器: https://eostracker.io/ https://eospark. ...
- struct模块
struct模块的作用是将数据长度转换成固定长度的内容 一般默认是4个字节 需要注意的是,struct模块是有缺点的,就是struct的int类型或别的类型不是无限制的.当整数大于一定值后,会失败,即 ...
- eclipse中安装XML editor Rinzo
eclipse中安装XML editor Rinzo 1. 较高版本的eclipse可以通过 Help--Market 搜索 Rinzo,然后安装 2. 第1种方法如果不行,尝试下面的方法 (1)从 ...
- Swagger Editor Linux安装(全新环境)
查看内核版本 cat /proc/version cat /etc/redhat-release 查看系统是32位还是64位方法总结getconf LONG_BIT 安装相关工具 yum instal ...