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 ...
随机推荐
- 启动Jmeter4.0 后弹出命令窗口提示信息是什么意思?
启动Jmeter4.0 后弹出命令窗口提示信息: =========================================================================== ...
- grub启动流程和配置
grub stage 1 MBR中前 446个字节,如果把这里面的内容损坏,那么系统会认为当前磁盘没有启动引导功能,会尝试从光盘或者网络启动系统 grub stage 1.5 存放识别/boot ...
- 数据库---mysql内置功能
一.视图 简介: 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名],用户使用时只需使用[名称]即可获取结果集,可以将该结果集当做表来使用.使用视图我们可以把查询过 ...
- oracle-安装-init.sh
!#/bin/bashgroupadd -g 1001 oinstallgroupadd -g 1002 dbagroupadd -g 1003 opergroupadd -g 1004 asmadm ...
- String扩展 让你在PadLeft和PadRight时不再受单双字节问题困扰
/// <summary> /// 按单字节字符串向左填充长度 /// </summary> /// <param name="input">& ...
- GOROOT、GOPATH、GOBIN
GOROOT golang安装路径. GOPATH GOPATH可以设置多个工程目录,linux下用冒号分隔(必须用冒号,fish shell的空格分割会出错),windows下用分号分隔,但是go ...
- pro*c的使用
一.什么是Pro*c程序 在oracle数据库管理系统中,有三种访问数据库的方法: 1.用 SQL*Plus,直接输入sql命令以命令行交换的方式访问数据库 2.用一些应用开发 ...
- 9个Linux系统常用监控命令
我们的系统一旦上线跑起来我们自然希望它一直相安无事,不要宕机,不要无响应,不要慢腾腾的.但是这不是打开机器电源然后放任不管就可以得到的.所以我们要监视系统的运行状况,发现问题及时处理. 对于系统和网络 ...
- Vbox下的linux和windows共享文件设置
参考链接: https://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html
- Windows PyCharm永久激活
1.下载 链接: https://pan.baidu.com/s/1LvQozk5lXdyk2p8qgGsr3A 提取码: x1t5 放置到 pycharm安装目录的\bin目录下(位置可随意,只要配 ...