結果

問題 No.1100 Boxes
ユーザー tikitaka1201tikitaka1201
提出日時 2020-06-28 17:08:50
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 536 bytes
コンパイル時間 302 ms
コンパイル使用メモリ 87,336 KB
実行使用メモリ 89,492 KB
最終ジャッジ日時 2023-09-22 04:30:16
合計ジャッジ時間 11,582 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,372 KB
testcase_01 AC 71 ms
71,036 KB
testcase_02 AC 74 ms
71,160 KB
testcase_03 AC 71 ms
71,488 KB
testcase_04 AC 77 ms
71,528 KB
testcase_05 AC 70 ms
71,376 KB
testcase_06 AC 74 ms
71,472 KB
testcase_07 AC 74 ms
71,404 KB
testcase_08 AC 72 ms
71,192 KB
testcase_09 AC 71 ms
71,504 KB
testcase_10 AC 73 ms
71,400 KB
testcase_11 AC 73 ms
71,224 KB
testcase_12 AC 72 ms
71,268 KB
testcase_13 AC 72 ms
71,360 KB
testcase_14 AC 73 ms
71,040 KB
testcase_15 AC 73 ms
71,500 KB
testcase_16 AC 70 ms
71,468 KB
testcase_17 AC 75 ms
71,508 KB
testcase_18 AC 74 ms
71,228 KB
testcase_19 AC 98 ms
76,284 KB
testcase_20 AC 143 ms
76,976 KB
testcase_21 AC 586 ms
79,756 KB
testcase_22 TLE -
testcase_23 AC 588 ms
79,792 KB
testcase_24 AC 853 ms
80,808 KB
testcase_25 AC 1,119 ms
80,616 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))%mod)
        ans%=mod
    else:
        ans-=tmp*((2**(i-1))%mod)
        ans=(ans+mod)%mod

print(ans)
0