hiho week 221 register

Ended

Participants:165

Verdict:Accepted
Score:100 / 100
Submitted:2018-09-28 18:28:48

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
There are N buttons on the console. Each button needs to be pushed exactly once.
 Each time you may push several buttons simultaneously.
Assume there are 4 buttons. 
You can first push button 1 and button 3 at one time, 
then push button 2 and button 4 at one time. 
It can be represented as a string "13-24". 
Other pushing way may be "1-2-4-3", "23-14" or "1234". 
Note that "23-41" is the same as "23-14".
Given the number N your task is to find the number of different valid pushing ways.
An integer N. (1 <= N <= 1000)
Output the number of different pushing ways. 
The answer would be very large so you only need to output the answer modulo 1000000007.
3
13
N1000220N^2
DP
 
dp[i][j]ij(j>i0)
ii-1i-1i
jii-1
ijj  
ij-1,jj  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX