1697⑨ to write.

Source: Internet
Author: User

 time limit: 1 sspace limit: 128000 KBtitle level: Golden Gold SolvingView Run Results  Title Description Description

Qi Cirno (Ice Goblin) has the ability to control the air-conditioning. It is more dangerous to freeze a small thing in an instant than a normal goblin. had been releasing the air-conditioner around her always very cold.

Due to the following three points reason ...

    • Qi Cirno's Fuca symbol "Icicle Fall"-easy of the bomb screen is enough stupid, as long as standing in front of her there is no play will touch you;
    • Zun in "Red Devil Township" introduced her when she said she was a bit stupid;
    • In the Zun release "Oriental Phantasmagoria Tomb" Introduction map, in the picture put the Qi Lulu in the position of ⑨, and with "⑨ idiot" simple take, from "⑨" and "idiot" became her alias ...

So Kiki Cirno got the nickname of "idiot".

One day, Kiki Cirno again 2 ...

She wrote n letters to be loaded into N envelopes, but all were wrong ... Now you want to know how many kinds of possibilities are wrong.

Enter a description input Description

Number of letters and envelopes N.

outputs description output Description

The number of possibilities to mount the error.

sample input to sample

Input Example 1

2

Input Example 2

4

Sample output Sample outputs

Output Example 1

1

Output Example 2

9

data size & Hint

1≤n≤100

Code: (This problem applies the high-precision added to the equation solution, the code does not increase the precision operation)

#include <iostream>
#include <cstdio>
#include <cstring>
using namespace Std;
int n,f[110];
int dp (int i)
{
if (i==1) return f[1];
if (i==2) return f[2];
else return f[i]= (i-1) * (DP (I-1) +DP (i-2));
}
int main ()
{
scanf ("%d", &n);
F[1]=0;f[2]=1;
printf ("%d", DP (n));
return 0;
}

1697⑨ to write.

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.