codeforces 124A The number of positions
来源:互联网 发布:ubuntu caffe gpu 编辑:程序博客网 时间:2024/06/03 21:33
点击打开链接
A. The number of positions
time limit per test
0.5 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputPetr stands in line of n people, but he doesn't know exactly which position he occupies. He can say that there are no less than a people standing in front of him and no more than b people standing behind him. Find the number of different positions Petr can occupy.
Input
The only line contains three integers n, a and b (0 ≤ a, b < n ≤ 100).
Output
Print the single number — the number of the sought positions.
Examples
input
3 1 1
output
2
input
5 2 3
output
3
Note
The possible positions in the first sample are: 2 and 3 (if we number the positions starting with 1).
In the second sample they are 3, 4 and 5.
#include<stdio.h>#include<algorithm>using namespace std;int main(){ int n,a,b; scanf("%d%d%d",&n,&a,&b); printf("%d\n",min(n-a,b+1)); return 0;}
阅读全文
0 0
- CodeForces-124A-The number of positions
- CodeForces-124A-The number of positions
- codeforces 124A The number of positions
- Codeforces Problem-124A. The number of positions
- A. The number of positions
- Codeforces Beta Round #92 (Div. 2) / 124A The number of positions (简单数学)
- Codeforces Beta Round #92 (Div. 2) / 124A The number of positions 【简单模拟】【水题】
- Manipulating the positions of desktop icons
- calculate the square of a number
- CodeForces 144A Arrival of the General
- codeforces 144A Arrival of the General
- codeforces 144A Arrival of the General
- Codeforces 27E - Number With The Given Amount Of Divisors
- Codeforces 27E Number With The Given Amount Of Divisors
- Codeforces 27 E Number With The Given Amount Of Divisors
- CodeForces 27E Number With The Given Amount Of Divisors
- codeforces 724G. Xor-matic Number of the Graph
- codeforces 724G. Xor-matic Number of the Graph
- 虚函数&多态
- Jenkins-部署(一)
- 1.1云存储技术的起源与发展
- 开源数据处理引擎 GeoTrellis 发布
- html+springMVC的拦截器token配置--解决ajax表单重复提交的问题
- codeforces 124A The number of positions
- 阿里云/腾讯 云服务器的使用方法
- 多态中方法的重写和方法的重载
- 地址、数据、控制总线
- MySQL优化sql查询的30种方法
- 关于BootStrap框架中的网格式布局详解,以及消除外边距和container-fluid属性的解释。
- CQBZOJ 3380 (NOIP 膜你题2 T3) 小Q的新玩具
- path-sum i & ii
- windows 安装nginx服务 出错