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

package spring;
import java.util.Scanner;

public class Signboard {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String name = sc .next();
		int count =0;
		for(int x=0; x<N; x++){
			String oldname = sc.next();
			
			label:for(int a=0; a<oldname.length(); a++){
			    if(name.charAt(0) == oldname.charAt(a));
			    int b=1;
			    if(name.charAt(1) == oldname.charAt(b));
			    int c=b-a;
			    for(int d=b+c; d<oldname.length(); d+=c) {
			    	if(name.charAt(3)==oldname.charAt(d)) break;
			    	else {
			    		if(name.charAt(name.length()-1)==d) {
			    			count++;
			    			break label;
			    		}
			    		d++;
			    	}
					
				}
			}
		}
		System.out.println(count);
	}
}
				

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

package spring;
import java.util.Scanner;

public class Signboard {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		String name = sc .next();
		int count =0;
		for(int x=0; x<N; x++){
			String oldname = sc.next();
			
			label:for(int a=0; a<oldname.length()-1; a++){
			    if(name.charAt(0) != oldname.charAt(a));
			    int b=1;
			    if(name.charAt(1) != oldname.charAt(b));
			    int c=b-a;
			    for(int d=b+c; d<oldname.length(); d+=c) {
			    	if(name.charAt(3)!=oldname.charAt(d)) break;
			    	else {
			    		if(name.charAt(d)==name.length()-1) {
			    			count++;
			    			break label;
			    		}
			    		d++;
			    	}
					
				}
			}
		}
		System.out.println(count);
	}
}
				

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

public class Main {
	
	char[] target;
	int cnt=0;
	
	void check(char[] o){
		int space, work;
		boolean flag;
		
		for(int j=0; j<o.length; j++){
			flag=true;
			if(target[0]==o[j]){//??????????????????????????£??????
				
				for(int k=j+1; k<o.length; k++){
					if(target[1]==o[k]){//??????????????????????????£??????
						
						space = k-j;
						if(o.length<=space*(target.length-1)+j) break;//??????????????\???????????¨????????£??????
						work = k;
						
						for(int l=2; l<target.length; l++){
							work+=space;
							if(o[work]!=target[l]) break;//??????????????\???????????£??????
							if(l==target.length-1){
								cnt++;
								flag = false;//???????????£???????????§?¬?????????????
							}
						}
						if(flag==false) break;
					}
				}
			}
			if(flag==false) break;
		}
	}
	
	void doIt(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int cnt = 0;
		target = sc.next().toCharArray();
		char[] old;
		
		for(int i=0; i<n; i++){
			old = sc.next().toCharArray();
			new Main().check(old);
		}
		
		System.out.println(cnt);
	}
	
	public static void main(String[] args){
		new Main().doIt();
	}
	
}

Compiler output:
Main.java:38: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:38: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

package sd_kadai_3;

import java.util.Scanner;

public class Main {
	
	char[] target;
	int cnt=0;
	
	void check(char[] o){
		int space, work;
		boolean flag;
		
		for(int j=0; j<o.length; j++){
			flag=true;
			if(target[0]==o[j]){//??????????????????????????£??????
				
				for(int k=j+1; k<o.length; k++){
					if(target[1]==o[k]){//??????????????????????????£??????
						
						space = k-j;
						if(o.length<=space*(target.length-1)+j) break;//??????????????\???????????¨????????£??????
						work = k;
						
						for(int l=2; l<target.length; l++){
							work+=space;
							if(o[work]!=target[l]) break;//??????????????\???????????£??????
							if(l==target.length-1){
								cnt++;
								flag = false;//???????????£???????????§?¬?????????????
							}
						}
						if(flag==false) break;
					}
				}
			}
			if(flag==false) break;
		}
	}
	
	void doIt(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		target = sc.next().toCharArray();
		char[] old;
		
		for(int i=0; i<n; i++){
			old = sc.next().toCharArray();
			new Main().check(old);
		}
		
		System.out.println(cnt);
	}
	
	public static void main(String[] args){
		new Main().doIt();
		retrun 0;
	}
	
}

Compiler output:
Main.java:57: error: not a statement
		retrun 0;
		^
Main.java:57: error: ';' expected
		retrun 0;
		      ^
2 errors
Language: Java

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

public class Main {
    BufferedReader br;
    Main() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    public static void main(String[] args) {
        new Main().run();
    }
    void debug(Object ... o) {
        System.out.println(Arrays.deepToString(o));
    }
    int N;
    String in;
    String [] cand;
    void init() {
        try {
            N = Integer.parseInt(br.readLine());
            cand = new String[N];
            in = br.readLine();
            for (int i = 0; i < N; i++) cand[i] = br.readLine();
        } catch (Exception e) {}
    }
    void run() {
        init();
        int c = 0;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < 20; j++) {
                StringBuilder sb = new StringBuilder();
                sb.append(".*");
                sb.append(in.charAt(0));
                for (int k = 1; k < in.length(); k++) {
                    for (int l = 0; l < j; l++) sb.append('.');
                    sb.append(in.charAt(k));
                }
                sb.append(".*");
                String pattern = sb.toString();
                if (Pattern.matches(pattern, cand[i])) {
                    c++;
                    break;
                }
            }
        }
        System.out.println(c);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
gimport java.io.*;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:3: error: class, interface, enum, or record expected
import java.util.regex.*;
^
3 errors
Language: Java

import java.util.*;

public class signboard {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		String tar = sc.next();
		for(int i=0;i<n;i++){
			String s = sc.next();
			if(search(tar,s)){
				ans++;
			}
		}
		System.out.println(ans);
	}

	static boolean search(String tar , String str){
		int keylen=tar.length();
		int len=str.length();
		int s=0;
		boolean cntflg=true;

		//現在検索している文字
		for(int j=0;j<=len-keylen;j++){
			//ターゲットの先頭文字と一致する文字をstrから探す
			if(tar.charAt(0)==str.charAt(j)){
				//System.out.println("first;"+j);
				//空白をあけて文字列を検索
				for(int leap=1;leap<=(len-j-1)/(keylen-1);leap++){
					s=1;
					cntflg=true;
					int h=j;
					for(s=1;s<keylen;s++){
						h+=leap;
						if(tar.charAt(s)==str.charAt(h)){
							s++;
						}else{
							cntflg=false;
							break;
						}
					}
					//ずっとフラグがtrueのままだったなら文字列が存在する
					if(cntflg)return true;
				}
			}
		}
		return false;
	}
}

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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		//new AOJ0578().run();
		new Main().run
	}
	void run(){
		Scanner sc=new Scanner(System.in);
		
		while(sc.hasNext()){
			int n=sc.nextInt();
			int count=0;
			char name[]=sc.next().toCharArray();
			char old[][]=new char[n][];
			//いい名前が思い浮かばなかった。
			//temp[i]はつくりたい看板のi文字目がoldの何文字目にあったかを入れておく.
			int temp[]=new int[name.length];
			for(int i=0; i<n; i++){
				old[i]=sc.next().toCharArray();
			}
			
			for(int i=0; i<n; i++){
				for(int j=0; j<old[i].length; j++){
					if(name[0]==old[i][j]){
						//なんか関数を呼ぶ
						if(signBord(name, old[i], j, 0, temp)){
							//System.out.println(i+" "+String.valueOf(old[i]));
							count++;
							break;
						}
					}
				}
			}
			System.out.println(count);
		}
	}
	
	boolean signBord(char name[],char old[],int k,int d, int temp[]){
		temp[d]=k;
		if(name.length-1 <= d){
			for(int i=0; i+2<name.length; i++){
				if(temp[i+1]-temp[i] != temp[i+2]-temp[i+1]){
						return false;
				}
			}
			return true;
		}
		
		boolean f;
		
		for(int j=k+1; j<old.length; j++){
			if(name[d+1]==old[j]){
				if(signBord(name, old, j, d+1, temp)){
					return true;
				}
			}
		}
		return false;
	}

}

Compiler output:
Main.java:8: error: not a statement
		new Main().run
		          ^
Main.java:8: error: ';' expected
		new Main().run
		              ^
2 errors
Language: Java

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ティツ?ェテ・ツ仰陛ァツ板淌ヲツ按静」ツ?陛」ツつ古」ツ?淌」ツδ。テ」ツつステ」ツδε」ツδ嘉」ツδサテ」ツつケテ」ツつソテ」ツδ?
		//new AOJ0578().run();
		new Main().run
	}
	void run(){
		Scanner sc=new Scanner(System.in);
		
		while(sc.hasNext()){
			int n=sc.nextInt();
			int count=0;
			char name[]=sc.next().toCharArray();
			char old[][]=new char[n][];
			//テ」ツ??」ツ??・ツ青催・ツ可催」ツ?古ヲツ?敕」ツ??ヲツオツョテ」ツ?凝」ツ?ーテ」ツ?ェテ」ツ?凝」ツ?」テ」ツ?淌」ツ??
			//temp[i]テ」ツ?ッテ」ツ?、テ」ツ?湘」ツつ甘」ツ?淌」ツ??ァツ慊凝ヲツ敖ソテ」ツ?ョiテヲツ鳴?・ツュツ療ァツ崢ョテ」ツ?経ldテ」ツ?ョテ、ツスツ陛ヲツ鳴?・ツュツ療ァツ崢ョテ」ツ?ォテ」ツ?づ」ツ?」テ」ツ?淌」ツ?凝」ツつ津・ツ?・テ」ツつ古」ツ?ヲテ」ツ?甘」ツ??
			int temp[]=new int[name.length];
			for(int i=0; i<n; i++){
				old[i]=sc.next().toCharArray();
			}
			
			for(int i=0; i<n; i++){
				for(int j=0; j<old[i].length; j++){
					if(name[0]==old[i][j]){
						//テ」ツ?ェテ」ツつ禿」ツ?凝ゥツ鳴「テヲツ閉ーテ」ツつ津・ツ堕シテ」ツ?カ
						if(signBord(name, old[i], j, 0, temp)){
							//System.out.println(i+" "+String.valueOf(old[i]));
							count++;
							break;
						}
					}
				}
			}
			System.out.println(count);
		}
	}
	
	boolean signBord(char name[],char old[],int k,int d, int temp[]){
		temp[d]=k;
		if(name.length-1 <= d){
			for(int i=0; i+2<name.length; i++){
				if(temp[i+1]-temp[i] != temp[i+2]-temp[i+1]){
						return false;
				}
			}
			return true;
		}
		for(int j=k+1; j<old.length; j++){
			if(name[d+1]==old[j]){
				if(signBord(name, old, j, d+1, temp)){
					return true;
				}
			}
		}
		return false;
	}

}

Compiler output:
Main.java:8: error: not a statement
		new Main().run
		          ^
Main.java:8: error: ';' expected
		new Main().run
		              ^
2 errors
Language: Java

import java.util.Scanner;

public class aoj0578 {
	public static void main(String[] args){
		new aoj0578().run();
	}
	void run(){
		Scanner in = new Scanner(System.in);
		int k = in.nextInt();
		int count = 0;
		char name[]=in.next().toCharArray();
		int cnt[] = new int [name.length];
		char yobi[][] = new char [k][];
		for(int i = 0;i < k;i++){
			yobi[i]=in.next().toCharArray();
		}
		for(int i = 0;i < k;i++){
			for(int j=0; j<yobi[i].length; j++){
				if(name[0]==yobi[i][j]){
					if(barname(name,yobi[i],j,0,cnt)){
						count++;
						break;
					}
				}
			}
		}
		System.out.println(count);
	}
	boolean barname(char name[],char yobi[],int j,int v,int cnt[]){
		cnt[v]=j;
		if(name.length-1 <= v){
			for(int k=0; k+2<name.length; k++){
				if(cnt[k+1]-cnt[k] != cnt[k+2]-cnt[k+1]){
					return false;
				}
			}
			return true;
		}
		for(int l=j+1; l<yobi.length; l++){
			if(name[v+1]==yobi[l]){
				if(barname(name, yobi, l, v+1, cnt)){
					return true;
				}
			}
		}
		return false;
	}
}

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

import java.util.Scanner;

public class practice {
	public static void Main(String[] args) {
        new practice().run();
    }
    void run(){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n=sc.nextInt();
            int count=0;
            char name[]=sc.next().toCharArray();
            char old[][]=new char[n][];
            int temp[]=new int[name.length];
            for(int i=0; i<n; i++){
                old[i]=sc.next().toCharArray();
            }
            for(int i=0; i<n; i++){
                for(int j=0; j<old[i].length; j++){
                    if(name[0]==old[i][j]){
                        if(signBord(name, old[i], j, 0, temp)){
                            count++;
                            break;
                        }
                    }
                }
            }
            System.out.println(count);
        }
    }
    boolean signBord(char name[],char old[],int k,int d, int temp[]){
        temp[d]=k;
        if(name.length-1 <= d){
            for(int i=0; i+2<name.length; i++){
                if(temp[i+1]-temp[i] != temp[i+2]-temp[i+1]){
                        return false;
                }
            }
            return true;
        }
        for(int j=k+1; j<old.length; j++){
            if(name[d+1]==old[j]){
                if(signBord(name, old, j, d+1, temp)){
                    return true;
                }
            }
        }
        return false;
    }
}

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

public class Main {
	public static void main(String[] args) {
		java.util.Scanner in = new java.util.Scanner(System.in);
		int n = in.nextInt();
		String name = in.next();
		int cnt = 0; //当てはまる個数
		for (int i=0; i<n; i++) {
			String board = in.next(); //古い看板
			for(int k=0; k<board.length();k++) {
				if (name.charAt(0) == board.charAt(k)) {
					int same1 = k; // nameと1文字目が同じ添字を格納
					int same2 = 0;
					for (int l=k+1; l<board.length(); l++) {
						if (name.charAt(1) == board.charAt(l)) {
							same2 = l; //nameと2文字目が同じ添字を格納
							break;
						}
					}
					int diffe = same2 - same1; //文字間隔
					for (int l=2; l<name.length();l++) {
						if (same2 + diffe*(l-1) < board.length())
							if (name.charAt(l) == board.charAt(same2 + diffe*(l-1))) {
								if (l == name.length()-1)
									cnt++;
							} 
						else break;
					}
				}
			}
		}
		System.out.println(cnt);
	}

Compiler output:
Main.java:32: error: reached end of file while parsing
	}
	 ^
1 error
Language: C

#include<stdio.h>
#include<string.h>
int main(void)
{
	int len,n,i,j,k,l,flg,flg2,cnt;
	char s[26],str[100][101];
	scanf("%d",&n);
	scanf("%d",s);
	for(i=0;i<n;i++){
		scanf("%s",str[i]);
	}
	for(i=0;i<n;i++){
		len=strlen(str[i]);
		flg=0;
		for(j=0;j<len;j++){
			for(k=1;k<len;k++){
				flg2=1; cnt=0;
				for(l=j;l<len;l+=k){
					if(s[cnt]!=str[i][l]){
						flg2=0;
						break;
					}
				}
				if(flg2==1

Compiler output:
main.c: In function 'main':
main.c:24:43: error: expected ')' at end of input
   24 |                                 if(flg2==1
      |                                   ~       ^
      |                                           )
main.c:24:33: error: expected declaration or statement at end of input
   24 |                                 if(flg2==1
      |                                 ^~
main.c:24:33: error: expected declaration or statement at end of input
main.c:24:33: error: expected declaration or statement at end of input
main.c:24:33: error: expected declaration or statement at end of input
Language: C++

#include "stdafx.h"
int n,size_n;
int size_b[100];
char name[26];
char board[100][101];

int check(int a, int start, int interval,int i) {//a目的のなんもじめかstartボードの何文字目か
	if (start > size_b[i]) {
		return 0;
	}
	if (name[a] == board[i][start]) {
		if (a == size_n-1) {
			printf("numis_%dlastis_%d\n", interval,start); 
			return 1;
		}
		return check(a+1, start + interval, interval,i);
	}
	return 0;

}
int main()
{
	int end=0;
	int a;
	int c = 0;
	scanf("%d", &n);
	scanf("%s", name,sizeof(name));
	for (int i = 0; i < 26; i++) {
		if (name[i] == '\0')size_n=i;
	}
	for (int i = 0; i < n; i++) {
		scanf("%s", board[i], sizeof(board));
		for (int j = 0; j < 100; j++) {
			if (board[i][j] == '\0')size_b[i] = j;
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < size_b[i]; j++) {//start
			for (int k = 1; k < size_b[i]; k++) {//interval
				a = 0;
				if (check(a, j, k, i) == 1) {
					c++;
					end = 1;
				}
				if (end == 1) {
					break;
				}
			}
			if (end == 1) {
				end = 0;
				break;
			}
		}
	}

	printf("%d\n", c);
    return 0;
}


Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <stdio.h>
#include <string.h>
 
int main(void) {
    int N;
    char shop_name[100];
    char old_board[200];
    int cut_i,cut_j,cut_k;
    int count;
    int board_num;
    int len;
    int mise_length;
    int hantei1,hantei2;

    scanf("%d",&N);
    scanf("%s",shop_name);
    shop_len=strlen(shop_name);
    count=0;

    for(board_num=0;board_num<N;board_num++) {

        scanf("%s",old_board);

        len=strlen(old_board);
        hantei2=0;

        for(cut_i=0;cut_i<len;cut_i++) {
            for(cut_j=1;cut_j<leng;cut_j++) {
                if(cut_i+cut_j*(shop_len-1)>=len)break;

                hantei1=1;

                for(cut_k=0;cut_k<shop_len && hantei1;cut_k++) {
                    if(old_board[cut_i+cut_j*cut_k]!=shop_name[cut_k])hantei1=0;
                }

                if(hantei2)hantei1=1;
            }
        }
        if(hantei1)count++;
    }
    printf("%d\n",count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'shop_len' was not declared in this scope
   17 |     shop_len=strlen(shop_name);
      |     ^~~~~~~~
a.cc:28:31: error: 'leng' was not declared in this scope; did you mean 'len'?
   28 |             for(cut_j=1;cut_j<leng;cut_j++) {
      |                               ^~~~
      |                               len
Language: C++

#include <stdio.h>
#include <string.h>
 
int main(void) {
    int N;
    char shop_name[100];
    char old_board[200];
    int cut_i,cut_j,cut_k;
    int count;
    int board_num;
    int len;
    int mise_length;
    int hantei1,hantei2;

    scanf("%d",&N);
    scanf("%s",shop_name);
    shop_len=strlen(shop_name);
    count=0;

    for(board_num=0;board_num<N;board_num++) {

        scanf("%s",old_board);

        len=strlen(old_board);
        hantei2=0;

        for(cut_i=0;cut_i<len;cut_i++) {
            for(cut_j=1;cut_j<len;cut_j++) {
                if(cut_i+cut_j*(shop_len-1)>=len)break;

                hantei1=1;

                for(cut_k=0;cut_k<shop_len && hantei1;cut_k++) {
                    if(old_board[cut_i+cut_j*cut_k]!=shop_name[cut_k])hantei1=0;
                }

                if(hantei2)hantei1=1;
            }
        }
        if(hantei1)count++;
    }
    printf("%d\n",count);
    return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
void main(){
	int N, c = 0, ns;
	string n, s;
	cin >> N >> n;
	ns = n.length();
	while (N--){
		string s;
		cin >> s;
		if ([&](){
			for (int i = 0; i < s.length(); i++)
				if (s[i] == n[0])
					for (int p = 1;; p++){
						if (i + p*(ns - 1) >= s.length()) break;
						for (int h = 1; h < ns; h++)
							if (s[i + p * h] != n[h]) break;
							else if (h == ns - 1) return true;
					}
			return false;
		}()
			) c++;
	}
	printf("%d\n", c);
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N, c=0, ns;
string n, s;
cin>>N>>n;
ns = n.length();
while (N--){
string s;
cin>>s;
if ([&](){
for (int i=0;i<s.length();++i)
if(s[i] == n[0])
for(int p=1;;++p){
if(i+p*(ns-1)>= s.length())break;
for(int h=1;h<ns;h++)
if(s[i+p*h]!=n[h])break;
else if (h==ns-1return true;
}
return false;
}()
)c++;
}
cout << c << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:21:16: error: unable to find numeric literal operator 'operator""return'
   21 | else if (h==ns-1return true;
      |                ^~~~~~~
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
a.cc:21:29: error: expected ')' before '}' token
   21 | else if (h==ns-1return true;
      |         ~                   ^
      |                             )
   22 | }
      | ~                            
a.cc:22:1: error: expected primary-expression before '}' token
   22 | }
      | ^
Language: C++

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

using namespace std;

#define str to_string
#define rep(i, n) for (int i=0; i<int(n); i++)
#define all(c) (c).begin(), (c).end()

#define MAX_N 101
int N;
char name[30]; // .{3,25}
int len_name;

// buf??§`name`????????????????????????
bool solve(char *buf) {
  int len_buf = strlen(buf);
  if (len_buf < len_name) return false;

  int t = len_buf;
  for (int offset=0; offset<len_buf; offset++) {
    if (buf[offset] != name[0]) continue;

    for (int size=1; size<t; size++) {

      rep(i, len_name) {
        // if ((offset + i*size) < len_buf) goto PASS;
        if (buf[offset+i*size] != name[i]) goto PASS;
      }
      return true;
      PASS:
      ;
    }
  }

  return false;
}

int main() {
  cin >> N;
  cin >> name;
  len_name = strlen(name);

  char buf[30];

  int answer = 0;
  rep(i, N) {
    memset(buf, 0, 30);
    cin >> buf;
    if (solve(buf)) answer++;
  }

  cout << answer << '\n';
  return 0;
}

Compiler output:
a.cc: In function 'bool solve(char*)':
a.cc:21:17: error: 'strlen' was not declared in this scope
   21 |   int len_buf = strlen(buf);
      |                 ^~~~~~
a.cc:7:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <cmath>
  +++ |+#include <cstring>
    7 | 
a.cc: In function 'int main()':
a.cc:46:14: error: 'strlen' was not declared in this scope
   46 |   len_name = strlen(name);
      |              ^~~~~~
a.cc:46:14: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
a.cc:52:5: error: 'memset' was not declared in this scope
   52 |     memset(buf, 0, 30);
      |     ^~~~~~
a.cc:52:5: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main()
{
	int n; cin >> n;
	string S; cin >> S;

	int cnt = 0;

	for (int i = 0; i < n; ++i) {
		string si; cin >> si;
		int len = si.length();
		for (int j = 0; j < len; ++j) {
			int f = 0;
			for (int k = 1; k < len; ++k) {
				string s = "";
				for (int l = j; l < len; l += k) {
					s += si[l];
					if (s == S) {
						f = 1;
						cnt++;
					}
                    if (f) break;
                    if (s.length >= len) break;
				}
				if (f) break;
			}
			if (f) break;
		}
	}

	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:27: 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 '()' ?)
   27 |                     if (s.length >= len) break;
      |                         ~~^~~~~~
      |                                 ()
Language: C++

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

#define MAX_N  100
#define MAX_NN 26

int main()
{

	int  N, pos, start_pos, sign_length, dist = 1, make_cnt = 0, same_cnt = 0;
	char sign_new[26], sign_old[101][101];
	bool able_flg;

	scanf("%d %s", &N, sign_new);

	for(int i = 0; i < N; i++) scanf("%s", sign_old[i]);

	sign_length = strlen(sign_new);

	for(int i = 0; i < N; i++) {
		while(dist * 2 < strlen(sign_old[i])) {
			pos		  = 0;
			same_cnt  = 0;
			start_pos = 0;
			for(int j = 0; j < strlen(sign_old[i]); j++) {
				if(sign_old[i][j] == sign_new[0]) { start_pos = j; break; }
			}
			for(int j = start_pos; j < strlen(sign_old[i]); j += dist) {
				
				if(sign_old[i][j] == sign_new[pos++]) {
					same_cnt++;
					if(same_cnt == sign_length) {
						able_flg = true;
						make_cnt++;
						break;
					}
				}
				else {
					pos = 0;
					same_cnt = 0;
					for(int k = 0; k < strlen(sign_old[i]); k++) {
						if(sign_old[i][k] == sign_new[0]) { start_pos = k; break; }
					}
				}

			}
			dist++;
		}
		dist = 1;
	}

	printf("%d\n", make_cnt);

	return 0;

}

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

#include<iostream>
#include<string>
using namespace std;
int n;string S,T;
int solve(string T){
	for(int i=0;i<T.size();i++){
		for(int j=1;j<T.size();j++){
			string U="";int c=i;
			while(c<T.size()){
				U+=T[c];c+=j;
				if(U==S)return 1;
			}
			if(U==S)return 1;
		}
	}
	return 0;
}
int main(){
	cin>>n>>S;int cnt=0;
	for(int i=0;i<n;i++){
		cin>>T;cnt+=solve(T);
	}
	cuot<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'cuot' was not declared in this scope
   23 |         cuot<<cnt<<endl;
      |         ^~~~
Language: C++

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

int main(){
	string a,b;
	int n,m;
	int i,j,k,l;
	int s=0,e=0;
	cin>>n>>a;
	for(i=0;i<n;i++){
		cin>>b;
		for(j=0;j<b.size();j++){
			for(k=0;k<b.size();k++){
				e=0;
				for(l=0;l<a.size();l++){
					if(j+k*l<b.size() || a[j+k*l]!=b[j]){
						e=1;
						break;
					}
				}
				if(e==0){
					e=2,s++;
					break;
				}
			}
			if(e==2){
				e=0,break;
			}
		}
	}
	cout<<s<<endl;
	return 0;			
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected primary-expression before 'break'
   28 |                                 e=0,break;
      |                                     ^~~~~
Language: C++

#include <cstdio>
using namespace std;
int main()
{
    int n; cin >> n;
    string S; cin >> S;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        string s; cin >> s;
        int len = s.length();
        for (int j = 1; j < len; ++j) {
            for (int k = 0; k < len; ++k) {
                int cnt = 0;
                int idx = 0;
                int now;
                for (now = k; now < len; now += j) {
                    if (s[now] == S[idx]) {
                        idx++;
                        cnt++;
                    } else {
                        idx = cnt = 0;
                        break;
                    }
                    if (cnt == S.length()) {
                        ans++;
                        goto next;
                    }
                }
            }
        }
next:;
    }
    printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:12: error: 'cin' was not declared in this scope
    5 |     int n; cin >> n;
      |            ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string S; cin >> S;
      |     ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <cstdio>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:6:22: error: 'S' was not declared in this scope
    6 |     string S; cin >> S;
      |                      ^
a.cc:9:15: error: expected ';' before 's'
    9 |         string s; cin >> s;
      |               ^~
      |               ;
a.cc:9:26: error: 's' was not declared in this scope
    9 |         string s; cin >> s;
      |                          ^
Language: C++

#include <cstdio>
#include <string>
using namespace std;
int main()
{
    int n; cin >> n;
    string S; cin >> S;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        string s; cin >> s;
        int len = s.length();
        for (int j = 1; j < len; ++j) {
            for (int k = 0; k < len; ++k) {
                int cnt = 0;
                int idx = 0;
                int now;
                for (now = k; now < len; now += j) {
                    if (s[now] == S[idx]) {
                        idx++;
                        cnt++;
                    } else {
                        idx = cnt = 0;
                        break;
                    }
                    if (cnt == S.length()) {
                        ans++;
                        goto next;
                    }
                }
            }
        }
next:;
    }
    printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:12: error: 'cin' was not declared in this scope
    6 |     int n; cin >> n;
      |            ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string>
  +++ |+#include <iostream>
    3 | using namespace std;
Language: C++

#include"bits/stdc++.h"
using namespace std;
int main(){
    int N,ans=0,in,i,sp,kan,st,tf;
    char com[100],tem[100];
    cin>>N;
    cin>>tem;
    for(in=0;in<N;in++){
        cin>>com;
        for(kan=0;kan<(strlen(com)/(strlen(com)-1);kan++){
            for(sp=0;sp<=kan;sp++){
                for(st=sp;st<N-((kan+1)*(strlen(tem)-1));st+=kan+1){
                    tf=1;
                    for(i=0;i<strlen(tem);i++){
                        if(com[st]!=tem[i]){
                            tf=0;
                            break;
                        }
                    }
                    if(tf==1){
                        ans++;
                        break;
                    }
                }
            if(tf==1)break;
            }
        if(tf==1)break;
        }
    }
    cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:51: error: expected ')' before ';' token
   10 |         for(kan=0;kan<(strlen(com)/(strlen(com)-1);kan++){
      |                       ~                           ^
      |                                                   )
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
	int n, cnt=0, siz,siz_, on;
	char c[26], l[101];
	cin >> n;
	scanf("%s", c);
	siz = strlen(c);
	for (int w = 0; w < n; w++)
	{
		scanf("%s", l);
		siz_ = strlen(l);
		bool gj = false;
		for (int i = 0; i < siz_; i++)
		{
			for (int j = 1; i + j*(siz - 1) < siz_; j++)
			{
				on = i;
				bool jg = true;
				for (int k = 0; k < siz; k++)
				{
					if (c[k] != l[on])jg = false;
					on += j;
				}
				if (jg==true)gj = true;
			}
		}
		if (gj==true)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'strlen' was not declared in this scope
   12 |         siz = strlen(c);
      |               ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #include<string>
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
	int n, cnt=0, siz,siz_, on;
	char c[26], l[101];
	cin >> n;
	scanf("%s", c);
	siz = strlen(c);
	for (int w = 0; w < n; w++)
	{
		scanf("%s", l);
		siz_ = strlen(l);
		bool gj = false;
		for (int i = 0; i < siz_; i++)
		{
			for (int j = 1; i + j*(siz - 1) < siz_; j++)
			{
				on = i;
				bool jg = true;
				for (int k = 0; k < siz; k++)
				{
					if (c[k] != l[on])jg = false;
					on += j;
				}
				if (jg)gj = true;
			}
		}
		if (gj)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: 'strlen' was not declared in this scope
   12 |         siz = strlen(c);
      |               ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | #include<string>
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
int main()
{
	int n, cnt = 0, siz, siz_, on;
	char c[26], l[101];
	cin >> n;
	scanf("%s", c);
	siz = strlen(c);
	for (int w = 0; w < n; w++)
	{
		scanf("%s", l);
		siz_ = strlen(l);
		bool gj = false;
		for (int i = 0; i < siz_; i++) for (int j = 1; i + j*(siz - 1) < siz_; j++)
		on = i;
		bool jg = true;
		for (int k = 0; k < siz; k++)
		{
			if (c[k] != l[on])jg = false;
			on += j;
		}
		if (jg)gj = true;
		}
??	}
	if (gj)cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:31: error: 'j' was not declared in this scope
   24 |                         on += j;
      |                               ^
a.cc:28:1: error: expected primary-expression before '?' token
   28 | ??      }
      | ^
a.cc:28:2: error: expected primary-expression before '?' token
   28 | ??      }
      |  ^
a.cc:28:9: error: expected primary-expression before '}' token
   28 | ??      }
      |         ^
a.cc:28:8: error: expected ':' before '}' token
   28 | ??      }
      |   ^~~~~~~
      |        :
a.cc:28:9: error: expected primary-expression before '}' token
   28 | ??      }
      |         ^
a.cc:28:8: error: expected ':' before '}' token
   28 | ??      }
      |   ^~~~~~~
      |        :
a.cc:28:9: error: expected primary-expression before '}' token
   28 | ??      }
      |         ^
a.cc: At global scope:
a.cc:29:9: error: expected unqualified-id before 'if'
   29 |         if (gj)cnt++;
      |         ^~
a.cc:30:9: error: expected declaration before '}' token
   30 |         }
      |         ^
a.cc:31:9: error: 'cout' does not name a type
   31 |         cout << cnt << endl;
      |         ^~~~
a.cc:32:9: error: expected unqualified-id before 'return'
   32 |         return 0;
      |         ^~~~~~
a.cc:33:1: error: expected declaration before '}' token
   33 | }
      | ^
Language: C++

#include<cstdio>
#include<cctype>
#include<algorithm>
using namespace std;
int main(){
	
	int n;
	scanf("%d",&n);
	
	char str[126];
	scanf("%s",str);
	
	char y[126];
	int cnt = 0;
	
	for(int i = 0; i < n; i++){
		scanf("%s",y);
		for(int k = 0; k < strlen(y); k++){
			if(str[0] != y[k])continue;
			for(int j = 1; j < strlen(y); j++){
				int x = 0;
				for(int l = k; l < strlen(y); l+=j){
					//printf("%d\n",j);
					if(str[x] == y[l]){
						if(x == strlen(str)-1){
							cnt++;
							goto flg;
						}
						x++;
					}
					else if(str[x] != y[l]){
						//printf("x=%d k=%d l=%d j=%d a\n",x,k,l,j);
						break;
					}
				}
			}
		}
		flg:;
	}
					
	printf("%d\n",cnt);

	return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:36: error: 'strlen' was not declared in this scope
   18 |                 for(int k = 0; k < strlen(y); k++){
      |                                    ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

public class Main {
    BufferedReader br;
    Main() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    public static void main(String[] args) {
        new Main().run();
    }
    void debug(Object ... o) {
        System.out.println(Arrays.deepToString(o));
    }
    int N;
    String in;
    String [] cand;
    void init() {
        try {
            N = Integer.parseInt(br.readLine());
            cand = new String[N];
            in = br.readLine();
            for (int i = 0; i < N; i++) cand[i] = br.readLine();
        } catch (Exception e) {}
    }
    void run() {
        init();
        int c = 0;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < 20; j++) {
                StringBuilder sb = new StringBuilder();
                sb.append(".*");
                sb.append(in.charAt(0));
                for (int k = 1; k < in.length(); k++) {
                    for (int l = 0; l < j; l++) sb.append('.');
                    sb.append(in.charAt(k));
                }
                sb.append(".*");
                String pattern = sb.toString();
                if (Pattern.matches(pattern, cand[i])) {
                    c++;
                    break;
                }
            }
        }
        System.out.println(c);
    }
}

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

#include<iostream>

using namespace std;
int n;
string pattern;


int main(){
cin>>n;
cin >>pattern;
int ans = 0;
for(int i = 0;i <n;i++){
string mozi;
cin >>mozi;
int j = 0;
for(int i = 0;i <strlen(mozi);i++){
if(mozi(i) ==pattern[j]){
j++;
}
if(j==strlen(pattern)){
ans++;
break;
    }
  }
}
cout <<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: 'strlen' was not declared in this scope
   16 | for(int i = 0;i <strlen(mozi);i++){
      |                  ^~~~~~
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 | 
a.cc:17:8: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   17 | if(mozi(i) ==pattern[j]){
      |    ~~~~^~~
Language: C++

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


int main(){
cin>>n;
cin >>pattern;
int ans = 0;
for(int i = 0;i <n;i++){
string mozi;
cin >>mozi;
int j = 0;
for(int i = 0;i <strlen(mozi);i++){
if(mozi(i) ==pattern[j]){
j++;
}
if(j==strlen(pattern)){
ans++;
break;
    }
  }
}
cout <<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   17 | for(int i = 0;i <strlen(mozi);i++){
      |                         ^~~~
      |                         |
      |                         std::string {aka std::__cxx11::basic_string<char>}
In file included from a.cc:3:
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
a.cc:18:8: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   18 | if(mozi(i) ==pattern[j]){
      |    ~~~~^~~
a.cc:21:14: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   21 | if(j==strlen(pattern)){
      |              ^~~~~~~
      |              |
      |              std::string {aka std::__cxx11::basic_string<char>}
/usr/include/string.h:407:35: note:   initializing argument 1 of 'size_t strlen(const char*)'
  407 | extern size_t strlen (const char *__s)
      |                       ~~~~~~~~~~~~^~~
Language: C++

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


int main(){
cin>>n;
cin >>pattern;
int ans = 0;
for(int i = 0;i <n;i++){
string mozi;
cin >>mozi;
int j = 0;
for(int i = 0;i <mozi.length();i++){
if(mozi(i) ==pattern[j]){
j++;
}
if(j==pattern.length()){
ans++;
break;
    }
  }
}
cout <<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: no match for call to '(std::string {aka std::__cxx11::basic_string<char>}) (int&)'
   18 | if(mozi(i) ==pattern[j]){
      |    ~~~~^~~
Language: Java

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int N,D;
static int[] T,A,B,C,D;
static int[][] dp;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
N=ir.nextInt();
D=ir.nextInt();
T=ir.toIntArray(D);
A=new int[N];
B=new int[N];
C=new int[N];
for(int i=0;i<N;i++){
A[i]=ir.nextInt();
B[i]=ir.nextInt();
C[i]=ir.nextInt();
}
dp=new int[D+1][N];
for(int i=0;i<D;i++) Arrays.fill(d[i],Integer.MIN_VALUE);
for(int i=D-1;i>=0;i--){
for(int j=N-1;j>=0;j--){
if(T[i]>=A[j]&&T[i]<=B[j]){
for(int k=0;k<N;k++){
if(dp[i+1][k]!=Integer.MIN_VALUE) dp[i][j]=Math.max(dp[i][j],dp[i+1][k]+Math.abs(C[k]-C[j]));
}
}
}
}
int ans=0;
for(int i=0;i<N;i++) if(dp[0][i]>0) ans=Math.max(ans,dp[0][i]);
out.println(ans);
out.flush();
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}
}

Compiler output:
Main.java:23: error: variable D is already defined in class Main
static int[] T,A,B,C,D;
                     ^
Main.java:40: error: cannot find symbol
for(int i=0;i<D;i++) Arrays.fill(d[i],Integer.MIN_VALUE);
                                 ^
  symbol:   variable d
  location: class Main
2 errors
Language: Java

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.PriorityQueue;
import java.math.BigInteger;
    
public class Main{

static final InputStream in=System.in;
static final PrintWriter out=new PrintWriter(System.out);
static final int INF=Integer.MAX_VALUE/2;
static final long LINF=Long.MAX_VALUE/2;
static int N,D;
static int[] T,A,B,C,;
static int[][] dp;

public static void main(String[] args) throws IOException{
InputReader ir=new InputReader(in);
N=ir.nextInt();
D=ir.nextInt();
T=ir.toIntArray(D);
A=new int[N];
B=new int[N];
C=new int[N];
for(int i=0;i<N;i++){
A[i]=ir.nextInt();
B[i]=ir.nextInt();
C[i]=ir.nextInt();
}
dp=new int[D+1][N];
for(int i=0;i<D;i++) Arrays.fill(d[i],Integer.MIN_VALUE);
for(int i=D-1;i>=0;i--){
for(int j=N-1;j>=0;j--){
if(T[i]>=A[j]&&T[i]<=B[j]){
for(int k=0;k<N;k++){
if(dp[i+1][k]!=Integer.MIN_VALUE) dp[i][j]=Math.max(dp[i][j],dp[i+1][k]+Math.abs(C[k]-C[j]));
}
}
}
}
int ans=0;
for(int i=0;i<N;i++) if(dp[0][i]>0) ans=Math.max(ans,dp[0][i]);
out.println(ans);
out.flush();
}

static class InputReader {
private InputStream in;
private byte[] buffer=new byte[1024];
private int curbuf;
private int lenbuf;

public InputReader(InputStream in) {this.in=in;}
  
public int readByte() {
if(lenbuf==-1) throw new InputMismatchException();
if(curbuf>=lenbuf){
curbuf= 0;
try{
lenbuf=in.read(buffer);
}
catch (IOException e) {
throw new InputMismatchException();
}
if(lenbuf<=0)
return -1;
}
return buffer[curbuf++];
}

public boolean isSpaceChar(int c){return !(c>=33&&c<=126);}

private int skip() {int b; while((b = readByte())!=-1&&isSpaceChar(b)); return b;}

public String next() {
int b=skip();
StringBuilder sb=new StringBuilder();
while(!isSpaceChar(b)){
sb.appendCodePoint(b);
b=readByte();
}
return sb.toString();
}
 
public int nextInt() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
int res=0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public long nextLong() {
int c=readByte();
while (isSpaceChar(c)) c=readByte();
boolean minus=false;
if (c=='-') {
minus=true;
c=readByte();
}
long res = 0;
do{
if(c<'0'||c>'9') throw new InputMismatchException();
res=res*10+c-'0';
c=readByte();
}while(!isSpaceChar(c));
return (minus)?-res:res;
}

public int[] toIntArray(int n){
int[] a=new int[n];
for(int i=0;i<n;i++) a[i]=nextInt();
return a;
}
}
}

Compiler output:
Main.java:23: error: <identifier> expected
static int[] T,A,B,C,;
                     ^
1 error