Language: C++

#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>/*toupperとかが入っている*/
#include<vector>/*可変長配列vectorのインクルード*/
using namespace std;/*標準名前空間を利用する。cinやcoutはこれによって利用可能になる*/

std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

int N,A,B,C;

int main(void) {
  cin >> N >> A >> B >> C;

/*AがN回勝つとする*/
  double sumA=N;
  sumA=sumA+(B/A)*N+(C/A)*N;
  
/*BがN回勝つとする*/
  double sumB=N;
  sumB=sumB+(A/B)*N+(C/B)*N;
  
/*Aが先に勝つ確率を求める*/  
  double winA;
  for(int k=N; k<=2*N; k++){
    winA = winA  + comb(k,N) * pow((A/abs(A-B)),N) * pow(B/abs(A-B)),k-N) * (A/abs(A-B));
  }

  cout << winA * sumA + (1-winA) * sumB << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:30: error: no match for 'operator*' (operand types are 'std::vector<std::vector<long long int> >' and '__gnu_cxx::__promote<double>::__type' {aka 'double'})
   38 |     winA = winA  + comb(k,N) * pow((A/abs(A-B)),N) * pow(B/abs(A-B)),k-N) * (A/abs(A-B));
      |                    ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
      |                        |          |
      |                        |          __gnu_cxx::__promote<double>::__type {aka double}
      |                        std::vector<std::vector<long long int> >
a.cc:38:57: error: no matching function for call to 'pow(int)'
   38 |     winA = winA  + comb(k,N) * pow((A/abs(A-B)),N) * pow(B/abs(A-B)),k-N) * (A/abs(A-B));
      |                                                      ~~~^~~~~~~~~~~~
In file included from a.cc:3:
/usr/include/c++/14/cmath:1074:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::pow(_Tp, _Up)'
 1074 |     pow(_Tp __x, _Up __y)
      |     ^~~
/usr/include/c++/14/cmath:1074:5: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/iostream:38,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: candidate: 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:380:3: note: candidate: 'constexpr long double std::pow(long double, long double)'
  380 |   pow(long double __x, long double __y)
      |   ^~~
/usr/include/c++/14/cmath:380:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:376:3: note: candidate: 'constexpr float std::pow(float, float)'
  376 |   pow(float __x, float __y)
      |   ^~~
/usr/include/c++/14/cmath:376:3: note:   candidate expects 2 arguments, 1 provided