P1595 Envelope problem

Source: Internet
Author: User

Title Description

Someone wrote n letters and n envelopes, and if all the letters were packed in the wrong envelope. Find out how many different situations there are in a wrong envelope for all the letters.

input/output format

Input format:

Number of envelopes N (n<=20)

Output format:

An integer that represents the number of cases.

input/Output sampleInput Sample # #: Copy
2
Output Example # #: Replication
1
Input Example #: Copy
3
Output Example # #: Copy
2
 

Too wasted,,,

So I find water problem brush ...

See this, I know it is the National Day Hui-yan teacher said the wrong row problem

Https://www.cnblogs.com/Mary-Sue/p/9735348.html

Pull down, and you'll see,

is actually the extension of Fibonacci,

Formula:

Just set it on the right,

And then

By,,, what a ghost bug,

Cin,cout,,, not in the library ...

And a long long??? That's impossible,

But it's WA,,,

No way to use unsigned long long,,,

And then you can have a,,,

And think of the last day HGR teacher said that the first problem, precision problem,,

To change a long long to double should be able to get more points,

Seems to be,,,

But changed into a double after 90, and, wondering why WA the last two points,,,

。。。

or the unsigned ...

Dev and Luogu at the same time bug???

...... No words.

Code:

#include <iostream> #include <cstdio> #include <cmath> #include <algorithm> #include < Cstring>using namespace Std;int n;unsigned Long Long f[22];int main () {scanf ("%d", &n), if (n==1) {printf ("0"); return 0;} if (n==2) {printf ("1"); return 0;} f[1]=0;f[2]=1;for (int i=3;i<=n;++i) f[i]= (i-1) * (F[i-1]+f[i-2]);p rintf ("%llu", F[n]); return 0;}

If you're not happy, I'll share it with the handsome fool on the right.

you see, he is so good-looking, so affectionate look at you, you still sad?

Oh, really! The picture stared at him for five seconds to laugh.

Everything's going to be over.

P1595 Envelope problem

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.