BZOJ1002[FJOI2007] Rotavirus

Source: Internet
Author: User

BZOJ1002[FJOI2007] Rotavirus

Test instructions

The rule of N-rotavirus is to delete several edges in an n-wheeled base, so that there is a unique information channel between the atoms, for example, a total of 16
The same 3 rotavirus, as shown in

Now given n, calculate how many different N-rotavirus viruses are. n<=100

Exercises

Formula: F[i]=f[i-1]*3-f[i-2]+2,i≥3,f[1]=1,f[2]=5. (I admit I'm a qaq because I don't know anything about matrix-Tree theorem ~

It was high precision, and I dropped it with the Python water ...

Code:

1n=Int (raw_input ())2A=13B=54  forIinchRange (3,n+1):5C=b*3-a+26A=b7b=C8 ifN==1:9     PrintaTen Else: One     PrintB

20160814

BZOJ1002[FJOI2007] Rotavirus

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.