結果

問題 No.2188 整数列コイントスゲーム
ユーザー lddlinanlddlinan
提出日時 2023-03-16 00:00:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 979 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 85,612 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 12:39:00
合計ジャッジ時間 4,749 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,348 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 1 ms
4,348 KB
testcase_26 AC 1 ms
4,348 KB
testcase_27 AC 2 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 2 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 2 ms
4,348 KB
testcase_36 AC 2 ms
4,348 KB
testcase_37 AC 2 ms
4,348 KB
testcase_38 AC 2 ms
4,348 KB
testcase_39 AC 1 ms
4,348 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <map>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <algorithm>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <string>
using namespace std;

bool rcmp(int a, int b) { return a>b; }
typedef long long LL;



LL ft[32];
LL cc[15][15];
int main() {
    int n, i, j, m;
    scanf("%d %d", &n, &m);
    cc[0][0]=1; for (j=1; j<=n; j++) cc[0][j]=0;
    for (i=1; i<=n; i++) {
        for (j=i+1; j<=n; j++) cc[i][j]=0;
        cc[i][0]=0;
        for (j=1; j<=i; j++) {
            cc[i][j]=j*cc[i-1][j]+cc[i-1][j-1];
        }
        // for (j=1; j<=i; j++) printf("%d:%d => %lld\n", i, j, cc[i][j]);
    }
    ft[0]=1; for (i=1; i<=n; i++) ft[i]=ft[i-1]*i;
    for (i=1; i<=n; i++) {
        for (j=1; j<=i; j++) {
            cc[i][j]*=ft[j];
        }
    }
    if (m>n) printf("0\n");
    else printf("%lld\n", cc[n][m]);
    return 0;
}
0