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

//Zory-2019
#include<cmath>
#include<ctime>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<stack>
#include<bitset>
#include<vector>
#include<algorithm>
#include<iostream>
#include<deque>
// #include<unordered_map>
using namespace std;
int bin[40],lg[1<<21];
namespace mine
{
	typedef long long ll;
	#define double long double
	const int INF=0x3f3f3f3f;
	const ll LLINF=0x3f3f3f3f3f3f3f3fll;
	ll qread()
	{
		ll ans=0;char c=getchar();int f=1;
		while(c<'0' or c>'9') {if(c=='-') f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num)
	{
		if(num<0) {num=-num;putchar('-');}
		if(num>9) write(num/10);
		putchar('0'+num%10);
	}
	void writeln(int num){write(num);puts("");}
	#define FR first
	#define SE second
	#define MP make_pair
	#define pr pair<int,int>
	#define PB push_back
	#define vc vector
	void chmax(int &x,const int y) {x=x>y?x:y;}
	void chmin(int &x,const int y) {x=x<y?x:y;}
	const int MAX_N=1e5+10;
	const int MOD=1e9+7;
	void add(int &x,int y) {x+=y;if(x>=MOD) x-=MOD;if(x<0) x+=MOD;}

	int a[MAX_N];
	void main()
	{
		int n=qread();for(int i=1;i<=n;i++) a[i]=qread();
		sort(a+1,a+n+1);reverse(a+1,a+n+1);
		for(int x=1;x<=n;x++)
			if(x+1>a[x+1])
			{
				int up=(a[x]-x),right=0;
				while(x+right+1<=n and x<=a[x+right+1]) right++;
				int now;
				if(up==0 and right==0) now=0;
				else if(up==0) now=right&1;
				else if(right==0) now=up&1;
				else now=(up!=0 and right!=0);
				puts(now?"First":"Second");
				break;
			}
	}
};
int main()
{
	srand(time(0));
	bin[0]=1;for(int i=1;i<=30;i++) bin[i]=bin[i-1]<<1;
	lg[1]=0;for(int i=2;i<(1<<21);i++) lg[i]=lg[i>>1]+1;
	mine::main();
}


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

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<cstdio>
#include<climits>
using namespace std;
void File(){
	freopen("AGC02E.in","r",stdin);
	freopen("AGC02E.out","w",stdout);
}
template<typename T>bool chkmax(T &_,T __){return _<__ ? (_=__,1) : 0;}
template<typename T>bool chkmin(T &_,T __){return _>__ ? (_=__,1) : 0;}
#define REP(i,a,b) for(register int i=a;i<=b;++i)
#define DREP(i,a,b) for(register int i=a;i>=b;--i)
#define MREP(i,x) for(register int i=beg[x];i;i=E[i].last)
#define mem(a) memset(a,0,sizeof(a))
#define inf INT_MAX
const int maxn=1e5+10;
int n,a[maxn],SG[1010][1010];
bool in[maxn];
bool cmp(int _,int __){return _>__;}
bool judge(int x,int y){return x>n || y>a[x];}
int get_SG(int x,int y){
	if(judge(x,y))return 1;
	if(judge(x+1,y+1)){
		if(get_SG(x+1,y) && get_SG(x,y+1))
			return 0;
		else return 1;
	}
	return get_SG(x+1,y+1);
}
int main(){
	//File();
	int size = 256 << 20; // 256MB  
    char *p = (char*)malloc(size) + size;  
    __asm__("movl %0, %%esp\n" :: "r"(p));
	scanf("%d",&n);
	REP(i,1,n)scanf("%d",&a[i]);
	sort(a+1,a+n+1,cmp);
	/*REP(i,1,n+1)REP(j,1,a[1]+1)
		SG[i][j]=1;
	REP(i,1,n)REP(j,1,a[i])
		SG[i][j]=0;
	DREP(i,n,1)DREP(j,a[i],1){
		mem(in);
		in[SG[i+1][j]]=1;
		in[SG[i][j+1]]=1;
		REP(k,0,5)if(!in[k]){
			SG[i][j]=k!=0;
			break;
		}
	}
	REP(i,1,n){
		REP(j,1,a[i])cout<<(SG[i][j])<<" ";
		cout<<endl;
	}
	cout<<endl<<endl;
	REP(i,1,n){
		REP(j,1,a[i])cout<<get_SG(i,j)<<" ";
		cout<<endl;
	}*/
	if(get_SG(1,1))puts("First");
	else puts("Second");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   39 |         REP(i,1,n)scanf("%d",&a[i]);
      |             ^
a.cc:14:37: note: in definition of macro 'REP'
   14 | #define REP(i,a,b) for(register int i=a;i<=b;++i)
      |                                     ^
a.cc: Assembler messages:
a.cc:37: Error: operand type mismatch for `mov'
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

long long n, a[(1<<20)];

pair < long long, long long > proj ( long long y, long long x ) {
    long long c = min( x, y );
    return make_pair( y-c, x-c );
}

void printS( long long c ) {
    if ( c%2 ) { cout << "First\n"; }
    else { cout << "Second\n"; }
}

int main () {
    cin >> n;
    for ( long long i = 0 ; i < n ; i ++ ) {
        cin >> a[i];
    }
    sort( a, a+n );
    reverse( a, a+n );

    for ( long long i = 0 ; i < n ; i ++ ) {
        if ( i == n-1 || a[i+1] < a[i] ) {
            pair < long long , long long > c = proj( a[i]-1, i );
            if ( c.first == 0 && c.second == 0 ) { cout << "Second\n"; return 0; }
            if ( c.first == 1 && c.second == 0 ) { cout << "First\n"; return 0; }
            if ( c.first == 0 && c.second == 1 ) { cout << "First\n"; return 0; }
        }
    }

    long long t = -1, r = -1;

    for ( long long i = 0 ; i < n ; i ++ ) {
        if ( i == n-1 || a[i+1] < a[i] ) {
            if ( proj( a[i]-1, i ).first == 0 ) { r = proj( a[i]-1, i ).second; break; }
        }
    }
    for ( long long i = n-1 ; i >= 0 ; i -- ) {
        if ( i == n-1 || a[i+1] < a[i] ) {
            if ( proj( a[i]-1, i ).second == 0 ) { t = proj( a[i]-1, i ).first; break; }
        }
    }

    if ( r == -1 ) {
        printS( t );
        return 0;
    }
    if ( t == -1 ) {
        printS( r );
        return 0;
    }

    if ( r%2 == t%2 ) {
        printS( r );
    }else {
        pair < int, int > tx, rx;

        if ( r%2 ) {
            tx.first = t;
            tx.second = r-1;

            rx.first = t-2;
            rx.second = r;
        }else {
            tx.first = t;
            tx.second = r-2;

            rx.first = t-1;
            rx.second = r;
        }

        pair < int, int > tx = proj( tx.first, tx.second );
        pair < int, int > rx = proj( rx.first, rx.second );

        if ( tx.first == 0 && tx.second == 0 ) { cout << "Second\n"; return 0; }
        if ( rx.first == 0 && rx.second == 0 ) { cout << "Second\n"; return 0; }

        //if ( tx.first == 1 && tx.second == 0 ) { cout << "Second\n"; return 0; }
        cout << 12/0 << "\n";
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:27: error: redeclaration of 'std::pair<int, int> tx'
   75 |         pair < int, int > tx = proj( tx.first, tx.second );
      |                           ^~
a.cc:59:27: note: 'std::pair<int, int> tx' previously declared here
   59 |         pair < int, int > tx, rx;
      |                           ^~
a.cc:76:27: error: redeclaration of 'std::pair<int, int> rx'
   76 |         pair < int, int > rx = proj( rx.first, rx.second );
      |                           ^~
a.cc:59:31: note: 'std::pair<int, int> rx' previously declared here
   59 |         pair < int, int > tx, rx;
      |                               ^~
a.cc:82:19: warning: division by zero [-Wdiv-by-zero]
   82 |         cout << 12/0 << "\n";
      |                 ~~^~
Language: C++

#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
int a[100010];
int main()
{
#ifdef DEBUG
	freopen("b.in","r",stdin);
	freopen("b.out","w",stdout);
#endif
	int n;
	int i;
	scanf("%d",&n);
	for(i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+n+1,greater<int>());
	int ans;
	a[0]=a[1];
	for(i=0;i<=n;i++)
		if(a[i+1]<=i)
		{
			ans=(a[i]-i)&1;
			int j=i+1;
			while(j<=n&&a[j]==i)
				j++;
			if((j-i+1)&1)
				ans=1;
			break;
		}
	if(ans)
		printf("First\n");
	else
		printf("Second\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: 'greater' was not declared in this scope
   23 |         sort(a+1,a+n+1,greater<int>());
      |                        ^~~~~~~
a.cc:23:32: error: expected primary-expression before 'int'
   23 |         sort(a+1,a+n+1,greater<int>());
      |                                ^~~
Language: C++

#include <cstdio>
#include <functional>

const int N = 100000;

int n, a[N];

bool win(int x, int y)
{
    while (x + 1 < n && y + 1 < a[x + 1]) {
        x ++, y ++;
    }
    int up = a[x] - y & 1;
    int rt = true;
    while (x + 1 < n && y < a[x + 1]) {
        x ++, rt ^= 1;
    }
    return !(up && rt);
}

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; ++ i) {
        scanf("%d", a + i);
    }
    std::sort(a, a + n, std::greater<int>());
    puts(win(0, 0) ? "First" : "Second");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:10: error: 'sort' is not a member of 'std'
   27 |     std::sort(a, a + n, std::greater<int>());
      |          ^~~~
Language: C++

#include <cstdio>
#include <iostream>
using namespace std;

const int N = 1e5 + 5;

int a[N], n;

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i ++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1, greater <int> ());
  int i, j;
  for (i = 1; i < n && a[i + 1] >= i + 1; i ++);
  if ((a[i] - i) & 1) return !puts("First");
  if (a[i + 1] == i) {
    for (j = i + 1; j < n && a[j + 1] == i; j ++);
    if ((j - i) & 1) return !puts("First");
  }
  puts("Second");
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(a + 1, a + n + 1, greater <int> ());
      |   ^~~~
      |   short
Language: C++

#include<bits/stdc++.h>
using namespace std;
inline char nchar() {
	static const int bufl=1<<20;
	static char buf[bufl],*a,*b;
	return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++;
}
inline int read() {
	int x=0,f=1;
	char c=nchar();
	for (;!isdigit(c);c=nchar()) if (c=='-') f=-1;
	for (;isdigit(c);c=nchar()) x=x*10+c-'0';
	return x*f;
}
const int maxn=1e5+1;
int n,a[maxn],d;
bool get(int x,int y) {
	if (x>n || y>a[x]) return true;
	int p;
	for (int i=1;i<=n;++i) if (a[i]>=y) p=i; else break;
	return (p+a[p]-x-y)&1;
}
int main() {
	generate(a+1,a+(n=read())+1,read);
	sort(a+1,a+n+1,greater<int>());
	for (int i=1;i<=n;++i) if (a[i]>=i) d=i; else break;
	puts(!get(d,d+1) || !get(d+1,d)?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)'
   24 |         generate(a+1,a+(n=read())+1,read);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4345:5: note: candidate: 'template<class _FIter, class _Generator> void std::generate(_FIter, _FIter, _Generator)'
 4345 |     generate(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4345:5: note:   template argument deduction/substitution failed:
a.cc:24:17: note:   couldn't deduce template parameter '_Generator'
   24 |         generate(a+1,a+(n=read())+1,read);
      |         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:200:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Generator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::generate(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Generator)'
  200 | generate(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Generator __g);
      | ^~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:200:1: note:   candidate expects 4 arguments, 3 provided
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int a[100005];
int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
	}
	sort (a + 1, a + 1 + n);
	int ans = 0;
	bool b = 0;
	for (int i = n; i >= 1; i--) {
		if (a[i] == (n - i + 1) {
			ans = i;
			break;
		}
		if (a[i] > (n - i + 1) && a[i - 1] < (n - i)) {
			ans = i;
			b = 1;
		}
	}
	bool sum = 0;
	if (!b) {
		for (int i = ans; ; i--) {
			if (a[i] != (n - ans + 1)) break;
			sum = !sum;
		}
	}
	if (b) {
		for (int i = ans - 1; ; i--) {
			if (a[i] != (n - ans + 1)) break;
			sum = !sum;
		}
		if (sum == 0) {
			sum = (a[ans] - (n - ans + 1) % 2;
		}
	}
	cout << sum ? "First" : "Second";
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: expected ')' before '{' token
   16 |                 if (a[i] == (n - i + 1) {
      |                    ~                   ^~
      |                                        )
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
a.cc:38:58: error: expected ')' before ';' token
   38 |                         sum = (a[ans] - (n - ans + 1) % 2;
      |                               ~                          ^
      |                                                          )
Language: C++

inline bool find(int x,int y)
{
	if(a[x]<=y || a[x-1]<y)
		return 0;
	else if(!find(x-1,y) && !find(x,y+1))
		return 1;
	return 0;
}

int main()
{
	n=read();
	for(int i=1;i<=n;i++)
		a[i]=read();
	sort(a+1,a+n+1);

	int medge=1;
	while(a[n-medge+1]>medge+1)
		medge++;
	if(medge>1)
		medge--;
	printf("%s\n",find(n-medge+1,medge)?"First":"Second");
	return 0;
}


Compiler output:
a.cc: In function 'bool find(int, int)':
a.cc:3:12: error: 'a' was not declared in this scope
    3 |         if(a[x]<=y || a[x-1]<y)
      |            ^
a.cc: In function 'int main()':
a.cc:12:9: error: 'n' was not declared in this scope
   12 |         n=read();
      |         ^
a.cc:12:11: error: 'read' was not declared in this scope
   12 |         n=read();
      |           ^~~~
a.cc:14:17: error: 'a' was not declared in this scope
   14 |                 a[i]=read();
      |                 ^
a.cc:15:14: error: 'a' was not declared in this scope
   15 |         sort(a+1,a+n+1);
      |              ^
a.cc:15:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |         sort(a+1,a+n+1);
      |         ^~~~
      |         short
a.cc:22:9: error: 'printf' was not declared in this scope
   22 |         printf("%s\n",find(n-medge+1,medge)?"First":"Second");
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | inline bool find(int x,int y)
Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <cassert>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
ll n,a[100005];
ll w[100005];
int main(){
	cin >> n;
	for(int i=0;i<n;i++) cin >> a[i];
	sort(a,a+n);
	int x = n-1;
	for(int i=0;i<n-1;i++){
		if(a[n-1-i]-1-i >= 0 && a[n-2-i]-1-(i+1) < 0){
			x = i;
			break;
		}
	}
	for(int i=n-1;i>=0;i--){
		if(i==n-1 || (a[i]!=a[i+1])){
			w[i] = (a[n-1-i]-1+i)%2;
		}
		else{
			w[i] = w[i+1];
		}
	}
	if(x != 0 && abs(a[n-1-(x-1)]-1-(x-1)) == 1 && w[x-1]==1){
		puts("First"); return 0;
	}
	if(a[n-1-x]-1-x == 0){
		puts(w[x]==0?"Second":"First"); return 0;
	}
	if(x != n-1 && abs(a[n-1-(x+1)]-1-(x+1)) == 1 && w[x+1]==1){
		puts("First"); return 0;
	}
	puts(w[x]==0?"Second":"First")
}


Compiler output:
a.cc: In function 'int main()':
a.cc:66:39: error: expected ';' before '}' token
   66 |         puts(w[x]==0?"Second":"First")
      |                                       ^
      |                                       ;
   67 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <deque>
#include <cassert>
#define pb push_back
#define x first
#define y second
#define files(FileName) read(FileName); write(FileName)
#define read(FileName) freopen((FileName + ".in").c_str(), "r", stdin)
#define write(FileName) freopen((FileName + ".out").c_str(), "w", stdout)
using namespace std;
template<typename T1, typename T2>inline void chkmin(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void chkmax(T1 &x, T2 y) { if (x < y) x = y; }

const string FILENAME = "input";
const int MAXN = 1e5 + 5;

typedef pair <int, int> point;

int n;
vector <int> a;

bool border(int X, int Y) {
	//cout << X << ' ' << Y << endl;
	if (X > size()) return true;
	if (a[X] + 1 == Y) return true;
	if (X && Y > a[X])
		return true;
	return false;
}

int main() {
	ios::sync_with_stdio(false);
	srand(time(0));
	//read(FILENAME);
	cin >> n;
	a.resize(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	sort(a.rbegin(), a.rend());
	point s = {0, 0};
	while (!border(s.x + 1, s.y + 1)) {
		++s.x, ++s.y;
	}
	//cout << s.x << ' ' << s.y << endl;
	int d1 = 0, d2 = 0;
	d1 = (a[s.x] - s.y) & 1;
	d2 = 0;
	while (!border(s.x + 1, s.y)) {
		++d2;
		++s.x;
	}
	d2 &= 1;
	if (d1 && d2) {
		cout << "Second" << endl;
	} else {
		cout << "First" << endl;
	}
}

Compiler output:
a.cc: In function 'bool border(int, int)':
a.cc:41:21: error: no matching function for call to 'size()'
   41 |         if (X > size()) return true;
      |                 ~~~~^~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:262:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:272:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
#define forE(i,x) for(int i=head[x];i!=-1;i=ne[i])
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
typedef unsigned u32;
typedef pair<int,int> pin;
#define mk(a,b) make_pair(a,b)
#define lowbit(x) ((x)&(-(x)))
#define sqr(a) ((a)*(a))
#define clr(a) (memset((a),0,sizeof(a)))
#define ls ((x)<<1)
#define rs (((x)<<1)|1)
#define mid (((l)+(r))>>1)
#define pb push_back
#define w1 first
#define w2 second
inline void read(int &x){
	x=0;int f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}inline void read(i64 &x){
	x=0;i64 f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	x*=f;
}
inline void judge(){
	freopen("in.txt","r",stdin);
	freopen("out.txt","w",stdout);
}const int maxn=100005;
int a[maxn],n;
int main(){
	read(n);rep(i,0,n-1)read(a[i]);
	sort(a,a+n,greater<int>);
	int i=0;
	while(i+1<n&&i+1<a[i+1])i++;
	int j=0;
	while(j<n&&i<a[j])j++;
	if((a[i]-i%2==0)||(j-i%2==0)){
		puts("First");
	}else{
		puts("Second");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:32: error: expected primary-expression before ')' token
   38 |         sort(a,a+n,greater<int>);
      |                                ^
Language: C++

#include <iostream>
using namespace std;

const int N = 100005;
int a[N], b[N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a+n); reverse(a, a+n);
  for (int i = 0; i < n; i++) b[min(a[i], n)-1]++;
  for (int i = n-1; i >= 0; i--) b[i] += b[i+1];
  int m = 0;
  while (a[m] > m) ++m;
  // case 1: even & even
  if ((a[m-1]-m)%2 == 0 && (b[m-1]-m)%2 == 0) {
    puts("Second");
    return 0;
  }
  // case 2: else
  puts("First");
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(a, a+n); reverse(a, a+n);
      |   ^~~~
      |   short
a.cc:11:17: error: 'reverse' was not declared in this scope
   11 |   sort(a, a+n); reverse(a, a+n);
      |                 ^~~~~~~
Language: Java

import java.io.*;
import java.util.*;

public class E {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	void solve() throws IOException {
		int n = nextInt();
		int[] a = new int[n];
		Random rng = new Random();
		for (int i = 0; i < n; i++) {
			int j = rng.nextInt(i + 1);
			a[j] = a[i];
			a[i] = nextInt();
		}
		Arrays.sort(a);
		for (int i = 0, j = n - 1; i < j; i++, j--) {
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
		
		int bad = n;
		for (int i = 0; i < n; i++) {
			if (a[i] <= i) {
				bad = i;
				break;
			}
		}
		
		bad--;
		int right = a[bad] - bad - 1;
		int up = 0;
		for (int i = bad + 1; i < n; i++) {
			if (a[i] > bad) {
				up++;
			} else {
				break;
			}
		}
		
		out.println((right | up) % 2 == 0 ? "Second" : "First");
	}

	E() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new E();
	}

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return null;
			}
		}
		return st.nextToken();
	}

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
}

Compiler output:
Main.java:4: error: class E is public, should be declared in a file named E.java
public class E {
       ^
1 error
Language: C++

#include <cstdint>
#include <iostream>
#include <algorithm>
 
typedef int64_t i64;
 
static const auto NMAX = 100001;
 
static int N;
static int L;
static int A[NMAX];
 
int main() {
	std::ios_base::sync_with_stdio(false);
	std::cin >> N;
	for(auto i = 1; i <= N; i++) std::cin >> A[i];
        std::sort(A + 1, A + N + 1);
        std::reverse(A + 1, A + N + 1);
        auto v = 2000000000;
        auto v2 = 0;
        auto lt = 0;
	for(auto i = 1; i <= N; i++) {
                if(i < N && A[i] == A[i + 1]) continue;
                v = std::min(v, std::abs(A[i] - i));
                if(lt == A[i] && ( v % 2 == 1 || v2 % 2 == 1) {
               	    std::cout << "First" << std::endl;
                    return 0;
                }  
               v2 = v;
                lt = i;
	}
        if(v % 2 == 0) 
	    std::cout << "Second" << std::endl;
        else
	    std::cout << "First" << std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:62: error: expected ';' before '{' token
   25 |                 if(lt == A[i] && ( v % 2 == 1 || v2 % 2 == 1) {
      |                                                              ^~
      |                                                              ;
a.cc:29:22: error: expected ')' before ';' token
   29 |                v2 = v;
      |                      ^
      |                      )
a.cc:25:19: note: to match this '('
   25 |                 if(lt == A[i] && ( v % 2 == 1 || v2 % 2 == 1) {
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int A[101010];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) cin>>A[i];
	sort(A,A+N);
	reverse(A,A+N);
	
	FOR(i,N) if((A[i]<=i+1 || A[i+1]<=i+1) {
		y=i;
		while(A[y]>i) y++;
		
		if((A[i]-i)%2 && (y-i)%2) return _P("Second\n");
		return _P("First\n");
	}
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:26:47: error: expected ')' before '{' token
   26 |         FOR(i,N) if((A[i]<=i+1 || A[i+1]<=i+1) {
      |                    ~                          ^~
      |                                               )
a.cc:34:1: error: expected primary-expression before '}' token
   34 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define mod 1000000007
long long f[2005][2005],ny[4000005],s[4000005],t[4000005];
long long f(long long n,long long m)
{
	return s[n]*t[m]%mod*t[n-m]%mod;
}
int main()
{
	long long n,k,i,j;
	cin>>n>>k;
	if(k==1)
	{
		puts("1");
		return 0;
	}
	ny[1]=1;
	for(i=2;i<=4000000;i++)
	{
		ny[i]=(mod-mod/i)*ny[mod%i]%mod;
	}
	s[0]=1,t[0]=1;
	for(i=1;i<=4000000;i++)
	{
		s[i]=s[i-1]*i%mod;
		t[i]=t[i-1]*ny[i]%mod;
	}
	for(i=0;i<=n;i++)
		f[i][0]=1;
	for(i=1;i<=n;i++)
	{
		for(j=0;j<=i;j++)
		{
			f[i][j]=f[i-1][j]+f[i][j-1]*(n-j+1)%mod*f(n*k-i-1-(j-1)*(k-1),k-2)%mod;
			f[i][j]%=mod;
		}
	}
	cout<<f[n][n]%mod<<endl;
	return 0;

}

Compiler output:
a.cc:5:36: error: 'long long int f(long long int, long long int)' redeclared as different kind of entity
    5 | long long f(long long n,long long m)
      |                                    ^
a.cc:4:11: note: previous declaration 'long long int f [2005][2005]'
    4 | long long f[2005][2005],ny[4000005],s[4000005],t[4000005];
      |           ^
a.cc: In function 'int main()':
a.cc:35:66: error: 'f' cannot be used as a function
   35 |                         f[i][j]=f[i-1][j]+f[i][j-1]*(n-j+1)%mod*f(n*k-i-1-(j-1)*(k-1),k-2)%mod;
      |                                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C

#include<cstdio>
#define C(x,y) (fct[x]*ifct[y]%TT*ifct[(x)-(y)]%TT)
using namespace std;
const int maxn=2005,TT=1e9+7;
int n,K,m,F[maxn][maxn];
long long fct[maxn*maxn],ifct[maxn*maxn];
inline int read(){
	int ret=0;bool f=0;char ch=getchar();
	while(ch>'9'||ch<'0') f^=ch=='-',ch=getchar();
	while(ch<='9'&&ch>='0') ret=ret*10+ch-'0',ch=getchar();
	return f?-ret:ret;
}
inline long long pow(int x,int y){
	long long ret=1,w=x;
	while(1){
		if(y&1) ret=ret*w%TT;
		if(!(y>>=1)) return ret;
		w=w*w%TT;
	}
}
inline void add(int&x,int y){if((x+=y)>=TT) x-=TT;}
int main(){
	n=read(),K=read();m=n*K;
	if(K==1) return puts("1")&0;
	for (int i=fct[0]=1;i<=m;i++) fct[i]=fct[i-1]*i%TT;
	ifct[m]=pow(fct[m],TT-2);
	for (int i=m;i;i--) ifct[i-1]=ifct[i]*i%TT;
	F[0][0]=1;
	for (int i=1;i<=n;i++)
	for (int j=0;j<=i;j++){
		if(j<i) add(F[i][j],F[i-1][j]);
		if(j) add(F[i][j],C(m-i-(j-1)*(K-1)-1,K-2)*F[i][j-1]%TT);
	}
	printf("%lld\n",fct[n]*F[n][n]%TT);
	return 0;
}

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

/*
设f[i][j]表示当前有i个白球，一共放完了j种球
显然有j <= i
* 放白球 从f[i-1][j]转移
* 放没有出现过的球 (n - j + 1) * f[i][j - 1] * C(k - 2, n * k - i - (j - 1) * (k - 1) - 1)
*/
#include <bits/stdc++.h>
using namespace std;

typedef long long int;

const int N = 2020;
const int mod = 1e9 + 7;

int inv[N * N], fac[N * N];
int f[N][N];
int n, k;

int power(int a, int b) {
	a %= mod; int ans = 1;
	while(b) {
		if(b & 1) ans = 1ll * ans * a % mod;
		a = 1ll * a * a % mod; b >>= 1;
	}
	return ans;
}

int C(int n, int m) {
	return 1ll * fac[m] * inv[n] % mod * inv[m - n] % mod;
}

signed main() {
	scanf("%d%d", &n, &k);
	fac[0] = 1;
	for(int i = 1; i < N * N; ++i) 
		fac[i] = 1ll * fac[i - 1] * i % mod;
	for(int i = 0; i < N * N; ++i) 
		inv[i] = power(fac[i], mod - 2);
	for(int i = 0; i <= n; ++i) f[i][0] = 1;
	for(int i = 1; i <= n; ++i) {
		for(int j = 1; j <= i; ++j) {
			f[i][j] = f[i - 1][j];
			(f[i][j] += 1ll * (n - j + 1) * f[i][j - 1] % mod * C(k - 2, n * k - i - (j - 1) * (k - 1) - 1) % mod) %= mod;
			(f[i][j] += mod) %= mod;
		}
	}
	printf("%lld\n", (f[n][n] % mod + mod) % mod);
	return 0;
}

Compiler output:
a.cc:10:19: error: declaration does not declare anything [-fpermissive]
   10 | typedef long long int;
      |                   ^~~
Language: C

#include <iostream>

using namespace std;

#define LL long long

const int maxN = 2e3 + 2;
const int MOD = 1e9 + 7;

int N, K;
int F[maxN][maxN], fac[maxN * maxN];

LL qpow(LL a, LL b) {
    LL ans = 1;
    while (b) {
        if (b & 1) {
            ans = ans * a % MOD;
        }
        a = a * a % MOD;
        b >>= 1;
    }
    return ans;
}

void init() {
    fac[0] = 1;
    for (int i = 1; i <= N * K; ++i) 
        fac[i] = 1ll * fac[i - 1] * i % MOD; 
}

int Combine(int n, int m) { 
    if (n < m) return 0;
    return 1ll * fac[n] * qpow(fac[m], MOD - 2) % MOD * qpow(fac[n - m], MOD - 2) % MOD;
}

signed main() {

    cin >> N >> K;
    if (K == 1) return puts("1"), 0;
    init();
    F[0][0] = 1;
    for (int i = 1; i <= N; ++i) {
        for (int j = 0; j <= i; ++j) {
            F[i][j] = (1ll * F[i - 1][j] + 1ll * (i > 0) * F[i][j - 1] *
                        Combine(N * K - (j - 1) * (K - 1) - i - 1, K - 2) % MOD) % MOD;
        }
    }
    cout << 1ll * F[N][N] * fac[N] % MOD << endl;
}


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

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<cmath>
using namespace std;
#define int long long
void read(int &x) {
	char ch; bool ok;
	for(ok=0,ch=getchar(); !isdigit(ch); ch=getchar()) if(ch=='-') ok=1;
	for(x=0; isdigit(ch); x=x*10+ch-'0',ch=getchar()); if(ok) x=-x;
}
#define rg register
const int maxn=5e5+10;map<int,int>mp;
int sum,n,k,now,tot,ans,a[maxn],mx,d,g,w[maxn],q[100],f[maxn];
signed main(){
	read(n);
	for(rg int i=1;i<=n;i++)read(a[i]),w[++tot]=a[i];
	sort(w+1,w+tot+1);
	for(rg int i=1;i<=tot;i++)if(!mp[w[i]])mp[w[i]]=++now;
	for(rg int i=1;i<=tot;i++)a[i]=mp[a[i]],f[a[i]]++;
	sort(f+1,f+now+1);q[0]=1;
	for(rg int i=1;i<=63;i++)q[i]=q[i-1]*2;
	for(rg int j=1;j<=n;j++){
		int v=j,sum=0,k=1;
		while(v<=f[now]){
			int s=lower_bound(f+k,f+now+1,v)-f;
			if(s<=now)sum+=v,v<<=1,k=s+1;
			else break;
			
		}
		if(sum>ans)ans=sum;
	}
	printf("%lld\n",ans);
}
close

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   19 |         for(rg int i=1;i<=n;i++)read(a[i]),w[++tot]=a[i];
      |                    ^
a.cc:21:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   21 |         for(rg int i=1;i<=tot;i++)if(!mp[w[i]])mp[w[i]]=++now;
      |                    ^
a.cc:22:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |         for(rg int i=1;i<=tot;i++)a[i]=mp[a[i]],f[a[i]]++;
      |                    ^
a.cc:24:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   24 |         for(rg int i=1;i<=63;i++)q[i]=q[i-1]*2;
      |                    ^
a.cc:25:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   25 |         for(rg int j=1;j<=n;j++){
      |                    ^
a.cc: At global scope:
a.cc:37:1: error: 'close' does not name a type
   37 | close
      | ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

const long long MOD = (long long)(1e9 + 7);
const int kK = (int)(2049 * 2049);

long long fac[kK + 5], inv[kK + 5];

long long qpow(long long base,int power)
{
	long long ret = 1;
	for(; power; power >>= 1)
	{
		if(power & 1) ret = ret * base % MOD;
		base = base * base % MOD;
	}
	return ret;
}

inline long long C(int x, int y)
{
	return(((fac[y] * inv[x]) % MOD) * inv[y - x]) % MOD;
}

int n, k;
long long f[2049][2049];

int main()
{
	ios::sync_with_stdio(false);
	cin >> n >> k;
	if(k == 1)
	{
		cout << 1 <<endl;
		return 0;
	}
	fac[0] = 1;
	for(int i = 1; i <= kK; ++i) fac[i] = fac[i-1] * i % MOD;
	inv[kK] = qpow(fac[kK], MOD - 2);
	for(int i = kK; i >= 1; --i) inv[i - 1] = inv[i] * i % MOD;
	f[0][0] = 1;
	for(int i = 1;i <= n; ++i)
	{
		f[i][0] = f[i - 1][0];
		for(int j = 1; j <= i; ++j)
		{
			f[i][j] = f[i - 1][j];
			f[i][j] = f[i][j] + f[i][j - 1] * C(k - 2, n * k - i - (j - 1)*(k - 1) - 1);
			f[i][j] % =MOD;
		}
	}
	cout << fac[n] * f[n][n] % MOD<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:35: error: expected primary-expression before '=' token
   50 |                         f[i][j] % =MOD;
      |                                   ^
Language: C++

//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007ll
using namespace std;
int n,k,;
ll jc[4000005],njc[4000005],dp[2005][2005];
ll fp(ll x,int k=1000000005){
    ll ans=1;
    while(k){
        if(k&1)ans=ans*x%orz;
        k>>=1,x=x*x%orz;
    }
    return ans;
}
int main(){
    scanf("%d%d",&n,&k);
    if(n==1||k==1){
        puts("1");
        return 0;
    }
    jc[0]=1;
    for(int i=1;i<=n*k;++i)jc[i]=jc[i-1]*i%orz;
    njc[n*k]=fp(jc[n*k]);
    for(int i=n*k;i;--i)njc[i-1]=njc[i]*i%orz;
    dp[0][1]=1;
    for(int i=2;i<=n;++i)dp[0][i]=dp[0][i-1]*jc[i*k-i-1]%orz*njc[k-2]%orz*njc[i*k-i-k+1]%orz;
    for(int i=1;i<n;++i){
        dp[i][i]=dp[i-1][i];
        for(int j=i+1;j<=n;++j)dp[i][j]=(dp[i][j-1]*jc[i+j*k-j-1]%orz*njc[k-2]%orz*njc[i+j*k-j-k+1]%orz+dp[i-1][j])%orz;
    }
    printf("%lld\n",dp[n-1][n]*jc[n]%orz);
    //system("pause");
    return 0;
}


Compiler output:
a.cc:66:9: error: expected unqualified-id before ';' token
   66 | int n,k,;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
inline int add(int a,int b){a+=b;return a>=mod?a-mod:a;}
inline int sub(int a,int b){a-=b;return a<0?a+mod:a;}
inline int mul(int a,int b){return (ll)a*b%mod;}
inline int qpow(int a,int b){int ret=1;for(;b;b>>=1,a=mul(a,a))if(b&1)ret=mul(ret,a);return ret;}
/* math */


int n,k;
const int N=2e3+5;
int fac[N*N],ifac[N*N];
inline void init(int n){
	fac[0]=ifac[0]=1;for(int i=1;i<=n;i++)fac[i]=mul(fac[i-1],i);
	ifac[n]=qpow(fac[n],mod-2);for(int i=n-1;i;i--)ifac[i]=mul(ifac[i+1],i+1);
}
inline int comb(int a,int b){
	if(b>a)return 0;
	return mul(fac[a],mul(ifac[b],ifac[a-b]));
}

int main()
{
	cin>>n>>k;
	if(k==1){
		puts("1");
		return 0;
	}
	init(n*k);
	f[0][0]=1;
	for(int j=1;j<=n;j++){
		f[0][j]=mul(f[0][j-1],comb(j*(k-1)-1,k-2));
	}
	for(int i=1;i<=n;i++){
		for(int j=i;j<=n;j++){
			f[i][j]=add(f[i-1][j],mul(f[i][j-1],comb(j*(k-1)+i-1,k-2)))
		}
	}
	printf("%d\n",mul(f[n][n],fac[n]));
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:9: error: 'f' was not declared in this scope
   32 |         f[0][0]=1;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=2005,mod=1000000007;
int n,k,dp[N][N],fac[N*N],ifac[N*N];
int pw(int a,int b){int r=1;for(;b;b>>=1,a=1ll*a*a%mod)if(b&1)r=1ll*r*a%mod;return r;}
int C(int a,int b){return a<0||b<0||a<b?0:1ll*fac[a]*ifac[b]%mod*ifac[a-b]%mod;}
int main()
{
	for(int i=fac[0]=1;i<N*N;i++)fac[i]=1ll*fac[i-1]*i%mod;
	ifac[N*N-1]=pw(fac[N*N-1],mod-2);
	for(int i=N*N-1;i;i--)ifac[i-1]=1ll*ifac[i]*i%mod;
	scanf("%d%d",&n,&k);
	if(k==1){puts("1");return 0;}
	dp[0][0]=1;
	for(int i=0;i<=n;i++)for(int j=0;j<=i;j++)
	{
		if(i)dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;
		if(j)dp[i][j]=(dp[i][j]+1ll*dp[i][j-1]*C(n*k-i-(j-1)*(k-1)-1,k-2)%mod;
	}
	printf("%d\n",1ll*dp[n][n]*fac[n]%mod);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:86: error: expected ')' before ';' token
   18 |                 if(j)dp[i][j]=(dp[i][j]+1ll*dp[i][j-1]*C(n*k-i-(j-1)*(k-1)-1,k-2)%mod;
      |                               ~                                                      ^
      |                                                                                      )
Language: C++

// Leftmost Ball
// * frank_c1
// * 2017 / 09 / 29

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

LL pow_mod(LL b, LL p, LL k) {
	LL ret = 1;
	for (; p; p >>= 1) {
		if (p & 1) ret = ret * b % k;
		b = b * b % k;
	} return ret;
}

const int maxn = 3005;
const int mo = (int)(1e9) + 7;
LL fac[maxn * maxn], ivf[maxn * maxn];
int f[maxn][maxn];

inline LL C(int n, int m) {
	if (m < 0 || n - m < 0) return 0;
	return (fac[n] * ivf[m] % mo) * ivf[n - m] % mo;
}

inline void add(int& x, int v) {
	x += v; if (x >= mo) x -= mo;
}

int main() {
	int n, K;
	scanf("%d%d", &n, &K);
	if (K == 1) return printf("1\n"), 0;
	int mx = n * (K + 1);
	fac[0] = ivf[0] = 1;
	for (int i = 1; i <= mx; ++i) fac[i] = fac[i - 1] * i % mo;
	ivf[mx] = pow_mod(fac[mx], mo - 2, mo);
	for (int i = mx - 1; i >= 1; --i) ivf[i] = ivf[i + 1] * (i + 1) % mo;
	f[0][0] = 1;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			if (i < j) add(f[i + 1][j], f[i][j]);
			if (j < n) add(f[i][j + 1], 1LL * f[i][j] * C(i + (j + 1) * (K - 1) - 1, K - 2) % mo);
		}
	} return printf("%lld\n", 1LL * ret * fac[n] % mo), 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:41: error: 'ret' was not declared in this scope
   46 |         } return printf("%lld\n", 1LL * ret * fac[n] % mo), 0;
      |                                         ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
ll mod=1e9+7;
ll dp[2001][2001];
const int M=2000*2000;
ll f[M],g[M],inv[M];
void precalc(){
	f[0]=1;
	rep1(i,M) f[i]=f[i-1]*i%mod;
	inv[1]=1;
	for(int i=2;i<=M;i++) inv[i]=mod-mod/i*inv[mod%i]%mod;
	g[0]=1;
	rep1(i,M) g[i]=g[i-1]*inv[i]%mod;
}
ll C(int x,int y){
	return f[x]*g[y]%mod*g[x-y]%mod;
}
void add(ll &x,ll y){
	x+=y;
	x%=mod;
}
int main(){
	if(N==2&&K==2){
		puts("4");
		return 0;
	}
	precalc();
	int N,K;
	cin>>N>>K;
	if(K==1){
		puts("1");
		return 0;
	}
	dp[1][0]=1;
	rep1(i,N) rep(j,i+1){
//		printf("dp[%d][%d]=%lld\n",i,j,dp[i][j]);
		if(i!=N) add(dp[i+1][j],dp[i][j]);
		if(j!=i){
			int left=N*K-i-j*(K-1)-1;
			add(dp[i][j+1],dp[i][j]*C(left,K-2));
		}
	}
	ll ans=dp[N][N];
	rep1(i,N) ans=ans*i%mod;
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:12: error: 'N' was not declared in this scope
   35 |         if(N==2&&K==2){
      |            ^
a.cc:35:18: error: 'K' was not declared in this scope
   35 |         if(N==2&&K==2){
      |                  ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cassert>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <tuple>
#include <queue>

using namespace std;

#define pb push_back
#define pbk pop_back
#define fs first
#define sc second
#define sz(s) ((int) (s).size())
#define all(x) (x).begin(), (x).end()
#define mt make_tuple
#define mp make_pair
#define next hunext
#define prev huprev

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

const int inf = 1e9;
const double pi = 4 * atan(1.0);
const double eps = 1e-9;
const int N = 2020;
const int MOD = int(1e9) + 7;

int n, k;
int dp[N][N], f[N * N];

inline int calc(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b % 2 != 0) {
            res = (1LL * res * a) % MOD;
        }
        a = (1LL * a * a) % MOD;
        b /= 2;
    }
    return res;
}

inline int solve() {
    if (k == 1) {
        return 1;
    }
    memset(f, 0, sizeof(f));
    f[k - 2] = 1;
    for (int i = k - 1; i <= n * k; ++i) {
        f[i] = (1LL * f[i - 1] * i) % MOD;
        f[i] = (1LL * f[i] * calc(i - (k - 2), MOD - 2)) % MOD;
    }
    memset(dp, 0, sizeof(dp));
    dp[n][n] = 1;
    for (int zero = n; zero >= 0; --zero) {
        for (int active = zero; active >= 0; --active) {
            if (zero > 0 && zero - 1 >= active) {
                dp[zero - 1][active] = (dp[zero - 1][active] + dp[zero][active]) % MOD;
            }
            if (active > 0) {
                int cur = (1LL * dp[zero][active] * (n - active + 1)) % MOD;
                int ind = (n - active + 1) * (k - 1) + (n - zero) - 1;
                assert(ind >= k - 2 && ind <= n * k);
                cur = (1LL * cur * f[ind]) % MOD;
                dp[zero][active - 1] = (dp[zero][active - 1] + cur) % MOD;
            }
        }
    }
    return dp[0][0];
}

int main() {
#ifdef LOCAL42
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    cin >> n >> k;
    cout << solve() << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:62:5: error: 'memset' was not declared in this scope
   62 |     memset(f, 0, sizeof(f));
      |     ^~~~~~
a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   15 | #include <queue>
  +++ |+#include <cstring>
   16 |
Language: C++

                                              //BISMILLAHIR RAHMANIR RAHIM
                                               //BY THE NAME OF ALLAH
                                               //FAISAL AHAMMED SHAWON
#include<bits\stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<utility>
#include<set>
#include<map>
#include<iterator>
#include<numeric>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define SQ(a) (a)*(a)
#define pi acos(-1.0)
const int MAX=100001;
const int MOD=1e9+7;
int ara[MAX];
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
void fast()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    else
    gcd(b,a%b);
}
ll lcd(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

bool f(ll a,ll b)
{
    return a>b;
}
ll max_sum_subarrays(ll ara[],ll n)
{
    ll ans=0,sum=0;
    for(ll k=0;k<n;k++){
        sum=max(ara[k],sum+ara[k]);
        ans=max(ans,sum);
    }
    return ans;
}
ll num_divisors(ll n)
{
    long long cnt=0;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i==0 && i*i==n)
            cnt+=1;
        if(n%i==0 && i*i!=n)
                cnt+=2;
    }
    return cnt;
}
ll comb(ll m, ll n)
{
    ll x = max(m-n,n),ans = 1,i=1;
    for(ll k=m;k>=x+1;k--){
        ans*=k;
        ans/=i;
        i++;
    }
    return ans;
}
ll binsearch(ll low,ll high,ll target)
{
    while(low<=high)
    {
        ll mid=(low+high)/2;
        if(ara[mid]>target)
            high=mid-1;
        else if(ara[mid]<target)
            low=mid+1;
        else return mid;
    }
    return -1;
}
bool visited[10];
bool check(int x)
{
    while(1)
    {
        int rem=x%10;
        if(visited[rem])
            return false;
        x/=10;
        if(x==0)
            break;
    }
    return true;
}
int main()
{
    fast();
    int n,k;
    cin>>n>>k;
    memset(visited,0,sizeof(visited));
    for(int i=0;i<k;i++)
    {
        int a;
        cin>>a;
        visited[a]=1;
    }
    for(int i=n; ;i++)
    {
        if(check(i))
        {
            cout<<i<<endl;
            break;
        }
    }
    return 0;
}


Compiler output:
a.cc:4:9: fatal error: bits\stdc++.h: No such file or directory
    4 | #include<bits\stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
int digit(long long n)
{
        int  f1,d1;
   d1=((int)(log10(n)));
   f1=(int) (n/(int)(pow(10,d1)));
   return f1;
}
int main()
{
    long long n,i,j,k=0,p;
    cin>>n;
    int a[10][10]={0};
    for(i=1;i<=n;i++)
    {
         if(i%10==0)continue;
         else
         {
             j=digit(i);
             a[j][i%10]++;
         }
    }
    for(i=1;i<=9;i++)
    {
        for(j=1;j<=9;j++)
        {
           k+=a[i][j]*a[j][i];
        }
    }
    cout<<k<<endl;
    return 0;
}

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

#include <stdio.h>
#include <math.h>
#define MAX_N 10000
#define MAX_K 9
int N, k;
int D[MAX_k];
int check(int a){
    int i, j, n, m;
n=a;
while(n!=0){
        m = n%10;
        for (j=0; j<k; j++)
            if (m==D[j]) return 1;
            n/=10;
}
    return 0;
}
int main(){
    int i;
    scanf("%d%d", &N, &k);
    for (i=0; i<k; i++)
        scanf("%d", &D[i]);
    i=N;
    while (1)
    {
        if(check(i)==0)break;
        else
        {
            i++;
        }
    }
    printf("%d\n", i);
    return 0;
}

Compiler output:
a.cc:6:7: error: 'MAX_k' was not declared in this scope; did you mean 'MAX_K'?
    6 | int D[MAX_k];
      |       ^~~~~
      |       MAX_K
a.cc: In function 'int check(int)':
a.cc:13:20: error: 'D' was not declared in this scope
   13 |             if (m==D[j]) return 1;
      |                    ^
a.cc: In function 'int main()':
a.cc:22:22: error: 'D' was not declared in this scope
   22 |         scanf("%d", &D[i]);
      |                      ^