The rain was raining, the wind blew, the code was knocking in the lab
After a year after another to do this problem, still the same God back out;
Title: Li Bai Cider
Say the great poet Li Bai, a good drink in life. Fortunately, he never drives.
One day, he was carrying a flask, out of the house, a flask of wine 2. He sang while walking:
Walk in the street, lift the pot to cider.
Every shop adds one times, meets the flower to drink a fight.
On this road, he met the shop 5 times, met the flowers 10 times, known the last encounter is a flower, he just drank the wine.
Please calculate the order that Li Bai meets the shop and the flower, can take the shop to remember as a, meet the flower to remember as B. Then: BABAABBABBABBBB is a reasonable order. How many are there in the answer like this? Please calculate the number of all possible scenarios (including the topic given).
Note: Submit an answer via the browser. The answer is an integer. Don't write any extra content.
1#include <iostream>2#include <algorithm>3#include <cstdio>4#include <queue>5#include <cmath>6#include <cstring>7 using namespacestd;8 intAns =0;9 voidDfsintTime1,intTime2,intsum)Ten { One if(sum<0|| Time1>5|| Time2>Ten) A return ; - if(time1==5&& time2==Ten&& sum = =1) - { theAns + +; - } -DFS (time1+1, time2,sum*2); -DFS (time1,time2+1, sum-1); + } - intMain () + { A intT,m,n; atDfs0,1,2); -printf"ans =%d", ans); - return 0; -}
Blue Bridge Cup fifth annual B-group Li Bai Cider