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

#include <iostream>
using namespace std;

int count(int H, int W, int D, int A[300][300], int L[100000], int R[100000], int k){
	int i, j=0,l=0,x[H*W],y[H*W],S=0;
	return S;
}
int main(){
	int H,W,D,A[H][W],i,j,k,Q,L[Q],R[Q],MP=0;
	cin >> H >> W >> D;
	for(i=0;i<H;i++){
		for(j=0;j<W;j++){
			cin >> A[i][j];
		}
	}
	cin >> Q;
	for(i=0;i<Q;i++){
		cin >> L[i] >> R[i];
	}

	for(k=0;k<Q;k++){
			while(L[k]!=R[k]){
		for(i=0;i<H;i++){
			if(A[i][j]==L[k]){
				x[l]=i;
				y[l]=j;
				l++;
				break;
			}
			else{j++;}
		}
		L[k] += D;
		i=0;
		j=0;
	}
	for(i=0;i<l-1;i++){
		MP += abs(x[l]-x[l+1])+abs(y[l]-y[l+1]);
	}
	}
	cout << MP << endl;
			
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'x' was not declared in this scope
   25 |                                 x[l]=i;
      |                                 ^
a.cc:25:35: error: 'l' was not declared in this scope
   25 |                                 x[l]=i;
      |                                   ^
a.cc:26:33: error: 'y' was not declared in this scope
   26 |                                 y[l]=j;
      |                                 ^
a.cc:36:19: error: 'l' was not declared in this scope
   36 |         for(i=0;i<l-1;i++){
      |                   ^
a.cc:37:27: error: 'x' was not declared in this scope
   37 |                 MP += abs(x[l]-x[l+1])+abs(y[l]-y[l+1]);
      |                           ^
a.cc:37:44: error: 'y' was not declared in this scope
   37 |                 MP += abs(x[l]-x[l+1])+abs(y[l]-y[l+1]);
      |                                            ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.push_back(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 1;
      }
      else if(S[i][0] == 'A'){
      	a = 1;
      }
      else if(S[i][0] == 'R'){
      	r = 1;
      }
      else if(S[i][0] == 'C'){
      	c = 1;
      }
      else if(S[i][0] == 'H'){
      	h = 1;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2))/6 << std::endl;
  }
  else{
  	std::cout << 0 << endl;
  }
  
  
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   43 |         std::cout << 0 << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

int main(){
    int N;
    cin >> N;
    char name[100000][11];
    for(int i=0;i<N;i++){
        cin >> name[i];
    }
    int m=0,a=0,r=0,c=0,h=0;
    for(int i=0;i<N;i++){
        switch(name[i][0]){
            case 'M':
                m++;
                break;
            case 'A':
                a++;
                break;
            case 'R':
                r++;
                break;
            case 'C':
                c++;
                break;
            case 'H':
                h++;
                break;
            default:
                break;
        }
    }
    long long ans;
    ans=m*(a*r + a*c + a*h + r*c + r*h + c*h) + a*(r*c + r*h + c*h) + r*c*h + 0;
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout << ans;
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.push_buck(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 1;
      }
      else if(S[i][0] == 'A'){
      	a = 1;
      }
      else if(S[i][0] == 'R'){
      	r = 1;
      }
      else if(S[i][0] == 'C'){
      	c = 1;
      }
      else if(S[i][0] == 'H'){
      	h = 1;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2))/6 << std::endl;
  }
  
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'push_buck'; did you mean 'push_back'?
   14 |       S.push_buck(a);
      |         ^~~~~~~~~
      |         push_back
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.push_buck(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 1;
      }
      else if(S[i][0] == 'A'){
      	a = 1;
      }
      else if(S[i][0] == 'R'){
      	r = 1;
      }
      else if(S[i][0] == 'C'){
      	c = 1;
      }
      else if(S[i][0] == 'H'){
      	h = 1;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2))/6 << std::endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'push_buck'; did you mean 'push_back'?
   14 |       S.push_buck(a);
      |         ^~~~~~~~~
      |         push_back
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
      	int n = scanner.nextInt();
        String name[] = new String[n];
		for(int t = 0;t<n;t++) {
			name[t] = scanner.next();
        }
        int x = 0;
		Long amnt[] = {0,0,0,0,0};
        String moji[] = {"M","A","R","C","H"};
        int s;
        for(x = 0;x < n;x++){
          	for(s = 0;s<5;s++){
         		if(moji[s].equals(name[x].charAt(0)))amnt[s]++;
            }
        }
		Long ans = amnt[0]*(amnt[1]*(amnt[2]+amnt[3]+amnt[4])+amnt[2]*(amnt[3]+amnt[4])+amnt[3]*amnt[4])+amnt[1]*(amnt[2]*amnt[3]+amnt[2]*amnt[4]+amnt[3]*amnt[4])+amnt[2]*amnt[3]*amnt[4];
       System.out.println(ans);
    }
}

Compiler output:
Main.java:12: error: incompatible types: int cannot be converted to Long
		Long amnt[] = {0,0,0,0,0};
		               ^
Main.java:12: error: incompatible types: int cannot be converted to Long
		Long amnt[] = {0,0,0,0,0};
		                 ^
Main.java:12: error: incompatible types: int cannot be converted to Long
		Long amnt[] = {0,0,0,0,0};
		                   ^
Main.java:12: error: incompatible types: int cannot be converted to Long
		Long amnt[] = {0,0,0,0,0};
		                     ^
Main.java:12: error: incompatible types: int cannot be converted to Long
		Long amnt[] = {0,0,0,0,0};
		                       ^
5 errors
Language: C++

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

int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.push_buck(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 1;
      }
      else if(S[i][0] == 'A'){
      	a = 1;
      }
      else if(S[i][0] == 'R'){
      	r = 1;
      }
      else if(S[i][0] == 'C'){
      	c = 1;
      }
      else if(S[i][0] == 'H'){
      	h = 1;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2))/6 << std::endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'push_buck'; did you mean 'push_back'?
   14 |       S.push_buck(a);
      |         ^~~~~~~~~
      |         push_back
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
public class Main {
	public static void main(String[] args){
		Scanner scanner = new Scanner(System.in);
      	int n = scanner.nextInt();
        String name[] = new String[n];
		for(int t = 0;t<n;t++) {
			name[t] = scanner.next();
        }
        int x = 0;
		int amnt[] = {0,0,0,0,0};
        String moji[] = {"M","A","R","C","H"};
        int s;
        for(x = 0;x < n;x++){
          	for(s = 0;s<5;s++){
         		if(moji[s].equals(name[x].charAt(0)))amnt[s]++;
            }
        }
		Long ans = amnt[0]*(amnt[1]*(amnt[2]+amnt[3]+amnt[4])+amnt[2]*(amnt[3]+amnt[4])+amnt[3]*amnt[4])+amnt[1]*(amnt[2]*amnt[3]+amnt[2]*amnt[4]+amnt[3]*amnt[4])+amnt[2]*amnt[3]*amnt[4];
       System.out.println(ans);
    }
}

Compiler output:
Main.java:20: error: incompatible types: int cannot be converted to Long
		Long ans = amnt[0]*(amnt[1]*(amnt[2]+amnt[3]+amnt[4])+amnt[2]*(amnt[3]+amnt[4])+amnt[3]*amnt[4])+amnt[1]*(amnt[2]*amnt[3]+amnt[2]*amnt[4]+amnt[3]*amnt[4])+amnt[2]*amnt[3]*amnt[4];
		                                                                                                                                                          ^
1 error
Language: C++

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

int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.push_buck(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 0;
      }
      else if(S[i][0] == 'A'){
      	a = 0;
      }
      else if(S[i][0] == 'R'){
      	r = 0;
      }
      else if(S[i][0] == 'C'){
      	c = 0;
      }
      else if(S[i][0] == 'H'){
      	h = 0;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2)/6 << std::endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'push_buck'; did you mean 'push_back'?
   14 |       S.push_buck(a);
      |         ^~~~~~~~~
      |         push_back
a.cc:40:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   40 |         std::cout << (x*(x-1)*(x-2)/6 << std::endl;
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
a.cc:40:51: error: expected ')' before ';' token
   40 |         std::cout << (x*(x-1)*(x-2)/6 << std::endl;
      |                      ~                            ^
      |                                                   )
Language: C++

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

int main(void)
{
	int N;
    std::cin >> N;
  	std::vector<std::string> S;
  	for(int i=0;i<N;i++)
    {
      std::string a;
      std::cin >> a;
      S.pushbuck(a);
    }
  	int m=0,a=0,r=0,c=0,h=0;
  	for(int i=0;i<N;i++)
    {
      if(S[i][0] == 'M'){
        m = 0;
      }
      else if(S[i][0] == 'A'){
      	a = 0;
      }
      else if(S[i][0] == 'R'){
      	r = 0;
      }
      else if(S[i][0] == 'C'){
      	c = 0;
      }
      else if(S[i][0] == 'H'){
      	h = 0;
      }
      
    }
  	
  	int x;
  	x = m + a + r + c + h;
  if(x >=3){
  	std::cout << (x*(x-1)*(x-2)/6 << std::endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'class std::vector<std::__cxx11::basic_string<char> >' has no member named 'pushbuck'; did you mean 'push_back'?
   14 |       S.pushbuck(a);
      |         ^~~~~~~~
      |         push_back
a.cc:40:39: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   40 |         std::cout << (x*(x-1)*(x-2)/6 << std::endl;
      |                       ~~~~~~~~~~~~~~~~^~~~~~~~~~~~
a.cc:40:51: error: expected ')' before ';' token
   40 |         std::cout << (x*(x-1)*(x-2)/6 << std::endl;
      |                      ~                            ^
      |                                                   )
Language: C++

#include <iostream>
using namespace std;

int count(int H, int W, int D, int L, int R, int k){
	int i, j=0,x,y,S;
	while(L[k]!=R[k]){
		for(i=0;i<H;i++){
			if(A[i][j]==L[k]){
				x=i;
				y=j;
				break;
			}
			else{j++;}
		}
		L[k] += D;
		S += abs(x-i) + abs (y-j);
		i=0;
		j=0;
	}
	return S;
}
int main(){
	int H,W,D,A[H][W],i,j,Q,L[Q],R[Q],MP=0;
	cin >> H >> W >> D;
	for(i=0;i<H;i++){
		for(j=0;j<W;j++){
			cin >> A[i][j];
		}
	}
	cin >> Q;
	for(i=0;i<Q;i++){
		cin >> L[i] >> R[Q];
	}

	for(i=0;i<Q;i++){
		MP += count(H, W, D, L, R, i);
	}
	cout << MP << endl;
			
}


Compiler output:
a.cc: In function 'int count(int, int, int, int, int, int)':
a.cc:6:16: error: invalid types 'int[int]' for array subscript
    6 |         while(L[k]!=R[k]){
      |                ^
a.cc:6:22: error: invalid types 'int[int]' for array subscript
    6 |         while(L[k]!=R[k]){
      |                      ^
a.cc:8:28: error: 'A' was not declared in this scope
    8 |                         if(A[i][j]==L[k]){
      |                            ^
a.cc:8:38: error: invalid types 'int[int]' for array subscript
    8 |                         if(A[i][j]==L[k]){
      |                                      ^
a.cc:15:18: error: invalid types 'int[int]' for array subscript
   15 |                 L[k] += D;
      |                  ^
a.cc: In function 'int main()':
a.cc:36:38: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   36 |                 MP += count(H, W, D, L, R, i);
      |                                      ^
      |                                      |
      |                                      int*
a.cc:4:36: note:   initializing argument 4 of 'int count(int, int, int, int, int, int)'
    4 | int count(int H, int W, int D, int L, int R, int k){
      |                                ~~~~^
a.cc:36:41: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   36 |                 MP += count(H, W, D, L, R, i);
      |                                         ^
      |                                         |
      |                                         int*
a.cc:4:43: note:   initializing argument 5 of 'int count(int, int, int, int, int, int)'
    4 | int count(int H, int W, int D, int L, int R, int k){
      |                                       ~~~~^
Language: C++

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

int n;
int march[10];
char name[15];
int main(){
	int a=1;
	stack<int> s;
	scanf("%d",&n);
	for(int i=1;i<=n+1;i++){
		gets(name);
		if(name[0]=='M') march[1]++;
		if(name[0]=='A') march[2]++;
		if(name[0]=='R') march[3]++;
		if(name[0]=='C') march[4]++;
		if(name[0]=='H') march[5]++;
	}
	for(int i=1;i<=5;i++) if(march[i]!=0) s.push(march[i]);
	if(s.size()<3) printf("0");
	if(s.size()==3){
		for(int i=1;i<=3;i++) a*=s.top(),s.pop();
		printf("%d",a);
	}
	if(s.size()==4){
		a=0;
		for(int i=1;i<=4;i++) march[i]=1,march[i]*=s.top(),s.pop();
		a+=march[1]*march[2]*march[3];
		a+=march[4]*march[2]*march[3];
		a+=march[1]*march[2]*march[4];
		a+=march[1]*march[4]*march[3];
		printf("%d",a);
	}
	if(s.size()==5){
		a=0;
		for(int i=1;i<=5;i++) march[i]=1,march[i]*=s.top(),s.pop();
		a+=march[1]*march[2]*march[3];
		a+=march[4]*march[2]*march[3];
		a+=march[1]*march[2]*march[4];
		a+=march[1]*march[4]*march[3];
		a+=march[1]*march[2]*march[5];
		a+=march[4]*march[2]*march[5];
		a+=march[3]*march[5]*march[4];
		a+=march[1]*march[4]*march[5];
		a+=march[1]*march[5]*march[3];
		a+=march[5]*march[2]*march[3];
		printf("%d",a);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   12 |                 gets(name);
      |                 ^~~~
      |                 getw
Language: Java

import java.io.*;

public class Main{
  public static void main(String[] args) {
    try {
      long result;
      int n, i = 0;
      int num[] = {0, 0, 0, 0, 0};

      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

      n = Integer.parseInt(reader.readLine());
      String name[] = new String[n];
      char nameF[] = new char[n];

      for(i = 0; i < n; i++){
        name[i] = reader.readLine();
      }
      
      for(i = 0; i < n; i++){
        nameF[i] = name[i].charAt(0);
      }
      
      for(i = 0; i < n; i++){
        if (nameF[i] == 'M') {
          num[0] = ++num[0];
        }
        if (nameF[i] == 'A') {
          num[1] = ++num[1];
        }
        if (nameF[i] == 'R') {
          num[2] = ++num[2];
        }
        if (nameF[i] == 'C') {
          num[3] = ++num[3];
        }
        if (nameF[i] == 'H') {
          num[4] = ++num[4];
        }
      }

      result = num[0]*num[1]*(num[2]+num[3]+num[4])+num[0]*num[2]*(num[3]+num[4])+num[0]*num[3]*num[4]
               +num[1]*num[2]*(num[3]+num[4])+num[1]*num[3]*num[4] + num[2]*num[3]*num[4];

      Sustem.out.println(result);
      
    }
    catch (Exception e) {
      
    }
  }
}

Compiler output:
Main.java:45: error: package Sustem does not exist
      Sustem.out.println(result);
            ^
1 error
Language: C


#include <stdio.h>
 


long long int minx(long long int v[],int n){
	int i,j,k;
	long long int tmp;
	tmp=v[0];
	for(i=1;i<=n-1;i++){
		if(tmp>v[i])
		tmp=v[i];}
		return tmp;}
int maxx(int v[],int n){
	int i,j,k,tmp;
	tmp=v[0];
	for(i=1;i<=n-1;i++){
		if(tmp<v[i])
		tmp=v[i];}
		return tmp;}
int max(int n1,int n2,int n3){
	int tmp;
	tmp=n1;
	if(n2>tmp)
	tmp=n2;
	if(n3>tmp)
	tmp=n3;
	return tmp;}
int max2(int n1,int n2){
	int tmp;
	tmp=n1;
	if(n2>tmp)
	tmp=n2;
	return tmp;}
int min3(int n1,int n2,int n3){
	int tmp;
	tmp=n1;
	if(n2<tmp)
	tmp=n2;
	if(n3<tmp)
	tmp=n3;
	return tmp;}
int min2(int n1,int n2){
	int tmp;
	tmp=n1;
	if(n2<tmp)
	tmp=n2;
	return tmp;}
long long int abs(long long int n){
	if(n>=0)
	return n;
	else return(-1)*n;
}
int main(void)
{int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
	long long int sum,min;
	sum=1;
	scanf("%d",&N);
	char S[100000][10];
	nM=0;
	nA=0;
	nR=0;
	nC=0;
	nH=0;
	for(i=0;i<=N-1;i++){
		scanf("%s",&S[i]);}
	for(j=0;j<=N-1;j++){
		if(S[j][0]=='M'){
		nM+=1;}
		else if(S[j][0]=='A'){
		nA+=1;}
		else if(S[j][0]=='R'){
		nR+=1;}
		else if(S[j][0]=='C'){
		nC+=1;}
		else if(S[j][0]=='H'){
		nH+=1;}
		
		}
	int A[5]={nM,nA,nR,nC,nH};
	long long int B[5];
	k=0;
	for(i=0;i<=4;i++){
		if(A[i]!=0){
			B[k]=A[i];
			k+=1;}}
	if(k<3)
	printf("0");
	else if(k==3){
		sum=B[0]*B[1]*B[2];
		printf("%lld",sum);}
		else if(k==4){
			sum=B[0]*B[1]*B[2]+B[0]*B[1]*B[3]+B[0]*B[2]*B[3]+B[1]*B[2]*B[3];
			printf("%lld",sum);}
			else if(k==5){
				sum=B[0]*B[1]*B[2]+B[0]*B[1]*B[3]+B[0]*B[2]*B[3]+B[1]*B[2]*B[3]+B[0]*B[1]*B[4]+B[0]*B[2]*B[4]+B[0]*B[3]*B[4]+B[1]*B[2]*B[4]+B[1]*B[3]*B[4]+B[2]*B[3]*B[4];
				printf("%lld",sum);}
	
	



	return 0;
}


Compiler output:
main.c:49:15: warning: conflicting types for built-in function 'abs'; expected 'int(int)' [-Wbuiltin-declaration-mismatch]
   49 | long long int abs(long long int n){
      |               ^~~
main.c:3:1: note: 'abs' is declared in header '<stdlib.h>'
    2 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c: In function 'main':
main.c:80:13: error: conflicting types for 'A'; have 'int[5]'
   80 |         int A[5]={nM,nA,nR,nC,nH};
      |             ^
main.c:55:8: note: previous declaration of 'A' with type 'int'
   55 | {int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
      |        ^
main.c:81:23: error: conflicting types for 'B'; have 'long long int[5]'
   81 |         long long int B[5];
      |                       ^
main.c:55:12: note: previous declaration of 'B' with type 'int'
   55 | {int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
      |            ^
Language: C++

//#include <bits/stdc++.h>
#include<iostream>
#include<string>
#include<queue>
#include<cmath>
#include<vector>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)//初期値a,i<bの範囲でループ
#define REP(i,n) FOR(i,0,n)//初期値0,i<nの範囲でループ
using namespace std;
typedef long long ll;//int64
typedef unsigned long long ull;

int n;
int cnt=0;
char g[20];
string s[10010];
ll ans=0;

int v1[9]={0,0,0,0,0,1,1,1,2};
int v2[9]={1,1,1,2,2,2,2,3,3};
int v3[9]={2,3,4,3,4,3,4,4,4};

int powa(int d,int e){
    if(e<0)return 0;
    return pow(d,e);
}

ll int ini[5];

int main(){
    cin>>n;
    REP(i,n){
        cin>>g;
        //g=g.substr(0,1);
        //cout<<g[0];
        if(g[0]=='M'){
            ini[0]++;
        }if(g[0]=='A'){
            ini[1]++;
        }if(g[0]=='R'){
            ini[2]++;
        }if(g[0]=='C'){
            ini[3]++;
        }if(g[0]=='H'){
            ini[4]++;
        }

    }

    int c=0;
    REP(i,5){
        if(ini[i]>0)c++;
    }
    if(c<3){
        cout<<0<<endl;
        return 0;
    }


    REP(i,9){
        ans+=ini[v1[i]]*ini[v2[i]]*ini[v3[i]];
    }


    cout<<ans<<endl;
    
    

    return 0;
}

Compiler output:
a.cc:28:1: error: two or more data types in declaration of 'ini'
   28 | ll int ini[5];
      | ^~
a.cc: In function 'int main()':
a.cc:37:13: error: 'ini' was not declared in this scope; did you mean 'int'?
   37 |             ini[0]++;
      |             ^~~
      |             int
a.cc:39:13: error: 'ini' was not declared in this scope; did you mean 'int'?
   39 |             ini[1]++;
      |             ^~~
      |             int
a.cc:41:13: error: 'ini' was not declared in this scope; did you mean 'int'?
   41 |             ini[2]++;
      |             ^~~
      |             int
a.cc:43:13: error: 'ini' was not declared in this scope; did you mean 'int'?
   43 |             ini[3]++;
      |             ^~~
      |             int
a.cc:45:13: error: 'ini' was not declared in this scope; did you mean 'int'?
   45 |             ini[4]++;
      |             ^~~
      |             int
a.cc:52:12: error: 'ini' was not declared in this scope; did you mean 'int'?
   52 |         if(ini[i]>0)c++;
      |            ^~~
      |            int
a.cc:61:14: error: 'ini' was not declared in this scope; did you mean 'int'?
   61 |         ans+=ini[v1[i]]*ini[v2[i]]*ini[v3[i]];
      |              ^~~
      |              int
Language: Java

import java.util.*;

public class abc089c{
  public static void main(String[] args) {
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    long cnt=0;
    String name[]=new String[n];
    for(int i=0;i<n;i++) name[i]=sc.next();
    for(int a=0;a<n;a++)
      for(int b=a+1;b<n;b++){
        if(name[a].charAt(0)==name[b].charAt(0)) continue;
        else if(name[b].charAt(0)!='M'&&name[b].charAt(0)!='A'&&name[b].charAt(0)!='R'&&name[b].charAt(0)!='C'&&name[b].charAt(0)!='H') continue;
        for(int c=b+1;c<n;c++){
          if(name[b].charAt(0)==name[c].charAt(0)||name[a].charAt(0)==name[c].charAt(0)) continue;
          else if(name[c].charAt(0)!='M'&&name[c].charAt(0)!='A'&&name[c].charAt(0)!='R'&&name[c].charAt(0)!='C'&&name[c].charAt(0)!='H') continue;
          cnt++;
        }
      }
    System.out.println(cnt);
  }
}

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

#include <cstdio>
#define MAXN 14

int main(void)
{

	int i,c0,c1,c2,N,m[5]={0},s;
	char name[MAXN];
	const char sign[7]="MARCH";
	scanf("%d",&N);
	for(i=0;i<N;i++)
	{
		scanf("%s",name);
		for(int j=0;j<5;j++)
			if(name[0]==sign[j])
				m[j]++;
	}
	s=0;
	for(c0=0;c0<5;c0++)
		for(c1=c0+1;c1<5;c1++)
			for(c2=c1+1;c2<5;c2++)
				s+=m[c0]*m[c1]*m[c2];
	printf("%d\n",s);
	return 0;

}

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

#include<cstring>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;

char s[100000];
map<char,int>S;
int main(){
	int n;
	ll sum=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%s",s);
		if(s[0]=='M'||s[0]=='A'||s[0]=='R'||s[0]=='C'||s[0]=='H') S[s[0]]++;
	}
	if(n<3) printf("0\n");
	else{
		sum+=(S['M']*S['A']*S['R']);
		sum+=(S['M']*S['A']*S['C']);
		sum+=(S['M']*S['A']*S['H']);
		sum+=(S['M']*S['R']*S['C']);
		sum+=(S['M']*S['R']*S['H']);
		sum+=(S['M']*S['C']*S['H']);
		sum+=(S['A']*S['R']*S['C']);
		sum+=(S['A']*S['R']*S['H']);
		sum+=(S['A']*S['C']*S['H']);
		sum+=(S['R']*S['C']*S['H']);
		printf("%lld\n",sum);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'll' was not declared in this scope
   14 |         ll sum=0;
      |         ^~
a.cc:22:17: error: 'sum' was not declared in this scope
   22 |                 sum+=(S['M']*S['A']*S['R']);
      |                 ^~~
Language: C


#include <stdio.h>
 


long long int minx(long long int v[],int n){
	int i,j,k;
	long long int tmp;
	tmp=v[0];
	for(i=1;i<=n-1;i++){
		if(tmp>v[i])
		tmp=v[i];}
		return tmp;}
int maxx(int v[],int n){
	int i,j,k,tmp;
	tmp=v[0];
	for(i=1;i<=n-1;i++){
		if(tmp<v[i])
		tmp=v[i];}
		return tmp;}
int max(int n1,int n2,int n3){
	int tmp;
	tmp=n1;
	if(n2>tmp)
	tmp=n2;
	if(n3>tmp)
	tmp=n3;
	return tmp;}
int max2(int n1,int n2){
	int tmp;
	tmp=n1;
	if(n2>tmp)
	tmp=n2;
	return tmp;}
int min3(int n1,int n2,int n3){
	int tmp;
	tmp=n1;
	if(n2<tmp)
	tmp=n2;
	if(n3<tmp)
	tmp=n3;
	return tmp;}
int min2(int n1,int n2){
	int tmp;
	tmp=n1;
	if(n2<tmp)
	tmp=n2;
	return tmp;}
long long int abs(long long int n){
	if(n>=0)
	return n;
	else return(-1)*n;
}
int main(void)
{int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
	long long int sum,min;
	sum=1;
	scanf("%d",&N);
	char S[100000][10];
	nM=0;
	nA=0;
	nR=0;
	nC=0;
	nH=0;
	for(i=0;i<=N-1;i++){
		scanf("%s",&S[i]);}
	for(j=0;j<=N-1;j++){
		if(S[j][0]=='M'){
		nM+=1;}
		else if(S[j][0]=='A'){
		nA+=1;}
		else if(S[j][0]=='R'){
		nR+=1;}
		else if(S[j][0]=='C'){
		nC+=1;}
		else if(S[j][0]=='H'){
		nH+=1;}
		
		}
	int A[5]={nM,nA,nR,nC,nH};
	int B[5];
	k=0;
	for(i=0;i<=4;i++){
		if(A[i]!=0){
			B[k]=A[i];
			k+=1;}}
	if(k<3)
	printf("0");
	else if(k==3){
		sum=B[0]*B[1]*B[2];
		printf("%lld",sum);}
		else if(k==4){
			sum=B[0]*B[1]*B[2]+B[0]*B[1]*B[3]+B[0]*B[2]*B[3]+B[1]*B[2]*B[3];
			printf("%lld",sum);}
			else if(k==5){
				sum=B[0]*B[1]*B[2]+B[0]*B[1]*B[3]+B[0]*B[2]*B[3]+B[1]*B[2]*B[3]+B[0]*B[1]*B[4]+B[0]*B[2]*B[4]+B[0]*B[3]*B[4]+B[1]*B[2]*B[4]+B[1]*B[3]*B[4]+B[2]*B[3]*B[4];
				printf("%lld",sum);}
	
	



	return 0;
}


Compiler output:
main.c:49:15: warning: conflicting types for built-in function 'abs'; expected 'int(int)' [-Wbuiltin-declaration-mismatch]
   49 | long long int abs(long long int n){
      |               ^~~
main.c:3:1: note: 'abs' is declared in header '<stdlib.h>'
    2 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    3 | 
main.c: In function 'main':
main.c:80:13: error: conflicting types for 'A'; have 'int[5]'
   80 |         int A[5]={nM,nA,nR,nC,nH};
      |             ^
main.c:55:8: note: previous declaration of 'A' with type 'int'
   55 | {int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
      |        ^
main.c:81:13: error: conflicting types for 'B'; have 'int[5]'
   81 |         int B[5];
      |             ^
main.c:55:12: note: previous declaration of 'B' with type 'int'
   55 | {int N,A,M,B,j,i,k,H,W,l,nM,nA,nR,nC,nH,flag;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int s=0,n,i,a=0,b=0,c=0,d=0,e=0;
	char a,tmp[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%c",&a);
		scanf("%s",tmp);
		if(a=='M')
			e++;
		if(a=='A')
			a++;
		if(a=='R')
			b++;
		if(a=='C')
			c++;
		if(a=='H')
			d++;
	}
	s+=a*b*c+a*b*d+a*b*e+a*c*d+a*c*e+a*d*e+b*c*d+b*c*e+b*d*e+c*d*e;
	printf("%d",s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: conflicting declaration 'char a'
    6 |         char a,tmp[100];
      |              ^
a.cc:5:21: note: previous declaration as 'int a'
    5 |         int s=0,n,i,a=0,b=0,c=0,d=0,e=0;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int s=0,n,i,a=0,b=0,c=0,d=0,e=0;
	char a,tmp[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%c",&a);
		scanf("%s",tmp);
		if(a=='M')
			e++;
		if(a=='A')
			a++
		if(a=='R')
			b++ 
		if(a=='C')
			c++;
		if(a=='H')
			d++;
	}
	s+=a*b*c+a*b*d+a*b*e+a*c*d+a*c*e+a*d*e+b*c*d+b*c*e+b*d*e+c*d*e;
	printf("%d",s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: conflicting declaration 'char a'
    6 |         char a,tmp[100];
      |              ^
a.cc:5:21: note: previous declaration as 'int a'
    5 |         int s=0,n,i,a=0,b=0,c=0,d=0,e=0;
      |                     ^
a.cc:15:28: error: expected ';' before 'if'
   15 |                         a++
      |                            ^
      |                            ;
   16 |                 if(a=='R')
      |                 ~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

long long m[200005],a[200005],r[200005],c[200005],h[200005];

void is(char g,int b){
	if(g == 'M') m[b]++;
	else if(g == 'A') a[b]++;
	else if(g == 'R') r[b]++;
	else if(g == 'C') c[b]++;
	else if(g == 'H') h[b]++;
}

int main(){
	long long n;
	cin >> n;
	string input;
	for(long long i = 0; i < n; i++){
		cin >> input;
		is(input[0],i);
	}
	for(long long i = n-2; i >= 0; i--){
		m[i] += m[i+1];
		a[i] += a[i+1];
		r[i] += r[i+1];
		c[i] += c[i+1];
		h[i] += h[i+1];
	}
	long long sol = 0;
	for(long long i = 0; i < n; i++){
		if(x[i][0] == 'M'){
			sol += a[i] * r[i];
			sol += a[i] * c[i];
			sol += a[i] * h[i];
			sol += r[i] * c[i];
			sol += r[i] * h[i];
			sol += c[i] * h[i];
		}
		else if(x[i][0] == 'A'){
			sol += m[i] * r[i] + m[i] * c[i] + m[i] * h[i] + r[i] * c[i] + r[i] * h[i] + c[i] * h[i];
		}
		else if(x[i][0] == 'R'){
			sol += m[i] * a[i] + m[i] * c[i] + m[i] * h[i] + a[i] * c[i] + a[i] * h[i] + c[i] * h[i]; 
		}
		else if(x[i][0] == 'C'){
			sol += m[i] * a[i] + m[i] * r[i] + m[i] * h[i] + a[i] * r[i] + a[i] * h[i] + r[i] * h[i];
		}
		else if(x[i][0] == 'H'){
			sol += m[i] * a[i] + m[i] * r[i] + m[i] * c[i] + a[i] * r[i] + a[i] * c[i] + r[i] * c[i];
		}
	}
	cout << sol;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:20: error: 'x' was not declared in this scope
   32 |                 if(x[i][0] == 'M'){
      |                    ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    int N;
    cin >> N;
    char name[100000][11];
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    int m=0,a=0,r=0,c=0,h=0;
    for(int i=0;i<N;i++){
        switch(a[i][1]){
            case 'M':
                m++;
                break;
            case 'A':
                a++;
                break;
            case 'R':
                r++;
                break;
            case 'C':
                c++;
                break;
            case 'H':
                h++;
                break;
            default:
                break;
        }
    }
    long long ans;
    ans=m*a*r*c*h+0;
    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'a' was not declared in this scope
    9 |         cin >> a[i];
      |                ^
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |         switch(a[i][1]){
      |                 ^
Language: C++

#include<iostream>

using namespace std;

int n;
long long ans=0;
long long a[105];
char ch,my[100];

int main()
{
	cin>>n;
	getchar();
	for(int i=1;i<=n;i++)
	{
		gets(my);
		ch=my[0];
		if(ch=='M')a[1]++;
		if(ch=='A')a[2]++;
		if(ch=='R')a[3]++;
		if(ch=='C')a[4]++;
		if(ch=='H')a[5]++;
		
	}
	

	ans+=a[1]*a[2]*a[3];
	ans+=a[1]*a[2]*a[4];
	ans+=a[1]*a[2]*a[5];
	ans+=a[1]*a[3]*a[4];
	ans+=a[1]*a[3]*a[5];
	ans+=a[1]*a[4]*a[5];
	ans+=a[2]*a[3]*a[4];
	ans+=a[2]*a[3]*a[5];
	ans+=a[2]*a[4]*a[5];
	ans+=a[3]*a[4]*a[5];
	
	
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   16 |                 gets(my);
      |                 ^~~~
      |                 getw
Language: C++

#include<iostream>
using namespace std;

int main(){
    int N;
    cin >> N;
    char a[100000][11];
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    int m=0,a=0,r=0,c=0,h=0;
    for(int i=0;i<N;i++){
        switch(a[i][1]){
            case 'M':
                m++;
                break;
            case 'A':
                a++;
                break;
            case 'R':
                r++;
                break;
            case 'C':
                c++;
                break;
            case 'H':
                h++;
                break;
            default:
                break;
        }
    }
    long long ans;
    ans=m*a*r*c*h+0;
    cout << ans;
    return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: conflicting declaration 'int a'
   11 |     int m=0,a=0,r=0,c=0,h=0;
      |             ^
a.cc:7:10: note: previous declaration as 'char a [100000][11]'
    7 |     char a[100000][11];
      |          ^
a.cc:18:17: error: lvalue required as increment operand
   18 |                 a++;
      |                 ^
a.cc:34:10: error: invalid operands of types 'int' and 'char [100000][11]' to binary 'operator*'
   34 |     ans=m*a*r*c*h+0;
      |         ~^~
      |         | |
      |         | char [100000][11]
      |         int
a.cc:36:13: error: expected ';' before '}' token
   36 |     return 0
      |             ^
      |             ;
   37 | }
      | ~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#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 n;cin>>n;
  ll cn[5]={};
  for(int i=0;i<n;i++){
    string s;cin>>s;
    if(s[0]=='M')cn[0]++;
    else if(s[0]=='A')cn[1]++;
    else if(s[0]=='C')cn[2]++;
    else if(s[0]=='R')cn[3]++;
    else if(s[0]=='H')cn[4]++;
  }
  ll cnt=0;
  for(int i=0;i<5;i++)
    if(cn[i])cnt++;
  ll ans=0;
  if(cnt>=3){
    if(cnt==3){
      ans=1;
      //cout<<"!"<<endl;
      for(int i=0;i<5;i++)
	if(cn[i])ans*=(ll)cn[i];
    }else if(cnt==4){
      vector<ll>cc;
      for(int i=0;i<5;i++)
	if(cn[i])cc.pb(cn[i]);
      ans+=()cc[0]*cc[1]*cc[2];
      ans+=cc[0]*cc[1]*cc[3];
      ans+=cc[0]*cc[2]*cc[3];
      ans+=cc[1]*cc[2]*cc[3];
    }else{
      ans+=cn[0]*cn[1]*cn[2];
      ans+=cn[0]*cn[1]*cn[3];
      ans+=cn[0]*cn[1]*cn[4];
      ans+=cn[0]*cn[2]*cn[3];
      ans+=cn[0]*cn[2]*cn[4];
      ans+=cn[0]*cn[3]*cn[4];
      ans+=cn[1]*cn[2]*cn[3];
      ans+=cn[1]*cn[2]*cn[4];
      ans+=cn[1]*cn[3]*cn[4];
       ans+=cn[3]*cn[2]*cn[4];
   }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:13: error: expected primary-expression before ')' token
   46 |       ans+=()cc[0]*cc[1]*cc[2];
      |             ^
Language: C++

#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#define ll long long
int n;
string t[200000];
ll c[10];
int main(){
	cin>>n;
	rep(i,n){

		cin>>t[i];
		if(t[i][0]=='M')c[0]++;
		if(t[i][0]=='A')c[1]++;
		if(t[i][0]=='R')c[2]++;
		if(t[i][0]=='C')c[3]++;
		if(t[i][0]=='H')c[4]++;
		
	}
	ll ans=0;
	for(int i=0;i<5;i++){
		for(int j=i+1;j<5;j++){
			for(int k=j+1;k<5;k++)ans+=(c[i]*c[j]*c[k]);
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:20:1: note: in expansion of macro 'll'
   20 | ll c[10];
      | ^~
a.cc: In function 'int main()':
a.cc:26:33: error: 'c' was not declared in this scope
   26 |                 if(t[i][0]=='M')c[0]++;
      |                                 ^
a.cc:27:33: error: 'c' was not declared in this scope
   27 |                 if(t[i][0]=='A')c[1]++;
      |                                 ^
a.cc:28:33: error: 'c' was not declared in this scope
   28 |                 if(t[i][0]=='R')c[2]++;
      |                                 ^
a.cc:29:33: error: 'c' was not declared in this scope
   29 |                 if(t[i][0]=='C')c[3]++;
      |                                 ^
a.cc:30:33: error: 'c' was not declared in this scope
   30 |                 if(t[i][0]=='H')c[4]++;
      |                                 ^
a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   16 | #define ll __int64
      |            ^~~~~~~
a.cc:33:9: note: in expansion of macro 'll'
   33 |         ll ans=0;
      |         ^~
a.cc:36:47: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |                         for(int k=j+1;k<5;k++)ans+=(c[i]*c[j]*c[k]);
      |                                               ^~~
      |                                               abs
a.cc:36:53: error: 'c' was not declared in this scope
   36 |                         for(int k=j+1;k<5;k++)ans+=(c[i]*c[j]*c[k]);
      |                                                     ^
a.cc:39:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int a,h,w,d,m,y[90001],x[90001],s[90001];

int main() {
	cin >> h >> w >> d;
	REP(i,h) REP(j,w) {
    cin >> a;
    y[a]=i,x[a]=j;
  }
	cin >> q;
  int l[q],r[q];
	REP(i,q) cin >> l[i] >> r[i];

	for (int i=1; i<=h*w-d; i++) {
		s[i+d] = s[i] + abs(x[i+d]-x[i]) + abs(y[i+d]-y[i]);
  }

  REP(i,q) COUT(s[r[i]]-s[l[i]]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'q' was not declared in this scope
   33 |         cin >> q;
      |                ^
a.cc:35:25: error: 'l' was not declared in this scope
   35 |         REP(i,q) cin >> l[i] >> r[i];
      |                         ^
a.cc:35:33: error: 'r' was not declared in this scope
   35 |         REP(i,q) cin >> l[i] >> r[i];
      |                                 ^
a.cc:41:19: error: 'r' was not declared in this scope
   41 |   REP(i,q) COUT(s[r[i]]-s[l[i]]);
      |                   ^
a.cc:4:24: note: in definition of macro 'COUT'
    4 | #define COUT(x) cout<<(x)<<"\n"
      |                        ^
a.cc:41:27: error: 'l' was not declared in this scope
   41 |   REP(i,q) COUT(s[r[i]]-s[l[i]]);
      |                           ^
a.cc:4:24: note: in definition of macro 'COUT'
    4 | #define COUT(x) cout<<(x)<<"\n"
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int a,h,w,d,m,y[90001],x[90001],s[90001];
int main() {
	cin >> h >> w >> d;
	REP(i,h) REP(j,w) {
    cin >> a;
    y[a]=i,x[a]=j;
  }
	cin >> m;
	REP(i,m) cin >> l[i] >> r[i];
  int l[m],r[m];

	for (int i=d+1;i<=h*w;i++) {
		s[i] = s[i-d] + abs(x[i-d]-x[i]) + abs(y[i-d]-y[i]);
  }

  REP(i,m) {
		cout << s[r[i]]-s[l[i]] << endl;
	}

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: 'l' was not declared in this scope
   33 |         REP(i,m) cin >> l[i] >> r[i];
      |                         ^
a.cc:33:33: error: 'r' was not declared in this scope
   33 |         REP(i,m) cin >> l[i] >> r[i];
      |                                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i, n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int h,w,d,q;
int a[300][300];
int l[90001],r[90001];

void input() {
  cin >> h >> w >> d;
  REP(i,h) REP(j,w) cin >> a[i][j];
  cin >> q;
  REP(i,q) cin >> l[i] >> r[i];
}

int main() {
  IOS;
  input();

  vector<P> p(h*w+1);
  vector<int> s(h*w+1);
  REP(i,h) REP(j,w) {
    p[a[i][j]] = {i,j};
  }

  for (int i = 1; i <= h*w-d; i++) {
    s[i+d] = s[i] + abs(p[i+d].first - p[i].first) + abs(nv.second - v.second);
  }

  REP(i,q) COUT(s[r[i]] - s[l[i]]);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:58: error: 'nv' was not declared in this scope
   47 |     s[i+d] = s[i] + abs(p[i+d].first - p[i].first) + abs(nv.second - v.second);
      |                                                          ^~
a.cc:47:70: error: 'v' was not declared in this scope
   47 |     s[i+d] = s[i] + abs(p[i+d].first - p[i].first) + abs(nv.second - v.second);
      |                                                                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pi;
int h,w,d;

int main(){
	ios_base::sync_with_stdio(false);
	cint.tie(NULL);
	vector<pair<int,pi> >arr;
	cin>>h>>w>>d;
	for(int i=1; i<=h; i++){
		for(int j=1; j<=w; j++){
			int num;
			cin>>num;
			arr.push_back(make_pair(num-1,pi(i,j)));
		}
	}
	sort(arr.begin(),arr.end());
	vector<int>psum(arr.size(),0);
	for(int i=0; i<arr.size(); i++){
		int previ = i-d;
		if(previ<0) continue;
		psum[i]+=psum[previ];
		int x = arr[previ].second.first-arr[i].second.first;
		int y = arr[previ].second.second-arr[i].second.second;
		psum[i]+=abs(x)+abs(y);
	}	
	int q;
	cin>>q;
	while(q--){
		int l,r;
		cin>>l>>r;
		cout<<psum[r-1]-psum[l-1]<<'\n';
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cint' was not declared in this scope; did you mean 'uint'?
    8 |         cint.tie(NULL);
      |         ^~~~
      |         uint
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll MOD = 1000000007;
ll A[10000][10000];
map<int, P> s;
int dfs(int l, int r, int d, vector<vector<int>> &memo) {
  if (l == r) return 0;
  if (memo[l][r] != 0) return memo[l][r];
  return memo[l][r] = abs(s[l].first - s[l + d].first) +
                      abs(s[l].second - s[l + d].second) + dfs(l + d, r, d);
}
int main() {
  int H, W, D;
  cin >> H >> W >> D;
  REP(i, H) REP(j, W) {
    // cin >> A[i][j];
    int a;
    cin >> a;
    s[a] = P(i + 1, j + 1);
  }
  vector<vector<int>> memo(H * W + 5, vector<int>(H * W + 5));
  int Q;
  cin >> Q;
  REP(i, Q) {
    int l, r;
    cin >> l >> r;
    cout << dfs(l, r, D, memo) << endl;
  }
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, std::vector<std::vector<int> >&)':
a.cc:14:63: error: too few arguments to function 'int dfs(int, int, int, std::vector<std::vector<int> >&)'
   14 |                       abs(s[l].second - s[l + d].second) + dfs(l + d, r, d);
      |                                                            ~~~^~~~~~~~~~~~~
a.cc:10:5: note: declared here
   10 | int dfs(int l, int r, int d, vector<vector<int>> &memo) {
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll MOD = 1000000007;
ll memo[90000+10][90000+10];
ll A[10000][10000];
map<int, P> s;
int dfs(int l, int r, int d) {
  if (l == r) return 0;
  if (memo[l][r] != 0) return memo[l][r];
  return memo[l][r] = abs(s[l].first - s[l + d].first) +
                      abs(s[l].second - s[l + d].second) + dfs(l + d, r, d);
}
int main() {
  int H, W, D;
  cin >> H >> W >> D;
  REP(i, H) REP(j, W) {
    // cin >> A[i][j];
    int a;
    cin >> a;
    s[a] = P(i + 1, j + 1);
  }
  int Q;
  cin >> Q;
  REP(i, Q) {
    int l, r;
    cin >> l >> r;
    cout << dfs(l, r, D) << endl;
  }
}

Compiler output:
/tmp/cc7h9guQ.o: in function `dfs(int, int, int)':
a.cc:(.text+0x8a): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
a.cc:(.text+0xad): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
a.cc:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
/tmp/cc7h9guQ.o: in function `main':
a.cc:(.text+0x229): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
/tmp/cc7h9guQ.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2f9): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
a.cc:(.text+0x312): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/cc7h9guQ.o
collect2: error: ld returned 1 exit status