結果

問題 No.523 LED
ユーザー rpy3cpprpy3cpp
提出日時 2017-06-02 22:40:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 210 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 11,716 KB
実行使用メモリ 10,072 KB
最終ジャッジ日時 2023-10-21 21:09:41
合計ジャッジ時間 2,583 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,072 KB
testcase_01 AC 24 ms
10,072 KB
testcase_02 AC 46 ms
10,072 KB
testcase_03 AC 25 ms
10,072 KB
testcase_04 AC 23 ms
10,072 KB
testcase_05 AC 24 ms
10,072 KB
testcase_06 AC 24 ms
10,072 KB
testcase_07 AC 24 ms
10,072 KB
testcase_08 AC 23 ms
10,072 KB
testcase_09 AC 40 ms
10,072 KB
testcase_10 AC 25 ms
10,072 KB
testcase_11 AC 26 ms
10,072 KB
testcase_12 AC 28 ms
10,072 KB
testcase_13 AC 199 ms
10,072 KB
testcase_14 AC 25 ms
10,072 KB
testcase_15 AC 26 ms
10,072 KB
testcase_16 AC 24 ms
10,072 KB
testcase_17 AC 27 ms
10,072 KB
testcase_18 AC 210 ms
10,072 KB
testcase_19 AC 125 ms
10,072 KB
testcase_20 AC 51 ms
10,072 KB
testcase_21 AC 110 ms
10,072 KB
testcase_22 AC 96 ms
10,072 KB
testcase_23 AC 95 ms
10,072 KB
testcase_24 AC 56 ms
10,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

def solve(N):
    '''
    nCr(2N, 2) * nCr(2N-2, 2) * ....
    2N*(2N-1)*(2N-2)*...*1/(2*2*2*2...)
    (2N)!/(2^N)
    '''
    mod = 10**9 + 7
    d, r = divmod(N, 10**6)
    aa = [1, 975701239, 694465021, 819045129, 390946736, 18892601, 778494515, 729453757, 665093464, 846684919, 260624814]
    a = aa[d]
    for n in range(d*10**6 + 1, N + 1):
        a = (a * n * (2*n - 1)) % mod
    return a

print(solve(N))
0