結果
問題 |
No.2383 Naphthol
|
ユーザー |
👑 |
提出日時 | 2023-07-15 00:11:29 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 75,904 KB |
最終ジャッジ日時 | 2024-09-16 09:10:47 |
合計ジャッジ時間 | 3,135 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 WA * 5 |
ソースコード
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)