#P8644. [蓝桥杯 2016 国 B] 机器人塔
[蓝桥杯 2016 国 B] 机器人塔
Problem Description
The robot cheerleading team on Planet X has two kinds of uniforms, A and B.
This time, they are performing by building a robot tower.
For example:
A
B B
A B A
A A B B
B B B A B
A B A B B A
The team’s tower-building rules are:
A can only stand on the shoulders of AA or BB.
B can only stand on the shoulders of AB or BA.
Your task is to help the team compute, given the numbers of A and B, how many different tower patterns can be formed.
Input Format
One line with two integers and , separated by a space (, and it is guaranteed that there exists such that ), representing the number of A and the number of B, respectively.
Output Format
Output one integer, indicating the number of different patterns that can be produced.
1 2
3
3 3
4
Hint
Time limit: 1 second, 256 MB. Lanqiao Cup 2016, 7th edition.
Translated by ChatGPT 5