A9727 | Up the hill
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Hiking club "Up the hill" just returned from a walk. Now they are trying to remember which hills they've just walked through.
It is known that there were $N$ stops, all on different integer heights between $1$ and $N$ kilometers (inclusive) above the sea level. On the first day they've traveled from the first stop to the second stop, on the second day they've traveled from the second to the third and so on, and on the last day they've traveled from the stop $N-1$ to the stop $N$ and successfully finished their expedition.
They are trying to find out which heights were their stops located at. They have an entry in a travel journal specifying how many days did they travel up the hill, and how many days did they walk down the hill.
Help them by suggesting some possible stop heights satisfying numbers from the travel journal.
It is known that there were $N$ stops, all on different integer heights between $1$ and $N$ kilometers (inclusive) above the sea level. On the first day they've traveled from the first stop to the second stop, on the second day they've traveled from the second to the third and so on, and on the last day they've traveled from the stop $N-1$ to the stop $N$ and successfully finished their expedition.
They are trying to find out which heights were their stops located at. They have an entry in a travel journal specifying how many days did they travel up the hill, and how many days did they walk down the hill.
Help them by suggesting some possible stop heights satisfying numbers from the travel journal.
输入格式
In the first line there is an integer non-negative number $A$ denoting the number of days of climbing up the hill. Second line contains an integer non-negative number $B$ — the number of days of walking down the hill ( $A+B+1=N$ , $1<=N<=100000$ ).
输出格式
Output $N$ space-separated distinct integers from $1$ to $N$ inclusive, denoting possible heights of the stops in order of visiting.
输入输出样例
输入 #1
0 1
输出 #1
2 1
输入 #2
2 1
输出 #2
1 3 4 2
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted