URAL 1409. Two Gangsters
2015-03-10 18:50
183 查看
1409. Two Gangsters
Time limit: 1.0 secondMemory 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
input | output |
---|---|
4 7 | 6 3 |
还有注意不要用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; }
相关文章推荐
- timus 1185. Wall URAL 解题报告 凸包
- ural 1837. Isenbaev's Number bfs
- ural 1353. Milliard Vasya's Function(dp)
- ural 1333 化平面为点计算覆盖率
- URAL 1136 Parliament (DFS)
- ural 1752 Tree 2
- Ural 1100 Final Standings
- Ural 1052
- URAL-1987 Nested Segments 线段树简单区间覆盖
- ural 1352. Mersenne Primes
- URAL 1969. Hong Kong Tram
- ****ural 1141. RSA Attack(RSA加密,扩展欧几里得算法)
- URAL 1713 Key Substrings 后缀数组
- ural1517之最长公共子串
- ural 1057 Amount of Degrees(数位dp)
- Ural 1068 - Sum
- wrong answer of URAL 1802
- ural1238. Folding(记忆化)
- URAL 1742 Team building 强联通
- Ural 1557 Network Attack