Language: C

#include<stdio.h>
#define MAX 510000;
#define MOD 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++){
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k){
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main(){
	COMinit;
	int N,M;
	scanf("%d",N);
	scanf("%d",M);
	printf("%d",COM(N,2)+COM(M,2));
}


Compiler output:
main.c:2:19: error: expected ']' before ';' token
    2 | #define MAX 510000;
      |                   ^
main.c:5:15: note: in expansion of macro 'MAX'
    5 | long long fac[MAX], finv[MAX], inv[MAX];
      |               ^~~
main.c:5:29: error: expected identifier or '(' before ']' token
    5 | long long fac[MAX], finv[MAX], inv[MAX];
      |                             ^
main.c:5:39: error: expected identifier or '(' before ']' token
    5 | long long fac[MAX], finv[MAX], inv[MAX];
      |                                       ^
main.c: In function 'COMinit':
main.c:9:9: error: 'fac' undeclared (first use in this function)
    9 |         fac[0] = fac[1] = 1;
      |         ^~~
main.c:9:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:9: error: 'finv' undeclared (first use in this function)
   10 |         finv[0] = finv[1] = 1;
      |         ^~~~
main.c:11:9: error: 'inv' undeclared (first use in this function); did you mean 'int'?
   11 |         inv[1] = 1;
      |         ^~~
      |         int
main.c:12:32: error: expected expression before ';' token
   12 |         for (int i = 2; i < MAX; i++){
      |                                ^
main.c:3:23: error: expected ']' before ';' token
    3 | #define MOD 1000000007;
      |                       ^
main.c:14:36: note: in expansion of macro 'MOD'
   14 |                 inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      |                                    ^~~
main.c:3:23: error: expected ')' before ';' token
    3 | #define MOD 1000000007;
      |                       ^
main.c:14:46: note: in expansion of macro 'MOD'
   14 |                 inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      |                                              ^~~
main.c:14:45: note: to match this '('
   14 |                 inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      |                                             ^
main.c: In function 'COM':
main.c:23:16: error: 'fac' undeclared (first use in this function)
   23 |         return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |                ^~~
main.c:23:26: error: 'finv' undeclared (first use in this function)
   23 |         return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |                          ^~~~
main.c:3:23: error: expected ')' before ';' token
    3 | #define MOD 1000000007;
      |                       ^
main.c:23:50: note: in expansion of macro 'MOD'
   23 |         return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |                                                  ^~~
main.c:23:25: note: to match this '('
   23 |         return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
      |                         ^