URAL 1409. Two Gangsters
来源:互联网 发布:淘宝手机端装修模板 编辑:程序博客网 时间:2024/06/06 04:03
1409. Two Gangsters
Time limit: 1.0 second
Memory limit: 64 MB
Memory limit: 64 MB
Two gangsters Harry and Larry had a rest at countryside. They decided to spend some time shooting, so they put several beer cans (no more than 10) on a log. Harry started to shoot cans one after another from the leftmost to the right and Larry – from the rightmost to the left. At some moment it happened so that they shot one and the same can.
Harry got indignant and claimed that Larry owed him a considerable sum of money because Larry deprived him of shooting some more cans. Larry became furious and told Harry that he owed even greater sum of money to Larry because of the same reason. They started to argufy but nobody remembered how many cans there were at the very beginning. And no one of them was going to search cans which was shot. Anyway, each of them remembered exactly how many cans he shot.
Determine how many cans were not shot by Harry and how many cans were not shot by Larry.
Input
The only input line contains two integers — the number of cans shot by Harry and by Larry respectively.
Output
two integers — the number of cans that were not shot by Harry and the number of cans that were not shot by Larry, respectively.
Sample
4 7
6 3
还是一个炒鸡简单的问题,两个人总会有打到一起的时候,把对方打中的瓶子数减一就OK了。
还有注意不要用10减去瓶子数,因为no more than在这里的意思是不超过...
#include<cstdio>#include<iostream>using namespace std;int main(){ int a,b; while(cin>>a>>b) { printf("%d %d\n",b-1,a-1); } return 0;}
0 0
- URAL 1409. Two Gangsters
- URAL 1409 Two Gangsters (开放思维)
- Ural 1106. Two Teams
- ural 1106. Two Teams
- URAL 1106 Two Teams
- ural 1106. Two Teams
- URAL 1495. One-two, One-two 2
- URAL 1495. One-two, One-two 2
- ural 1106. Two Teams -bfs
- ural 1106. Two Teams dfs
- ural 1106. Two Teams 二分图染色
- ural 1106. Two Teams 二分图染色
- URAL 1106. Two Teams (二分图)
- URAL 1106 Two Teams (DFS + 二分图)
- URAL 1216 Two Pawns and One King
- URAL 1495. One-two, One-two 2 DP or BFS?
- URAL 1495. One-two, One-two 2(暴力枚举)
- 【构造】 URAL 1495 One-two, One-two 2
- 第一篇blog
- 题目1047:素数判定
- 遇到的Spring注解
- C++ 赋值运算符重载
- PorterDuffXfermode的初级使用
- URAL 1409. Two Gangsters
- AngularJS四大核心特性
- Android在子线程更新UI的4种方法
- 电影数据集总结:Netflix、MovieLens、LDOS-CoMoDa、AdomMovie
- 字符串参数必须包含一个或者多个数字,函数应该把这些数字字符转换为整数并返回这个整数。如果字符串参数包含了任何非数字字符,函数就返回零
- JQuery (简化dom操作)
- MySQL多版本并发控制分析
- 求最大公约数
- hdu 1686 kmp统计匹配数