Bzoj 1197 HNOI2006 Flower Fairy's magic recursion

Source: Internet
Author: User

The main idea: to find the n-dimensional space of M ball can be divided into how many areas of space

The VFK: http://vfleaking.blog.163.com/blog/static/174807634201321193348312/

See for yourself ....

I'm still in the tangle of 0-dimensional space to put in a 0-dimensional ball after the space will be divided into several ....

#include <cstdio> #include <cstring> #include <iostream> #include <algorithm>using namespace Std;long Long f[20][110];int m,n;int main () {int i,j;cin>>m>>n;f[0][0]=1;for (j=1;j<=m;j++) f[0][j]=2; for (i=1;i<=n;i++) {f[i][0]=1;for (j=1;j<=m;j++) f[i][j]=f[i][j-1]+f[i-1][j-1];} Cout<<f[n][m]<<endl;return 0;}


Bzoj 1197 HNOI2006 Flower Fairy's magic recursion

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.