結果

問題 No.2033 Chromatic Duel
ユーザー とりゐとりゐ
提出日時 2022-07-21 21:51:04
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 608 bytes
コンパイル時間 415 ms
コンパイル使用メモリ 86,952 KB
実行使用メモリ 89,760 KB
最終ジャッジ日時 2023-09-29 22:19:05
合計ジャッジ時間 5,976 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
83,092 KB
testcase_01 AC 96 ms
82,920 KB
testcase_02 AC 88 ms
82,772 KB
testcase_03 AC 85 ms
83,060 KB
testcase_04 AC 83 ms
83,092 KB
testcase_05 AC 114 ms
89,596 KB
testcase_06 AC 110 ms
87,580 KB
testcase_07 AC 105 ms
84,924 KB
testcase_08 AC 99 ms
83,448 KB
testcase_09 AC 87 ms
83,108 KB
testcase_10 AC 99 ms
83,860 KB
testcase_11 AC 87 ms
82,916 KB
testcase_12 AC 103 ms
85,508 KB
testcase_13 AC 108 ms
85,976 KB
testcase_14 AC 109 ms
85,932 KB
testcase_15 AC 112 ms
87,932 KB
testcase_16 AC 88 ms
82,956 KB
testcase_17 AC 86 ms
82,732 KB
testcase_18 AC 89 ms
82,728 KB
testcase_19 AC 85 ms
82,772 KB
testcase_20 AC 84 ms
82,732 KB
testcase_21 AC 115 ms
87,932 KB
testcase_22 AC 115 ms
87,664 KB
testcase_23 AC 90 ms
82,732 KB
testcase_24 AC 87 ms
82,964 KB
testcase_25 AC 115 ms
88,620 KB
testcase_26 AC 90 ms
83,108 KB
testcase_27 AC 90 ms
82,772 KB
testcase_28 AC 85 ms
82,812 KB
testcase_29 AC 91 ms
83,024 KB
testcase_30 AC 90 ms
82,996 KB
testcase_31 AC 108 ms
84,860 KB
testcase_32 AC 87 ms
82,748 KB
testcase_33 AC 115 ms
87,388 KB
testcase_34 AC 114 ms
89,760 KB
testcase_35 AC 100 ms
83,672 KB
testcase_36 AC 91 ms
83,044 KB
testcase_37 AC 91 ms
82,760 KB
testcase_38 AC 90 ms
83,096 KB
testcase_39 AC 90 ms
82,752 KB
testcase_40 AC 94 ms
83,056 KB
権限があれば一括ダウンロードができます

ソースコード

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:
    if n==k==-1:
      return 1
    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