結果

問題 No.1100 Boxes
ユーザー tikitaka1201tikitaka1201
提出日時 2020-06-28 17:07:40
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 524 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 87,044 KB
実行使用メモリ 89,336 KB
最終ジャッジ日時 2023-09-22 04:27:53
合計ジャッジ時間 12,915 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
75,764 KB
testcase_01 AC 71 ms
71,144 KB
testcase_02 AC 71 ms
71,248 KB
testcase_03 AC 74 ms
71,376 KB
testcase_04 AC 71 ms
71,188 KB
testcase_05 AC 71 ms
71,156 KB
testcase_06 AC 72 ms
71,184 KB
testcase_07 AC 71 ms
71,184 KB
testcase_08 AC 71 ms
71,144 KB
testcase_09 AC 71 ms
71,004 KB
testcase_10 AC 70 ms
71,388 KB
testcase_11 AC 70 ms
71,176 KB
testcase_12 AC 69 ms
71,356 KB
testcase_13 AC 70 ms
71,160 KB
testcase_14 AC 70 ms
71,320 KB
testcase_15 AC 71 ms
71,468 KB
testcase_16 AC 71 ms
71,140 KB
testcase_17 AC 75 ms
71,280 KB
testcase_18 AC 73 ms
71,040 KB
testcase_19 AC 96 ms
76,120 KB
testcase_20 AC 144 ms
77,120 KB
testcase_21 AC 668 ms
79,592 KB
testcase_22 TLE -
testcase_23 AC 665 ms
79,588 KB
testcase_24 AC 981 ms
80,760 KB
testcase_25 AC 1,291 ms
81,032 KB
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k=map(int,input().split())
mod=998244353

framod=[1]
def framod_calc(n, mod, a=1):
    for i in range(1,n+1):
        a=a * i % mod
        framod.append(a)
framod_calc(k+1, mod)
def combmod(n, k, mod):
    a=framod[n]
    b=framod[k]
    c=framod[n-k]
    return (a * pow(b, mod-2, mod) * pow(c, mod-2, mod)) % mod

ans=0

for i in range(1,k+1):
    tmp=combmod(k,i,mod)*pow(k-i,n,mod)
    if i%2==1:
        ans+=tmp*(2**(i-1))
        ans%=mod
    else:
        ans-=tmp*(2**(i-1))
        ans=(ans+mod)%mod

print(ans)
0