結果

問題 No.2033 Chromatic Duel
ユーザー とりゐとりゐ
提出日時 2022-07-21 21:44:37
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 576 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,756 KB
実行使用メモリ 89,952 KB
最終ジャッジ日時 2023-09-29 23:09:09
合計ジャッジ時間 6,793 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 110 ms
83,256 KB
testcase_02 AC 98 ms
82,940 KB
testcase_03 AC 98 ms
82,976 KB
testcase_04 WA -
testcase_05 AC 129 ms
89,736 KB
testcase_06 AC 126 ms
87,448 KB
testcase_07 AC 123 ms
84,928 KB
testcase_08 AC 114 ms
83,608 KB
testcase_09 AC 103 ms
83,104 KB
testcase_10 AC 121 ms
83,760 KB
testcase_11 AC 101 ms
82,972 KB
testcase_12 AC 121 ms
85,628 KB
testcase_13 AC 124 ms
86,000 KB
testcase_14 AC 124 ms
85,908 KB
testcase_15 AC 128 ms
88,224 KB
testcase_16 AC 96 ms
82,976 KB
testcase_17 AC 97 ms
82,892 KB
testcase_18 AC 97 ms
82,956 KB
testcase_19 AC 98 ms
82,984 KB
testcase_20 WA -
testcase_21 AC 127 ms
88,292 KB
testcase_22 WA -
testcase_23 AC 104 ms
83,172 KB
testcase_24 AC 97 ms
83,092 KB
testcase_25 AC 128 ms
88,604 KB
testcase_26 AC 100 ms
83,296 KB
testcase_27 AC 100 ms
83,132 KB
testcase_28 AC 97 ms
83,244 KB
testcase_29 AC 104 ms
83,356 KB
testcase_30 AC 102 ms
83,212 KB
testcase_31 AC 122 ms
84,820 KB
testcase_32 AC 98 ms
83,156 KB
testcase_33 AC 128 ms
87,364 KB
testcase_34 AC 129 ms
89,952 KB
testcase_35 AC 118 ms
83,836 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353
M=(10**5)*3+1 
fac=[1]*M
ninv=[1]*M
finv=[1]*M
for i in range(2,M):
  fac[i]=fac[i-1]*i%mod
  ninv[i]=(-(mod//i)*ninv[mod%i])%mod
  finv[i]=finv[i-1]*ninv[i]%mod

def binom(n,k):
  if n<0 or k<0:
    return 0
  if k>n:
    return 0
  return (fac[n]*finv[k]%mod)*finv[n-k]%mod

N,B,W=map(int,input().split())
ans=0

for t,p,q in [[1,2,0],[2,3,1],[1,4,2]]:
  for c1 in range(B):
    x=B-1-c1
    y=N+1-W-c1-p
    c2=3*x-y
    c3=y-2*x
    if c2<0 or c3<0:
      continue
    ans+=t*binom(B-1,c1)*binom(B-1-c1,c2)%mod*binom(W+c3+q-1,c3+q-1)
    ans%=mod

print(ans)
0