結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,300 KB
testcase_01 AC 59 ms
71,192 KB
testcase_02 AC 75 ms
76,728 KB
testcase_03 AC 59 ms
71,188 KB
testcase_04 AC 59 ms
71,104 KB
testcase_05 AC 65 ms
71,372 KB
testcase_06 AC 62 ms
71,596 KB
testcase_07 AC 61 ms
71,184 KB
testcase_08 AC 61 ms
71,184 KB
testcase_09 AC 60 ms
71,096 KB
testcase_10 AC 151 ms
76,448 KB
testcase_11 AC 232 ms
76,572 KB
testcase_12 AC 93 ms
76,612 KB
testcase_13 AC 106 ms
76,604 KB
testcase_14 AC 177 ms
76,600 KB
testcase_15 AC 86 ms
76,652 KB
testcase_16 AC 95 ms
76,612 KB
testcase_17 AC 74 ms
76,184 KB
testcase_18 AC 179 ms
76,600 KB
testcase_19 AC 73 ms
76,624 KB
testcase_20 AC 197 ms
76,632 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])*748683265%P)
0