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

#include <iostream>
#include <algorithm>
#define MAX 20000

int main(void){
  int array[MAX],n,sum,ans;

  while(cin >> n){
    for(int i = 0 ; i < n ; i++) cin >> array[i];

    sort(array,array+n);    

    sum = 0;
    ans = 0;
    for(int i = 0 ; i < n ; i++){
      sum += array[i];
      ans += sum; 
    }
    cout << ans << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   while(cin >> n){
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 |     sort(array,array+n);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout << ans << endl;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

//使い方もわからないくせにincludeしまくる人間のクズ
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<deque>
//using namespaceは必須
using namespace std;

//defineは可読性を左右する諸刃の剣

//型宣言をいつやればいいのか分からないためグローバルに宣言
int a[10], b, i; 
char str[10];
bool judge;

class InterestingNumber{
public:
  char test(){
    return std::Interesting;
  }
}


int main(){
  InterestingNumber ok;
  memset(a, 0, sizeof(int));
  scanf("%s", str);
  b = strlen(str);
  if(b % 2 != 0){
    printf("Not interesting\n");
    return 0;
  }
  judge = true;
  for(i = 0; i < b / 2; i++){
    if(str[i] == 'z') continue;
    if(i + (str[i] - '0') >= b){
      judge = false;
      break;
    }
    if(str[i] != str[i + str[i] - '0' + 1]){
      judge = false;
      break;
    }
    str[i + str[i] - '0' + 1] = 'z';
  }
  if(judge) ok.
  else printf("Not interesting\n");
  return 0;
}

Compiler output:
a.cc:27:2: error: expected ';' after class definition
   27 | }
      |  ^
      |  ;
a.cc: In member function 'char InterestingNumber::test()':
a.cc:25:17: error: 'Interesting' is not a member of 'std'
   25 |     return std::Interesting;
      |                 ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:3: error: expected unqualified-id before 'else'
   53 |   else printf("Not interesting\n");
      |   ^~~~
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int n;
  for(;cin>>n;)
    {
      long long int data[n];
      for(int i=0;i<n;i++)
	cin>>data[i];
      long long int ans=0;
      long long int sum=0;
      sort(data,data+n);
      for(int i=0;i<n;i++)
	{
	  sum+=data[i];
	  ans+=sum;
	}
      cout<<ans<<endl;
      
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |       sort(data,data+n);
      |       ^~~~
      |       short
Language: C++

#include <iostream>
#include <math.h>
using namespace std;


int main(int argc, const char * argv[])
{
    int n;
    while(cin >> n){
        int times[n];
        for(int i = 0; i < n; i++){
            cin >> times[i];
        }
        sort(times, times+n);
        
        int part_sum = 0;
        int all_sum = 0;
        for(int i = 0; i < n; i++){
            part_sum += times[i];
            all_sum += part_sum;
        }
        
        cout << all_sum; << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   14 |         sort(times, times+n);
      |         ^~~~
      |         sqrt
a.cc:23:26: error: expected primary-expression before '<<' token
   23 |         cout << all_sum; << "\n";
      |                          ^~
Language: C++

#include <iostream>
#include <math.h>
using namespace std;


int main(int argc, const char * argv[])
{
    int n;
    while(cin >> n){
        int times[n];
        for(int i = 0; i < n; i++){
            cin >> times[i];
        }
        sort(times, times+n);
        
        int part_sum = 0;
        int all_sum = 0;
        for(int i = 0; i < n; i++){
            part_sum += times[i];
            all_sum += part_sum;
        }
        
        cout << all_sum << "\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   14 |         sort(times, times+n);
      |         ^~~~
      |         sqrt
Language: Java

import java.util.Scanner;

/**
 * Vampirish Night
 *  URL:http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1019&lang=jp
 *
 * @author Igari Kazuya
 */
public class P1019_Vampirish_Night {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO ツ篠ゥツ督ョツ青カツ青ャツつウツづェツつスツδソツッツドツ・ツスツタツブ
		Scanner sc = new Scanner(System.in);
		int n,k;
		while(true){
			n = sc.nextInt();
			k = sc.nextInt();

			if(n==0 && k==0){
				break;
			}

			int[][] array = new int[n+1][k];
			for(int i=0;i<n+1;i++){
				for(int j=0;j<k;j++){
					array[i][j] = sc.nextInt();
				}
			}

			for(int i=1;i<n+1;i++){
				for(int j=0;j<k;j++){
					array[0][j] -= array[i][j];
				}
			}

			boolean flag = true;
			for(int i=0;i<k;i++){
				if(array[0][i] < 0){
					flag = false;
				}
			}

			if(flag){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
		}
	}

}

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

  for(;scanf("%d%d",&n,&k),n;){
    for(i=0;i<k;i++)scanf("%d",a+i);
    for(;n--;)
      for(i=0;i<k;a[i++]-=x)scanf("%d",&x),;
    for(i=0;i<k&&a[i]>=0;i++);
    puts(k-i?"No":"Yes");
  }
  return 0;
}

Compiler output:
main.c:1:3: error: expected identifier or '(' before 'for'
    1 |   for(;scanf("%d%d",&n,&k),n;){
      |   ^~~
main.c:1:14: error: expected declaration specifiers or '...' before string constant
    1 |   for(;scanf("%d%d",&n,&k),n;){
      |              ^~~~~~
main.c:1:21: error: expected declaration specifiers or '...' before '&' token
    1 |   for(;scanf("%d%d",&n,&k),n;){
      |                     ^
main.c:1:24: error: expected declaration specifiers or '...' before '&' token
    1 |   for(;scanf("%d%d",&n,&k),n;){
      |                        ^
main.c:1:30: error: expected identifier or '(' before ')' token
    1 |   for(;scanf("%d%d",&n,&k),n;){
      |                              ^
main.c:8:3: error: expected identifier or '(' before 'return'
    8 |   return 0;
      |   ^~~~~~
main.c:9:1: error: expected identifier or '(' before '}' token
    9 | }
      | ^
Language: C

#define _USE_MATH_DEFINES
#define INF 100000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair <int,int> P;

static const double EPS = 1e-8;

int main(){
	int N,K;

	int tank[100];
	while(~scanf("%d %d",&N,&K)){
		if(N==K && K==0) break;
		for(int i=0;i<K;i++){
			scanf("%d",tank+i);
		}

		bool isok = true;
		for(int i=0;i<N;i++){
			for(int j=0;j<K;j++){
				int B;
				scanf("%d",&B);
				tank[j]-=B;
				if(tank[j]<0) isok = false;
			}
		}

		printf("%s\n",isok ? "Yes" : "No");
	}
}

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

using System;
using System.Collections.Generic;
using System.Text;

class TEST{
	static void Main(){
		while(true){
		String s="";
		if((s=Console.ReadLine())==null)break;
		long[] ss=Array.ConvertAll(s.Split(' '),elem=>long.Parse(elem));
		if(ss[0]==0)break;
		long N=ss[0];
		long K=ss[1];
		Sol mySol=new Sol(N,K);
		Console.WriteLine(mySol.Ans);
		}
	}
}

class Sol{
	String ans;
	public String Ans{
		get{return ans;}
	}
	public Sol(long N,long K){
		long[] Stock=Array.ConvertAll(Console.ReadLine().Split(' '),elem=>long.Parse(elem));
		bool chk=true;
		for(int i=0;i<N;i++){
			var S=Console.ReadLine().Split(' ');
			for(int j=0;j<K;j++){
				Stock[j]-=long.Parse(S[j]);
				if(Stock[j]<0)chk=false;
			}
		}
		if(chk)ans="Yes";
		if(!chk)ans="No";
	}
}

Compiler output:
main.c:1:1: error: unknown type name 'using'
    1 | using System;
      | ^~~~~
main.c:2:1: error: unknown type name 'using'
    2 | using System.Collections.Generic;
      | ^~~~~
main.c:2:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | using System.Collections.Generic;
      |             ^
main.c:3:1: error: unknown type name 'using'
    3 | using System.Text;
      | ^~~~~
main.c:3:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    3 | using System.Text;
      |             ^
main.c:5:1: error: unknown type name 'class'
    5 | class TEST{
      | ^~~~~
main.c:5:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    5 | class TEST{
      |           ^
main.c:20:1: error: unknown type name 'class'
   20 | class Sol{
      | ^~~~~
main.c:20:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   20 | class Sol{
      |          ^
Language: C++

#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int a,b;
  while(cin>>a>>b,a+b){
    int S[b];
    for(int i=0;i<b;i++)
      cin>>S[i];
    int flag=1;
    for(int i=0;i<a;i++){
      for(int j=0;j<b;j++){
	int B;
	cin>>B;
	S[j]-=B;
	if(S[j]<0){
	  flag=0;
	}
      }
    }
    if(flag)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'cin' was not declared in this scope
   18 |   while(cin>>a>>b,a+b){
      |         ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include<cmath>
  +++ |+#include <iostream>
    7 | #define INF 2147483647
a.cc:34:7: error: 'cout' was not declared in this scope
   34 |       cout<<"Yes"<<endl;
      |       ^~~~
a.cc:34:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:20: error: 'endl' was not declared in this scope
   34 |       cout<<"Yes"<<endl;
      |                    ^~~~
a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    6 | #include<cmath>
  +++ |+#include <ostream>
    7 | #define INF 2147483647
a.cc:36:7: error: 'cout' was not declared in this scope
   36 |       cout<<"No"<<endl;
      |       ^~~~
a.cc:36:7: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:36:19: error: 'endl' was not declared in this scope
   36 |       cout<<"No"<<endl;
      |                   ^~~~
a.cc:36:19: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

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

using namespace std;

int exist[100000];
int needed[100000];
int main(){
	int n,k;
	while(1)
	{
		cin >> n >> k;
		if (n==0)break;
		memset(exist,0,sizeof(exist));
		memset(needed,0,sizeof(needed));
		for (int i=0; i<k; i++)
		{
			cin >> exist[i];
		}
		int tmp;
		for (int i=0; i<n; i++)
		{
			for (int j=0; j<k; j++)
			{
				cin >> tmp;
				needed[j]+=tmp;
			}
		}
		int ok=1;
		for (int i=0; i<k; i++)
		{
			if (exist[i]<needed[i])
			{
				ok=0;
				break;
			}
		}
		(ok==1)?cout << "YES" << endl:cout << "NO" << endl;
	}
	return 0;
}

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

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

int N, K;

int main()
{
  while (scanf("%d %d ", &N, &K) == 2) {
    if (N == 0 && K == 0) {
      break;
    }
    //    printf("(N, K) = (%d, %d)\n", N, K);
    vector<int> S;
    for (int i = 0; i < K; i++) {
      int s;
      scanf("%d ", &s);
      S.push_back(s);
    }

    bool flag = true;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < K; j++) {
	int b;
	scanf("%d ", &b);
	S[j] -= b;
	if (S[j] < 0) {
	  flag = false;
	}
      }      
    }
    if (flag) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

int N, K;

int main()
{
  while (scanf("%d %d ", &N, &K) == 2) {
    if (N == 0 && K == 0) {
      break;
    }
    //    printf("(N, K) = (%d, %d)\n", N, K);
    vector<int> S;
    for (int i = 0; i < K; i++) {
      int s;
      scanf("%d ", &s);
      S.push_back(s);
    }

    bool flag = true;
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < K; j++) {
	int b;
	scanf("%d ", &b);
	S[j] -= b;
	if (S[j] < 0) {
	  flag = false;
	}
      }      
    }
    if (flag) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}

Compiler output:
a.cc:45:5: error: redefinition of 'int N'
   45 | int N, K;
      |     ^
a.cc:6:5: note: 'int N' previously declared here
    6 | int N, K;
      |     ^
a.cc:45:8: error: redefinition of 'int K'
   45 | int N, K;
      |        ^
a.cc:6:8: note: 'int K' previously declared here
    6 | int N, K;
      |        ^
a.cc:47:5: error: redefinition of 'int main()'
   47 | int main()
      |     ^~~~
a.cc:8:5: note: 'int main()' previously defined here
    8 | int main()
      |     ^~~~
Language: C++

#include<stdio.h>




int main(){
	int N,K;
	int S[100];
	int B;
	int count;
	int h=1;

	int i,j;

	scanf("%d %d",&N,&K);

	while((N!=0)&&(K!=0)){
		h=1;
		for(i=0;i<K;i++){
			scanf("%d",&S[i]);
		}

		for(i=0;i<N;i++){
			for(j=0;j<K;j++){
				scanf("%d",&B);
				}
			}
		}
		if(h==1){
			printf("Yes\n");
		}


		scanf("%d %d",&N,&K);
	}

	return 0;

}

Compiler output:
a.cc:37:9: error: expected unqualified-id before 'return'
   37 |         return 0;
      |         ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

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

int main(){
  int N, K;
  while( scanf("%d %d", &N, &K), N||K ){
    vector<int> bloods;
    for( int i=0; i<K; i++ ){
      int b;
      scanf("%d", &b);
      bloods.push_back(b);
    }

    for( int i=0; i<N; i++ ){
      for( int j=0; j<K; j++ ){
        int b;
        scanf("%d", &b );
        bloods[j] -= b;
      }
    }
    bool runout = false;
    for( int i=0; i<K; i++ ){
      if( bloods[j] < 0 ){
        runout = true;
        break;
    }
    printf(runout?"No\n":"Yes\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: 'j' was not declared in this scope
   24 |       if( bloods[j] < 0 ){
      |                  ^
a.cc:31:2: error: expected '}' at end of input
   31 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include<stdio.h>
main(){
    int N,K,blood[101],family[101],tmp,i,j,x;
    while(1){
         scanf("%d %d", &N, &K)
         if(N==0&&k==0)
         break;
        tmp=1;
        for(i=0;i<K;i++)
            scanf("%d",&blood[i]);
        for(i=0;i<N;i++){
            for(j=0;j<K;j++){
                scanf("%d",&x);
                blood[j]-=x;
                if(blood[j]<0)
                tmp=0;
            }
        }
        if(tmp==0)
        printf("no\n");
        else
        printf("yes\n");
    }
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:32: error: expected ';' before 'if'
    5 |          scanf("%d %d", &N, &K)
      |                                ^
      |                                ;
    6 |          if(N==0&&k==0)
      |          ~~
Language: C++

#include<stdio.h>
main(){
    int N,K,blood[101],family[101],tmp,i,j,x;
    while(1){
         scanf("%d %d", &N, &K);
         if(N==0&&k==0)
         break;
        tmp=1;
        for(i=0;i<K;i++)
            scanf("%d",&blood[i]);
        for(i=0;i<N;i++){
            for(j=0;j<K;j++){
                scanf("%d",&x);
                blood[j]-=x;
                if(blood[j]<0)
                tmp=0;
            }
        }
        if(tmp==0)
        printf("no\n");
        else
        printf("yes\n");
    }
}

Compiler output:
a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:6:19: error: 'k' was not declared in this scope
    6 |          if(N==0&&k==0)
      |                   ^
Language: C

#include "stdio.h"
#include "math.h"

int main()
{
	int n;
	char s, t, b;

	scanf("%d", &n);
	while(n>0){
		scanf(" %c %c %c", &s, &t, &b);
		s-='A'; t-='A'; b-='A';

		int footprint1[9]={0,0,0,0,0,0,0,0,0};
		int footprint2[9];
		footprint1[s] = 1;
		for(int i=0; i<n; i++){
			for(int j=0; j<9; j++) footprint2[j]=0;
			for(int j=0; j<9; j++){
				if(footprint1[j]>0){
					if(j>2 && j-3!=b) footprint2[j-3]+=footprint1[j];
					else footprint2[j]+=footprint1[j];
					if(j%3>0 && j-1!=b) footprint2[j-1]+=footprint1[j];
					else footprint2[j]+=footprint1[j];
					if((j+1)%3>0 && j+1!=b) footprint2[j+1]+=footprint1[j];
					else footprint2[j]+=footprint1[j];
					if(j<6 && j+3!=b) footprint2[j+3]+=footprint1[j];
					else footprint2[j]+=footprint1[j];
				}
			}
			for(int j=0; j<9; j++) footprint1[j]=footprint2[j];
		}

		printf("%f\n", footprint1[t] / pow(4.0, n));

		scanf("%d", &n);
	}

	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccEm14L3.o: in function `main':
main.c:(.text+0x2fe): undefined reference to `pow'
collect2: error: ld returned 1 exit status
Language: C

#include "stdio.h"
#include "math.h"

int main()
{
 int n;
 char s, t, b;

 scanf("%d", &n);
 while(n>0){
  scanf(" %c %c %c", &s, &t, &b);
  s-='A'; t-='A'; b-='A';

  int footprint1[9]={0,0,0,0,0,0,0,0,0};
  int footprint2[9];
  footprint1[s] = 1;
  for(int i=0; i<n; i++){
   for(int j=0; j<9; j++) footprint2[j]=0;
   for(int j=0; j<9; j++){
    if(footprint1[j]>0){
     if(j>2 && j-3!=b) footprint2[j-3]+=footprint1[j];
     else footprint2[j]+=footprint1[j];
     if(j%3>0 && j-1!=b) footprint2[j-1]+=footprint1[j];
     else footprint2[j]+=footprint1[j];
     if((j+1)%3>0 && j+1!=b) footprint2[j+1]+=footprint1[j];
     else footprint2[j]+=footprint1[j];
     if(j<6 && j+3!=b) footprint2[j+3]+=footprint1[j];
     else footprint2[j]+=footprint1[j];
    }
   }
   for(int j=0; j<9; j++) footprint1[j]=footprint2[j];
  }

  printf("%f\n", footprint1[t] / pow(4.0, n));

  scanf("%d", &n);
 }

 return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccHTJXQ4.o: in function `main':
main.c:(.text+0x2fe): undefined reference to `pow'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
int dp[16][9];
const int m[]={-3,-1,1,3};
int main(){
	while(true){
		int n;	cin>>n;
		if(n==0)	return 0;
		char s,t,b;	cin>>s>>t>>b;
		int ss=s-'A',bb=b-'A',tt=t-'A';
		memset(dp,0,sizeof(dp));
		dp[0][tt]=1;
		for(int i=0;i<n;i++){
			for(int j=0;j<9;j++){
				if(dp[i][j]==0)	continue;
				for(int k=0;k<4;k++){
					if(j+m[k]<0||9<=j+m[k])	dp[i+1][j]+=dp[i][j];
					else if(bb==j+m[k])	dp[i+1][j]+=dp[i][j];
					else 	dp[i+1][j+m[k]]+=dp[i][j];
				}
			}
		}
		printf("%.15lf\n",(double)dp[n][ss]>>(2*n));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:52: error: invalid operands of types 'double' and 'int' to binary 'operator>>'
   23 |                 printf("%.15lf\n",(double)dp[n][ss]>>(2*n));
      |                                   ~~~~~~~~~~~~~~~~~^~~~~~~
      |                                   |                    |
      |                                   double               int
Language: C++

#include<iostream>
#include<map>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
using namespace std;

double dp[16][9];
int k, x, y, z;
int b[9][4]={
	{1,3,-1,-1},
	{ 0,2,4,-1 },
	{ 1,5,-1,-1 },
	{ 0,4,6,-1 },
	{ 1,3,5,7 },
	{ 2,4,8,-1 },
	{ 3,7,-1,-1 },
	{ 4,6,8,-1 },
	{ 5,7,-1,-1 }
};
int main() {
	while (cin >> k, k) {
		memset(dp, 0, sizeof(dp));
		char a, b, c; cin >> a >> b >> c;
		dp[0][a - 'A'] = 1;
	    y = b - 'A'; z = c - 'A';
		double S = 0;
		for (int i = 0; i < k; i++) {
			for (int j = 0; j < 9; j++) {
				for (int l = 0; l < 4; l++) {
					if (::b[j][l] == -1 || ::b[j][l] == z) {
						dp[i + 1][j] += dp[i][j] * 0.25;
					}
					else {
						dp[i + 1][::b[j][l]] += dp[i][j] * 0.25;
					}
				}
			}
		}
		printf("%.10lf\n", dp[k][y]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'memset' was not declared in this scope
   26 |                 memset(dp, 0, sizeof(dp));
      |                 ^~~~~~
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 | #include<map>
Language: C++

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
const double PI = acos(-1);


int n;
char s, t, b;
pair<int, int> S, T, B;
double dp[16][3][3];

int dx[] = { 0,1,0,-1 }, dy[] = { -1,0,1,0 };

int main() {
	while (cin >> n&&n) {
		cin >> s >> t >> b;
		S = make_pair((s - 'A') / 3, (s - 'A') % 3);
		T = make_pair((t - 'A') / 3, (t - 'A') % 3);
		B = make_pair((b - 'A') / 3, (b - 'A') % 3);
		memset(dp, 0.0, sizeof(dp));
		dp[0][S.first][S.second] = 1;
		for (int i = 0; i < n; i++) {
			for (int y = 0; y < 3; y++) {
				for (int x = 0; x < 3; x++) {
					if (dp[i][y][x] == 0)continue;
					for (int d = 0; d < 4; d++) {
						int ny = y + dy[d], nx = x + dx[d];
						if (0 <= nx&&nx < 3 && 0 <= ny&&ny < 3 && make_pair(ny, nx) != B)dp[i + 1][ny][nx] += dp[i][y][x] * 0.25;
						else dp[i + 1][y][x] += dp[i][y][x] * 0.25;
					}
				}
			}
		}
		cout << fixed << setprecision(10) << dp[n][T.first][T.second] << endl;
	}
}

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

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;
const double PI = acos(-1);


int n;
char s, t, b;
pair<int, int> S, T, B;
double dp[16][3][3];

int dx[] = { 0,1,0,-1 }, dy[] = { -1,0,1,0 };

int main() {
	while (cin >> n&&n) {
		cin >> s >> t >> b;
		S = make_pair((s - 'A') / 3, (s - 'A') % 3);
		T = make_pair((t - 'A') / 3, (t - 'A') % 3);
		B = make_pair((b - 'A') / 3, (b - 'A') % 3);
		std::memset(dp, 0.0, sizeof(dp));
		dp[0][S.first][S.second] = 1;
		for (int i = 0; i < n; i++) {
			for (int y = 0; y < 3; y++) {
				for (int x = 0; x < 3; x++) {
					if (dp[i][y][x] == 0)continue;
					for (int d = 0; d < 4; d++) {
						int ny = y + dy[d], nx = x + dx[d];
						if (0 <= nx&&nx < 3 && 0 <= ny&&ny < 3 && make_pair(ny, nx) != B)dp[i + 1][ny][nx] += dp[i][y][x] * 0.25;
						else dp[i + 1][y][x] += dp[i][y][x] * 0.25;
					}
				}
			}
		}
		cout << fixed << setprecision(10) << dp[n][T.first][T.second] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: 'memset' is not a member of 'std'; did you mean 'wmemset'?
   34 |                 std::memset(dp, 0.0, sizeof(dp));
      |                      ^~~~~~
      |                      wmemset
Language: C++

#include <stdio.h>

int dp[16][3 + 2][3 + 2];

int main(void)
{
	int n;
	char s[2], e[2], t[2];
	int start;
	int end;
	int not;
	int mot;
	
	while (1){
		scanf("%d", &n);
		if (n == 0) break;
		
		scanf("%s%s%s", s, e, t);
		
		for (int i = 0; i < 5; i++){
			for (int j = 0; j < 5; j++){
				for (int k = 0; k < 16; k++){
					if (i == 0 || i == 4 || j == 0 || j == 4){
						dp[k][i][j] = -1;
					}
					else {
						dp[k][i][j] = 0;
					}
				}
			}
		}
		
		start = s[0] - 'A';
		not = t[0] - 'A';
		dp[0][(start % 3) + 1][(start / 3) + 1] = 1;
		
		for (int i = 0; i < n + 1; i++){
			dp[i][(not % 3) + 1][(not / 3) + 1] = -1;
		}
		
		for (int i = 0; i < n; i++){
			for (int y = 1; y <= 3; y++){
				for (int x = 1; x <= 3; x++){
					if (dp[i][x][y] == -1) continue;
					if (dp[i][x + 1][y] == -1){
						dp[i + 1][x][y] += dp[i][x][y];
					}
					else {
						dp[i + 1][x + 1][y] += dp[i][x][y];
					}
					if (dp[i][x - 1][y] == -1){
						dp[i + 1][x][y] += dp[i][x][y];
					}
					else {
						dp[i + 1][x - 1][y] += dp[i][x][y];
					}
					if (dp[i][x][y + 1] == -1){
						dp[i + 1][x][y] += dp[i][x][y];
					}
					else {
						dp[i + 1][x][y + 1] += dp[i][x][y];
					}
					if (dp[i][x][y - 1] == -1){
						dp[i + 1][x][y] += dp[i][x][y];
					}
					else {
						dp[i + 1][x][y - 1] += dp[i][x][y];
					}
				}
			}
		}
		
		mot = 0;
		for (int y = 1; y <= 3; y++){
			for (int x = 1; x <= 3; x++){
				if (dp[n][x][y] != -1){
					mot += dp[n][x][y];
				}
			}
		}
		end = e[0] - 'A';
		printf("%lf\n", double((double)(dp[n][(end % 3) + 1][(end / 3) + 1]) / (double)mot));
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: expected unqualified-id before 'not' token
   11 |         int not;
      |             ^~~
a.cc:34:21: error: expected primary-expression before '=' token
   34 |                 not = t[0] - 'A';
      |                     ^
a.cc:38:36: error: expected primary-expression before '%' token
   38 |                         dp[i][(not % 3) + 1][(not / 3) + 1] = -1;
      |                                    ^
a.cc:38:51: error: expected primary-expression before '/' token
   38 |                         dp[i][(not % 3) + 1][(not / 3) + 1] = -1;
      |                                                   ^
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
char s,t,b;
char fld[3][3]={"ABC","DEF","GHI"};
int ans,sum,dx[]={1,0,-1,0},dy[]={0,1,0,-1};
void rep(int now,int y,int x){
	int X,Y;
	if(now==0){
		sum++;
		if(fld[y][x]==t){
			ans++;
		}
		return ;
	}
	for(int i=0;i<4;i++){
		X=x+dx[i];
		Y=y+dy[i];
		if(X>=0&&X<3&&Y>=0&&Y<3&&fld[Y][X]!=b){
			rep(now-1,Y,X);
		}
		else{
			rep(now-1,y,x);
		}
	}
}
int main(){
	int n;
	while(cin>>n,n){
		cin>>s>>t>>b;
		sum=0;
		ans=0;
		for(int i=0;i<3;i++)
		for(int j=0;j<3;j++){
			if(fld[i][j]==s)
			rep(n,i,j);
		}
		cout<<ans<<' '<<sum<<endl;
		printf("%.8lf\n",(double)ans/sum);
	}
	return 0;
}

Compiler output:
a.cc:5:17: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 | char fld[3][3]={"ABC","DEF","GHI"};
      |                 ^~~~~
a.cc:5:23: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 | char fld[3][3]={"ABC","DEF","GHI"};
      |                       ^~~~~
a.cc:5:29: error: initializer-string for 'char [3]' is too long [-fpermissive]
    5 | char fld[3][3]={"ABC","DEF","GHI"};
      |                             ^~~~~
Language: C++

int dy[4]={0,0,1,-1};
int bx,by;
int tx,ty;

long double rec(int rest,int x,int y){
     //cout<<"x:"<<x<<"y:"<<y<<endl;
     if(x<0||x>2||y<0||y>2)return 0;
     if(dp[rest][x][y]>0)return dp[rest][x][y];

     if(rest==0){
	  if(x==tx&&y==ty)return 1;
	  else return 0;
     }
     long double sum=0;
     for(int i=0;i<4;i++){
	  if(((x+dx[i]==bx)&&(y+dy[i]==by))||x+dx[i]<0||x+dx[i]>2||y+dy[i]>2||y+dy[i]<0){
	       sum+=rec(rest-1,x,y);
	       }else{
	       sum+=rec(rest-1,x+dx[i],y+dy[i]);
	  }
     }
     sum=sum/4.0;
     dp[rest][x][y]=sum;
     return sum;
}
void topoint(char a,int &x,int &y){
     int tmp=a-'A';
     x=tmp/3;
     y=tmp%3;
     return;
}
int main(){
     int N;
     cout.precision(8);
     cout.setf(ios::fixed);
     while(cin>>N,N){
	  char s,t,b;
	  cin>>s>>t>>b;
	  int sx,sy;
	  topoint(s,sx,sy);
	  topoint(t,tx,ty);
	  topoint(b,bx,by);
	  //cout<<sx<<":"<<sy<<" "<<tx<<":"<<ty<<endl;
	  cout<<rec(N,sx,sy)<<endl;
	  for(int i=0;i<15;i++){
	       for(int j=0;j<3;j++){
		    for(int k=0;k<3;k++){
			 dp[i][j][k]=0;
		    }
	       }
	  }
		   
     }
     return 0;
}

Compiler output:
a.cc: In function 'long double rec(int, int, int)':
a.cc:8:9: error: 'dp' was not declared in this scope; did you mean 'dy'?
    8 |      if(dp[rest][x][y]>0)return dp[rest][x][y];
      |         ^~
      |         dy
a.cc:16:18: error: 'dx' was not declared in this scope; did you mean 'x'?
   16 |           if(((x+dx[i]==bx)&&(y+dy[i]==by))||x+dx[i]<0||x+dx[i]>2||y+dy[i]>2||y+dy[i]<0){
      |                  ^~
      |                  x
a.cc:23:6: error: 'dp' was not declared in this scope; did you mean 'dy'?
   23 |      dp[rest][x][y]=sum;
      |      ^~
      |      dy
a.cc: In function 'int main()':
a.cc:34:6: error: 'cout' was not declared in this scope
   34 |      cout.precision(8);
      |      ^~~~
a.cc:35:16: error: 'ios' has not been declared
   35 |      cout.setf(ios::fixed);
      |                ^~~
a.cc:36:12: error: 'cin' was not declared in this scope
   36 |      while(cin>>N,N){
      |            ^~~
a.cc:44:31: error: 'endl' was not declared in this scope
   44 |           cout<<rec(N,sx,sy)<<endl;
      |                               ^~~~
a.cc:48:26: error: 'dp' was not declared in this scope; did you mean 'dy'?
   48 |                          dp[i][j][k]=0;
      |                          ^~
      |                          dy
Language: C++

#include <iostream>

using namespace std;

int n;
char room[10] = "ABCDEFGHI";
char s, t, b;
int off[4][2] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
int x, y;

double table[3][3];

double solve()
{
	memset(&table[0][0], 0, sizeof(double) * 9);
	table[x][y] = 1.0;
	for(int k=0; k<n; k++)
	{
		double temp[3][3];
		memset(&temp[0][0], 0, sizeof(double) * 9);
		for(int j=0; j<3; j++)
		{
			for(int i=0; i<3; i++)
			{
				if(table[j][i] != 0.0)
				{
					for(int m=0; m<4; m++)
					{
						int xx = i + off[m][0];
						int yy = j + off[m][1];
						int index = xx + yy * 3;
						xx = (xx>=0 && xx<3 && room[index] != b) ? xx : i;
						yy = (yy>=0 && yy<3 && room[index] != b) ? yy : j;
						temp[yy][xx] += table[j][i] / 4.0;
					}
				}
			}
		}

		memcpy(&table[0][0], &temp[0][0], sizeof(double) * 9);
	}

	for(int i=0; i<9; i++)
	{
		if(room[i]==t) return table[i/3][i%3];
	}

	return 0.0;
}

int main()
{
	while( 1 )
	{
		cin >> n;
		if(n==0) break;
		
		cin >> s >> t >> b;
		for(int i=0; i<9; i++)
		{
			if(room[i] == s)
			{
				x = i%3;
				y = i/3;
			}
		}

		printf("%.8f\n", solve());
	}

	return 0;
}

Compiler output:
a.cc: In function 'double solve()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset(&table[0][0], 0, sizeof(double) * 9);
      |         ^~~~~~
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 | 
a.cc:40:17: error: 'memcpy' was not declared in this scope
   40 |                 memcpy(&table[0][0], &temp[0][0], sizeof(double) * 9);
      |                 ^~~~~~
a.cc:40:17: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <cstdio>
#include <iomanip>

using namespace std;

const double EPS = 1e-8;

int n;
pair<int, int> s, t, b;
double dp[16][3][3];
int dy[] = {-1, 0, 1, 0};
int dx[] = {0, 1, 0, -1};

bool equals(double a, double b){
  return abs(a-b) < EPS;
}

void setp(pair<int, int>& p, char c){
  int tmp = c - 'A';
  p = make_pair(tmp/3, tmp-(tmp/3)*3);
}

main(){
  while(cin >> n && n){
    char in1, in2, in3;
    cin >> in1 >> in2 >> in3;
    setp(s, in1);
    setp(t, in2);
    setp(b, in3);
    fill(dp[0][0], dp[16][0], 0.0);
    dp[0][s.first][s.second] = 1.0;
    for(int i=0;i<n;i++){
      for(int j=0;j<3;j++){
	for(int k=0;k<3;k++){
	  if(equals(dp[i][j][k], 0.0)) continue;
	  /*if(j == t.first && k == t.second){
	    dp[i+1][j][k] += dp[i][j][k];
	    continue;
	    }*/
	  for(int l=0;l<4;l++){
	    int ty = j + dy[l];
	    int tx = k + dx[l];
	    if(ty>=0 && ty<3){
	      if(tx>=0 && tx<3){
		if(ty != b.first || tx != b.second){
		  dp[i+1][ty][tx] += dp[i][j][k] / 4.0;
		  continue;
		}
	      }
	    }
	    dp[i+1][j][k] += dp[i][j][k] / 4.0;
	  }
	}
      }
      /*for(int j=0;j<3;j++){
	for(int k=0;k<3;k++){
	  cout << setw(6) << dp[i][j][k] << ' ';
	}
	cout << endl;
      }
      cout << endl;*/
    }
    /*for(int j=0;j<3;j++){
      for(int k=0;k<3;k++){
	cout << setw(6) << dp[n][j][k] << ' ';
      }
      cout << endl;
      }*/
    printf("%.8f\n", dp[n][t.first][t.second]);
  }

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

#include<iostream>
#include<map>
#include<string.h>
using namespace std;

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

struct Cor{
	int x,y;
	Cor(int a,int b){
		x=a,y=b;
	}
};

int main()
{
	map<char,pair<int,int>> M;
	M['A']=make_pair(0,0);
	M['B']=make_pair(1,0);
	M['C']=make_pair(2,0);
	M['D']=make_pair(0,1);
	M['E']=make_pair(1,1);
	M['F']=make_pair(2,1);
	M['G']=make_pair(0,2);
	M['H']=make_pair(1,2);
	M['I']=make_pair(2,2);

	int n;
	while(cin>>n &&n!=0){
		char s,t,b;
		cin>>s>>t>>b;
		pair<int,int> now=M[s];
		pair<int,int> goal=M[t];
		pair<int,int> not=M[b];

		double ans[17][3][3];

		for(int i=0;i<16;i++)
			for(int x=0;x<3;x++)
				for(int y=0;y<3;y++)
					ans[i][y][x]=0.0;

		cout<<now.first<<" "<<now.second<<endl;
		ans[0][now.second][now.first]=1.0;

		for(int i=0;i<n;i++){
			for(int x=0;x<3;x++){
				for(int y=0;y<3;y++){
					for(int r=0;r<4;r++){
						int nx=x+dx[r],ny=y+dy[r];
						if(nx<0 || nx>=3 || ny<0 || ny>=3 || make_pair(nx,ny)==not){
							ans[i+1][y][x]+=ans[i][y][x]/4.0;
						}
						else{
							ans[i+1][ny][nx]+=ans[i][y][x]/4.0;
						}
					}
				}
			}
		}
		cout<<ans[n][goal.second][goal.first]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:31: error: expected unqualified-id before 'not' token
   35 |                 pair<int,int> not=M[b];
      |                               ^~~
a.cc:52:107: error: expected primary-expression before ')' token
   52 |                                                 if(nx<0 || nx>=3 || ny<0 || ny>=3 || make_pair(nx,ny)==not){
      |                                                                                                           ^
Language: C++

#include<iostream>
#include<map>
#include<string.h>
using namespace std;

int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};

int main()
{
	map<char,pair<int,int> > M;
	M['A']=make_pair(0,0);
	M['B']=make_pair(1,0);
	M['C']=make_pair(2,0);
	M['D']=make_pair(0,1);
	M['E']=make_pair(1,1);
	M['F']=make_pair(2,1);
	M['G']=make_pair(0,2);
	M['H']=make_pair(1,2);
	M['I']=make_pair(2,2);

	int n;
	while(cin>>n &&n!=0){
		char s,t,b;
		cin>>s>>t>>b;
		pair<int,int> now=M[s];
		pair<int,int> goal=M[t];
		pair<int,int> not=M[b];

		double ans[17][3][3];

		for(int i=0;i<16;i++)
			for(int x=0;x<3;x++)
				for(int y=0;y<3;y++)
					ans[i][y][x]=0.0;

		cout<<now.first<<" "<<now.second<<endl;
		ans[0][now.second][now.first]=1.0;

		for(int i=0;i<n;i++){
			for(int x=0;x<3;x++){
				for(int y=0;y<3;y++){
					for(int r=0;r<4;r++){
						int nx=x+dx[r],ny=y+dy[r];
						if(nx<0 || nx>=3 || ny<0 || ny>=3 || make_pair(nx,ny)==not){
							ans[i+1][y][x]+=ans[i][y][x]/4.0;
						}
						else{
							ans[i+1][ny][nx]+=ans[i][y][x]/4.0;
						}
					}
				}
			}
		}
		cout<<ans[n][goal.second][goal.first]<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:31: error: expected unqualified-id before 'not' token
   28 |                 pair<int,int> not=M[b];
      |                               ^~~
a.cc:45:107: error: expected primary-expression before ')' token
   45 |                                                 if(nx<0 || nx>=3 || ny<0 || ny>=3 || make_pair(nx,ny)==not){
      |                                                                                                           ^
Language: C++

#include<stdlib.h>
#include<iostream>
using namespace std;
int s,t,b,n;
double p,nn;
int d[4]={1,3,-1,-3};
double df[10][20];
void dfs(int s,int n){
	double p1;
	if(n==0){
		if(s==t){p+=pow(0.25,nn);}
		return;
	}
	if(df[s][n]>=0){
		p+=df[s][n];
		return;
	}else{
		for(int i=0;i<4;i++){
			if(s+d[i]==b){
				p1=p;
				dfs(s,n-1);
				df[s][n-1]=p-p1;
			}else if(s/3!=(s+d[i])/3){
				if(d[i]*d[i]==9&&0<=s+d[i]&&s+d[i]<9){
					p1=p;
					dfs(s+d[i],n-1);
					df[s+d[1]][n-1]=p-p1;
				}else{
					p1=p;
					dfs(s,n-1);
					df[s][n-1]=p-p1;
				}
			}else{
				p1=p;
				dfs(s+d[i],n-1);
				df[s+d[i]][n-1]=p-p1;
			}
		}
	}
	return;
}
int main(){
	while(1){
		char cs,ct,cb;
		p=0;
		cin>>n;
		nn=n;
		if(n==0)break;
		for(int i=0;i<10;i++){
			for(int j=0;j<20;j++){
				df[i][j]=-1;
			}
		}
		cin>>cs>>ct>>cb;
		s=(int)cs-'A';
		t=(int)ct-'A';
		b=(int)cb-'A';
		dfs(s,n);
		cout<<p<<endl;
	}
	return 0;
}	

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:11:29: error: 'pow' was not declared in this scope
   11 |                 if(s==t){p+=pow(0.25,nn);}
      |                             ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vectoer>
#include<string>
#include<map>
#include<cstdio>

#define f first
#define s second

using namespace std;

typedef pair<int,int> P;

int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};

int main(void){

int n,id=0;
string s="ABCDEFGHI";
char s,t,d;
map<char,P>mp;

for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
mp[s[id++]]=P(i,j);
}
}

while(cin >> n,n){
cin >> s >> t >> d;
P S=mp[s],T=mp[t],D=mp[d];

int dp[16][3][3];

for(int k=0;k<16;k++)
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)dp[k][i][j]=0;

dp[0][S.s][S.f]=1;

for(int k=0;k<n;k++){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
for(int l=0;l<4;l++){
int nx=j+dx[l],ny=i+dy[l];
if(nx<0 || ny<0 || 2<nx || 2<ny || 
(nx==D.s&&ny==D.f))nx=j,ny=i;
dp[k+1][ny][nx]+=dp[k][i][j]/4;
}
}
}
}
printf("%.8f\n",dp[n][T.s][T.f]);
}

return 0;
}

Compiler output:
a.cc:3:9: fatal error: vectoer: No such file or directory
    3 | #include<vectoer>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include<vectoer>
#include<string>
#include<map>
#include<cstdio>
 
#define f first
#define s second
 
using namespace std;
 
typedef pair<int,int> P;
 
int dx[4]={0,0,1,-1};
int dy[4]={1,-1,0,0};
 
int main(void){
 
int n,id=0;
string s="ABCDEFGHI";
char s,t,d;
map<char,P>mp;
 
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
mp[s[id++]]=P(j,i);
}
}
 
while(cin >> n,n){
cin >> s >> t >> d;
P S=mp[s],T=mp[t],D=mp[d];
 
double dp[16][3][3];
 
for(int k=0;k<16;k++)
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)dp[k][i][j]=0;
 
dp[0][S.s][S.f]=1;
 
for(int k=0;k<n;k++){
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
for(int l=0;l<4;l++){
int nx=j+dx[l],ny=i+dy[l];
if(nx<0 || ny<0 || 2<nx || 2<ny || 
(nx==D.s&&ny==D.f))nx=j,ny=i;
dp[k+1][ny][nx]+=dp[k][i][j]/4;
}
}
}
}
printf("%.8f\n",dp[n][T.s][T.f]);
}
 
return 0;
}

Compiler output:
a.cc:3:9: fatal error: vectoer: No such file or directory
    3 | #include<vectoer>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#define rep(i,n) for(int i=0;i<n;i++)
#define ck(a) (0<=(a)&&(a)<9)
int di[]={-3,-1,1,3};
int main(){
    int n,s,t,b; char cs,ct,cb;
    while(scanf("%d",&n),n){
        scanf(" %c %c %c",&cs,&ct,&cb); s=cs-'A', t=ct-'A', b=cb-'A';
        double p[9]={0}; p[s]=1;
         
        while(n--){
            double q[9]={0};
            rep(i,9)rep(d,4){
                if(ck(i+di[d])&&!(i%3==0&&di[d]==-1)&&!(i%3==2&&di[d]==1)&&i+di[d]!=b)q[i+di[d]]+=p[i]/4;
                else q[i]+=p[i]/4;
            }
            rep(i,9)p[i]=q[i];
        }
         
        printf("%.8f\n",p[t]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'scanf' was not declared in this scope
    6 |     while(scanf("%d",&n),n){
      |           ^~~~~
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%.8f\n",p[t]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #define rep(i,n) for(int i=0;i<n;i++)
Language: Java

import java.awt.Point;
import java.io.InputStreamReader;
import java.nio.Buffer;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Pattern;

public class AOJ1021 {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		// TODO Auto-generated method stub

		Scanner sc = new Scanner(new InputStreamReader(System.in));

		ArrayList<StringBuilder> lines = new ArrayList<StringBuilder>();
		while (true) {
			String text = sc.next();
			if (text.equals("END_OF_TEXT"))
				break;
			lines.add(new StringBuilder(text));
		}
		Point cursor = new Point();

		String buffer = null;

		commandLoop: while (true) {
			char command = sc.next().charAt(0);
			StringBuilder currentLine = lines.get(cursor.y);
			switch (command) {
			case 'a':
				cursor.x = 0;
				break;
			case 'e':
				cursor.x = currentLine.length();
				break;
			case 'p':
				if (cursor.y > 0)
					cursor.y--;
				else
					cursor.x = 0;
				break;
			case 'n':
				if (cursor.y + 1 < lines.size())
					cursor.y++;
				cursor.x = 0; // ?
				break;
			case 'f':
				if (cursor.x < currentLine.length()) {
					cursor.x++;
				}
				else if (cursor.y + 1 < lines.size()) {
					cursor.y++;
					cursor.x = 0;
				}
				break;
			case 'b':
				if (cursor.x > 0) {
					cursor.x--;
					break;
				}
				else if (cursor.y > 0) {
					cursor.y--;
					cursor.x = 0;
				}
				break;
			case 'd':
				if (cursor.x < currentLine.length()) {
					currentLine.deleteCharAt(cursor.x);
				}
				else if (cursor.y + 1 < lines.size()) {
					currentLine.append(lines.remove(cursor.y + 1));
				}
				break;
			case 'k':
				if (cursor.x == currentLine.length()) {
					if (cursor.y + 1 < lines.size()) {
						currentLine.append(lines.remove(cursor.y + 1));
						buffer = "\n";
					}
				}
				else {
					buffer = currentLine.substring(cursor.x);
					currentLine.delete(cursor.x, currentLine.length());
				}
				break;
			case 'y':
				if (buffer != null) {
					if (buffer.equals("\n")) {
						StringBuilder newLine = new StringBuilder();
						if(cursor.x != currentLine.length()) {
							newLine.append(currentLine.substring(cursor.x));
							currentLine.delete(cursor.x, currentLine.length());
							
						}
						lines.add(cursor.y, newLine);
						cursor.y++;
						cursor.x = 0;
					}
					else {
						if(cursor.x == currentLine.length())
							currentLine.append(buffer);
						else
							currentLine.insert(cursor.x, buffer);
						cursor.x += buffer.length();
					}
				}
				break;

			default:
				break commandLoop;
			}
//			System.out.println(cursor);
//			System.out.println(currentLine);
		}
		for (StringBuilder sb : lines) {
			System.out.println(sb);
		}
	}

}

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

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <list>

using namespace std;

vector<string> text;
string buf;

int row, col;

void func_a(){
	col = 0;
}

void func_e(){
	col = text[row].size() - 1;
}

void func_p(){
	if (row > 0) row--;
	func_a();
}

void func_n(){
	if (row < text.size() - 1) row++;
	func_a();
}

void func_f(){
	if (col < text[row].size() - 1) col++;
	else func_n();
}

void func_b(){
	if (col > 0) col--;
	else if (row > 0){
		func_p();
		func_e();
	}
}

void func_d(){
	if (col < text[row].size() - 1) text[row].erase(col, col);
	else if (row < text.size() - 1){
		text[row] += text[row + 1];
		text.erase(text.begin() + row + 1);
	}
}

void func_k(){
	if (col < text[row].size() - 1){
		buf = text[row].substr(col, text[row].size() - col - 1);
		text[row].erase(col, text[row].size() - 1);
		col = text[row].size() - 1;
	}
	else if (row < text.size() - 1){
		func_d();
		buf = "\n";
	}
}

void func_y(){
	if (!buf.empty()){
		if (buf == "\n"){
			text.insert(text.begin() + row + 1, text[row].substr(col, text[row].size() - 1));
			text[row].erase(col, text[row].size() - 1);			
		}
		else {
			text[row].insert(col, buf);
			col += buf.size();
		}
	}
}

int main()
{
	string in;
	char cmd;

	while (getline(cin, in), in != "END_OF_TEXT"){
		text.push_back(in + '$');
	}
	
	col = row = 0;
	buf.clear();

	while (cin >> cmd, cmd != '-'){
		switch (cmd){
		  case 'a': func_a(); break;
		  case 'e':	func_e(); break;
		  case 'p':	func_p(); break;
		  case 'n': func_n(); break;
		  case 'f': func_f(); break;
		  case 'b':	func_b(); break;
		  case 'd':	func_d(); break;
		  case 'k': func_k(); break;
		  case 'y': func_y(); break;
		}
#if 0
		printf("col:%d row:%d\n", col, row);
		puts("status:");
		for (vector<string>::iterator it = text.begin(); it != text.end(); it++){
			cout << *it << endl;
		}
		puts("buffer:");
		cout << buf << endl;
#endif
	}

	
	for (vector<string>::iterator it = text.begin(); it != text.end(); it++){
		cout << it->substr(0, it->size() - 1) << endl;
	}

	return (0);
}

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