hihoCoder Challenge 5 register

Ended

Participants:319

Verdict:Accepted
Submitted:2014-11-09 19:21:51

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
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int n, k;
int perm[500];
bool used[500];
typedef long double ld;
ld comb[500][500];
ld dp[500][500] = { };
int main() {
    int T;
    cin >> T;
    for (int i = 0; i < 500; ++i) {
        for (int j = 0; j <= i; ++j) {
            comb[i][j] =
                    (i == 0 || j == 0) ?
                            1 : (comb[i - 1][j] + comb[i - 1][j - 1]);
        }
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX