結果

問題 No.523 LED
ユーザー realDivineJKrealDivineJK
提出日時 2020-09-20 18:39:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 215 ms / 2,000 ms
コード長 499 bytes
コンパイル時間 1,898 ms
コンパイル使用メモリ 87,020 KB
実行使用メモリ 75,920 KB
最終ジャッジ日時 2023-09-06 16:28:36
合計ジャッジ時間 4,396 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,204 KB
testcase_01 AC 71 ms
71,300 KB
testcase_02 AC 74 ms
75,672 KB
testcase_03 AC 70 ms
71,160 KB
testcase_04 AC 69 ms
71,144 KB
testcase_05 AC 207 ms
75,628 KB
testcase_06 AC 70 ms
71,292 KB
testcase_07 AC 69 ms
71,328 KB
testcase_08 AC 70 ms
71,172 KB
testcase_09 AC 74 ms
75,920 KB
testcase_10 AC 69 ms
71,184 KB
testcase_11 AC 73 ms
75,700 KB
testcase_12 AC 73 ms
75,808 KB
testcase_13 AC 99 ms
75,804 KB
testcase_14 AC 74 ms
75,796 KB
testcase_15 AC 73 ms
75,680 KB
testcase_16 AC 73 ms
75,780 KB
testcase_17 AC 73 ms
75,764 KB
testcase_18 AC 215 ms
75,568 KB
testcase_19 AC 127 ms
75,728 KB
testcase_20 AC 121 ms
75,844 KB
testcase_21 AC 179 ms
75,780 KB
testcase_22 AC 192 ms
75,812 KB
testcase_23 AC 191 ms
75,760 KB
testcase_24 AC 79 ms
75,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 1000000007
def doubling(n, m):
    y = 1
    bas = n
    tmp = m
    while tmp:
        if tmp % 2:
            y *= bas
            y %= mod
        bas *= bas
        bas %= mod
        tmp >>= 1
    return y

def inved(a):
    x, y, u, v, k, l = 1, 0, 0, 1, a, mod
    while l:
        x, y, u, v = u, v, x - u * (k // l), y - v * (k // l)
        k, l = l, k % l
    return x % mod

S = 1
for i in range(2*N):
    S *= i + 1
    S %= mod
print(S*inved(doubling(2, N))%mod)
0