Blue Bridge Cup fifth annual B-group Li Bai Cider

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.