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

import java.io.*;
import java.lang.Integer;
import java.util.Iterator;
import java.util.LinkedList;

public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        LinkedList<int> result = new LinkedList<int>();
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            for(int i = 0; i < text.length() - word.length() + 1; i++){
            	String str = text.substring(i,i + word.length());
            	if(str.equals(word)){
            		result.add(new Integer(i));
            	}
            }
            Iterator<int> it = result.iterator();
            while (it.hasNext()) {
            	System.out.println(it.next());
            }
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:10: error: unexpected type
        LinkedList<int> result = new LinkedList<int>();
                   ^
  required: reference
  found:    int
Main.java:10: error: unexpected type
        LinkedList<int> result = new LinkedList<int>();
                                                ^
  required: reference
  found:    int
Main.java:17: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
            		result.add(new Integer(i));
            		           ^
Main.java:20: error: unexpected type
            Iterator<int> it = result.iterator();
                     ^
  required: reference
  found:    int
3 errors
1 warning
Language: Java

import java.io.*;
import java.lang.Integer;
import java.util.Iterator;
import java.util.LinkedList;

public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        LinkedList<Integer> result = new LinkedList<Integer>();
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            for(int i = 0; i < text.length() - word.length() + 1; i++){
            	String str = text.substring(i,i + word.length());
            	if(str.equals(word)){
            		result.add(new Integer(i));
            	}
            }
            Iterator<int> it = result.iterator();
            while (it.hasNext()) {
            	System.out.println(it.next());
            }
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:17: warning: [removal] Integer(int) in Integer has been deprecated and marked for removal
            		result.add(new Integer(i));
            		           ^
Main.java:20: error: unexpected type
            Iterator<int> it = result.iterator();
                     ^
  required: reference
  found:    int
1 error
1 warning
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            for(int i = 0; i < text.length() - word.length() + 1; i++){
            	if(text.substring(i,i + word.length().str.equals(word)){
            		System.out.println(i);
            	}
            }       
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:10: error: ')' expected
            	if(text.substring(i,i + word.length().str.equals(word)){
            	                                                       ^
1 error
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            for(int i = 0; i < text.length() - word.length() + 1; i++){
            	for (int j = 0; j < word.length(); j++) {
            		if (text.charAt(i + j) != word(j))
            			break;
            	}
            	if(j == word.length()){
            		System.out.println(i);
            	}
            }       
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:11: error: cannot find symbol
            		if (text.charAt(i + j) != word(j))
            		                          ^
  symbol:   method word(int)
  location: class Main
Main.java:14: error: cannot find symbol
            	if(j == word.length()){
            	   ^
  symbol:   variable j
  location: class Main
2 errors
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            for(int i = 0; i < text.length() - word.length() + 1; i++){
            	for (int j = 0; j < word.length(); j++) {
            		if (text.charAt(i + j) != word.charAt(j))
            			break;
            	}
            	if(j == word.length()){
            		System.out.println(i);
            	}
            }       
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
            	if(j == word.length()){
            	   ^
  symbol:   variable j
  location: class Main
1 error
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            
            int index = text.indexOf(text);
            while (index > -1) {
            	System.out.println(index);
            	index = text.indexOf(text, index + 1)
            }
        }catch(IOException e){
            System.out.println(e);
        }  
    }
}

Compiler output:
Main.java:13: error: ';' expected
            	index = text.indexOf(text, index + 1)
            	                                     ^
1 error
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            
            kmpMatcher(text, word);
/*            int index = text.indexOf(word);
            while (index > -1) {
            	System.out.println(index);
            	index = text.indexOf(word, index + 1);
            }*/
        }catch(IOException e){
            System.out.println(e);
        }  
    }
    private static int kmpMatcher(String text, String pattern) {
        int txtCsl = 1;
        int ptnCsl = 0;
        
        int[] skip = new int[pattern.length() + 2];
        
        skip[txtCsl] = 0;
        
        //????´¢????±??????????????????????+1?????§
        while (txtCsl != pattern.length() + 1) {
            //??????????????????????????????????????????
            if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                skip[++txtCsl] = ++ptnCsl;
            } else if (ptnCsl == 0) {
                skip[++txtCsl] = ptnCsl;
            } else {
                ptnCsl = skip[ptnCsl];
            }
        }
        
        System.out.println("--------??¢?´¢????§????--------");
        txtCsl = ptnCsl = 0;
        while (txtCsl != text.length() && ptnCsl != pattern.length()) {
            if (text.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                txtCsl++;
                ptnCsl++;
                if (ptnCsl == pattern.length()) {
                	System.out.println(txtCsl - ptnCsl - 2);
                	ptnCsl = skip[ptnCsl];
                }
            } else if (ptnCsl == 0) {
                txtCsl++;
            } else {
                ptnCsl = skip[ptnCsl];
            }
        }
    }
}

Compiler output:
Main.java:56: error: missing return statement
    }
    ^
1 error
Language: Java

import java.io.*;
public class Main {
    public static void main(String[] args) {    
        InputStreamReader in = new InputStreamReader(System.in);
        BufferedReader reader = new BufferedReader(in);
        try{
            String text = reader.readLine();
            String word = reader.readLine();
            
            kmpMatcher(text, word);
/*            int index = text.indexOf(word);
            while (index > -1) {
            	System.out.println(index);
            	index = text.indexOf(word, index + 1);
            }*/
        }catch(IOException e){
            System.out.println(e);
        }  
    }
    private static int kmpMatcher(String text, String pattern) {
        int txtCsl = 1;
        int ptnCsl = 0;
        
        int[] skip = new int[pattern.length() + 2];
        
        skip[txtCsl] = 0;
        
        //????´¢????±??????????????????????+1?????§
        while (txtCsl != pattern.length() + 1) {
            //??????????????????????????????????????????
            if (txtCsl != pattern.length() && pattern.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                skip[++txtCsl] = ++ptnCsl;
            } else if (ptnCsl == 0) {
                skip[++txtCsl] = ptnCsl;
            } else {
                ptnCsl = skip[ptnCsl];
            }
        }
        
        txtCsl = ptnCsl = 0;
        while (txtCsl != text.length() && ptnCsl != pattern.length()) {
            if (text.charAt(txtCsl) == pattern.charAt(ptnCsl)) {
                txtCsl++;
                ptnCsl++;
                if (ptnCsl == pattern.length()) {
                	System.out.println(txtCsl - ptnCsl - 2);
                	ptnCsl = skip[ptnCsl];
                }
            } else if (ptnCsl == 0) {
                txtCsl++;
            } else {
                ptnCsl = skip[ptnCsl];
            }
        }
    }
}

Compiler output:
Main.java:55: error: missing return statement
    }
    ^
1 error
Language: Java

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

public class Algo49{
	private static FastScanner sc = new FastScanner();

	public static void main(String[] args){
		char[] S = sc.next().toCharArray();
		char[] P = sc.next().toCharArray();
		int n = S.length;
		int m = P.length;

		int[] T = new int[m+1];
		T[0] = -1;
		T[1] = 0;
		int i = 2;
		int j = 0;
		while(i <= m){
			if(P[i-1] == P[j]){
				T[i] = j + 1;
				i++;
				j++;
			}else if(j > 0){
				j = T[j];
			}else{
				T[i] = 0;
				i++;
			}
		}

		i = 0;
		j = 0;
		StringBuilder ans = new StringBuilder();
		while(i + j < n){
			if(P[j] == S[i + j]){
				j++;
				if(j == m){
					ans.append(i);
					ans.append("\n");
				}else{
					continue;
				}
			}
			i = i + j - T[j];
			if(j > 0){
				j = T[j];
			}
		}

		System.out.print(ans);
	}

	static class FastScanner{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(){
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next(){
			while(st == null || !st.hasMoreElements()){
				try{
					st = new StringTokenizer(br.readLine());
				}catch(IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
	}
}

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

#include <iostream>
#include <string>

using namespace std;

int main() {
    string s1, s2;
    cin >> s1 >> s2;

    for (auto i = s1.begin(); i != s1.end(); ++i) {
        auto j = s2.begin();
        auto k = i;
        while (j != s2.end() && k != s1.end()) {
            if (*k != *j) {
                break;
            }
            ++k; ++j;
        }
        if (j == s2.end()) {
            cout << distance(s1.begin(), i) << endl;
        }
    }

    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include <iostream>
^
Main.java:2: error: illegal character: '#'
#include <string>
^
Main.java:8: error: not a statement
    cin >> s1 >> s2;
              ^
Main.java:20: error: not a statement
            cout << distance(s1.begin(), i) << endl;
                                            ^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
  (use --enable-preview to enable unnamed classes)
Main.java:14: error: illegal start of expression
            if (*k != *j) {
                ^
Main.java:14: error: illegal start of expression
            if (*k != *j) {
                      ^
7 errors
Language: C

#include<bits/stdc++.h>
using namespace std;
??
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;
??
typedef unsigned long long ull;
const ull p=1000000007;
const int SIZE=1000000;
ull H[SIZE+1],power[SIZE+1];
char S[SIZE+1],T[SIZE+1];
??
signed main(){
????????scanf("%s%s",S,T);
????????int ls=strlen(S),lt=strlen(T);
????????power[0]=1;
????????for(int i=1;i<=ls;i++){
????????????????power[i]=power[i-1]*p;
????????????????H[i]=H[i-1]*p+S[i-1];
????????}
??
????????ull ht=0;
????????rep(i,lt)ht=ht*p+T[i];
??
????????for(int i=lt;i<=ls;i++){
????????????????ull hs=H[i]-H[i-lt]*power[lt];
????????????????if(hs==ht)printf("%d\n",i-lt);
????????}
????????return 0;
}

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

#include<stdio.h>
#include<string.h>

int main(){
  int i,j,n,k=0,sum=0,tlen,plen,v[N];
  char T[1000000],P[1000];

  scanf("%s%s",T,P);
  tlen=strlen(T);
  plen=strlen(P);
  //printf("%d %d\n",tlen,plen);
  for(i=0;i<tlen;i++){
    if(T[i]==P[0]){
      j=i+1;
      n=1;
      while(n<plen){
        if(T[j]!=P[n])
          break;
        j++;
	n++;
      }
      if(n==plen){
        v[k]=i;
        sum++;
	k++;
      }
    }
  }
  for(k=0;k<sum;k++){
    printf("%d\n",v[k]);
  }
  //printf("%d\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:35: error: 'N' undeclared (first use in this function)
    5 |   int i,j,n,k=0,sum=0,tlen,plen,v[N];
      |                                   ^
main.c:5:35: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib>
#define N 10000
#define M 1000000

int main(){
  int A[N];
  int a,b;
  int i,count=0;
 char T[M];
 char P[N];
  scanf("%s %s",T, P);

  a = strlen(T);
  b = strlen(P);
  for(i = 0;i < a; i++){
    if(strncmp(T+i,P,b) == 0){
      A[count] = i;
      count++;
    }

  }
  for( i = 0; i < count; i++){
    printf("%d\n" , A[i]);
  }
  return 0;
}

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

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
  int A[N];
  int a,b;
  int i,count=0;
 char *T;
 char *P;
 T = (char* )malloc(sizeof(char) * 1000000);
 P = (char* )malloc(sizeof(char) * 10000);
  scanf("%s %s",T, P);

  a = strlen(T);
  b = strlen(P);
  for(i = 0;i < a; i++){
    if(strncmp(T+i,P,b) == 0){
      A[count] = i;
      count++;
    }

  }
  for( i = 0; i < count; i++){
    printf("%d\n" , A[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:9: error: 'N' undeclared (first use in this function)
    6 |   int A[N];
      |         ^
main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
  int a,b;
  int i,count=0;
 char *T;
 char *P;
 T = (char* )malloc(sizeof(char) * 1000000);
 P = (char* )malloc(sizeof(char) * 10000);
  scanf("%s%s",T, P);

  a = strlen(T);
  b = strlen(P);
  for(i = 0;i < a; i++){
    if(strncmp(T+i,P,b) == 0){
      printF("%d\n",i);

  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: implicit declaration of function 'printF'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |       printF("%d\n",i);
      |       ^~~~~~
      |       printf
main.c:22:1: error: expected declaration or statement at end of input
   22 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
  int a,b;
  int i,count=0;
 char *T;
 char *P;
 T = (char* )malloc(sizeof(char) * 1000000);
 P = (char* )malloc(sizeof(char) * 10000);
  scanf("%s%s",T, P);

  a = strlen(T);
  b = strlen(P);
  for(i = 0;i < a; i++){
    if(strncmp(T+i,P,b) == 0){
      printF("%d\n",i);
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:7: error: implicit declaration of function 'printF'; did you mean 'printf'? [-Wimplicit-function-declaration]
   18 |       printF("%d\n",i);
      |       ^~~~~~
      |       printf
Language: C

#include <stdio.h>
#include <string.h>
 
int main(){
    char A[1000001],B[10001];
    int i, k, in, state;
     
    scanf("%s",A);
    scanf("%s",B);
    in=strlen(A);
    ln=strlen(B);
     
    for(i=0;i<in;i++){
        if(strncmp(&A[i],B,k)==0)printf("%d\n",i);
    }
     
     
    return 0;
     
}

Compiler output:
main.c: In function 'main':
main.c:11:5: error: 'ln' undeclared (first use in this function); did you mean 'in'?
   11 |     ln=strlen(B);
      |     ^~
      |     in
main.c:11:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>

int main() {
    char s1[1000001];
    char s2[10001];
    int i, j, k;

    scanf("%s", s1);
    scanf("%s", s2);
    
    s1len = strlen(s1);
    s2len = strlen(s2);

    for (i = 0; i < s1len; i++) {
        if(strncmp(s2, &s1[i], s2len)==0) printf("%d\n", i);
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:5: error: 's1len' undeclared (first use in this function); did you mean 'strlen'?
   12 |     s1len = strlen(s1);
      |     ^~~~~
      |     strlen
main.c:12:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:5: error: 's2len' undeclared (first use in this function); did you mean 'strlen'?
   13 |     s2len = strlen(s2);
      |     ^~~~~
      |     strlen
Language: C++

/*input
aabhfgfaagjffasaaabaaazxzxcohxzcohxzcohzcxohizxciaabaaagfaabaaaaasfdasfabaaaaabaaafgsdffdhaabaagffgffhdfaaabaghfdaa
aa
*/
fn read_line() -> String {
    let mut return_ = format!("");
    std::io::stdin().read_line(&mut return_).ok();
    return_.pop();
    return_
}

fn main() {
    let string: Vec<char> = read_line().chars().collect();
    let pattern: Vec<char> = read_line().chars().collect();
    //let start = std::time::Instant::now();
    kmp(&string, &pattern);
    //println!("{:?}", start.elapsed());
}

fn kmp_table(pattern: &Vec<char>, m: usize, mut kmp: Vec<usize>) -> Vec<usize> {
    let mut len: usize = 0;
    kmp[0] = 0;
    let mut i: usize = 1;
    while i < m {
        if pattern[i] == pattern[len] {
            len = len + 1;
            kmp[i] = len;
            i = i + 1;
        } else {
            if len != 0 {
                len = kmp[len - 1];
            } else {
                kmp[i] = 0;
                i = i + 1;
            }
        }
    }
    kmp
}

fn kmp(string: &Vec<char>, pattern: &Vec<char>) -> () {
    let n = string.len();
    let m = pattern.len();
    let kmp = kmp_table(&pattern, m, vec![0usize; m]);
    let mut i: usize = 0;
    let mut j: usize = 0;
    while i < n {
        if pattern[j] == string[i] {
            i = i + 1;
            j = j + 1;
        }
        if j == m {
            println!("{:?}", i - j);
            j = kmp[j - 1];
        } else if i < n && pattern[j] != string[i] {
            if j != 0 {
                j = kmp[j - 1];
            } else {
                i = i + 1;
            }
        }
    }
}



Compiler output:
a.cc:5:1: error: 'fn' does not name a type
    5 | fn read_line() -> String {
      | ^~
a.cc:12:1: error: 'fn' does not name a type
   12 | fn main() {
      | ^~
a.cc:20:1: error: 'fn' does not name a type
   20 | fn kmp_table(pattern: &Vec<char>, m: usize, mut kmp: Vec<usize>) -> Vec<usize> {
      | ^~
a.cc:41:1: error: 'fn' does not name a type
   41 | fn kmp(string: &Vec<char>, pattern: &Vec<char>) -> () {
      | ^~
Language: C++

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

void KMP(string T, string P){
	int t=T.size();
	int p=P.size();
	int i,j,k;
	
	//?????????????????????
	vector<int> next(p);
	i=2;
	j=0;
	next[0]=-1;
	next[1]=0;
	while(i<p){
		if(P[i-1]==P[j]){
			next[i]=j+1;
			i++;
			j++;
		}else if(j>0){
			j=next[j];
		}else{
			next[i]=0;
			i++;
		}
	}
	
	i=0;
	j=0;
	while(i<t){
		//cout << i << " "<< j<<endl;
		if(T[i+j]==P[j]){
			j++;
			if(j==p) {
				printf(%d\n,i);
				i++;
				j=0;
			}
		}else{
			i=i+j-next[j];
			if(j>0){j=next[j];}
		}
	}
	
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	string T,P;
	cin >> T >> P;
	KMP(T,P);
	return 0;
}

Compiler output:
a.cc:38:42: error: stray '\' in program
   38 |                                 printf(%d\n,i);
      |                                          ^
a.cc: In function 'void KMP(std::string, std::string)':
a.cc:38:40: error: expected primary-expression before '%' token
   38 |                                 printf(%d\n,i);
      |                                        ^
a.cc:38:41: error: 'd' was not declared in this scope
   38 |                                 printf(%d\n,i);
      |                                         ^
Language: C++

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

int solve(char* T, char* P, int start)
{
    int n = strlen(T), m = strlen(P);
    int k = start;
    int x, y;

    if(n < m) return -1;

    while(k <= n - m){
        for(x = m - 1; x >= 0; x--){
            if(P[x] != T[k + x]) break;
        }
        if(x < 0) return k;
        for(y = x; y >= 0; y--){
            if(P[y] == T[k + x]) break;
        }
        k += x - y;
    };
    return -1;
}

int main()
{
    //string T, P;
	char T[1000000], P[10000];
	//cin >> T >> P;
	scanf("%s %s", T, P);
    int start = 0;

    while(1){
        start = solve(T, P, start);
        if(start < 0) break;
        cout << start << endl;
        start++;
    };
    return 0;
}

Compiler output:
a.cc: In function 'int solve(char*, char*, int)':
a.cc:8:13: error: 'strlen' was not declared in this scope
    8 |     int n = strlen(T), m = strlen(P);
      |             ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
a.cc:12:12: error: 'm' was not declared in this scope
   12 |     if(n < m) return -1;
      |            ^
a.cc:14:20: error: 'm' was not declared in this scope
   14 |     while(k <= n - m){
      |                    ^
Language: C++

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

#define A 1995455101 // large prime number.
#define B 1995455447 // large prime number, bigger than A.

int main()
{
    char T[1000000]; scanf("%s", T); int len_T = strlen(T);
    char P[10000];   scanf("%s", P); int len_P = strlen(P);
    long long *has_T, *has_P;
    has_T = new long long [len_T];
    has_P = new long long [len_P];

    long long h = 0; int i;  // hash coding.
    // has_T[i] = (T[0]A^{i-1} + T[1]A^{i-2} + ... + T[i-1]A + T[i]) % B.
    for(i = 0; i < len_T; i++){ h = (h * A + T[i]) % B; has_T[i] = h; }
    h = 0;
    // has_P[i] = (P[0]A^{i-1} + P[1]A^{i-2} + ... + P[i-1]A + P[i]) % B.
    for(i = 0; i < len_P; i++){ h = (h * A + P[i]) % B; has_P[i] = h; }

    // last_has = (P[0]A^{len_P-1} + P[1]A^{len_P-2} + ... + P[len_P-1]) % B.
    long long last_has = has_P[len_P - 1];
    // A^{len_P} Mod B.
    long long power, x, y, z;
    x = A, y = len_P, z = 1;
    for( ; y; y /= 2){
        if((y & 1) != 0){ z = (z * x) % B; }
        x = (x * x) % B;
    }
    power = z;

    for(i = len_P - 1; i < len_T; i++){
        if(has_T[i] == ((i >= len_P ? has_T[i - len_P] : 0) * power + last_has) % B){
			printf("%d\n", i - len_P + 1);
        }
    }
    delete [] has_T; delete [] has_P;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:50: error: 'strlen' was not declared in this scope
   11 |     char T[1000000]; scanf("%s", T); int len_T = strlen(T);
      |                                                  ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <iostream>
#include <string>
using namespace std;
 
int main(){
    string a,b;
    cin >> a >> b;
    int SizeA = a.size();
    int SizeB = b.size();
    if(SizeA < SizeB) return 0;
    for (int i = 0; i < SizeA-SizeB +1 ; ++i) {
        if(a[i]== b[0]){
            if(a.substr(i,SizeB) == b) printf("%d\n",i);
        }
    }
    reaurn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'reaurn' was not declared in this scope
   16 |     reaurn 0;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
 
int main(){
    string a,b;
    cin >> a >> b;
    int SizeA = a.size();
    int SizeB = b.size();
    if(SizeA < SizeB) return 0;
    for (int i = 0; i < SizeA-SizeB +1 ; ++i) {
        if(a[i]== b[0]){
            if(a.substr(i,SizeB) == b) printf("%d\n",i);
        }
    }
    reaurn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'reaurn' was not declared in this scope
   17 |     reaurn 0;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
using namespace std;
 
int main(){
    string a,b;
    cin >> a >> b;
    int SizeA = a.size();
    int SizeB = b.size();
    if(SizeA < SizeB) return 0;
    for (int i = 0; i < SizeA-SizeB +1 ; ++i) {
        if(a[i]== b[0]){
            if(a.substr(i,SizeB) == b) printf("%d\n",i);
        }
    }
    reaurn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'reaurn' was not declared in this scope
   18 |     reaurn 0;
      |     ^~~~~~
Language: C++

#include <iostream>
#include <cmath>
#include <string>

int main(void) {
  std::sync_with_stdio(false);

  std::string T;
  std::string P;

  std::cin >> T;
  std::cin >> P;
  
  if (T.size() < P.size()) {
    return 0;
  }

  int index = 0;

  for (int i = 0; i <= T.size() - P.size(); i++) {
    if (P == T.substr(i, P.size())) {
      std::cout << i << std::endl;
    }
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: 'sync_with_stdio' is not a member of 'std'
    6 |   std::sync_with_stdio(false);
      |        ^~~~~~~~~~~~~~~
Language: C++

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

int main() {
	string a, b;
	cin >> a >> b;
	if (a.length < b.length())goto s;
	for (int c = 0; c < a.length() - b.length() + 1; c++) {
		for (int d = 0; d < b.length(); d++) {
			if (a[c + d] != b[d])break;
			if (b.length() - 1 == d) { cout << c <<endl; }
		}
	}
s:;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
    9 |         if (a.length < b.length())goto s;
      |             ~~^~~~~~
      |                     ()
Language: C++

#include<bits/stdc++.h>
using namespace std;
??
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
typedef vector<int>vint;
typedef pair<int,int>pint;
??
typedef unsigned long long ull;
const ull p=1000000007;
const int SIZE=1000000;
ull H[SIZE+1],power[SIZE+1];
char S[SIZE+1],T[SIZE+1];
??
signed main(){
????????scanf("%s%s",S,T);
????????int ls=strlen(S),lt=strlen(T);
????????power[0]=1;
????????for(int i=1;i<=ls;i++){
????????????????power[i]=power[i-1]*p;
????????????????H[i]=H[i-1]*p+S[i-1];
????????}
??
????????ull ht=0;
????????rep(i,lt)ht=ht*p+T[i];
??
????????for(int i=lt;i<=ls;i++){
????????????????ull hs=H[i]-H[i-lt]*power[lt];
????????????????if(hs==ht)printf("%d\n",i-lt);
????????}
????????return 0;
}

Compiler output:
a.cc:3:1: error: expected unqualified-id before '?' token
    3 | ??
      | ^
a.cc:9:1: error: expected unqualified-id before '?' token
    9 | ??
      | ^
a.cc:11:7: error: 'ull' does not name a type; did you mean 'all'?
   11 | const ull p=1000000007;
      |       ^~~
      |       all
a.cc:13:1: error: 'ull' does not name a type; did you mean 'all'?
   13 | ull H[SIZE+1],power[SIZE+1];
      | ^~~
      | all
a.cc:15:1: error: expected unqualified-id before '?' token
   15 | ??
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

struct SuffixArray
{
  vector< int > SA;
  string s;

  void Build_SA(const string &str)
  {
    s = str;
    SA.resize(s.size());
    iota(begin(SA), end(SA), 0);
    sort(begin(SA), end(SA), [&](const int &a, const int &b)
    {
      if(s[a] == s[b]) return (a > b);
      return (s[a] < s[b]);
    });
    vector< int > classes(s.size()), c(s.size()), cnt(s.size());
    for(int i = 0; i < s.size(); i++) {
      c[i] = s[i];
    }
    for(int len = 1; len < s.size(); len <<= 1) {
      for(int i = 0; i < s.size(); i++) {
        if(i > 0 && c[SA[i - 1]] == c[SA[i]] && SA[i - 1] + len < s.size() && c[SA[i - 1] + len / 2] == c[SA[i] + len / 2]) {
          classes[SA[i]] = classes[SA[i - 1]];
        } else {
          classes[SA[i]] = i;
        }
      }
      iota(begin(cnt), end(cnt), 0);
      copy(begin(SA), end(SA), begin(c));
      for(int i = 0; i < s.size(); i++) {
        int s1 = c[i] - len;
        if(s1 >= 0) SA[cnt[classes[s1]]++] = s1;
      }
      classes.swap(c);
    }
  }

  int operator[](int k) const
  {
    return (SA[k]);
  }

  int size() const
  {
    return (s.size());
  }

  bool lt_substr(string &t, int si = 0, int ti = 0)
  {
    int sn = s.size(), tn = t.size();
    while(si < sn && ti < tn) {
      if(s[si] < t[ti]) return (true);
      if(s[si] > t[ti]) return (false);
      ++si, ++ti;
    }
    return (si >= sn && ti < tn);
  }

  int lower_bound(string &t)
  {
    int low = -1, high = SA.size();
    while(high - low > 1) {
      int mid = (low + high) >> 1;
      if(lt_substr(t, SA[mid])) low = mid;
      else high = mid;
    }
    return (high);
  }

  pair< int, int > lower_upper_bound(string t)
  {
    int idx = lower_bound(t);
    int low = idx - 1, high = SA.size();
    t.back()++;
    while(high - low > 1) {
      int mid = (low + high) >> 1;
      if(lt_substr(t, SA[mid])) low = mid;
      else high = mid;
    }
    t.back()--;
    return (make_pair(idx, high));
  }

  void output()
  {
    for(int i = 0; i < size(); i++) {
      cout << i << ": " << s.substr(SA[i]) << endl;
    }
  }
};


int main()
{
  char a[1000001], b[100001];
  scanf("%s", a);
  scanf("%s", b);

  SuffixArray sa;
  sa.Build_SA(string(a));

  auto get = sa.lower_upper_bound(string(b));
  bool v[1000000] = {};
  for(int i = get.first; i < get.second; i++) {
    v[sa[i]] = true;
  }
  for(int i = 0; i < T.size(); i++) {
    if(v[i]) printf("%d\n", i);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:111:22: error: 'T' was not declared in this scope
  111 |   for(int i = 0; i < T.size(); i++) {
      |                      ^
Language: C++

#include <iostream>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <algorithm>
#include <string>
using namespace std;
typedef long long lli;
typedef vector<lli> vll;
typedef vector<bool> vbl;
typedef vector<vector<lli> > mat;
typedef vector<vector<bool> > matb;
typedef vector<string> vst;
typedef pair<lli,lli> pll;
typedef pair<double,double> pdd;

const lli MOD = 1777777777;
const lli h = 341234;
lli hh;

string a;
string b;
lli a_hash;
lli b_hash;

lli pow(lli a,lli n,lli mod = MOD){
	lli ret = 1;
	for(;n!=0;n=n>>1){
		if(n&1) ret = (ret * a) % mod;
		a = (a * a) % mod;
	}
	return ret;
}

int main(){
    cin >> a >> b;
    if(a.size() < b.size()) return 0;
    hh = pow(h,b.size());
    for(lli i = 0;i < b.size();i++){
        b_hash *= h;
        b_hash %= MOD;
        b_hash += b[i];
        b_hash %= MOD;
    }
    for(lli i = 0;i < b.size();i++){
        a_hash *= h;
        a_hash %= MOD;
        a_hash += a[i];
        a_hash %= MOD;
    }
    a += "~";
    for(lli i = 0;i < a.size()-b.size()c;i++){
        if(a_hash == b_hash) cout << i << endl;
        a_hash *= h;
        a_hash %= MOD;
        a_hash += a[i+b.size()];
        a_hash %= MOD;
        a_hash -= (hh*a[i]) % MOD;
        a_hash += MOD;
        a_hash %= MOD;
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:40: error: expected ';' before 'c'
   56 |     for(lli i = 0;i < a.size()-b.size()c;i++){
      |                                        ^
      |                                        ;
a.cc:56:40: error: 'c' was not declared in this scope
a.cc:56:41: error: expected ')' before ';' token
   56 |     for(lli i = 0;i < a.size()-b.size()c;i++){
      |        ~                                ^
      |                                         )
a.cc:56:42: error: 'i' was not declared in this scope
   56 |     for(lli i = 0;i < a.size()-b.size()c;i++){
      |                                          ^
Language: C++

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

void bubble(int n,char a[],int b[]){
  
  for(int i=0;i<n-1;i++){
    for(int j=n-1;j>=i+1;j--){
      if(b[j]<b[j-1]){
	swap(b[j],b[j-1]);
	swap(a[j],a[j-1]);
      }
    }
  }
  for(int i=0;i<n;i++){
    if(i!=n-1) cout << a[i] << b[i] << ' ';
    else cout << a[i] << b[i] << endl;
  }
}

void select(int n,char a[],int b[]){

  for(int i=0;i<n-1;i++){
    int mi = i;
    for(int j=i;j<n-1;j++){
      if(b[j] < b[mi]) mi = j;
    }
    swap(b[i],b[mi]);
    swap(a[i],a[mi]);
  }
  for(int i=0;i<n;i++){
    if(i!=n-1) cout << a[i] << b[i] << ' ';
    else cout << a[i] << b[i] << endl;
  }
}

int main(){

  int n,d[37];
  char c[37];

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> c[i] >> d[i];
  }

  bubble(n,c,d);
  select(n,c,d);

  r

Compiler output:
a.cc: In function 'int main()':
a.cc:49:3: error: 'r' was not declared in this scope
   49 |   r
      |   ^
a.cc:49:4: error: expected '}' at end of input
   49 |   r
      |    ^
a.cc:36:11: note: to match this '{'
   36 | int main(){
      |           ^
Language: C++

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

#define TEXT_T_MAX 1000000
#define TEXT_P_MAX 10000;

bool compareText(const char *t1, char const *t2, int len);

int main (void)
{
	char t[TEXT_T_MAX + 1] = "\0";
	char p[TEXT_P_MAX + 1] = "\0";
	cin >> t >> p;

	int length;
	for (length = 0; p[length] != '\0'; length++);

	for (int i = 0; t[i + length - 1] != '\0'; i++) {
		if (compareText(&t[i], &p[0], length)) cout << i << endl;
	}

	return 0;	
}

bool compareText(const char *t1, const char *t2, int len)
{
	for (int i = 0; i < len; i++) {
		if (*(t1 + i) != *(t2 + i)) return false;
	}
	return true;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:25: error: expected ']' before ';' token
    6 | #define TEXT_P_MAX 10000;
      |                         ^
a.cc:13:16: note: in expansion of macro 'TEXT_P_MAX'
   13 |         char p[TEXT_P_MAX + 1] = "\0";
      |                ^~~~~~~~~~
a.cc:13:30: error: expected ';' before ']' token
   13 |         char p[TEXT_P_MAX + 1] = "\0";
      |                              ^
      |                              ;
a.cc:14:21: error: 'p' was not declared in this scope
   14 |         cin >> t >> p;
      |                     ^
Language: C++

#include<bits/stdc++.h> using namespace std; string S, T; int main() { cin >> S >> T; if (S.size() >= T.size()) { for (int i = 0; i <= S.size() - T.size(); i++) { if (T == S.substr(i, T.size())) { printf("%d\n",i); } } } }


Compiler output:
a.cc:1:25: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h> using namespace std; string S, T; int main() { cin >> S >> T; if (S.size() >= T.size()) { for (int i = 0; i <= S.size() - T.size(); i++) { if (T == S.substr(i, T.size())) { printf("%d\n",i); } } } }
      |                         ^~~~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <String.h>
#include <math.h>
#include <limits.h>


/*
 * ?????????????´¢????????????rolling-hash???
 * String????????????????????¨??????Pattern????????????????????????
 * ??????????±???????????????°???????????°????????????????????£??¬??????????????????
 *
 */

char String[1001][1001];
char Pattern[1001][1001];




/*
 * unsinged long long?????¨???????????¨??§???????????????????????????????????????????????? mod (2<<64)??¨??????????????¨????????????
 * P????????¨????????????(2<<64)??¨?´???§???????????????????????§????????????????????¶
 */
typedef unsigned long long ull;
#define P (1000000007)

ull power[1000001];

/*
 * String:????´¢????±??????????
 * s_num:????´¢????±???????????????????
 * Pattern:????´¢??????????????????
 * p_num:????´¢???????????????????????????
 */
void rolling_hash(int h, int w, int r, int c)
{
    int i, j, k , l;
    ull target_hash = 0, Pattern_hash = 0;
    
    
    /*
     * target hash??????????¨?????????¨?????????????????????????±?????????????
     */
    power[0] = 1;
    for (i=0; i <r*c; i++) {
            power[i+1]= power[i]* P;
    }
    
    /*
     * Pattern??????????????\???????±???????
     */
    for (i=0; i < r; i++) {
        for (j=0; j < c; j++) {
            Pattern_hash += Pattern[i][j] * power[i*c + j];
        }
    }
    
    
    for (i = 0; i + r <= h; i++) {
        
        /*
         * String???????????\???????±???????
         */
        target_hash = 0;
        for (k=i; k < r; k++) {
            for (l=0; l < c; l++) {
                target_hash += String[k][l] * power[c *(k-i)  + l] ;
            }
        }
        
        for (j=0; j+c <= w; j++) {
            /*
             * hash???????????´????????°?????????????????¨????????????
             */
            if (target_hash == Pattern_hash) {
                printf("%d %d\n", i, j);
            }
            
            
            /*
             * target???????????????????????????????????????????????????????????????????????\??????????¨??????????
             */
            if (j+c != w) {
                target_hash = 0;
                for (k=0; k < r; k++) {
                    for (l=0; l < c; l++) {
                        target_hash += String[i+k][l+j+1] * power[k*c + l] ;
                    }
                }
            }

        }
    }
    
    return;
}


int main( ){
    
    int i, j, H, W, R,C;
    scanf("%d", &H);
    scanf("%d", &W);
    getchar();
    for (i = 0; i < H ; i++) {
        for (j = 0; j < W; j++) {
            scanf("%c", &String[i][j]);
        }
        getchar();
    }
    
    scanf("%d", &R);
    scanf("%d", &C);
    getchar();
    for (i = 0; i < R ; i++) {
        for (j = 0; j < C; j++) {
            scanf("%c", &Pattern[i][j]);
        }
        getchar();
    }
    
    rolling_hash(H, W, R, C);
   
    
    return 0;
}

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

#include  <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

typedef unsigned long long ull;

const int max_size=1010;
char pattern[max_size][max_size];
char target[max_size][max_size];

ull hash[max_size][max_size],tmp[max_size][max_size];

void calc(char a[max_size][max_size],int n,int m,int r,int c){
	const ull br=1000000007;
	const ull bc=1000000009;

	ull tc=1;
	rep(i,c) tc*=bc;

	rep(i,n){
		ull e=0;
		rep(j,c) e=e*bc+a[i][j];
		rep(j,m){
			tmp[i][j]=e;
			if(j+c>=m) break;
			e=e*bc-tc*a[i][j]+a[i][j+c];
		}
	}

	ull tr=1;
	rep(j,r) tr*=br;

	rep(j,m-c+1){
		ull e=0;
		rep(i,r) e=e*br+tmp[i][j];
		rep(i,n){
			hash[i][j]=e;
			if(i+r>=n) break;
			e=e*br-tr*tmp[i][j]+tmp[i+r][j];
		}
	}
	return;
}

int main(void){
	int h,w;
	cin >> h >> w;
	rep(i,h)rep(j,w) cin >> target[i][j];
	int r,c;
	cin >> r >> c;
	rep(i,r)rep(j,c) cin >> pattern[i][j];
	calc(pattern,r,c,r,c);
	ull pattern_hash=hash[0][0];
	calc(target,h,w,r,c);
	for(int i=0;i+r<=h;++i)
		for(int j=0;j+c<=w;++j)
			if(pattern_hash==hash[i][j])
				cout << i << " " << j << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void calc(char (*)[1010], int, int, int, int)':
a.cc:37:25: error: reference to 'hash' is ambiguous
   37 |                         hash[i][j]=e;
      |                         ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:11:5: note:                 'ull hash [1010][1010]'
   11 | ull hash[max_size][max_size],tmp[max_size][max_size];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:53:26: error: reference to 'hash' is ambiguous
   53 |         ull pattern_hash=hash[0][0];
      |                          ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:11:5: note:                 'ull hash [1010][1010]'
   11 | ull hash[max_size][max_size],tmp[max_size][max_size];
      |     ^~~~
a.cc:57:42: error: reference to 'hash' is ambiguous
   57 |                         if(pattern_hash==hash[i][j])
      |                                          ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:11:5: note:                 'ull hash [1010][1010]'
   11 | ull hash[max_size][max_size],tmp[max_size][max_size];
      |     ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <String.h>
#include <math.h>
#include <limits.h>


/*
 * ?????????????´¢????????????rolling-hash???
 * String????????????????????¨??????Pattern????????????????????????
 * ??????????±???????????????°???????????°????????????????????£??¬??????????????????
 *
 */

char String[1001][1001];
char Pattern[1001][1001];




/*
 * unsinged long long?????¨???????????¨??§???????????????????????????????????????????????? mod (2<<64)??¨??????????????¨????????????
 * P????????¨????????????(2<<64)??¨?´???§???????????????????????§????????????????????¶
 */
typedef unsigned long long ull;
#define P (1000000007)

ull power[1000001];

/*
 * String:????´¢????±??????????
 * s_num:????´¢????±???????????????????
 * Pattern:????´¢??????????????????
 * p_num:????´¢???????????????????????????
 */
void rolling_hash(int h, int w, int r, int c)
{
    int i, j, k , l;
    ull target_hash = 0, Pattern_hash = 0;
    
    
    /*
     * target hash??????????¨?????????¨?????????????????????????±?????????????
     */
    power[0] = 1;
    for (i=0; i <r*c; i++) {
            power[i+1]= power[i]* P;
    }
    
    /*
     * Pattern??????????????\???????±???????
     */
    for (i=0; i < r; i++) {
        for (j=0; j < c; j++) {
            Pattern_hash += Pattern[i][j] * power[i*c + j];
        }
    }
    
    
    for (i = 0; i + r <= h; i++) {
        
        /*
         * String???????????\???????±???????
         */
        target_hash = 0;
        for (k=i; k < r; k++) {
            for (l=0; l < c; l++) {
                target_hash += String[k][l] * power[c *(k-i)  + l] ;
            }
        }
        
        for (j=0; j+c <= w; j++) {
            /*
             * hash???????????´????????°?????????????????¨????????????
             */
            if (target_hash == Pattern_hash) {
                printf("%d %d\n", i, j);
            }
            
            
            /*
             * target???????????????????????????????????????????????????????????????????????\??????????¨??????????
             */
            if (j+c != w) {
                target_hash = 0;
                for (k=0; k < r; k++) {
                    for (l=0; l < c; l++) {
                        target_hash += String[i+k][l+j+1] * power[k*c + l] ;
                    }
                }
            }

        }
    }
    
    return;
}


int main( ){
    
    int i, j, H, W, R,C;
    scanf("%d", &H);
    scanf("%d", &W);
    getchar();
    for (i = 0; i < H ; i++) {
        for (j = 0; j < W; j++) {
            scanf("%c", &String[i][j]);
        }
        getchar();
    }
    
    scanf("%d", &R);
    scanf("%d", &C);
    getchar();
    for (i = 0; i < R ; i++) {
        for (j = 0; j < C; j++) {
            scanf("%c", &Pattern[i][j]);
        }
        getchar();
    }
    
    rolling_hash(H, W, R, C);
   
    
    return 0;
}

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

#include<iostream>
#include<string>
#include<vector>
#include <cstdlib>
using namespace std;

typedef unsigned long long ull;

const ull X = 100001;
const ull Y = 9973;
const int MAX = 105;

ull hash1[MAX][MAX];
ull hash2[MAX][MAX];

void hashCalc(int T[MAX][MAX],int H,int W,int R, int  C) {
	//x???X???C???
	ull x = 1;
	for (int i = 0; i < C; i++) {
		x *= X;
	}

	ull y = 1;
	for (int i = 0; i < R; i++) {
		y *= Y;
	}
	
	for (int i = 0; i < H; i++) {
		ull h = 0;
		for (int j = 0; j < C; j++) {
			h = h*X + T[i][j];
		}
		for (int k = 0; k + C <= W; k++) {
			hash1[i][k] = h;
			h = h*X + T[i][k + C] - T[i][k] * x;
		}
	}

	for (int j = 0; j + C <= W; j++) {
		ull h = 0;
		for (int i = 0; i < R; i++) {
			h=h*Y+hash1[i][j];
		}
		for (int k = 0; k + R <= H; k++) {
			hash2[k][j] = h;
			h = h*Y + hash1[k + R][j] - hash1[k][j] * y;
		}
	}
}

int main() {
	string s,t;
	
	int H, W;
	cin >> H >> W;
	int T[MAX][MAX];
	for (int i = 0; i < H; i++) {
		cin >> s;
		for (int j = 0; j < W; j++) {
			t=s[j];
			T[i][j]=atoi(t.c_str());
		}
	}

	int R, C;
	cin >> R >> C;
	int P[R][C];
	for (int i = 0; i < R; i++) {
		cin >> s;
		for (int j = 0; j < C; j++) {
			t=s[j];#include <cstdlib>
			P[i][j]=atoi(t.c_str());
		}
	}

	ull tmp[R];

	hashCalc(T, H, W, R, C);
	
	for (int i = 0; i < R; i++) {
		ull h = 0;
		for (int j = 0; j < C; j++) {
			h = h*X + P[i][j];
		}
		tmp[i] = h;
	}

	ull hs = 0;
	for (int i = 0; i < R; i++) {
		hs = hs*Y + tmp[i];
	}

	for (int i = 0; i + R <= H; i++) {
		for (int j = 0; j + C <= W; j++) {
			if (hash2[i][j]==hs) {
				cout << i << " " << j << endl;
			}
		}
	}
	return 0;
}

Compiler output:
a.cc:71:32: error: stray '#' in program
   71 |                         t=s[j];#include <cstdlib>
      |                                ^
a.cc: In function 'int main()':
a.cc:71:33: error: 'include' was not declared in this scope
   71 |                         t=s[j];#include <cstdlib>
      |                                 ^~~~~~~
a.cc:71:42: error: 'cstdlib' was not declared in this scope; did you mean 'stdin'?
   71 |                         t=s[j];#include <cstdlib>
      |                                          ^~~~~~~
      |                                          stdin