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 ...
随机推荐
- finecms同时调用子栏目和子栏目的文章怎么操作
之前ytkah写过dedecms如何调用当前栏目的子栏目及子栏目文章,那如果是finecms如何同时调用子栏目和子栏目的文章呢? {list action=category pid=0 id=31} ...
- 使用DigitalOcean控制台访问Droplet(远程服务器)
介绍 大多数用户将使用SSH,PUTTY或安装的控制面板管理他们的DigitalOcean Droplet. 但是,可能会出现阻止您使用这些方法访问Droplet的情况. 例如,更改网络或服务配置文件 ...
- 萌新接触前端的第一课——HTML
HTML web服务本质(好吧这个先不用知道也可以) import socket def main(): sock = socket.socket(socket.AF_INET, socket.SOC ...
- what's the python之自定义模块和包
模块自定义 上节说了有关模块的知识,当时所说的模块都是内置模块,现在来看自己定制的模块,即模块也可以自定义. 模块的自定义就是指写一段python文件,一般情况下里面包含了可执行的语句和函数的定义,其 ...
- vue 点击当前的标签,获取当前标签的value值
点击当前的标签,获取当前标签的value值 html <p class="title" v-for="(item, i) in items" :key=& ...
- 外部盒模型大小固定 内部有边框div设置浮动时 缩放窗口内部div溢出的解决办法
原因分析: chorme和firefox浏览器下当缩放窗口大小时,边框的计算宽度变大造成内部div宽度的计算宽度变大,外部div放不下内部div而溢出. 解决办法: 给内部div设置 box-sizi ...
- Android使得Fragment 切换时不重新实例化
以前实现Fragment的切换都是用replace方法实现 public void startFragmentAdd(Fragment fragment) { FragmentManager frag ...
- poj3259: Wormholes(BF模板题)
http://poj.org/problem?id=3259 Description While exploring his many farms, Farmer John has discovere ...
- 2019.03.23 Http
自己也要分清楚 看清楚 request,response 一个是请求 一个是相应 行 头 之间还有个空行 体 HttpRequest请求对象(只读) 当用户访问一个视图函数时,Djan ...
- 别再说找不到Python练手项目了,这80个拿去过冬
开头真的很重要!!!一个吻,一部小说,一篇文章......好的开头就像一个漂亮女孩的问候,问完了,你还期待着她接下来会对你说些什么甜蜜的话呢. 真可惜!我不是漂亮女孩,我的这个开头也不好.但开头不好, ...