結果

問題 No.2383 Naphthol
ユーザー 👑 p-adicp-adic
提出日時 2023-07-15 00:26:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 240 ms / 2,000 ms
コード長 221 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 87,216 KB
実行使用メモリ 76,908 KB
最終ジャッジ日時 2023-10-14 14:47:49
合計ジャッジ時間 3,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
71,472 KB
testcase_01 AC 59 ms
71,312 KB
testcase_02 AC 81 ms
76,604 KB
testcase_03 AC 58 ms
71,340 KB
testcase_04 AC 59 ms
71,172 KB
testcase_05 AC 62 ms
71,544 KB
testcase_06 AC 62 ms
71,224 KB
testcase_07 AC 62 ms
71,160 KB
testcase_08 AC 58 ms
71,380 KB
testcase_09 AC 61 ms
71,512 KB
testcase_10 AC 155 ms
76,812 KB
testcase_11 AC 240 ms
76,908 KB
testcase_12 AC 96 ms
76,700 KB
testcase_13 AC 105 ms
76,872 KB
testcase_14 AC 180 ms
76,644 KB
testcase_15 AC 85 ms
76,700 KB
testcase_16 AC 96 ms
76,868 KB
testcase_17 AC 72 ms
76,240 KB
testcase_18 AC 174 ms
76,636 KB
testcase_19 AC 74 ms
76,600 KB
testcase_20 AC 195 ms
76,796 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
print([1,1,3,3,3,1,1][K]if N<2 else(C(2*N+4,K)+[C(N+2,K//2)*3,[0,C(N+1,K//2)*2][N%2]][K%2])*pow(4,-1,P)%P)
0