結果

問題 No.523 LED
ユーザー mitsuomitsuo
提出日時 2017-06-26 10:49:47
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 616 bytes
コンパイル時間 61 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 282,116 KB
最終ジャッジ日時 2024-04-15 01:47:33
合計ジャッジ時間 3,729 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
13,760 KB
testcase_01 AC 13 ms
6,940 KB
testcase_02 AC 58 ms
10,240 KB
testcase_03 AC 12 ms
6,940 KB
testcase_04 AC 14 ms
6,944 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

import math

# solve(2) = 1 * 2 * 3 * 4 / 2 * 2
# solve(3) = 1 * 2 * 3 * 4 * 5 * 6/ 2 * 2 * 2
# solve(4) = 1 * 2 * 3 * 4 * 5 * 6 * 7 * 8 / 2 * 2 * 2 * 2






def solve2(n):
    c = []
    c.append(1)

    for k in xrange(len(c), n + 1):
        #c.append(c[k-1] * k * (k * 2 - 1) % 1000000007)
        c.append( (c[k-1] * (pow(k,2) * 2 - k)) % 1000000007)

    return c[n]


def solve(n):
    t = 1
    for k in xrange(1, n * 2 + 1):
        t *= k
        if k % 2 == 0:
            t /= 2
        t %= 1000000007
    return t

if __name__ == "__main__":
    print solve2(int(raw_input()))
0