criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <bits/stdc++.h>
using namespace std;
int conbi(int *n,int *k){
  int f=1;
  int g=1;
  if(*k==0) return 1;
  else{
  for(int i=1;i<=*k;i++) f*=i;
  for(int i=0;i<=*k-1;i++) g*=*n-i;
  return g/f;
  }
}
int main(){
  long int n,a,b,k;
  cin>>n>>a>>b>>k;
  long int sum=0;
  long int x,y,z;
  for(x=0;x<=n;x++){
    for(y=0;y<=n-x;y++){
        if((k-a*x-(a+b)*y)%b==0){
          z=(k-a*x-(a+b)*y)/b;
          if(z>=0)
            int p,q;
            p=n-x;
            q=n-x-y;
            sum+=conbi(&n,&x)*conbi(&p,&y)*conbi(&q,&z);
        }
    }
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'p' was not declared in this scope
   24 |             p=n-x;
      |             ^
a.cc:25:13: error: 'q' was not declared in this scope
   25 |             q=n-x-y;
      |             ^
a.cc:26:24: error: cannot convert 'long int*' to 'int*'
   26 |             sum+=conbi(&n,&x)*conbi(&p,&y)*conbi(&q,&z);
      |                        ^~
      |                        |
      |                        long int*
a.cc:3:16: note:   initializing argument 1 of 'int conbi(int*, int*)'
    3 | int conbi(int *n,int *k){
      |           ~~~~~^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int conbi(int *n,int *k){
  int f=1;
  int g=1;
  if(*k==0) return 1;
  else{
  for(int i=1;i<=*k;i++) f*=i;
  for(int i=0;i<=*k-1;i++) g*=*n-i;
  return g/f;
  }
}
int main(){
  long int n,a,b,k;
  cin>>n>>a>>b>>k;
  long int sum=0;
  long int x,y,z;
  for(x=0;x<=n;x++){
    for(y=0;y<=n-x;y++){
        if((k-a*x-(a+b)*y)%b==0){
          z=(k-a*x-(a+b)*y)/b;
          if(z>=0)
            sum+=conbi(&n,&x)*conbi(&n-x,&y)*conbi(&n-x-y,&z);
        }
    }
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: cannot convert 'long int*' to 'int*'
   23 |             sum+=conbi(&n,&x)*conbi(&n-x,&y)*conbi(&n-x-y,&z);
      |                        ^~
      |                        |
      |                        long int*
a.cc:3:16: note:   initializing argument 1 of 'int conbi(int*, int*)'
    3 | int conbi(int *n,int *k){
      |           ~~~~~^
a.cc:23:39: error: cannot convert 'long int*' to 'int*'
   23 |             sum+=conbi(&n,&x)*conbi(&n-x,&y)*conbi(&n-x-y,&z);
      |                                     ~~^~
      |                                       |
      |                                       long int*
a.cc:3:16: note:   initializing argument 1 of 'int conbi(int*, int*)'
    3 | int conbi(int *n,int *k){
      |           ~~~~~^
a.cc:23:56: error: cannot convert 'long int*' to 'int*'
   23 |             sum+=conbi(&n,&x)*conbi(&n-x,&y)*conbi(&n-x-y,&z);
      |                                                    ~~~~^~
      |                                                        |
      |                                                        long int*
a.cc:3:16: note:   initializing argument 1 of 'int conbi(int*, int*)'
    3 | int conbi(int *n,int *k){
      |           ~~~~~^
Language: C++

#include <cstdio>

#define BlueCat "rp++"
#define AtCoder "rp++"
#define R register
#define Maxn 300010
#deifne min(a,b) ( a < b ? a : b )
#define Maxa min(n,x/a)
#define Maxb min(n,x/b)
#define Mod 998244353ll

typedef long long LL;
LL fac[Maxn] , inv[Maxn];	/* fac : 阶乘 , inv : 逆元 */

inline LL Qpow(LL x , LL y) {
	R LL ret = 1;
	for(; y; y>>=1) {
		if(y&1)	ret = ret * x % Mod;
		x = x * x % Mod;
	}
	return ret;
}

inline LL C(LL n , LL m) {
	return fac[n] % Mod * inv[m] % Mod * inv[n-m] % Mod;
}

int main() {
	
	//freopen( "color.in" , "r" , stdin );
	//freopen( "color.out" , "w" , stdout );
	
	inv[0] = fac[0] = 1ll;
	for(R int i=1; i<=Maxn; i++)
		fac[i] = fac[i-1] * (LL)i % Mod;
	inv[Maxn] = Qpow(fac[Maxn],Mod-2);
	for(R int i=Maxn-1; i>=1; i--)
		inv[i] = inv[i+1] * LL(i+1) % Mod;
		
	R LL n,a,b,x;
	
	scanf("%lld%lld%lld%lld",&n,&a,&b,&x);
	
	R LL ans = 0;
	for(R LL i=0; i<=Maxa; i++) {
		R LL j = x - a * i;
		if(j % b)	continue;
		j /= b;
		if(j > Maxb)	continue;
		ans = ( ans + C(n,i) * C(n,j) % Mod ) % Mod;
	}
	
	printf("%lld\n",ans);
	
	return 0;
	
}

Compiler output:
a.cc:7:2: error: invalid preprocessing directive #deifne; did you mean #define?
    7 | #deifne min(a,b) ( a < b ? a : b )
      |  ^~~~~~
      |  define
a.cc: In function 'LL Qpow(LL, LL)':
a.cc:16:14: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         R LL ret = 1;
      |              ^~~
a.cc: In function 'int main()':
a.cc:34:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   34 |         for(R int i=1; i<=Maxn; i++)
      |                   ^
a.cc:37:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |         for(R int i=Maxn-1; i>=1; i--)
      |                   ^
a.cc:40:14: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |         R LL n,a,b,x;
      |              ^
a.cc:40:16: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |         R LL n,a,b,x;
      |                ^
a.cc:40:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |         R LL n,a,b,x;
      |                  ^
a.cc:40:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   40 |         R LL n,a,b,x;
      |                    ^
a.cc:44:14: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   44 |         R LL ans = 0;
      |              ^~~
a.cc:45:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   45 |         for(R LL i=0; i<=Maxa; i++) {
      |                  ^
a.cc:8:14: error: 'min' was not declared in this scope; did you mean 'main'?
    8 | #define Maxa min(n,x/a)
      |              ^~~
a.cc:45:26: note: in expansion of macro 'Maxa'
   45 |         for(R LL i=0; i<=Maxa; i++) {
      |                          ^~~~
a.cc:46:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   46 |                 R LL j = x - a * i;
      |                      ^
Language: C++

#include <iostream>
#define mod 998244353

using namespace std;

long long fact[300009], inv[300009];

long long modpow(long long a, long long b, long long m)
{
	long long p=1, q=a;
	for (int i=0; i<30; i++)
    {
		if ((b/(1LL<<i))%2==1) { p*=q; p%=m; }
		q*=q; q%=m;
	}
	return p;
}

long long Div(long long a, long long b, long long p)
{
	return (a*modpow(b, p-2, p))%p;
}

void init(long long p)
{
	fact[0]=1;
	for (int i=1; i<=300000; i++) fact[i]=(1LL*fact[i-1]*i)%p;
	for (int i=0; i<=300000; i++) inv[i]=Div(1, fact[i], p);
}

long long nCrModp (long long n, long long r, long long p)
{
    if (r<0 || r>n) return 0;
    return ((fact[n]*inv[r])%p)*inv[n-r]%p;
}

long long calc (long long n, long long a, long long b)
{
    long long r=nCrModp(n, a, mod)*nCrModp(n, b, mod)%mod;
    return r;
}

int main()
{
    init(p);
    long long n, a, b, k, B, ans=0;
    cin>>n>>a>>b>>k;
    for (int i=0; i<=n; i++)
    {
        if ((k-i*a)%b==0)
        {
            B=(k-i*a)/b;
            if (B<=n) { ans=(ans+calc(n, i, B))%mod; }
        }
    }
    cout<<ans<<'\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:10: error: 'p' was not declared in this scope
   45 |     init(p);
      |          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define forn(i, x, n) for (int i = int(x); i <= int(n); ++i)
#define for1(i, n, x) for (int i = int(n); i >= int(x); --i)
#define x first
#define y second
#define pb push_back

typedef long long ll;
typedef pair <int, int> pii;
typedef long double ld;
typedef vector <ll> vi;

const int N = 2e6 + 1;
const int INF = 1e9 + 9;
const int B = 998244353;

ll pwr(ll a, ll b) {
    ll ans = 1;
    for (; b; b >>= 1, a = a * a % B)
        if (b & 1) ans = ans * a % B;
    return ans;
}

ll f[N], rf[N];

ll c(ll n, ll k) {
    return f[n] * rf[n - k] % B * rf[k] % B;
}

ll gcd(ll &ka, ll a, ll &kb, ll b) {
    if (!b) {
        ka = 1, kb = 0;
        return a;
    }
    ll g = gcd(kb, b, ka, a % b);
    kb -= ka * (a / b);
    assert(ka * a + kb * b == g);
    return g;
}

int main() {
    #ifdef black
    freopen("in", "r", stdin);
    #endif // black
    ios_base :: sync_with_stdio(0);
    cin.tie(0);

    f[0] = 1, rf[0] = 1;
    forn(i, 1, 1e5) {
        f[i] = f[i - 1] * i % B;
        rf[i] = pwr(f[i], B - 2);
    }

    ll n, a, b, k, ka, kb;
    cin >> n >> a >> b >> k;
    ll g = gcd(ka, a, kb, b);
    if (k % g != 0) {
        assert(shit);
        cout << "0\n";
        return 0;
    }
    ka *= k / g, kb *= k / g;
    ll l = a * b / g;
    ll qa = l / a, qb = l / b;
    if (ka < kb)
        swap(a, b), swap(ka, kb), swap(qa, qb);
    if (kb < 0) {
        ll d = (-kb + qb - 1) / qb;
        ka -= qa * d, kb += qb * d;
        if (ka < 0) {
            cout << "0\n";
            return 0;
        }
    }
    if (ka < kb)
        swap(a, b), swap(ka, kb), swap(qa, qb);
    if (ka > n) {
        ll d = ((ka - n) + qa - 1) / qa;
        ka -= qa * d, kb += qb * d;
        if (ka < 0 || kb > n) {
            cout << "0\n";
            return 0;
        }
    }
    if (ka < kb)
        swap(a, b), swap(ka, kb), swap(qa, qb);
    while (ka + qa <= n && kb - qb >= 0) ka += qa, kb -= qb;
    ll ans = 0;
    for (; 0 <= min(ka, kb) && max(ka, kb) <= n; ka -= qa, kb += qb)
        ans = (ans + c(n, ka) * c(n, kb)) % B;
    cout << ans << "\n";

    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
                 from a.cc:1:
a.cc: In function 'int main()':
a.cc:61:16: error: 'shit' was not declared in this scope
   61 |         assert(shit);
      |                ^~~~
Language: C++

using namespace std;

long long mod = 998244353;

long long pow(long long x, long long n) { 
    long long ans = 1;
    while (n > 0) {
    if ((n & 1) == 1) {
        ans = ans * x % mod;
    }
        x = x * x % mod; //一周する度にx, x^2, x^4, x^8となる
        n >>= 1; //桁をずらす n = n >> 1
    }
    return ans;
}




long long combination(long long n, long long r) {
    if (r == 0 ) return 1;
    else{
      if ( r * 2 > n ) r = n - r;
      long long dividend = 1;
      long long divisor_inv  = 1;
      for (long long i = 1; i <= r; ++i ) {
        dividend = (dividend * (n-i+1) )% mod;
        divisor_inv  = ( divisor_inv * pow( i,  (long long) mod - 2) )% mod;
      }
      return dividend * divisor_inv % mod;
    }
}

int main() {
    long long N, A, B, K;
    cin >> N >> A >> B >> K;
    
    long long count = 0;
    for (long long i = 0; i <= N; ++i) {
        if (K- i * A >= 0 && (K- i * A)  % B ==0) {
            long long j = (K- i * A)/B;
            if (j <= N) {
                cout << i << " " << j << " " << combination(N, i)  << " " << combination(N, j) << " " << pow( j,  (int) mod-2)  << endl;
                count +=  combination(N, i)  * combination(N, j) % mod;
            }
        }
    }
    cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'cin' was not declared in this scope
   36 |     cin >> N >> A >> B >> K;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:43:17: error: 'cout' was not declared in this scope
   43 |                 cout << i << " " << j << " " << combination(N, i)  << " " << combination(N, j) << " " << pow( j,  (int) mod-2)  << endl;
      |                 ^~~~
a.cc:43:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:43:132: error: 'endl' was not declared in this scope
   43 |                 cout << i << " " << j << " " << combination(N, i)  << " " << combination(N, j) << " " << pow( j,  (int) mod-2)  << endl;
      |                                                                                                                                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
a.cc:48:5: error: 'cout' was not declared in this scope
   48 |     cout << count << endl;
      |     ^~~~
a.cc:48:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:48:22: error: 'endl' was not declared in this scope
   48 |     cout << count << endl;
      |                      ^~~~
a.cc:48:22: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <cstdint>
#include <algorithm> 

uintmax_t combination(unsigned long long n, unsigned long long r) {
    if (r == 0 ) return 1;
    else{
      if ( r * 2 > n ) r = n - r;
      uintmax_t dividend = 1;
      uintmax_t divisor  = 1;
      for ( unsigned int i = 1; i <= r; ++i ) {
        dividend *= (n-i+1);
        divisor  *= i;
      }
      return dividend / divisor;
    }
}

int main() {
    long long N, A, B, K;
    cin >> N >> A >> B >> K;
    
    int count = 0;
    for (long long i = 0; i <= N; ++i) {
        for (long long j = 0; j <= N - i; ++j){
            for (long long  k = 0; k <= N - i - j; ++k){
                if (i * A + j * (A+B) + k * B == K) {
                    count +=  combination(N, i)  * combination(N-i, j)  * combination(N-i-j, k);
                }
            }
        }
    }
    cout << count % 998244353 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'cin' was not declared in this scope
   20 |     cin >> N >> A >> B >> K;
      |     ^~~
a.cc:32:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   32 |     cout << count % 998244353 << endl;
      |     ^~~~
      |     count
a.cc:32:34: error: 'endl' was not declared in this scope
   32 |     cout << count % 998244353 << endl;
      |                                  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
/*
ll GCD(ll A,ll B){
  return (B==0)?(A):(GCD(B,A%B));
}
ll LCM(ll A,ll B){
  return A/GCD(A,B)*B;
}
*/
ll N,A,B,K;
ll kai[300001];
ll gya[300001];
ll nck[300001];
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
void nCk(ll n,ll mod){
    kai[n]=n;
    ROF(i,1,n){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,n+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,n){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[n]=1;
}
int main(){
	cin>>N>>A>>B>>K;
	nCK(N,mod);
	ll ans=0;
	FOR(i,0,N+1){
		ll a=i;
		ll b=(K-a*A)/B;
		if(K==A*a+B*b&&0<=a&&a<=N&&0<=b&&b<=N){
			(ans+=nck[a]*nck[b])%=mod;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:9: error: 'nCK' was not declared in this scope; did you mean 'nCk'?
   80 |         nCK(N,mod);
      |         ^~~
      |         nCk
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
/*
ll GCD(ll A,ll B){
  return (B==0)?(A):(GCD(B,A%B));
}
ll LCM(ll A,ll B){
  return A/GCD(A,B)*B;
}
*/
ll N,A,B,K;
ll kai[300001];
ll gya[300001];
ll nck[300001];
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
void nCk(ll n,ll mod){
    kai[n]=n;
    ROF(i,1,n){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,n+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,n){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[n]=1;
}
int main(){
	cin>>N>>A>>B>>K;
	nCK(N,mod);
	ll ans=0;
	FOR(i,0,N+1){
		ll a=i;
		ll b=(K-a*A)/B;
		if(K==A*a+B*b&&a<=N&&b<=N){
			(ans+=nck[a]*nck[b])%=mod;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:9: error: 'nCK' was not declared in this scope; did you mean 'nCk'?
   80 |         nCK(N,mod);
      |         ^~~
      |         nCk
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
/*
ll GCD(ll A,ll B){
  return (B==0)?(A):(GCD(B,A%B));
}
ll LCM(ll A,ll B){
  return A/GCD(A,B)*B;
}
*/
ll N,A,B,K;
ll kai[300001];
ll gya[300001];
ll nck[300001];
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
void nCk(ll n,ll mod){
    kai[n]=n;
    ROF(i,1,n){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,n+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,n){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[n]=1;
}
int main(){
	cin>>N>>A>>B>>K;
	nCK(N,mod);
	ll ans=0;
	FOR(i,0,N+1){
		ll a=i;
		ll b=(K-a*A)/B;
		if(K==A*a+B*b){
			(ans+=nck[a]*nck[b])%=mod;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:9: error: 'nCK' was not declared in this scope; did you mean 'nCk'?
   80 |         nCK(N,mod);
      |         ^~~
      |         nCk
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
/*
ll GCD(ll A,ll B){
  return (B==0)?(A):(GCD(B,A%B));
}
ll LCM(ll A,ll B){
  return A/GCD(A,B)*B;
}
*/
ll N,A,B,K;
ll kai[300001];
ll gya[300001];
ll nck[300001];
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
void nCk(ll n,ll mod){
    kai[n]=n;
    ROF(i,1,n){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,n+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,n){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[n]=1;
}
int main(){
	cin>>N>>A>>B>>K;
	nCK(N,mod);
	ll ans=0;
	FOR(i,0,N+1){
		int a=i;
		int b=(K-a*A)/B;
		if(K==A*a+B*b){
			(ans+=nck[a]+nck[b])%=mod;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:9: error: 'nCK' was not declared in this scope; did you mean 'nCk'?
   80 |         nCK(N,mod);
      |         ^~~
      |         nCk
Language: C++

#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353;
long long f[300001];
long long pow(long long a, long long b, long long MOD){
 long long x=1;
 long longy=a; 
 while(b > 0){
 		if(b%2 == 1){
 		x=(x*y);
 		if(x>MOD) x%=MOD;
 	}
 	y = (y*y);
 	if(y>MOD) y%=MOD; 
 	b /= 2;
 	}
 return x;
}
long long InverseEuler(long long n, long long MOD){
 return pow(n,MOD-2,MOD);
}
long long C(long long n, long long r, long long MOD){
 
 return (f[n]*((InverseEuler(f[r], MOD) * InverseEuler(f[n-r], MOD)) % MOD)) % MOD;
}
int main(){
	fact[0]=1;
	for(int i=1;i<=300000;i++){
		f[i]=(f[i-1]*i)%mod;
	}
	long long ans=0,n,a,b,k;
	cin>>n>>a>>b>>k;
	for(int i=0;i<=n;i++){
		if((k-(i*a))%b==0){
			ans=ans+C(n,i,mod)+C(n,(k-(i*a))/b,mod);
			ans%=mod;
		}
	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'long long int pow(long long int, long long int, long long int)':
a.cc:10:22: error: 'y' was not declared in this scope
   10 |                 x=(x*y);
      |                      ^
a.cc:13:9: error: 'y' was not declared in this scope
   13 |         y = (y*y);
      |         ^
a.cc: In function 'int main()':
a.cc:27:9: error: 'fact' was not declared in this scope
   27 |         fact[0]=1;
      |         ^~~~
Language: C

#include<cstdio>
long long Mod=998244353;
long long n,a,b,k;
long long Ans;
long long frc[300001]={1,1},inv[300001]={1,1};
long long C(int x,int y){
	return frc[x]*inv[y]%Mod*inv[x-y]%Mod;
}
int main(){
	scanf("%lld%lld%lld%lld",&n,&a,&b,&k);
	for(int i=2;i<=n;++i) frc[i]=frc[i-1]*i%Mod;
	for(int i=2;i<=n;++i) inv[i]=(Mod-Mod/i)*inv[Mod%i]%Mod;
	for(int i=2;i<=n;++i) inv[i]=inv[i-1]*inv[i]%Mod;
	for(int i=0;i<=n&&i*a<=k;++i){
		if((k-i*a)%b) continue;
		int j=(k-i*a)/b;
		if(j>n) continue;
		Ans=(Ans+C(n,i)*C(n,j))%Mod;
	} printf("%lld",Ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

vector<long int> DP(300001,1);
vector<long int> memonckmodp(300001,0);
vector<long int> memoexpbkp(300001,0);
bool flag = 0;

long int expbkp(long int b,long int k,long int p){
  if(memoexpbkp[b])return memoexpbkp[b];
  qb = b;
  b = DP[b];
  vector<long int> modp(1,b % p);
  long int q = b % p,ans = 1;
  for(long int i = 1;pow(2,i) <= k;i++){
    q = (q*q)%p;
    modp.push_back(q);
  }
  for(long int i = 0;pow(2,i) <= k;i++){
    q = pow(2,i);
    if(k & q)ans = (ans * modp[i])%p;
  }
  memoexpbkp[q] = ans;
  return ans;
}

long int nckmodp(long int n,long int k,long int p){
  if(memonckmodp[k] )return memonckmodp[k];
  long int ans = (((DP[n] * expbkp(k,p-2,p))%p) * expbkp(n-k,p-2,p))%p;
  memonckmodp[k] = ans;
  memonckmodp[n-k] = ans;
  return ans;
}

long int G(long int A,long int B){
  long int ans = 1,i = 2;
  while(i <= A && i <= B){
    while(1){
      if(A%i == 0 && B%i == 0 && i <= A && i <= B){
        A /= i;
        B /= i;
        ans *= i;
      }
      else break;
    }
    i++;
  }
  return ans;
}

vector<long int> first(long int N,long int A,long int B,long int K){
  vector<long int> ans;
  for(long int i = 0;i <= N && A * i <= K;i++){
    if((K - A * i)%B == 0 && (K - A * i + B - 1)/B <= N){
      ans.push_back(i);
      ans.push_back((K-A*i)/B);
      return ans;
    }
  }
  flag = 1;
  ans.push_back(0);
  ans.push_back(0);
  return ans;
}

int main() {
  long int N,A,B,K,sum = 0,p = 998244353;
  for(long int i = 1;i <= 300000;i++)DP[i] = (DP[i - 1] * i)%p;
  cin >> N >> A >> B >> K;
  vector<long int> v = first(N,A,B,K);
  long int a = A / G(A,B),b = B / G(A,B),X = v[0],Y = v[1];
  if(flag)cout << 1 << endl;
  else{
    while(X >= 0 && Y >= 0 && X <= N && Y <= N){
      sum = (sum + nckmodp(N,X,p) * nckmodp(N,Y,p))%p;
      X += b;
      Y -= a;
    }
    cout << sum << endl;
  }
}


Compiler output:
a.cc: In function 'long int expbkp(long int, long int, long int)':
a.cc:11:3: error: 'qb' was not declared in this scope; did you mean 'b'?
   11 |   qb = b;
      |   ^~
      |   b
Language: C++

#include <bits/stdc++.h>
using namespace std;

vector<long int> DP(300001,1);
vector<long int> memonckmodp(300001,0);
long int memoncknck[300001][300001] = {};

bool flag = 0;

long int expbkp(long int b,long int k,long int p){
  b = DP[b];
  vector<long int> modp(1,b % p);
  long int q = b % p,ans = 1;
  for(long int i = 1;pow(2,i) <= k;i++){
    q = (q*q)%p;
    modp.push_back(q);
  }
  for(long int i = 0;pow(2,i) <= k;i++){
    q = pow(2,i);
    if(k & q)ans = (ans * modp[i])%p;
  }
  return ans;
}

long int nckmodp(long int n,long int k,long int p){
  if(memonckmodp[k])return memonckmodp[k];
  long int ans = (((DP[n] * expbkp(k,p-2,p))%p) * expbkp(n-k,p-2,p))%p;
  memonckmodp[k] = ans;
  return ans;
}

long int G(long int A,long int B){
  long int ans = 1,i = 2;
  while(i <= A && i <= B){
    while(1){
      if(A%i == 0 && B%i == 0 && i <= A && i <= B){
        A /= i;
        B /= i;
        ans *= i;
      }
      else break;
    }
    i++;
  }
  return ans;
}

vector<long int> first(long int N,long int A,long int B,long int K){
  vector<long int> ans;
  for(long int i = 0;i <= N && A * i <= K;i++){
    if((K - A * i)%B == 0 && (K - A * i + B - 1)/B <= N){
      ans.push_back(i);
      ans.push_back((K-A*i)/B);
      return ans;
    }
  }
  flag = 1;
  ans.push_back(0);
  ans.push_back(0);
  return ans;
}

int main() {
  long int N,A,B,K,sum = 0,p = 998244353;
  for(long int i = 1;i <= 300000;i++)DP[i] = (DP[i - 1] * i)%p;
  cin >> N >> A >> B >> K;
  vector<long int> v = first(N,A,B,K);
  long int a = A / G(A,B),b = B / G(A,B),X = v[0],Y = v[1];
  if(flag)cout << 1 << endl;
  else{
    while(X >= 0 && Y >= 0 && X <= N && Y <= N){
      if(memoncknck[X][Y] == 0){
        long int q = (nckmodp(N,X,p) * nckmodp(N,Y,p))%p;
        memoncknck[X][Y] = q;
        memoncknck[Y][X] = q;
      }
      sum = (sum + memoncknck[X][Y])%p;
      X += b;
      Y -= a;
    }
    cout << sum << endl;
  }
}


Compiler output:
/tmp/ccvzyGF4.o: in function `first(long, long, long, long)':
a.cc:(.text+0x44c): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccvzyGF4.o
/tmp/ccvzyGF4.o: in function `main':
a.cc:(.text+0x619): relocation truncated to fit: R_X86_64_PC32 against symbol `flag' defined in .bss section in /tmp/ccvzyGF4.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>

using namespace std;

const long long mod = 998244353;

typedef long long ll;

ll fact[300001];
ll inv[300001];
int N;

ll pow(ll x,ll n){
    ll ans = 1;
    while (n > 0) {
        if (n & 1) ans = (ans * x) % mod;
        x = (x * x) % mod;
        n >>= 1;
    }
    return ans;
}

void calc_fact(){
    fact[0] = 1;
    for(int i = 1; i <= N; i++){
        fact[i] = (fact[i-1] * i) % mod;
    }
}

void calc_inv(){
    inv[N] = pow(fact[N], mod - 2);
    for(int i = N; i > 0; i--){
        inv[i-1] = (inv[i] * i) % mod;
    }
}

ll comb(int i, int j){
    return (((fact[i] * inv[j]) % mod) * inv[i-j]) % mod;
}

int main(){
    ll a,b,k,ans;
    cin >> N >> a >> b >> k;
    ans = 0;
    calc_fact();
    calc_inv();
    
    for(int i = 0; i <= N; i++){
        ll tmp = k - (a * i);
        if(tmp % b == 0){
            ll j = tmp / b;
            if(0 <= j && j <= N){
ans += (comb(N,i) * comb(N,j)) % mod;

        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:2: error: expected '}' at end of input
   59 | }
      |  ^
a.cc:41:11: note: to match this '{'
   41 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>
#pragma optimize "O3"
#define endl '\n'
const int MAXN=400017;
const int MOD=998244353;
using namespace std;

int n, a, b, fact[MAXN], inv[MAXN];
long long ans, k;

int poww(int a, int p)
{
	if(p==0) return 1;
	int half=poww(a, p/2)
	if(p%2==0) return (half*1ll*half)%MOD;
	return (((half*1ll*half)%MOD)*1ll*a)%MOD;
}
int c(int i, int j)
{
	return ((fact[i]*1ll*inv[j])%MOD*1ll*inv[i-j])%MOD;
}
void mainp()
{
    cin>>n>>a>>b>>k;
    fact[0]=1;
    for(int i=1; i<=n; i++) fact[i]=(fact[i-1]*1ll*i)%MOD;
    for(int i=0; i<=n; i++) inv[i]=poww(fact[i], MOD-2);
    
    for(int i=0; i<=n; i++)
    {
		long long aa=i, bb=(k-aa*1ll*a)/B;
		if(bb<0||aa*1ll*a+bb*1ll*b!=k||aa+bb>n) continue;
		ans+=c(n, a)*1ll*c(n, b);
		ans%=MOD;
	}
	cout<<ans<<endl;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    mainp();
    return 0;
}


Compiler output:
a.cc: In function 'int poww(int, int)':
a.cc:15:9: error: expected ',' or ';' before 'if'
   15 |         if(p%2==0) return (half*1ll*half)%MOD;
      |         ^~
a.cc: In function 'void mainp()':
a.cc:31:49: error: 'B' was not declared in this scope
   31 |                 long long aa=i, bb=(k-aa*1ll*a)/B;
      |                                                 ^
Language: C++

#include <iostream>
using namespace std;

typedef long long ll;

ll inf = 998244353;
ll func[300010] = {0};
ll inv[300010] = {0};

ll mult(ll n, ll m){
	if(m==1) return n%inf;
	else if(m%2==0){
		ll t = mult(n,m/2);
		return (t*t)%inf;
	}else{
		ll t = mult(n,m-1);
		return (t*n)%inf;
	}
}

void functional(ll N){
	for(ll i=0;i<=N;i++){
		if(i==0){
			func[i] = 1;
			inv[i] = 1;
		}
		else{
			func[i] = (i*func[i-1])%inf;
			inv[i] = mult(func[i],inf-2);
		}
	}
}

ll comb(ll n,ll k){
	if(k==0 || n==k) return 1;
	else return (((func[n]*inv[k])%inf)*inv[n-k])%inf;
}

ll N,A,B,K;
int main(){
	cin >> N >> A >> B >> K;
	functional(N);
	ll ans = 0;
	for(ll i=0;i<=N;i++){
		if((K-i*B)%A==0 && K-i*B>=0){
			ll j = (K-i*B)/A;
			if(j<=N) (ans += (comb(N,i)*comb(N,j))%inf)%inf;
          	ans = ans%inf
		}
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:30: error: expected ';' before '}' token
   48 |                 ans = ans%inf
      |                              ^
      |                              ;
   49 |                 }
      |                 ~
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;
using ll=long long;
using vll=vector<ll>;


#define MOD 998244353


ll mod_pow(ll x, ll n, ll m)
{
	ll ret = 1LL;
	for(;n>0;n>>=1)
	{
		if(n&1) ret=(ret*x)%m;
		x=(x*x)%m;
	}
	return ret;
}


ll mod_inv(ll x, ll m)
{
	return mod_pow(x, m-2, m)%m;
}


int main(void)
{
	int n;
	ll a, b, k;
	vll fact(300000+1);
	vll fact_inv(300000+1);

	{
		fact[0]=fact_inv[0]=1;
		for(int i=1;i<=300000;i++)
		{
			fact[i]=(fact[i-1]*i)%MOD;
			fact_inv[i]=mod_inv(fact[i], MOD);
		}
	}

	while(scanf("%d%lld%lld%lld", &n, &a, &b, &k)==4)
	{
		ll ans=0;
		ll t=1;

		for(ll x=k/a;x>=0;x--)
		{
			ll lans=0;
			ll r=k-a*x;
			if(r%b) continue;

			ll y=r/b;
			if(y>n) break;

			for(ll cn=max(0LL, x+y-n);cn<=x && cn<=y;cn++)
			{
				ll an=x-cn;
				ll bn=y-cn;
				ll dn=n-an-bn-cn;
				lans=fact[n];
				lans=(lans*fact_inv[an])%MOD;
				lans=(lans*fact_inv[bn])%MOD;
				lans=(lans*fact_inv[cn])%MOD;
				lans=(lans*fact_inv[dn])%MOD;
//				printf("an=%lld bn=%lld cn=%lld dn=%lld  lans=%lld\n", an, bn, cn, dn, lans);
				ans=(ans+lans)%MOD;
			}
		}
		printf("%lld\n", ans);
	}

	return 0;
}


Compiler output:
a.cc:6:11: error: 'vector' does not name a type
    6 | using vll=vector<ll>;
      |           ^~~~~~
a.cc: In function 'int main()':
a.cc:34:9: error: 'vll' was not declared in this scope; did you mean 'll'?
   34 |         vll fact(300000+1);
      |         ^~~
      |         ll
a.cc:35:12: error: expected ';' before 'fact_inv'
   35 |         vll fact_inv(300000+1);
      |            ^~~~~~~~~
      |            ;
a.cc:38:17: error: 'fact' was not declared in this scope
   38 |                 fact[0]=fact_inv[0]=1;
      |                 ^~~~
a.cc:38:25: error: 'fact_inv' was not declared in this scope
   38 |                 fact[0]=fact_inv[0]=1;
      |                         ^~~~~~~~
a.cc:65:38: error: 'fact' was not declared in this scope
   65 |                                 lans=fact[n];
      |                                      ^~~~
a.cc:66:44: error: 'fact_inv' was not declared in this scope
   66 |                                 lans=(lans*fact_inv[an])%MOD;
      |                                            ^~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
//
struct poi{
  int X;int Y;int Z;
  bool operator<(const poi&R)const{
    return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
  }
};
//
//
ll N,A,B,K;
ll kai[300001];
ll gya[300001];
ll nCk[300001];
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
void nCk(ll n,ll mod){
    kai[N]=N;
    ROF(i,1,N){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,N+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,N){
        (nCk[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nCk[0]=1;nCk[N]=1;
}
int main(){
  cin>>N>>A>>B>>K;
  nCk(N,mod);
  FOR(i,0,N+1){
    if((K-A*i)%B==0&&(K-A*i)/B>=0&&(K-A*i)/B<=N){
      ans+=nCk[i]*nCk[(K-A*i)/B];
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:60:21: error: 'void nCk(long long int, long long int)' redeclared as different kind of entity
   60 | void nCk(ll n,ll mod){
      |                     ^
a.cc:41:4: note: previous declaration 'long long int nCk [300001]'
   41 | ll nCk[300001];
      |    ^~~
a.cc: In function 'int main()':
a.cc:76:6: error: 'nCk' cannot be used as a function
   76 |   nCk(N,mod);
      |   ~~~^~~~~~~
a.cc:79:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   79 |       ans+=nCk[i]*nCk[(K-A*i)/B];
      |       ^~~
      |       abs
a.cc:82:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   82 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
//
struct poi{
  int X;int Y;int Z;
  bool operator<(const poi&R)const{
    return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
  }
};
//
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
ll kai[300001];
ll gya[300001];
ll nck[300001];
ll N,A,B,K;
void nck(ll n,ll mod){
    kai[N]=N;
    ROF(i,1,N){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,N+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,N){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[N]=1;
}
int main(){
  cin>>N>>A>>B>>K;
  nck(N,mod);
  ll ans=0;
  FOR(i,0,N+1){
    if((K-A*i)%B==0&&(K-A*i)/B>=0&&(K-A*i)/B<=N){
      (ans+=nck[i]*nck[(K-A*i)/B])%=mod;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:59:21: error: 'void nck(long long int, long long int)' redeclared as different kind of entity
   59 | void nck(ll n,ll mod){
      |                     ^
a.cc:57:4: note: previous declaration 'long long int nck [300001]'
   57 | ll nck[300001];
      |    ^~~
a.cc: In function 'int main()':
a.cc:75:6: error: 'nck' cannot be used as a function
   75 |   nck(N,mod);
      |   ~~~^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#define FI first
#define SE second
#define PF push_front
#define PB push_back
#define PPF pop_front
#define PPB pop_back
#define MA make_pair
#define ll long long
#define PA pair<int,int>
#define VE vector<int>
#define VP vector<PA>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
using namespace std;
//
const int INF=1e9+7;
const int mod=998244353;
//
//
struct poi{
  int X;int Y;int Z;
  bool operator<(const poi&R)const{
    return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
  }
};
//
//
ll pow(ll x,ll n,ll mod){
  ll res=1;
  if(n>0){
    res=pow(x,n/2,mod);
    if(n%2==0){
      res=(res*res)%mod;
    }else{
      res=(((res*res)%mod)*x)%mod;
    }
  }
  return res;
}
//
ll inv(ll n,ll mod){
  return pow(n,mod-2,mod);
}
//
ll kai[300001];
ll gya[300001];
ll nck[300001];
void nck(ll n,ll mod){
    kai[N]=N;
    ROF(i,1,N){
      (kai[i]=kai[i+1]*i)%=mod;
    }
    gya[1]=inv(1,mod);
    FOR(i,2,N+1){
        (gya[i]=gya[i-1]*inv(i,mod))%=mod;
    }
    FOR(i,1,N){
        (nck[i]=kai[N+1-i]*gya[i])%=mod;
    }
    nck[0]=1;nck[N]=1;
}
int main(){
  ll N,A,B,K;
  cin>>N>>A>>B>>K;
  nck(N,mod);
  ll ans=0;
  FOR(i,0,N+1){
    if((K-A*i)%B==0&&(K-A*i)/B>=0&&(K-A*i)/B<=N){
      (ans+=nck[i]*nck[(K-A*i)/B])%=mod;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc:58:21: error: 'void nck(long long int, long long int)' redeclared as different kind of entity
   58 | void nck(ll n,ll mod){
      |                     ^
a.cc:57:4: note: previous declaration 'long long int nck [300001]'
   57 | ll nck[300001];
      |    ^~~
a.cc: In function 'void nck(long long int, long long int)':
a.cc:59:9: error: 'N' was not declared in this scope
   59 |     kai[N]=N;
      |         ^
a.cc: In function 'int main()':
a.cc:75:6: error: 'nck' cannot be used as a function
   75 |   nck(N,mod);
      |   ~~~^~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<utility>
using namespace std;
#define N 998244353;

long long int ncr[1000000];
int main(){
    long long int n, a, b;
    long long int k;
    long long int sum = 0;
    pair<long long int, long long int> p;
    vector<pair<long long int, long long int> > v;
    cin >> n >> a >> b >> k;
    if(k == 0){
        cout << 1 << endl;
        return 0;
    }
    if((k-sum)%b == 0 && (k-sum)/b <= n){
        p = make_pair(0, (k-sum)/b);
        v.push_back(p);
    }
    for(long long int i = 0; i < n; i++){
        sum += a;
        if((k-sum)%b == 0 && (k-sum)/b <= n){
            p = make_pair(i+1, (k-sum)/b);
            v.push_back(p);
        }
    }
    long long int sums = 0;
    long long int r = 1;
    ncr[0] = 1;
    for(long long int i = 0; i < n/2; i++){
        ncr[i+1] = (ncr[i]*(n-i))%N;
        for(int j = 0; j < 30; j++){
            if(j == 0){
                r = i+1;
                ncr[i+1] = (ncr[i+1]*r)%N;
                continue;
            }
            r = (r*r)%N;
            if(j != 23 && j != 26){
                ncr[i+1] = (ncr[i+1]*r)%N;
            }
        }
    }
    long long int a1, b1, s1, s2;
    pair<long long int, long long int> p1;
    if(v.size() == 0){
        cout << 1 << endl;
        return 0;
    }
    else{
        long long int si = v.size();
        for(long long int i = 0; i < si; i++){
            p1 = v[v.size()-1];
            a1 = p1.first;
            if(a1 > n/2) a1 = n-a1;
            b1 = p1.second;
            if(b1 > n/2) b1 = n-b1;
            s1 = ncr[a1];
            s2 = ncr[b1];
            sums = (sums + (s1*s2)%N)%N;
            v.pop_back();
            }
        }
    cout << sums << endl;
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected ')' before ';' token
    5 | #define N 998244353;
      |                    ^
a.cc:63:36: note: in expansion of macro 'N'
   63 |             sums = (sums + (s1*s2)%N)%N;
      |                                    ^
a.cc:63:20: note: to match this '('
   63 |             sums = (sums + (s1*s2)%N)%N;
      |                    ^
a.cc:63:37: error: expected primary-expression before ')' token
   63 |             sums = (sums + (s1*s2)%N)%N;
      |                                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(j, n) for (int j = 0; j < (n); j++)

typedef long long ll;

ll combi(ll n,ll r){
  if(n==r)return 1;
  ll t=n*combi(n-1);
  return t;
}


int main()
{
   ll n,a,b,k,x=998244353,ans=0;
   cin>>n>>a>>b>>k;
   rep(i,k/a+1){
     if((k-a)%b!=0)continue;
     ans+=combi(n,a)+combi(n,b);
     ans%=x;
   }
   cout<<ans<<endl;
     
   return 0;
}


Compiler output:
a.cc: In function 'll combi(ll, ll)':
a.cc:10:15: error: too few arguments to function 'll combi(ll, ll)'
   10 |   ll t=n*combi(n-1);
      |          ~~~~~^~~~~
a.cc:8:4: note: declared here
    8 | ll combi(ll n,ll r){
      |    ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define forx(i, a, b) for (int i = (a); i < (b); i++)
#define rep(j, n) for (int j = 0; j < (n); j++)

typedef long long ll;

ll c(ll n,ll r){
  if(n==r)return 1;
  return n*c(n-1);
}


int main()
{
   ll n,a,b,k,x=998244353,ans=0;
   cin>>n>>a>>b>>k;
   rep(i,k/a+1){
     if((k-a)%b!=0)continue;
     ans+=c(n,a)+c(n,b);
   }
   cout<<ans<<endl;
     
   return 0;
}


Compiler output:
a.cc: In function 'll c(ll, ll)':
a.cc:10:13: error: too few arguments to function 'll c(ll, ll)'
   10 |   return n*c(n-1);
      |            ~^~~~~
a.cc:8:4: note: declared here
    8 | ll c(ll n,ll r){
      |    ^
Language: C++

#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 998244353
#define PI 3.1415926525
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------
ll combb[400000];
ll factt[400000];
ll fact(ll x){
  ll res=1;
  while(x>1){
    res*=x;
    res%=MOD;
    x--;
  }
  return res%MOD;
}

ll calc(int a,int b,int p){
  if(b==0){
    return 1;
  }else if(b%2==0){
    ll d=calc(a,b/2,p);
    return (d*d)%p;
  }else if(b%2==1){
    return (a*calc(a,b-1,p))%p;
  }
}

ll comb(int n,int r){
  return (factt[n])*calc(factt[r], MOD-2, MOD)*calc(factt[n-r], MOD-2, MOD))%MOD;
}

void get_fact(ll n){
  factt[0]=1;
  for(int i=1;i<=n;i++){
    factt[i]=(factt[i-1]*i)%MOD;
  }
}

void get_comb(ll n){
  for(int i=0;i<=n;i++){
    combb[i]=comb(n,i);
  }
}

int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  ll n,a,b,k;cin>>n>>a>>b>>k;
  ll cnt=0;
  get_fact(n);
  get_comb(n);
  for(int i=0;i<=n;i++){
    if((k-a*i)%b!=0)continue;
    ll j=(k-a*i)/b;
    if(j<0)continue;
    cnt+=(combb[i]*combb[j])%MOD;
  }

  P(cnt);

  return 0;
}


Compiler output:
a.cc: In function 'long long int comb(int, int)':
a.cc:40:76: error: expected ';' before ')' token
   40 |   return (factt[n])*calc(factt[r], MOD-2, MOD)*calc(factt[n-r], MOD-2, MOD))%MOD;
      |                                                                            ^
      |                                                                            ;
a.cc:40:76: error: expected primary-expression before ')' token
a.cc: In function 'long long int calc(int, int, int)':
a.cc:37:1: warning: control reaches end of non-void function [-Wreturn-type]
   37 | }
      | ^
Language: C++

#include<bits/stdc++.h>

//コピペここから

namespace MMNMM {

// extended Euclidean Algorithm
// ax + by = gcd(a, b)
// return : gcd(a, b)
    template<typename Integer = int_fast64_t>
    constexpr Integer extgcd(Integer a, Integer b, Integer &x, Integer &y) {
        Integer u = 0, v = 1, q = 0, tmp = 0;
        x = v = 1;
        y = u = 0;

        while (b) {
            q = a / b;
            x ^= u ^= x ^= u;
            u = u - q * x;
            y ^= v ^= y ^= v;
            v = v - q * y;
            a ^= b ^= a ^= b;
            b = b - q * a;
        }

        return a;
    }

// mod inverse(設計が変わるかもしれません)
// return : val^(-1) mod MOD
    template<uint_fast64_t MOD, typename Integer = int_fast64_t>
    constexpr Integer modinv(Integer val) {
        int_fast64_t ret = 0, tmp = 0;

        extgcd<int_fast64_t>(static_cast<int_fast64_t>(val), static_cast<int_fast64_t>(MOD), ret, tmp);

        return static_cast<Integer>(ret > 0 ? ret % MOD : (MOD - (-ret % MOD)));
    }

// const expression factorial mod MOD
    template<std::size_t N, std::uint_fast64_t MOD>
    struct Fact {
        std::uint_fast64_t val[N + 1];

        constexpr Fact() : val() {
            val[0] = 1;
            for (std::size_t i = 1; i <= N; ++i) val[i] = val[i - 1] * i % MOD;
        }
    };

// const expression factorial inverse mod MOD
    template<std::size_t N, std::uint_fast64_t MOD, std::uint_fast64_t F>
    struct IFact {
        std::uint_fast64_t val[N + 1];

        constexpr IFact() : val() {
            val[N] = F;
            for (std::size_t i = N; i; --i) val[i - 1] = val[i] * i % MOD;
        }
    };
}

constexpr std::uint_fast64_t MOD = 998244353, maxN = 2887500;

constexpr auto fact = MMNMM::Fact<maxN, MOD>();
constexpr auto ifact = MMNMM::IFact<maxN, MOD, MMNMM::modinv<MOD>(fact.val[maxN])>();

// const expression binomial mod MOD
inline constexpr std::uint_fast64_t binommod(std::uint_fast64_t n, std::uint_fast64_t r){
    if(r < 0 || r > n)return 0;
    return fact.val[n] * (ifact.val[r] * ifact.val[n - r] % MOD) % MOD;
}

inline constexpr std::uint_fast64_t C(std::uint_fast64_t n, std::uint_fast64_t r){
    return binommod(n, r);
}

//コピペここまで(ある部分を使うためにはそれより上を全てコピーしてください)

//verified : AtCoder Grand Contest 025 B - RGB Coloring

long long int N, M, A, B, K, ans;

int main(){
    using namespace std;
    scanf("%lld%lld%lld%lld", &N, &A, &B, &K);
    M = min(N, K / A);
    for(int i = 0; i <= M; ++i){
        if((K - i * A) % B == 0){
            ans += C(N, i) * C(N, (K - i * A) / B);
            ans %= MOD;
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:65:46:   in 'constexpr' expansion of 'MMNMM::Fact<2887500, 998244353>()'
a.cc:47:13: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   47 |             for (std::size_t i = 1; i <= N; ++i) val[i] = val[i - 1] * i % MOD;
      |             ^~~