Language: C++

/* ***********************************************
author        :dasinlsb
created time  :2018/6/3 20:45:40
file name     :c:\dasin\duipai.cpp
************************************************ */

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
const int n=300005;
const int mod= 998244353;
int n,a,b,fac[n],inv[n];
ll kk;
int c(int x,int y){
  //printf("c %d %d : %d %d %d,%d \n",x,y,fac[x],inv[y],inv[x-y],(ll)fac[x]*inv[x-y]%mod);
  return (ll)fac[x]*inv[y]%mod*inv[x-y]%mod;
}
int main(){
 // freopen("c:/dasin/aa.in","r",stdin);
  //freopen("c:/dasin/mine.out","w",stdout);
  int i,j;
  cin>>n>>a>>b>>kk;
  for(fac[0]=i=1;i<=n;++i)fac[i]=(ll)fac[i-1]*i%mod;
  for(inv[0]=inv[1]=1,i=2;i<=n;++i)inv[i]=mod-(ll)mod/i*inv[mod%i]%mod;
  for(i=1;i<=n;++i)inv[i]=(ll)inv[i]*inv[i-1]%mod;
  int ans=0;
  for(i=0;i<=n;++i){
    if((kk-a*i)%b)continue;
    ll bs=(kk-a*i)/b;
    if(bs>n)continue;
    //printf("pro %d %d\n",i,bs);
    ans=(ans+(ll)c(n,i)*c(n,bs))%mod;
  }
  printf("%d\n",ans);
  return 0;

}


Compiler output:
a.cc:15:5: error: conflicting declaration 'int n'
   15 | int n,a,b,fac[n],inv[n];
      |     ^
a.cc:13:11: note: previous declaration as 'const int n'
   13 | const int n=300005;
      |           ^
a.cc: In function 'int main()':
a.cc:25:6: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'const int')
   25 |   cin>>n>>a>>b>>kk;
      |   ~~~^~~
      |   |    |
      |   |    const int
      |   std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:7:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  170 |       operator>>(bool& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:170:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
  174 |       operator>>(short& __n);
      |       ^~~~~~~~
/usr/include/c++/14/istream:174:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: warning: overflow in conversion from 'int' to 'short int' changes value from '300005' to '-27675' [-Woverflow]
   25 |   cin>>n>>a>>b>>kk;
      |        ^
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'int'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  177 |       operator>>(unsigned short& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:177:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: warning: unsigned conversion from 'int' to 'short unsigned int' changes value from '300005' to '37861' [-Woverflow]
   25 |   cin>>n>>a>>b>>kk;
      |        ^
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'int'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  184 |       operator>>(unsigned int& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:184:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  188 |       operator>>(long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:188:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  192 |       operator>>(unsigned long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:192:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  199 |       operator>>(long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:199:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'long long int&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  203 |       operator>>(unsigned long long& __n)
      |       ^~~~~~~~
/usr/include/c++/14/istream:203:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  219 |       operator>>(float& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:219:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  223 |       operator>>(double& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:223:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  227 |       operator>>(long double& __f)
      |       ^~~~~~~~
/usr/include/c++/14/istream:227:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'int'
   25 |   cin>>n>>a>>b>>kk;
      |        ^
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  328 |       operator>>(void*& __p)
      |       ^~~~~~~~
/usr/include/c++/14/istream:328:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: invalid conversion from 'int' to 'void*' [-fpermissive]
   25 |   cin>>n>>a>>b>>kk;
      |        ^
      |        |
      |        int
a.cc:25:8: error: cannot bind rvalue '(void*)((long int)((int)n))' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  122 |       operator>>(__istream_type& (*__pf)(__istream_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:122:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: invalid conversion from 'int' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
   25 |   cin>>n>>a>>b>>kk;
      |        ^
      |        |
      |        int
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' (near match)
  126 |       operator>>(__ios_type& (*__pf)(__ios_type&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:126:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: invalid conversion from 'int' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} [-fpermissive]
   25 |   cin>>n>>a>>b>>kk;
      |        ^
      |        |
      |        int
/usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
  133 |       operator>>(ios_base& (*__pf)(ios_base&))
      |       ^~~~~~~~
/usr/include/c++/14/istream:133:7: note:   conversion of argument 1 would be ill-formed:
a.cc:25:8: error: invalid conversion from 'int' to 'std::ios_base& (*)(std::ios_base&)' [-fpermissive]
   25 |   cin>>n>>a>>b>>kk;
      |        ^