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

#include<cstdio>
#include<queue>
#include<vector>
#define rep(i,a) for( int i = 0; i != (a); ++i )
#define repi(i,a,b) for( int i = (a); i != (b); ++i )

int ma;
int n;
int d[252];
std::vector<int> G[252], rG[252];
bool reach[252], rev[252];

void dfs( int v )
{
	rev[v] = true;

	rep( i, rG[v].size() )
		if( !rev[rG[v][i]] )
			dfs( rG[v][i] );

	return;
}

void dfs2( int v )
{
	reach[v] = true;

	rep( i, G[v].size() )
		if( !reach[G[v][i]] )
			dfs2( G[v][i] );

	return;
}

int main()
{
	while( scanf( "%d", &ma ), ma )
	{
		rep( i, 252 )
			G[i].clear(), rG[i].clear();

		scanf( "%d", &n );

		repi( i, 1, n+1 )
			scanf( "%d", d+i );

		rep( i, n+1 )
		{
			rep( j, ma )
			{
				if( i+j+1 >= n+2 )
					break;

				int to = std::max( 0, std::min( i+j+1+d[i+j+1], n+1 ) );
				G[i].push_back( to );
				rG[to].push_back( i );
			}
		}

		memset( reach, false, sizeof( reach ) );
		memset( rev, false, sizeof( rev ) );
		dfs( n+1 );
		dfs2( 0 );

		bool fl = true;
		rep( i, n+2 )
			if( reach[i] && !rev[i] )
				fl = false;

		puts( fl ? "OK" : "NG" );
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:17: error: 'memset' was not declared in this scope
   60 |                 memset( reach, false, sizeof( reach ) );
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include<queue>
  +++ |+#include <cstring>
    3 | #include<vector>
Language: C++

     if(Solve(x+i)==true)return true;
    }   
    
  }
  
  flg[x]=false;
  
  return false;
}


int main(){
  
  while(cin>>mx , mx){
    cin >> n;
    d[0]=0;
    for(int i=1; i<=n; i++){
      cin>>d[i];
      flg[i]=false;
    }

    if(Solve(0)==true)cout<<"OK"<<endl;
    else cout<<"NG"<<endl;
  }


  return 0;
}

Compiler output:
a.cc:1:6: error: expected unqualified-id before 'if'
    1 |      if(Solve(x+i)==true)return true;
      |      ^~
a.cc:2:5: error: expected declaration before '}' token
    2 |     }
      |     ^
a.cc:4:3: error: expected declaration before '}' token
    4 |   }
      |   ^
a.cc:6:3: error: 'flg' does not name a type
    6 |   flg[x]=false;
      |   ^~~
a.cc:8:3: error: expected unqualified-id before 'return'
    8 |   return false;
      |   ^~~~~~
a.cc:9:1: error: expected declaration before '}' token
    9 | }
      | ^
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |   while(cin>>mx , mx){
      |         ^~~
a.cc:14:14: error: 'mx' was not declared in this scope
   14 |   while(cin>>mx , mx){
      |              ^~
a.cc:15:12: error: 'n' was not declared in this scope
   15 |     cin >> n;
      |            ^
a.cc:16:5: error: 'd' was not declared in this scope
   16 |     d[0]=0;
      |     ^
a.cc:19:7: error: 'flg' was not declared in this scope
   19 |       flg[i]=false;
      |       ^~~
a.cc:22:8: error: 'Solve' was not declared in this scope
   22 |     if(Solve(0)==true)cout<<"OK"<<endl;
      |        ^~~~~
a.cc:22:23: error: 'cout' was not declared in this scope
   22 |     if(Solve(0)==true)cout<<"OK"<<endl;
      |                       ^~~~
a.cc:22:35: error: 'endl' was not declared in this scope
   22 |     if(Solve(0)==true)cout<<"OK"<<endl;
      |                                   ^~~~
a.cc:23:10: error: 'cout' was not declared in this scope
   23 |     else cout<<"NG"<<endl;
      |          ^~~~
a.cc:23:22: error: 'endl' was not declared in this scope
   23 |     else cout<<"NG"<<endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define pb push_back
int M;
int N;
int D[259];
int main()
{
	while(true){
		scanf("%d",&M);
		if(M==0)break;
		scanf("%d",&N);
		for(int i=1;i<=N;i++)scanf("%d",&D[i]);
		vector<int> G[259];
		for(int i=1;i<=N;i++){
			if(i+D[i]<0)G[i].pb(0);
			else if(i+D[i]>N+1)G[i].pb(N+1);
			else G[i].pb(i+D[i]);
			for(int j=1;j<=M;j++){
				if(i+j<=N+1)G[i].pb(i+j);
			}
		}
		for(int j=1;j<=M;j++){
			if(j<=N+1)G[0].pb(j);
		}
		bool F[259];
		for(int i=0;i<=N+1;i++)F[i]=false;
		vector<int>S;S.pb(0);
		int l=0;
		while(l<(int)S.size()){
			int v=S[l];
			if(F[v])continue;
			F[v]=true;
			for(int i=0;i<(int)G[v].size();i++){
				if(!F[G[v][i]]){
					S.pb(G[v][i]);
					r++;
				}
			}
			l++;
		}
		bool ans=true;
		bool F1[259];
		for(int i=0;i<=N+1;i++){
			if(!F[i])continue;
			for(int j=0;j<=N+1;j++){
				F1[i]=false;
			}
			S.clear();
			S.pb(i);
			l=0;
			while(l<(int)S.size()&&!F1[N+1]){
				int v=S[l];
				if(F1[v])continue;
				F1[v]=true;
				for(int i=0;i<(int)G[v].size();i++){
					if(!F1[G[v][i]]){
						S.pb(G1[v][i]);
						r++;
					}
				}
				l++;
			}
			if(!F1[N+1])ans=false;
		}
		if(ans)printf("OK\n");
		else printf("NG\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:41: error: 'r' was not declared in this scope
   37 |                                         r++;
      |                                         ^
a.cc:58:54: error: 'G1' was not declared in this scope; did you mean 'F1'?
   58 |                                                 S.pb(G1[v][i]);
      |                                                      ^~
      |                                                      F1
a.cc:59:49: error: 'r' was not declared in this scope
   59 |                                                 r++;
      |                                                 ^
Language: C++

#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
 
const INF = 1 << 22;
int main()
{
    int Max,n;
    while(cin >> Max, Max){
        int map[252] = {};
        int dist[252][252];
        cin >> n;
        for(int i = 1; i <= n; ++i){
            cin >> map[i];   
        }
        fill((int*)dist,(int*)(dist + n + 2),INF);
        queue<int> q;
        q.push(0);
        while(!q.empty()){
            int x = q.front(); q.pop();
            for(int i = 1; i <= Max; ++i){
                int nx = x + i;
                if(nx >= n + 1){
                    dist[x][nx] = 1;
                } else {
                    int t = nx;
                    nx += map[t];
                    if(nx >= n + 1){
                        dist[x][n + 1] = 1;
                    } else if(nx <= 0){
                        dist[x][0] = 1;
                    } else if(dist[x][nx] == INF){
                        dist[x][nx] = 1;
                        q.push(nx);
                    }
                }
            }
        }
        for(int i = 0; i < n + 2; ++i){
            dist[i][i] = 0;
        }
        for(int k = 0; k < n + 2; ++k){
            for(int i = 0; i < n + 2; ++i){
                for(int j = 0; j < n + 2; ++j){
                    dist[i][j] = min(dist[i][j],dist[i][k] + dist[k][j]);
                }
            }
        }
        
        bool f = false;
        for(int i = 0; i < n + 1; ++i){
            if(dist[0][i] != INF && dist[i][n + 1] == INF){
                cout << "NG" << endl;
                f = true;
                break;
            }
        }
        if(!f){
            cout << "OK" << endl;
        }
    }
}

Compiler output:
a.cc:6:7: error: 'INF' does not name a type
    6 | const INF = 1 << 22;
      |       ^~~
a.cc: In function 'int main()':
a.cc:17:46: error: 'INF' was not declared in this scope
   17 |         fill((int*)dist,(int*)(dist + n + 2),INF);
      |                                              ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <vector>
#include <string>

using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];

const int AGARI = 100000;

bool dfs(int index)
{
	if(passed[index]) return false;
	passed[index] = true;

	index = min(n + 1, max(0 ,kouka[index] + index));
	if(kouka[index] == AGARI) return true;
	for (int i = 1; i <= maxCount; i++)
	{
		int next = index + i;
		if(memo[next])
			if(memo[next] = dfs(next))
				return true;
	}

	passed[index] = false;
	return false;
}

bool solve()
{
	for (int i = 1; i <= maxCount; i++)
	{
		if(dfs(i)) return true;
	}
	return false;
}

int main()
{
	while(cin >> maxCount && maxCount)
	{
		cin >> n;
		kouka.resize(n + 2);
		kouka[0] = -1;//ふりだし
		for (int i = 1; i < n + 1; i++)
		{
			cin >> kouka[i];
		}
		kouka[n + 1] = AGARI;//あがり
		memset(memo, true, sizeof(memo));
		memset(passed, false, sizeof(memo));
		cout << (solve()? "OK" : "NG") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:17: error: 'memset' was not declared in this scope
   56 |                 memset(memo, true, sizeof(memo));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <queue>
  +++ |+#include <cstring>
    4 | #include <deque>
Language: C++

#include <iostream>
#include <vector>
#include <string>

using namespace std;
int maxCount, n;
vector<int> kouka;
int memo[252];//251があがり0がふりだし
int passed[252];

const int AGARI = 100000;

bool dfs(int index)
{
	if(passed[index]) return false;
	passed[index] = true;

	index = min(n + 1, max(0 ,kouka[index] + index));
	if(kouka[index] == AGARI) return true;
	for (int i = 1; i <= maxCount; i++)
	{
		int next = index + i;
		if(memo[next])
			if(memo[next] = dfs(next))
				return true;
	}

	passed[index] = false;
	return false;
}

bool solve()
{
	for (int i = 1; i <= maxCount; i++)
	{
		if(dfs(i)) return true;
	}
	return false;
}

int main()
{
	while(cin >> maxCount && maxCount)
	{
		cin >> n;
		kouka.resize(n + 2);
		kouka[0] = -1;//ふりだし
		for (int i = 1; i < n + 1; i++)
		{
			cin >> kouka[i];
		}
		kouka[n + 1] = AGARI;//あがり
		memset(memo, true, sizeof(memo));
		memset(passed, false, sizeof(memo));
		cout << (solve()? "OK" : "NG") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:17: error: 'memset' was not declared in this scope
   53 |                 memset(memo, true, sizeof(memo));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include <iostream>
#include <vector>
#include <bitset>
using namespace std;


int M, N, D[256];
bool G[256][256];


int main()
{
	for(; cin >> M && M; ) {
		memset(G, false, sizeof G);
		
		cin >> N;

		for(int i = 1; i <= N; i++) {
			cin >> D[i];
		}

		for(int i = 0; i <= N; i++) {
			for(int j = 1; j <= M; j++) {
				if(i+j >= N+1) G[i][N+1] = true;
				else G[i][max(0, min(i+j+D[i+j], N+1))] = true;
			}
		}

		for(int i = 0; i <= N+1; i++) {
			for(int j = 0; j <= N+1; j++) {
				for(int k = 0; k <= N+1; k++) {
					G[i][j] |= (G[i][k] && G[k][j]);
				}
			}
		}

		bool res = G[0][N+1];
		for(int i = 1; i <= N; i++) {
			res &= (G[0][i] ? G[i][N+1] : true);
		}
		
		cout << (res ? "OK" : "NG") << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(G, false, sizeof G);
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <bitset>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C

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

int n, c, a[32], b[32], dp[32][65536], st[32][65536];

int bit_count(int x){
	int res = 0;
	for(int i = 0 ; i < 16 ; i++ ){
		if( x & (1 << i) ) res++;
	}
	return res;
}

int main(){	
	while( cin >> n >> c, n || c ){
		fill(a, a + 32, 0);
		fill(b, b + 32, 0);
		for(int i = 0 ; i < n ; i++ ){
			for(int j = 0 ; j < 16 ; j++ ){
				int e;
				cin >> e;
				a[i] |= e << j;
			}
		}
		for(int i = 0 ; i < c ; i++ ){
			for(int j = 0 ; j < 16 ; j++ ){
				int e;
				cin >> e;
				b[i] |= e << j;
			}
		}
		b[c] = 0;
		c++;
		
		for(int i = 0 ; i < c ; i++ ){
			for(int j = 0 ; j < (1 << 16) ; j++ ){
				st[i][j] = bit_count(j & b[i]);
			}
		}
		
		for(int i = 0 ; i < 32 ; i++ ) fill(dp[i], dp[i] + 65536, -1);
		dp[0][0] = 0;
		int ans = 0;
		for(int i = 0 ; i < n ; i++ ){
			for(int j = 0 ; j < (1 << 16) ; j++ ){
				if( dp[i][j] == -1 ) continue;
				
				int nx = j | a[i];
				for(int k = 0 ; k < c ; k++ ){
					int tx = nx & ~b[k];
					dp[i+1][tx] = max(dp[i+1][tx], dp[i][j] + st[k][nx]);
					ans = max(ans, dp[i+1][tx]);
				}
			}
		}
		cout << ans << endl;
	}
}

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

#include<iostream>
using namespace std;

int n,c;
int a[33];
int b[33];
int memo[31][1 << 16 + 1];
int dp(int index,int bit);

int main(){
	while(1){
		cin >> n >> c;
		if(n == 0 && c == 0) break;
		for(int i=0;i<n;i++){
			a[i] = 0;
			for(int j=0;j<16;j++){
				int aa;
				cin >> aa;
				if(aa) a[i] |= 1 << j;
			}
		}
		for(int i=0;i<c;i++){
			b[i] = 0;
			for(int j=0;j<16;j++){
				int bb;
				cin >> bb;
				if(bb) b[i] |= 1 << j;
			}
		}

		memset(memo,0,sizeof(memo));
		cout << dp(0,a[0]) << endl;

	}
}

int dp(int index,int bit){
	if(index == n) return 0;
	if(memo[index][bit]) return memo[index][bit];

	int ans = 0;
	for(int i=0;i<c;i++){
		ans = max(ans,dp(index+1,(bit & ~b[i]) | a[index+1]) + __builtin_popcount(bit & b[i]));
	}
	return memo[index][bit] = ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:17: error: 'memset' was not declared in this scope
   31 |                 memset(memo,0,sizeof(memo));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <stdio.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
using namespace std;
typedef long long ll;
int st[31][1<<16],dp[31][1<<16];
int count(int num){
	int res=0;
	for(int i=0;i<16;i++)if((num>>i)&1)res++;
	return res;
}
int main()
{
	int n,c;
	while(cin>>n>>c&&n){
		memset(st,0,sizeof(st));
		memset(dp,-1,sizeof(dp));
		int light[31],push[31],tmp;
		for(int i=0;i<n;i++)
			for(int j=0;j<16;j++){
				cin>>tmp;
				light[i]<<1;
				light[i]+=tmp;
			}
		for(int i=0;i<c;i++){
			for(int j=0;j<16;j++){
				cin>>tmp;
				push[i]*=2;
				push[i]+=tmp;
			}
			for(int j=0;j<(1<<16);j++){
				st[i][j]=count(push[i]&j);
				dp[0][j]=0;
			}
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<(1<<16);j++){
				if(dp[i][j]<0)continue;
				int nx=j|light[i];
				dp[i+1][nx]=max(dp[i+1][nx],dp[i][j]);
				for(int k=0;k<c;k++){
					int tx=nx&~push[j];
					dp[i+1][tx]=max(dp[i+1][tx],dp[i][j]+st[k][nx]);
				}
			}
		}
		int ans=0;
		for(int i=0;i<(1<<16);i++)ans=max(ans,dp[n][i]);
		printf("%d\n",ans);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'memset' was not declared in this scope
   19 |                 memset(st,0,sizeof(st));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <functional>
  +++ |+#include <cstring>
    6 | #include <string>
Language: C++

#include <iostream>
#include <stdio.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <string>
#include <set>
using namespace std;
typedef long long ll;
int st[31][1<<16],dp[31][1<<16];
int count(int num){
	int res=0;
	for(int i=0;i<16;i++)if((num>>i)&1)res++;
	return res;
}
int main()
{
	int n,c;
	while(cin>>n>>c&&n){
		memset(st,0,sizeof(st));
		memset(dp,-1,sizeof(dp));
		int light[31]={},push[31]={},tmp;
		for(int i=0;i<n;i++){
			for(int j=0;j<16;j++){
				cin>>tmp;
				light[i]*=2;
				light[i]+=tmp;
			}
			light[i]=light[i]&((1<<16)-1);
			//printf("light[%d]:%d\n",i,light[i]);
		}
		for(int i=0;i<c;i++){
			for(int j=0;j<16;j++){
				cin>>tmp;
				push[i]*=2;
				push[i]+=tmp;
			}
			for(int j=0;j<(1<<16);j++){
				st[i][j]=count(push[i]&j);
			}
			push[i]=push[i]&((1<<16)-1);
			//printf("push[%d]:%d\n",i,push[i]);
		}
		dp[0][0]=0;
		for(int i=0;i<n;i++){
			for(int j=0;j<(1<<16);j++){
				if(dp[i][j]<0)continue;
				int nx=j|light[i];
				//dp[i+1][nx]=max(dp[i+1][nx],dp[i][j]);
				for(int k=0;k<c;k++){
					int tx=nx-(nx&push[i]);
					dp[i+1][tx]=max(dp[i+1][tx],dp[i][j]+st[k][nx]);
				}
			}
		}
		int ans=0;
		for(int i=0;i<(1<<16);i++)ans=max(ans,dp[n][i]);
		printf("%d\n",ans);
	}
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
   20 |                 memset(st,0,sizeof(st));
      |                 ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <set>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int popcount(unsigned i) {
    i = ((i & 0xaaaaaaaa) >> 1) + (i & 0x55555555);
    i = ((i & 0xcccccccc) >> 2) + (i & 0x33333333);
    i = ((i & 0xf0f0f0f0) >> 4) + (i & 0x0f0f0f0f);
    i = ((i & 0xff00ff00) >> 8) + (i & 0x00ff00ff);
    i = ((i & 0xffff0000) >> 16) + (i & 0x0000ffff);
    return i;
}

bool solve() {
    int N, C;
    if(!(cin >> N >> C)) return false;
    if(!N &&! C) return false;

    vector<int> patterns(N), press_patterns(C);
    for(int i = 0; i < N; ++i) {
        int v = 0;
        for(int j = 0; j < 16; ++j) {
            int b;
            cin >> b;
            v <<= 1;
            v += b;
        }
        patterns[i] = v;
    }
    for(int i = 0; i < C; ++i) {
        int v = 0;
        for(int j = 0; j < 16; ++j) {
            int b;
            cin >> b;
            v <<= 1;
            v += b;
        }
        press_patterns[i] = v;
    }

    vector<int> memo[2];
    memo[0].resize(1<<16, -1);
    memo[1].resize(1<<16, -1);
    memo[0][0] = 0;
    for(int pat : patterns) {
        fill(memo[1].begin(), memo[1].end(), -1);
        for(int prev = 0; prev < (1<<16); ++prev) {
            if(memo[0][prev] == -1) continue;
            const int cur = pat | prev;
            for(int press : press_patterns) {
                const int np = cur & (~press);
                const int ns = memo[0][prev] + popcount(cur & press);
                memo[1][np] = max(memo[1][np], ns);
            }
        }
        memo[0].swap(memo[1]);
    }
    cout << *max_element(memo[0].begin(), memo[0].end()) << endl;
    return true;
}

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

    while(solve()) ;
    return 0;
}

Compiler output:
a.cc: In function 'bool solve()':
a.cc:59:14: error: 'max_element' was not declared in this scope
   59 |     cout << *max_element(memo[0].begin(), memo[0].end()) << endl;
      |              ^~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int power(int x,int k,int p){
	if(k==0)return 1;
	int tmp=power(x,k/2,p);
	tmp*=tmp; tmp%=p;
	if(k%2==1){tmp*=x; tmp%=p;}
	return tmp;
}

int plus(int x,int y,int p){
	return (x+y)%p;
}

int minus(int x,int y,int p){
	return (x-y+p)%p;
}

int mul(int x,int y,int p){
	return (x*y)%p;
}

int div(int x,int y,int p){
	return (x*power(y,p-2,p))%p;
}
string t = "";
int x = -1;
int get()
{
	if(t[x]=='(')return rec();
	int ret = 0;
	while(x++)
	{
		if(t[x]-'0' < 0 || t[x]-'0' > 9) return ret;
		ret = (ret*10+t[x]-'0');
	}
}
int rec()
{
	x++;
	int cur = 0;
	int sum = 0;
	bool minu = false;
	while(1)
	{
		cur = get();
		while(t[x] == '*' || t[x] == '/')
		{
			char C=t[x];
			x++;
			int aaa=get();
			if(C=='*')cur=mul(cur,aaa,p);
			else cur=div(cur,aaa,p);
		}
		if(t[x] == '+' || t[x] == '-')
		{
			if(minu) sum -= cur;
			else sum += cur;
		}
		if(t[x]==')'){
			
			if(minu) sum -= cur;
			else sum += cur;

			return sum;
		}
	}
}
	
	
int main()
{
	while(1)
	{
		string s;
		cin >> s;
		bool beg = false;
		int p = 0;
		for(int i=0;i<s.size();i++)
		{
			if(beg && s[i] != ' ') t.pb(s[i]);
			if(s[i] == ':') beg = true;
			if(!beg) p = (p*10+(s[i]-'0'));
		}
cout<<t" = ";
		t.pb(')');
		int res = rec();
		printf("%d",res);
cout<<" (mod "<<p<<")\n";
	}
		
}

Compiler output:
a.cc: In function 'int get()':
a.cc:31:29: error: 'rec' was not declared in this scope
   31 |         if(t[x]=='(')return rec();
      |                             ^~~
a.cc: In function 'int rec()':
a.cc:53:51: error: 'p' was not declared in this scope
   53 |                         if(C=='*')cur=mul(cur,aaa,p);
      |                                                   ^
a.cc:54:46: error: 'p' was not declared in this scope
   54 |                         else cur=div(cur,aaa,p);
      |                                              ^
a.cc: In function 'int main()':
a.cc:82:50: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pb'
   82 |                         if(beg && s[i] != ' ') t.pb(s[i]);
      |                                                  ^~
a.cc:86:8: error: expected ';' before string constant
   86 | cout<<t" = ";
      |        ^~~~~
      |        ;
a.cc:87:19: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'pb'
   87 |                 t.pb(')');
      |                   ^~
Language: C++

#include <cassert>
#include <cstdlib>
#include <iostream>
#include <sstream>
using namespace std;

int mod;
const char *p;

int mod_pow(int x, int n) {
	int res = 1;
	while(n > 0) {
		if(n & 1) res = (res * x) % mod;
		x = (x * x) % mod;
		n >>= 1;
	}
	return res;
}

int mod_inverse(int x) {
	return mod_pow(x, mod - 2);
}

int expr();
int term();
int factor();
int number();

int expr() {
	int res = term();
	while(*p == '+' || *p == '-') {
		switch(*(p++)) {
		case '+': res = (res + term()) % mod; break;
		case '-': res = (res - term() + mod) % mod; break;
		}
	}
	return res;
}

int term() {
	int res = factor();
	while(*p == '*' || *p == '/') {
		switch(*(p++)) {
		case '*': res = (res * factor()) % mod; break;
		case '/':
			const int divisor = factor();
			if(divisor == 0) throw "NG";
			res = (res * mod_inverse(divisor)) % mod;
			break;
		}
	}
	return res;
}

int factor() {
	if(*p == '(') {
		++p;
		const int res = expr();
		++p;
		return res;
	}

	assert(isdigit(*p));
	return number();
}

int number() {
	int res = 0;
	while(isdigit(*p)) {
		res = res * 10 + *(p++) - '0';
	}
	return res;
}

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

	for(string input; getline(cin, input);) {
		const unsigned separator = input.find(':');

		mod = stoi(input.substr(0, separator));
		if(mod == 0) break;

		string s = input.substr(separator + 1);
		s.erase(remove(s.begin(), s.end(), ' '), s.end());
		p = s.c_str();

		try {
			ostringstream os;
			os << s << " = " << expr() << " (mod " << mod << ")\n";
			cout << os.str();
		} catch(const char *) {
			cout << "NG\n";
		}
	}

	return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:86:39: error: cannot convert 'std::__cxx11::basic_string<char>::iterator' to 'const char*'
   86 |                 s.erase(remove(s.begin(), s.end(), ' '), s.end());
      |                                ~~~~~~~^~
      |                                       |
      |                                       std::__cxx11::basic_string<char>::iterator
In file included from /usr/include/c++/14/cstdio:42,
                 from /usr/include/c++/14/ext/string_conversions.h:45,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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:3:
/usr/include/stdio.h:158:32: note:   initializing argument 1 of 'int remove(const char*)'
  158 | extern int remove (const char *__filename) __THROW;
      |                    ~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <algorithm>
#include <cctype>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>

using namespace std;

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

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

int p;
int expr(string& s, int& t);

int inv(int n)
{
    if(n == 0) throw 0;
    
    int r = 1;
    rep(i, p-2) r = (r * n) % p;
    return r;
}

int num(string& s, int& t)
{
    if(s[t] == '('){
        ++t;
        int v = expr(s, t);
        ++t;
        return v;
    }
    else{
        int v = 0;
        while(isnumber(s[t])){
            v = v * 10 + s[t] - '0';
            ++t;
        }
        return v;
    }
}

int term2(string& s, int& t)
{
    char c = s[t];
    if(c != '*' && c != '/') return 1;
    ++t;
    int u = num(s, t);
    if(c == '/') u = inv(u);
    return (u * term2(s, t)) % p;
}

int term(string& s, int& t)
{
    int u = num(s, t);
    return (u * term2(s, t)) % p;
}

int expr2(string& s, int& t)
{
    char c = s[t];
    if(c != '+' && c != '-') return 0;
    ++t;
    int u = term(s, t);
    if(c == '-') u *= -1;
    int r = (p + u + expr2(s, t)) % p;
    return r;
}

int expr(string& s, int& t)
{
    int u = term(s, t);
    return (u + expr2(s, t)) % p;
}

string func(string str)
{
    p = stoi(str);
    
    stringstream sstr(str.substr(str.find(':') + 1));
    str = "";
    for(string t; sstr >> t;){
        str += t;
    }
    str += '\0';
    
    try{
        int t = 0;
        return str + " = " + to_string(expr(str, t)) + " (mod " + to_string(p) + ")";
    }
    catch(...){
        return "NG";
    }
}

int main()
{
    string str;
    while(getline(cin, str), str != "0:"){
        cout << func(str) << endl;
    }
}

Compiler output:
a.cc: In function 'int num(std::string&, int&)':
a.cc:40:15: error: 'isnumber' was not declared in this scope
   40 |         while(isnumber(s[t])){
      |               ^~~~~~~~
Language: C++

/* package whatever; // don't place package name! */

import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main(String[] args) {
		try (BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
			while (true) {
				String line = in.readLine().replaceAll(" ", "");
				String[] split = line.split(":");
				int p = Integer.parseInt(split[0]);
				if (p == 0)
					break;
				int[] rep = new int[p];
				for (int i = 0; i < p; i++) {
					rep[i] = 1;
					for (int j = 0; j < p - 2; j++) {
						rep[i] *= i;
						rep[i] %= p;
					}
				}
				try {
					StringBuffer expression = new StringBuffer(split[1]);
					while (true) {
						Matcher matcher = parPattern.matcher(expression);
						if (!matcher.find())
							break;
						StringBuffer buffer = new StringBuffer();
						do {
							int val = eval(matcher.group(1), p, rep);
							matcher.appendReplacement(buffer, val + "");
						} while (matcher.find());
						matcher.appendTail(buffer);
						expression = buffer;
					}
					int val = eval(expression.toString(), p, rep);
					System.out.println(split[1]+" = " +val + " (mod " + p + ")");
				} catch (IllegalArgumentException e) {
					System.out.println("NG");
				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private static Pattern parPattern = Pattern.compile("\\(([^()]*)\\)");
	private static Pattern pattern2 = Pattern.compile("([+-])([^+-]+)");
	private static Pattern pattern3 = Pattern.compile("([*/])([0-9]+)");

	private static int eval(String expression, int p, int[] rep) {
		Matcher matcher = pattern2.matcher("+" + expression);
		int ans = 0;
		while (matcher.find()) {
			int result = eval2(matcher.group(2), p, rep) % p;
			if (matcher.group(1).equals("+")) {
				ans += result;
			} else {
				ans += p - result;
			}
			ans %= p;
		}
		return ans;
	}

	private static int eval2(String expression, int p, int[] rep) {
		Matcher matcher = pattern3.matcher("*" + expression);
		int ans = 1;
		while (matcher.find()) {
			int num = Integer.parseInt(matcher.group(2));
			if (matcher.group(1).equals("*")) {
				ans *= num;
			} else {
				if (num == 0)
					throw new IllegalArgumentException();
				ans *= rep[num];
			}
			ans %= p;
		}
		return ans;
	}
}

Compiler output:
a.cc:3:1: error: 'import' does not name a type
    3 | import java.util.*;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.util.regex.*;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.lang.*;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.io.*;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: expected unqualified-id before 'public'
    9 | public class Main
      | ^~~~~~
Language: C

#include<iostream>
#include<cstring>

using namespace std;

string removedFirst(string str) {
  string ans;

  if(str.length() == 1) {
    return ans;
  }

  else {
    for(int i=1; i<str.length(); i++) {
      ans += str[i];
    }
    return ans;
  }
}

int main() {
  string str;
  getline(cin, str);
  while(str != "#") {
    char where = 'A';
    while(str.length() != 0) {
      char oldWhere = where;
      switch(where) {
      case 'A':
	if(str[0] == '0') {
	  where = 'X';
	}
	else {
	  where = 'Y';
	}
	break;
      case 'B':
	if(str[0] == '0') {
	  where = 'Y';
	}
	else {
	  where = 'X';
	}
	break;
      case 'X':
	if(str[0] == '1') {
	  where = 'Z';
	}
	break;
      case 'Y':
	if(str[0] == '0') {
	  where = 'X';
	}
	break;
      case 'Z':
	if(str[0] == '0') {
	  where = 'W';
	}
	else {
	  where = 'B';
	}
	break;
      case 'W':
	if(str[0] == '0') {
	  where = 'B';
	}
	else {
	  where = 'Y';
	}
      }
      str = removedFirst(str);
      if(where == oldWhere) {
	where = 'N';
	str.clear();
      }
    }

    //char tmp = 'B';
    if(where == 'B') {
      cout<<"YES"<<endl;
    }
    else {
      cout<<"NO"<<endl;
    }
    getline(cin, str);
  }
}

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

#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int g[6][2]={{1,2},{0,3},{1,0},{4,5},{5,2},{2,1}};
    char str[128];
    while(scanf("%s",str),str[0]!='#'){
        int pos=0;
        for(int i=0;str[i];i++){
            pos=g[pos][str[i]-'0'];
        }
        puts(pos==5?"YES":"NO");
    }
    return 0;
}
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int g[6][2]={{1,2},{0,3},{1,0},{4,5},{5,2},{2,1}};
    char str[128];
    while(scanf("%s",str),str[0]!='#'){
        int pos=0;
        for(int i=0;str[i];i++){
            pos=g[pos][str[i]-'0'];
        }
        puts(pos==5?"YES":"NO");
    }
    return 0;
}

Compiler output:
a.cc:21:5: error: redefinition of 'int main()'
   21 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~
Language: C++

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

const signed int t[2][6] = {{1, -1, 1, 4, 5, 2},
                         {2, 3, -1, 5, 2, 1},
                         };

int main(void){
  string str;
  while(cin >> str, str != "#"){
    int now_pos = 0;
    for(int p=0; p < str.size(); p++){
      if([str[p] - '0'][now_pos] == -1){
        cout << "No" << endl;
        break;
      }else{
        now_pos = t[str[p] - '0'][now_pos];
      }
    }
    if(now_pos == 5){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: expected ',' before '[' token
   13 |       if([str[p] - '0'][now_pos] == -1){
      |              ^
      |              ,
a.cc:13:14: error: expected identifier before '[' token
a.cc: In lambda function:
a.cc:13:24: error: expected '{' before '[' token
   13 |       if([str[p] - '0'][now_pos] == -1){
      |                        ^
a.cc: In function 'int main()':
a.cc:13:24: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
Language: C++

#include <iostream>
using namespace std;
#define F(i,n) for( int i = 0; i < n; i++ )

char graph[6][2] = {
  // fで失敗
  { 'x', 'y' }, // a
  { 'f', 'z' }, // x
  { 'x', 'f' }, // y
  { 'w', 'b' }, // z
  { 'b', 'y' }, // w
  { 'y', 'x' }  // b    
};

bool simulate( string s ){
  char now = 'a';
  F( i, s.size() ){
    int next = s[i] == '0' ? 0 : 1;
    int nowIndex;
    if( now == 'a' ){ nowIndex = 0; }
    else if( now == 'x' ){ nowIndex = 1; }
    else if( now == 'y' ){ nowIndex = 2; }
    else if( now == 'z' ){ nowIndex = 3; }
    else if( now == 'w' ){ nowIndex = 4; }
    else if( now == 'b' ){ nowIndex = 5; }
    now = graph[ nowIndex ][ next ];
    if( now == 'f'){ return false; }
  }
  if( now == 'b' ){ return true; }
  else return false;
}

main(){
  string s;
  while( cin >> s && s != "#" ){
    if( simulate( s ) ){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }

Compiler output:
a.cc:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   33 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:41:4: error: expected '}' at end of input
   41 |   }
      |    ^
a.cc:33:7: note: to match this '{'
   33 | main(){
      |       ^
Language: C++

#include <iostream>
using namespace std;

int b[1000000];

int main(){
  int n;
  while(cin >>n , n){
    for (int i = 0; i < n; ++i){
      cin >> b[i];
    }
    int i = 0;
    for (; i <= 10000; ++i){


      
      bool f = true;
      for (int k = 0; k < 1000000 && b[k]; ++k){
	if (b[k] != k+1){
	  f =  false;
	  break;
	}
      }
      if ( f){
	break;
      }

      int t = 0;
      int j = 0;
      for (; j < 1000000 && b[j]; ++j){
	--b[j];
	++t;
      }
      
      b[j] = t;
      for (int k = 0; k <= j; ++k){
	if (!b[k]){
	  for ( int l = k+1; l <= j; ++l){
	    if ( b[l] ){
	      b[k]=b[l];
	      b[l] = 0;
	      break;
	    }
	  }
	}
      }
      
    }
    if (i<=10000){
      cout << i << endl;
    } else {0
      cout << -1 << endl;
    }
  }
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: expected ';' before 'cout'
   51 |     } else {0
      |              ^
      |              ;
   52 |       cout << -1 << endl;
      |       ~~~~
Language: C++

6
1 4 1 3 2 4
5
1 2 3 4 5
10
1 1 1 1 1 1 1 1 1 1
9
1 1 1 1 1 1 1 1 1
12
1 4 1 3 2 4 3 3 2 1 2 2
1
5050
3
10000 10000 100
0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 6
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define SMIN 3
#define SMAX 1000000
#define NMIN 1
#define NMAX 100
#define BMIN 1
#define BMAX 10000
#define LIM 10000
#define TCASE 20

bool valid[SMAX+1];

bool check(vector<int> v){
  if ( v[0] != 1 ) return false;
  for ( int i = 1; i < v.size(); i++ ){
    if ( v[i-1]+1 != v[i] ) return false;
  }
  return true;
}

int simulate(vector<int> v, int sum){
  int cnt = 0;
  while(1){
    if ( check(v) ) return cnt;
    int r = v.size();
    for ( int i = 0; i < v.size(); i++ ) v[i]--;
    vector<int> nv;
    for ( int i = 0; i < v.size(); i++ ) {
      if ( v[i] ) nv.push_back(v[i]);
    }
    v = nv;
    v.push_back(r);
    cnt++;
    if ( cnt > LIM ) return cnt;
  }
}

void main(){
  for ( int i = 0; i <= SMAX; i++ ) valid[i] = false;
  int cur = 3, d = 3;
  while( cur <= SMAX ){
    valid[cur] = true;
    cur += d;
    d++;
  }

  int n;
  int tcase = 0;
  while(1){
    cin >> n;
    if ( n == 0 ) break;
    tcase++;
    assert( NMIN <= n && n <= NMAX);
    vector<int> v;
    int x;
    int sum = 0;
    for ( int i = 0; i < n ;i++) {
      cin >> x;
      v.push_back(x);
      sum += x;
    }
    int ans = simulate(v, sum);
    if ( ans > 10000 ) cout << -1 << endl;
    else cout << ans << endl;
  }
  return 0;
}

Compiler output:
a.cc:39:1: error: '::main' must return 'int'
   39 | void main(){
      | ^~~~
Language: C

#include <iostream>
#include <cstdio>

using namespace std;

int main(){
  int Q;

  cin >> Q;
  while(Q--){
    unsigned int s;

    scanf("%x" ,&s);
  
    if(s >> 31) cout << '-';
    int integer = (s & 0x7fffffff) >> 7;
    int decimal = (s & 0x0000007f);

    double c[7],d = 0.0;

    c[0] = 0.5;
    for(int i = 1 ; i < 7 ; i++)
      c[i] = 0.5*c[i-1];

    double e = 64;
    for(int i = 0 ; i < 7 ; i++){
      if(e <= decimal){
	d += c[i];
	decimal -= e;
      }
      
      e /= 2;
    }

    while(true){
      if(((int)(d*10))%10 == 0) break;
      d *= 10;
    }

    cout << integer << '.';
    printf("%d\n" ,(int)d);
  }

  return 0;
}

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

#include<iostream>
#include<map>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<sstream>
using namespace std;

string toBinary(string c)
{
  if(c == "0")
    return "0000";
  int val = (atoi)(c.c_str());
  string ret,ret2;
  while(true)
    {
      if(val == 1)
	{
	  ret += "1";
	  break;
	}      
      val%2 == 0?ret += "0":ret += "1";
      val /= 2;
    }
  reverse(ret.begin(),ret.end());
  ret2 = string(4-ret.size(),'0')+ret;
  return ret2;
}

string dtos(double d)
{
  stringstream ss;
  ss << d;
  return ss.str();
}

int main()
{

  int N;
  cin >> N;
  while(N-- > 0)
    {
      string s;
      cin >> s;
      string bin;
      for(int i=0;i<s.length();i++)
	{
	  string c;
	  if(s[i] == 'a')
	    c = "10";
	  else if(s[i] == 'b')
	    c = "11";
	  else if(s[i] == 'c')
	    c = "12";
	  else if(s[i] == 'd')
	    c = "13";
	  else if(s[i] == 'e')
	    c = "14";
	  else if(s[i] == 'f')
	    c = "15";
	  else 
	    c = s[i];
	  bin += toBinary(c);
	}
      
      double ans = 0.0;
      for(int i=1;i<=24;i++)
	if(bin[i] == '1')ans += pow(2.0,24-i);
      for(int i=25;i<32;i++)
	if(bin[i] == '1')ans += pow(0.5,i-24);
      if(bin[0] == '1')
	cout << "-";
      string sol = dtos(ans);
      cout << sol;
      sol.find(".") == string::npos?cout << ".0" << endl:cout << endl;
    }
  return 0;
}

Compiler output:
a.cc: In function 'std::string toBinary(std::string)':
a.cc:25:3: error: 'reverse' was not declared in this scope
   25 |   reverse(ret.begin(),ret.end());
      |   ^~~~~~~
Language: C++

#include<iostream>
#include<map>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>


using namespace std;



char pat[16][5] =	{"0000" , 
					"0001" , 
					"0010" ,
					"0011" ,
					"0100" ,
					"0101" , 
					"0110" , 
					"0111" , 
					"1000" , 
					"1001" ,
					"1010" ,
					"1011" ,
					"1100" ,
					"1101" ,
					"1110" ,
					"1111" };

//連想配列を利用する
map<char , int> str_data;


void f_set();



int main(void)
{
	//入力数
	int n = 0;

	//関数で連想配列をセット
	f_set();

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		//入力変数
		char str_input[9] = {NULL};

		cin >> str_input;

		//文字列を結合する
		string str_output;
		for (int j = 1; j < 8; j++)
		{
			str_output += pat[str_data[str_input[j]]];
		}

		//文字列を1次的に格納する変数
		char str_copy[100] = {NULL};
		//カウント変数
		int count = 0;
		//stringの4番目(先頭は符号)
		for (int j = 4; j < 32 - 7; j++)
		{
			str_copy[count++] = str_output[j];
		}
		//ina型に変換
		unsigned long long int change = 0;

		//掛け算変数
		int kakeru = 1;
		//文字列をチェンジにコピー
		for (int j = 32 - 7 - 1 - 4; j >= 0; j--)
		{
			change += (str_copy[j] - '0') * kakeru;
  			kakeru *= 2;
		}
		
		//double部分の計算
		int output_double = 0;

		//文字列をコピー
		count = 0;
		for (int j = 32 - 7 - 4; j < 32 - 4; j++)
		{
			str_copy[count++] = str_output[j];
		}
		//一応ナル文字を代入
		str_copy[count] = '\0';

		//文字列から変換
		//割る数
		int waru = 2;
		for (int j = 0; j < count; j++)
		{
			output_double += (double)(str_copy[j] - '0') / waru * 1000000;
			waru *= 2;
		}

		//文字列に変換
		itoa(output_double , str_copy , 10);

		//文字列の長さを求める
		int length = strlen(str_copy);

		for (int j = length - 1; j >= 1; j--)
		{
			if (str_copy[j] == '0')
			{
				str_copy[j] = '\0';
			}
			else
			{
				break;
			}
		}

		output_double = atoi(str_copy);

		if (str_input[0] == '8')
		{
			cout << "-";
		}

		//(double)output_double += change;

		cout << change << "." << output_double << endl;
	}

	return 0;
}


void f_set()
{
	str_data['0'] = 0;
	str_data['1'] = 1;
	str_data['2'] = 2;
	str_data['3'] = 3;
	str_data['4'] = 4;
	str_data['5'] = 5;
	str_data['6'] = 6;
	str_data['7'] = 7;
	str_data['8'] = 8;
	str_data['9'] = 9;
	str_data['a'] = 10;
	str_data['b'] = 11;
	str_data['c'] = 12;
	str_data['d'] = 13;
	str_data['e'] = 14;
	str_data['f'] = 15;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:42: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   51 |                 char str_input[9] = {NULL};
      |                                          ^
a.cc:63:43: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   63 |                 char str_copy[100] = {NULL};
      |                                           ^
a.cc:105:17: error: 'itoa' was not declared in this scope
  105 |                 itoa(output_double , str_copy , 10);
      |                 ^~~~
Language: C++










#include<iostream>
#include<map>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cstdio>


using namespace std;



char pat[16][5] =	{"0000" , 
					"0001" , 
					"0010" ,
					"0011" ,
					"0100" ,
					"0101" , 
					"0110" , 
					"0111" , 
					"1000" , 
					"1001" ,
					"1010" ,
					"1011" ,
					"1100" ,
					"1101" ,
					"1110" ,
					"1111" };

//連想配列を利用する
map<char , int> str_data;


void f_set();



int main(void)
{
	//入力数
	int n = 0;

	//関数で連想配列をセット
	f_set();

	cin >> n;

	for (int i = 0; i < n; i++)
	{
		//入力変数
		char str_input[9] = {NULL};

		cin >> str_input;

		//文字列を結合する
		string str_output;
		for (int j = 1; j < 8; j++)
		{
			str_output += pat[str_data[str_input[j]]];
		}

		//文字列を1次的に格納する変数
		char str_copy[100] = {NULL};
		//カウント変数
		int count = 0;
		//stringの4番目(先頭は符号)
		for (int j = 4; j < 32 - 7; j++)
		{
			str_copy[count++] = str_output[j];
		}
		//ina型に変換
		unsigned long long int change = 0;

		//掛け算変数
		int kakeru = 1;
		//文字列をチェンジにコピー
		for (int j = 32 - 7 - 1 - 4; j >= 0; j--)
		{
			change += (str_copy[j] - '0') * kakeru;
  			kakeru *= 2;
		}
		
		//double部分の計算
		int output_double = 0;

		//文字列をコピー
		count = 0;
		for (int j = 32 - 7 - 4; j < 32 - 4; j++)
		{
			str_copy[count++] = str_output[j];
		}
		//一応ナル文字を代入
		str_copy[count] = '\0';

		//文字列から変換
		//割る数
		int waru = 2;
		for (int j = 0; j < count; j++)
		{
			output_double += (double)(str_copy[j] - '0') / waru * 1000000;
			waru *= 2;
		}

		//文字列に変換
		itoa(output_double , str_copy , 10);

		//文字列の長さを求める
		int length = strlen(str_copy);

		for (int j = length - 1; j >= 1; j--)
		{
			if (str_copy[j] == '0')
			{
				str_copy[j] = '\0';
			}
			else
			{
				break;
			}
		}

		output_double = atoi(str_copy);

		if (str_input[0] == '8')
		{
			cout << "-";
		}

		//(double)output_double += change;

		cout << change << "." << output_double << endl;
	}

	return 0;
}


void f_set()
{
	str_data['0'] = 0;
	str_data['1'] = 1;
	str_data['2'] = 2;
	str_data['3'] = 3;
	str_data['4'] = 4;
	str_data['5'] = 5;
	str_data['6'] = 6;
	str_data['7'] = 7;
	str_data['8'] = 8;
	str_data['9'] = 9;
	str_data['a'] = 10;
	str_data['b'] = 11;
	str_data['c'] = 12;
	str_data['d'] = 13;
	str_data['e'] = 14;
	str_data['f'] = 15;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:42: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   60 |                 char str_input[9] = {NULL};
      |                                          ^
a.cc:72:43: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
   72 |                 char str_copy[100] = {NULL};
      |                                           ^
a.cc:114:17: error: 'itoa' was not declared in this scope
  114 |                 itoa(output_double , str_copy , 10);
      |                 ^~~~
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include<numeric>
using namespace std;
 
const double PI = 3.14159265358979;
 
class Point {
public:
    double x, y;
    Point(double x = 0.0, double y = 0.0) :x(x), y(y) {}
};
 
class Wind {
public:
    double w, a;
};
 
bool include(double angle, double low, double high) {
    if(low < 0.0) {
        double l = low + 2.0 * PI;
        if(l <= angle) return true;
    }
    if(high > 2.0 * PI) {
        double h = high - 2.0 * PI;
        if(angle <= h) return true;
    }
    return low <= angle && angle <= high;
}
 
bool savor(const Point &home, const Wind &wind, const vector<Point> &blossom, double d) {
    d /= 2.0;
    for(const auto &b: blossom) {
        Point dif(home.x - b.x, home.y - b.y);
        double angle = atan2(dif.y, dif.x);
        double dist = hypot(dif.y, dif.x);
        if(angle < 0.0) angle = angle + 2.0 * PI;
        if(dist <= wind.a + EPS && include(angle, wind.w - d, wind.w + d)) return true;
    }
    return false;
}
 
double toRadian(double d) {
    return d * PI / 180.0;
}
 
int main() {
    int H, R;
    while(cin >> H >> R, H | R) {
        vector<Point> home(H);
        for(auto &i: home) cin >> i.x >> i.y;
 
        int U, M, S;
        double du, dm, ds;
        cin >> U >> M >> S >> du >> dm >> ds;
 
        du = toRadian(du);
        dm = toRadian(dm);
        ds = toRadian(ds);
 
        vector<Point> plum(U), peach(M), cherry(S);
        for(auto &i: plum) cin >> i.x >> i.y;
        for(auto &i: peach) cin >> i.x >> i.y;
        for(auto &i: cherry) cin >> i.x >> i.y;
 
        vector<Wind> wind(R);
        for(auto &i: wind) cin >> i.w >> i.a;
        for(auto &i: wind) i.w = toRadian(i.w);
 
        // solve
        vector<int> number(H, 0);
        int maxNumber = 0;
 
        for(int i = 0; i < H; ++i) {
            for(int day = 0; day < R; ++day) {
                bool ok = savor(home[i], wind[day], {Point(0.0, 0.0)}, du);
                bool ng = false;
                ng |= savor(home[i], wind[day], plum, du);
                ng |= savor(home[i], wind[day], peach, dm);
                ng |= savor(home[i], wind[day], cherry, ds);
 
                if(!ok || ng) continue;
 
                ++number[i];
                maxNumber = max(maxNumber, number[i]);
            }
        }
 
        if(maxNumber) {
            bool first = true;
            for(int i = 0; i < H; ++i) if(number[i] == maxNumber) {
                if(!first) cout << " ";
                first = false;
                cout << i + 1;
            }
            cout << endl;
        } else {
            cout << "NA" << endl;
        }
    }
}

Compiler output:
a.cc: In function 'bool savor(const Point&, const Wind&, const std::vector<Point>&, double)':
a.cc:40:29: error: 'EPS' was not declared in this scope
   40 |         if(dist <= wind.a + EPS && include(angle, wind.w - d, wind.w + d)) return true;
      |                             ^~~