結果
問題 |
No.2383 Naphthol
|
ユーザー |
👑 |
提出日時 | 2023-07-15 00:13:13 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 251 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 76,160 KB |
最終ジャッジ日時 | 2024-09-16 09:12:29 |
合計ジャッジ時間 | 3,614 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 13 |
ソースコード
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) print((a+b+c+d+e)*pow(4,-1,P)%P)