結果

問題 No.2383 Naphthol
ユーザー 👑 p-adicp-adic
提出日時 2023-07-15 00:18:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 265 bytes
コンパイル時間 3,240 ms
コンパイル使用メモリ 86,488 KB
実行使用メモリ 76,912 KB
最終ジャッジ日時 2023-10-14 14:42:12
合計ジャッジ時間 4,816 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,052 KB
testcase_01 AC 73 ms
71,212 KB
testcase_02 AC 116 ms
76,652 KB
testcase_03 AC 71 ms
71,184 KB
testcase_04 AC 71 ms
71,272 KB
testcase_05 AC 70 ms
71,356 KB
testcase_06 AC 71 ms
71,088 KB
testcase_07 AC 71 ms
71,064 KB
testcase_08 AC 71 ms
71,060 KB
testcase_09 AC 73 ms
71,120 KB
testcase_10 AC 204 ms
76,760 KB
testcase_11 AC 328 ms
76,652 KB
testcase_12 AC 129 ms
76,560 KB
testcase_13 AC 145 ms
76,368 KB
testcase_14 AC 248 ms
76,680 KB
testcase_15 AC 111 ms
76,360 KB
testcase_16 AC 125 ms
76,816 KB
testcase_17 AC 93 ms
76,528 KB
testcase_18 AC 246 ms
76,680 KB
testcase_19 AC 97 ms
76,912 KB
testcase_20 AC 274 ms
76,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K=map(int,input().split())
P=998244353
def C(x,y):
	a=1
	for i in range(y):a=(a*(x-i)*pow(i+1,-1,P))%P
	return a
a=C(2*N+4,K)
b=[C(N+2,K//2),0][K%2]
c=max([C(N+2,K//2),[0,C(N+1,K//2)*2][N%2]][K%2],0)
d=b
print([1,1,3,3,3,1,1][K]if N<2 else(a+b+c+d)*pow(4,-1,P)%P)
0