AtCoder Beginner Contest 113 A
A - Discount Fare
Time limit : 2sec / Memory limit : 1024MB
Score: 100 points
Problem Statement
There is a train going from Station A to Station B that costs X yen (the currency of Japan).
Also, there is a bus going from Station B to Station C that costs Y yen.
Joisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.
How much does it cost to travel from Station A to Station C if she uses this ticket?
Constraints
- 1≤X,Y≤100
- Y is an even number.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
X Y
Output
If it costs x yen to travel from Station A to Station C, print x.
Sample Input 1
81 58
Sample Output 1
110
- The train fare is 81 yen.
- The train fare is 58 ⁄ 2=29 yen with the 50% discount.
Thus, it costs 110 yen to travel from Station A to Station C.
Sample Input 2
4 54
Sample Output 2
31
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
using namespace std;
#pragma comment(linker, "/stck:1024000000,1024000000")
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.1415926535897932384626433832
#define ios() ios::sync_with_stdio(true)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
int main()
{
int x,y;
cin>>x>>y;
cout<<x+y/<<endl;
return ;
}
AtCoder Beginner Contest 113 A的更多相关文章
- AtCoder Beginner Contest 113 C
C - ID Time limit : 2sec / Memory limit : 1024MB Score: 300 points Problem Statement In Republic of ...
- AtCoder Beginner Contest 113 D Number of Amidakuji
Number of Amidakuji 思路:dp dp[i][j]表示经过(i, j) 这个点的方案数 然后一层一层地转移, 对于某一层, 用二进制枚举这一层的连接情况, 判断连接是否符合题意, 然 ...
- AtCoder Beginner Contest 113 B
B - Palace Time limit : 2sec / Memory limit : 1024MB Score: 200 points Problem Statement A country d ...
- 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 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 ...
随机推荐
- Map-making Robots: A Review of the Occupancy Grid Map Algorithm
栅格地图算法:http://www.ikaros-project.org/articles/2008/gridmaps/
- Luogu 4251 [SCOI2015]小凸玩矩阵
BZOJ 4443 二分答案 + 二分图匹配 外层二分一个最小值,然后检验是否能选出$n - k + 1$个不小于当前二分出的$mid$的数.对于每一个$a_{i, j} \geq mid$,从$i$ ...
- 登录xdebug
1.配置 2.先不打断点,调至登录页面 3.在登录必经过处打断点,访问页面输入账号密码点击登录,进入代码追踪模式
- xml解析中的DOM和SAX的区别
面试题:DMO和SAX的区别? DOM解析的优点:增删查改操作方便,缺点:占用内存较大,不适合解析大的XML文件: SAX解析的优点:占用内存小,解析快:缺点:不适合增删查改:
- (转)初试konckout+webapi简单实现增删改查
原文地址:http://www.cnblogs.com/flykai/p/3361064.html 前言 konckout.js本人也是刚刚接触,也是初学,本文的目的是使用ko和asp.net mvc ...
- 转Delphi中XLSReadWrite控件的使用(1)---简介
XLSReadWrite控件简介: 一个你需要的,能在Delphi和.NET下访问Excel文件的完美解决方案. 一个经典的读写Excel的控件,对于使用Excel 开发很有帮助 官方网站: http ...
- 装饰(Decorator)模式
一. 装饰(Decorator)模式 装饰(Decorator)模式又名包装(Wrapper)模式[GOF95].装饰模式以对客户端透明的方式扩展对象的功能,是继承关系的一个替代方案. 二. 装饰模式 ...
- 15分XX秒后订单自动关闭(倒计时)
//订单记录 function get_order(){ //请求订单ajax方法 XX.send_api("method",{data},function(){ var date ...
- IOS GPS跟踪备注
CLLocationManager还提供了如下类方法来判断当前设备的定位相关服务状态. Ø + locationServicesEnabled:返回当前定位服务是否可用. Ø + deferredLo ...
- 3人从小公寓创业,到世界最大引擎公司,Unity创始人谈14年...
Unity创始人David Helgason出席了5月11 - 13日在上海举办的Unite 2017 Shanghai,并在大会期间接受了游戏陀螺的专访,动情地讲述了这14年来从3人在公寓创业,到成 ...