結果

問題 No.1357 Nada junior high school entrance examination 3rd day
ユーザー kozykozy
提出日時 2021-01-17 16:06:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 913 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,588 KB
実行使用メモリ 102,104 KB
最終ジャッジ日時 2024-05-07 05:29:52
合計ジャッジ時間 3,849 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
87,996 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def cmb(n, r,):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 998244353 #出力の制限
N = 10**5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
K=int(input())
L=[0]*(2*K+1)
mod=998244353
ans=1
kaijyo=1
for i in range(1,2*K+1):
    kaijyo*=i
    kaijyo%=mod
ans*=pow(2,2*K-1,mod)
B=list()
B.append(1)
for i in range(1,2*K+1):
    if i%2==1 and i>1:
        B.append(0)
        continue
    a=0
    for j in range(i):
        a+=cmb(i+1,j)*B[j]
        a%=mod
    a*=pow(i+1,mod-2,mod)*-1
    a%=mod
    B.append(a)
ans*=pow(kaijyo,mod-2,mod)
ans%=mod
if K%2==0:
    ans*=-1
L[-1]=ans*B[-1]%mod
print(*L)
0