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