結果

問題 No.2058 Binary String
コンテスト
ユーザー ytft
提出日時 2022-09-01 19:58:12
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
TLE  
実行時間 -
コード長 294 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 141 ms
コンパイル使用メモリ 85,248 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2026-05-09 23:23:26
合計ジャッジ時間 4,079 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 TLE * 1
other -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input=lambda:sys.stdin.readline().rstrip()
mod=998244353
N,K=map(int,input().split())
def p(a,b):
	temp=a
	ans=1
	while b>0:
		if b%2:
			ans=(ans*temp)%mod
		b//=2
		temp=(temp*temp)%mod
	return ans
C=1
ans=0
for l in range(N):
	ans=(ans+C*p(l,K))%mod
	C=C*(N-1-l)//(l+1)
print(ans)
0