結果

問題 No.2383 Naphthol
ユーザー 👑 p-adicp-adic
提出日時 2023-07-15 00:11:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 334 ms
コンパイル使用メモリ 86,944 KB
実行使用メモリ 77,216 KB
最終ジャッジ日時 2023-10-14 14:35:06
合計ジャッジ時間 4,746 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,028 KB
testcase_01 AC 80 ms
71,172 KB
testcase_02 AC 111 ms
76,880 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 76 ms
71,132 KB
testcase_09 AC 76 ms
71,096 KB
testcase_10 AC 234 ms
76,776 KB
testcase_11 AC 384 ms
76,796 KB
testcase_12 AC 142 ms
76,760 KB
testcase_13 AC 162 ms
76,624 KB
testcase_14 AC 290 ms
76,600 KB
testcase_15 AC 125 ms
76,784 KB
testcase_16 AC 140 ms
77,040 KB
testcase_17 AC 102 ms
76,532 KB
testcase_18 AC 284 ms
76,772 KB
testcase_19 AC 108 ms
77,216 KB
testcase_20 AC 317 ms
76,788 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
e=max([[C(N//2+1,K//4),[0,C((N+1)//2,K//4)][N%2]][(K%4)//2],0][K%2],0)
i=pow(2,-1,P)
print((e+(b-e)*i+(c-e)*i+(d-e)*i+(a-b-c-d+e*2)*i*i)%P)
0