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

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

using namesapce std;

#define NMAX 100005
 
int N;
int path[NMAX];
int L[NMAX];


int compute(){
	L[0] = path[0];
	int length = 1;
	for (int i = 1; i < N; ++i)
	{
		if (path[i] > L[length-1])
		{
			L[length] = path[i];
			length++;
		} else {
			*lower_bound(L, L + length, path[i]) = path[i];
		}
	}
	return length;
}


int main(){
	cin >> N;
	for (int i = 0; i < N; ++i)
	{
		cin >> path[i];
	}
	cout << compute() << endl;
}

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'namesapce'
    5 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int compute()':
a.cc:24:26: error: 'lower_bound' was not declared in this scope; did you mean 'std::lower_bound'?
   24 |                         *lower_bound(L, L + length, path[i]) = path[i];
      |                          ^~~~~~~~~~~
      |                          std::lower_bound
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:1963:5: note: 'std::lower_bound' declared here
 1963 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:32:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   32 |         cin >> N;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:37:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   37 |         cout << compute() << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:37:30: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   37 |         cout << compute() << endl;
      |                              ^~~~
      |                              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

int solve(vector<int> a)
{
  int n = a.size();
  vector<int> seq;
  seq.push_back(a[0]);
  for (int i = 1; i < n; ++i) {
    if (a[i] > seq.back()) {
      seq.push_back(a[i]);
    }
    else {
      //int pos = search(0, seq.size() - 1, a[i], seq);
      //seq[pos] = a[i];
      vector<int>::iterator iter = lower_bound(seq.begin(), seq.end(), a[i]);
      *iter = a[i];
    }
  }
  return seq.size();
}

int main()
{
  int n = 0;
  fscanf(stdin, "%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    fscanf(stdin, "%d", &a[i]);
  }
  int ans = solve(a);
  fprintf(stdout, "%d", ans);
  fprintf(stdout, "\n");
  return 0;
}

Compiler output:
a.cc:1:11: error: 'vector' was not declared in this scope
    1 | int solve(vector<int> a)
      |           ^~~~~~
a.cc:1:18: error: expected primary-expression before 'int'
    1 | int solve(vector<int> a)
      |                  ^~~
a.cc: In function 'int main()':
a.cc:23:10: error: 'stdin' was not declared in this scope
   23 |   fscanf(stdin, "%d", &n);
      |          ^~~~~
a.cc:1:1: note: 'stdin' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int solve(vector<int> a)
a.cc:23:3: error: 'fscanf' was not declared in this scope
   23 |   fscanf(stdin, "%d", &n);
      |   ^~~~~~
a.cc:24:3: error: 'vector' was not declared in this scope
   24 |   vector<int> a(n);
      |   ^~~~~~
a.cc:24:10: error: expected primary-expression before 'int'
   24 |   vector<int> a(n);
      |          ^~~
a.cc:26:26: error: 'a' was not declared in this scope
   26 |     fscanf(stdin, "%d", &a[i]);
      |                          ^
a.cc:28:19: error: 'a' was not declared in this scope
   28 |   int ans = solve(a);
      |                   ^
a.cc:28:20: error: 'solve' cannot be used as a function
   28 |   int ans = solve(a);
      |                    ^
a.cc:29:11: error: 'stdout' was not declared in this scope
   29 |   fprintf(stdout, "%d", ans);
      |           ^~~~~~
a.cc:29:11: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:29:3: error: 'fprintf' was not declared in this scope
   29 |   fprintf(stdout, "%d", ans);
      |   ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <fstream>
#include <string>
#include <sstream>
#include <math.h>
#include <set>
using namespace std;
#define rep(i,n) for(int i = 0; i < n ; i++)
#define pb push_back
static const int INF = (1<<21);


int main(void){
  int n; cin >> n;
  int A[n];rep(i,n){cin >> A[i];}
  int L[n]; L[0] = INF;
  int length = 1;

  rep(i,n){
    if(L[length -1] < A[i]){
      L[length] = A[i];
      length += 1;
    }else{
      *lower_bound(L, L + length, A[i]) = A[i];
    }
  }

  cout << length << endl;

  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:32:12: error: expected '}' at end of input
   32 |   return 0;
      |            ^
a.cc:15:15: note: to match this '{'
   15 | int main(void){
      |               ^
Language: C++

#include<stdio.h>
#include<algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <functional>
using namespace std;
int a[100001] = { 0 };
int dp[100001] = { 0 };
int n, w;
int main() {
	scanf("%d",&n);
	int mx = 1;
	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		#include<stdio.h>
#include<algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <functional>
using namespace std;
int a[100001] = { 0 };
int dp[100001] = { 0 };
int n, w;
int main() {
	scanf("%d",&n);
	int mx = 1;
	fill(dp, dp + n + 1, 1);
	for (int i = 0; i < n; ++i) {
		scanf("%d", &a[i]);
		for (int j = 0; j <= i; ++j) {
			if (a[i] > a[j]) {
				++dp[j];
				mx = max(mx, dp[j]);
			}
		}
	}
	printf("%d\n", mx);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   34 | int main() {
      |         ^~
a.cc:34:9: note: remove parentheses to default-initialize a variable
   34 | int main() {
      |         ^~
      |         --
a.cc:34:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:34:12: error: a function-definition is not allowed here before '{' token
   34 | int main() {
      |            ^
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:18:37: note: to match this '{'
   18 |         for (int i = 0; i < n; ++i) {
      |                                     ^
a.cc:48:2: error: expected '}' at end of input
   48 | }
      |  ^
a.cc:15:12: note: to match this '{'
   15 | int main() {
      |            ^
Language: C++

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

int main(){
int s[100005]{};
int a;
scanf("%d",&a);
fill(s+1,s+a+1,1<<29);#include<bits/stdc++.h>
using namespace std;

int main(){
int s[100005]{};
int a;
scanf("%d",&a);
fill(s+1,s+a+1,1<<29);
int b;
for(int c=0;c<a+1;c++){
	scanf("%d",&b);
	auto x=lower_bound(s,s+a+1,b);
	*x=b;
}
for(int q=0;q<a+1;q++){
	if(s[q]==1<<29){printf("%d\n",q-1);break;}
}
}
int b;
for(int c=0;c<a+1;c++){
	scanf("%d",&b);
	auto x=lower_bound(s,s+a+1,b);
	*x=b;
}
for(int q=0;q<a+1;q++){
	if(s[q]==1<<29){printf("%d\n",q-1);break;}
}
}

Compiler output:
a.cc:8:23: error: stray '#' in program
    8 | fill(s+1,s+a+1,1<<29);#include<bits/stdc++.h>
      |                       ^
a.cc: In function 'int main()':
a.cc:8:24: error: 'include' was not declared in this scope
    8 | fill(s+1,s+a+1,1<<29);#include<bits/stdc++.h>
      |                        ^~~~~~~
a.cc:8:32: error: 'bits' was not declared in this scope
    8 | fill(s+1,s+a+1,1<<29);#include<bits/stdc++.h>
      |                                ^~~~
a.cc:8:37: error: 'stdc' was not declared in this scope; did you mean 'std'?
    8 | fill(s+1,s+a+1,1<<29);#include<bits/stdc++.h>
      |                                     ^~~~
      |                                     std
a.cc:9:1: error: expected primary-expression before 'using'
    9 | using namespace std;
      | ^~~~~
a.cc:11:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   11 | int main(){
      |         ^~
a.cc:11:9: note: remove parentheses to default-initialize a variable
   11 | int main(){
      |         ^~
      |         --
a.cc:11:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:11:11: error: a function-definition is not allowed here before '{' token
   11 | int main(){
      |           ^
Language: C++

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

int main(){
int s[100005]{};
int a;
scanf("%d",&a);
fill(s+1,s+a+1,1<<29);
int b;
for(int c=0;c<a+1;c++){
	scanf("%d",&b);
	auto x=lower_bound(s,s+a+1,b);
	*x=b;
}
for(int q=0;q<a+1;q++){
	if(s[q]==1<<29){printf("%d\n",q-1);break;}
}
}
int b;
for(int c=0;c<a+1;c++){
	scanf("%d",&b);
	auto x=lower_bound(s,s+a+1,b);
	*x=b;
}
for(int q=0;q<a+1;q++){
	if(s[q]==1<<29){printf("%d\n",q-1);break;}
}
}

Compiler output:
a.cc:20:1: error: expected unqualified-id before 'for'
   20 | for(int c=0;c<a+1;c++){
      | ^~~
a.cc:20:13: error: 'c' does not name a type
   20 | for(int c=0;c<a+1;c++){
      |             ^
a.cc:20:19: error: 'c' does not name a type
   20 | for(int c=0;c<a+1;c++){
      |                   ^
a.cc:25:1: error: expected unqualified-id before 'for'
   25 | for(int q=0;q<a+1;q++){
      | ^~~
a.cc:25:13: error: 'q' does not name a type
   25 | for(int q=0;q<a+1;q++){
      |             ^
a.cc:25:19: error: 'q' does not name a type
   25 | for(int q=0;q<a+1;q++){
      |                   ^
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include<stdio.h>
#include<algorithm>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <functional>
using namespace std;
int a[100000] = { 0 };
int dp[10001][10001] = { 0 };
int n, w;
int main() {
	int mx;
	scanf_s("%d",&n);
	for (int i = 0; i < n; ++i) {
		scanf_s("%d", &a[i]);
	}
	for (int i = n; i >= 1; --i) {
		for (int j = i; j <= n; ++j) {
			if (i == j) dp[i][j] = 1;
			else if(a[i - 1] < a[j - 1]){
				dp[i][j] = max(dp[j][n] + 1, dp[i][j - 1]);
			}
			else {
				dp[i][j] = dp[i][j - 1];
			}
		}
	}
	mx = 0;
	for (int i = 0; i <= n; ++i) {
		for (int j = 0; j <= n; ++j) {
			printf("%2d ", dp[i][j]);
		}
		printf("\n");
	}
	for (int i = 0; i <= n; ++i) {
		if (mx < dp[i][n]) {
			mx = dp[i][n];
		}
	}
	printf("%d\n", mx);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   17 |         scanf_s("%d",&n);
      |         ^~~~~~~
      |         scanf
Language: C++

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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v, n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vvint(v, w, n) vector<int> v(n); vector<int> w(n); REP(i,n) cin >> v[i] >> w[i];
#define vlint(v, n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v, n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v, n1, n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v, n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()
#define len(v) (v).length()
#define FIND(s, n) (s.find(n) != s.end())
#define SORT(a) sort(all(a))

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long int MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};


int longest_increasing_subsequence0(int N, vector<int> a){
    int dp[N];
    fill(dp, dp+N, INF);
    REP(i, N) *lower_bound(dp, dp+n, a[i]) = a[i];
 
    return lower_bound(dp, dp+n, INF) - dp);
}



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

  int N;
  cin >> N;

  vint(p, N);

  cout << longest_increasing_subsequence0(N, p) << endl;

}

Compiler output:
a.cc: In function 'int longest_increasing_subsequence0(int, std::vector<int>)':
a.cc:46:35: error: 'n' was not declared in this scope
   46 |     REP(i, N) *lower_bound(dp, dp+n, a[i]) = a[i];
      |                                   ^
a.cc:48:31: error: 'n' was not declared in this scope
   48 |     return lower_bound(dp, dp+n, INF) - dp);
      |                               ^
a.cc:48:43: error: expected ';' before ')' token
   48 |     return lower_bound(dp, dp+n, INF) - dp);
      |                                           ^
      |                                           ;
a.cc:48:43: error: expected primary-expression before ')' token
Language: C++

def _input(n):
    return [int(raw_input()) for i in xrange(n)]

def linear_lower_bound(arr, n, target):
    p = -1
    for i in xrange(n):
        if arr[i] <= target:
            p = i
    print p
    return p+1

def LIS(arr):
    L = [0] * len(arr)
    L[0] = arr[0]
    length = 1

    for i in xrange(1, len(arr)):
        #if len(L) == 0: L.append(i)
        if arr[i] > L[length - 1]:
            L[length] = arr[i]#L.append(A[i])
            length += 1
        else:
            L[linear_lower_bound(L, length, arr[i])] = arr[i]
    return len(L), L

#==============================================
def main():
    n = int(raw_input())
    arr = _input(n)
    print LIS(arr)

if __name__ == "__main__":
    main()

Compiler output:
a.cc:18:16: error: missing binary operator before token "("
   18 |         #if len(L) == 0: L.append(i)
      |                ^
a.cc:18: error: unterminated #if
   18 |         #if len(L) == 0: L.append(i)
a.cc:1:1: error: 'def' does not name a type
    1 | def _input(n):
      | ^~~
Language: C++

const int MAX = 10000;

int solve(long long ary[], int n, int dp[], int cnt,int depth) {

	if (dp[depth] != -1) {
		return dp[depth] + cnt;
	}

	if (depth >= n - 1)return cnt;

	int res = 0;
	for (int i = depth + 1; i < n; i++) {
		if (ary[depth] < ary[i]) {
			res = max(res, solve(ary, n, dp, cnt + 1, i));
		}
	}
	dp[depth] = res - cnt;
	return res;
}

int main() {
	int n;
	long long ary[MAX];
	int dp[MAX];
	

	cin >> n;

	for (int i = 0; i < n + 1; i++) {
		dp[i] = -1;
	}
	ary[0] = -1;
	for (int i = 1; i < n + 1; i++) {
		cin >> ary[i];
	}

	cout << solve(ary, n + 1, dp, 0, 0) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int solve(long long int*, int, int*, int, int)':
a.cc:14:31: error: 'max' was not declared in this scope
   14 |                         res = max(res, solve(ary, n, dp, cnt + 1, i));
      |                               ^~~
a.cc: In function 'int main()':
a.cc:27:9: error: 'cin' was not declared in this scope
   27 |         cin >> n;
      |         ^~~
a.cc:37:9: error: 'cout' was not declared in this scope
   37 |         cout << solve(ary, n + 1, dp, 0, 0) << endl;
      |         ^~~~
a.cc:37:48: error: 'endl' was not declared in this scope
   37 |         cout << solve(ary, n + 1, dp, 0, 0) << endl;
      |                                                ^~~~
Language: C++

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;

int main(void){
	ll n;
	cin>>n;
	ll a[100000];
	rep(i,n)cin>>a[i];
	ll DP[100001];//i?????????????????¨????????????????????§??????????¢??????¨???????????????
	DP[i]=1;
	ll ans=1;
	rep(i,n){
		rep(j,i){
			if(a[i]>a[j] && DP[i]<DP[j]+1)DP[i]=DP[j]+1;
		}
		if(DP[i]>ans)ans=DP[i];
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'i' was not declared in this scope
   27 |         DP[i]=1;
      |            ^
Language: C++

#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll MOD = 1e9+7;
//LLONG_MIN

int main(void){
    int n, a[100005];
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    int dp[100005];
    fill(dp, dp+n, INF);
    for(int i=0; i<n; i++){
        *lower_bound(dp, dp+n, a[i]) = a[i];
    }
    cout << lower_bound(dp, dp+n, INF) - dp << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: 'INF' was not declared in this scope
   31 |     fill(dp, dp+n, INF);
      |                    ^~~
Language: C++

#include <iostream>
#define nmax 100000
using namespace std;

int l[nmax],a[nmax+1];
int n;

int lis(){
    l[0] =a[0];
    int len=1;
    for (int i = 1; i <n; ++i) {
        if (l[len-1]<a[i]){
            l[len++]=a[i];
        } else{
            *lower_bound(l,l+len,a[i])=a[i];
        }
    }
    return len;
}

int main() {
    cin>>n;
    for (int i = 0; i < n; ++i) {
        cin>>a[i]
    }
    cout<<lis()<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:18: error: expected ';' before '}' token
   24 |         cin>>a[i]
      |                  ^
      |                  ;
   25 |     }
      |     ~
Language: C++

import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int s=0,n=0;
		n=scan.nextInt();
		int List[]=new int[n];
		for(int i=0;i<n;i++){
			List[i]=scan.nextInt();
		}
		for(int i=0;i<n;i++){
			for(int j=i;0<=j;j--){
				if(j<i && List[j]<List[i]){
					if(s<List[j]){
						s=List[j];
					}
				}
			}
		}
		System.out.println(s);
	}
}

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

#include <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n,temp;
vector<int>ans;
scanf("%d%d",&n,&temp);
ans.push_back(temp);
while(n--){
scanf("%d",&temp);
if(temp>ans.back())ans.push_back(temp);
else *lower_bound(ans.begin(),and.end(),temp)=temp;
}
printf("%d\n",ans.size());
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:34: error: expected identifier before '.' token
   13 | else *lower_bound(ans.begin(),and.end(),temp)=temp;
      |                                  ^
Language: C++

string line;
cin >> line;
int num = stoi(line);
vector<int> numbers;
for (int i = 0; i < num; i++) {
      int temp;
      cin >> temp;
      numbers.push_back(temp);
}

vector<int> b;
for (int i = 0; i < numbers.size(); i++) {
     int index = lower_bound(b.begin(), b.end(), numbers[i]) - b.begin();
     if (index == b.size()) 
           b.push_back(numbers[i]);
     else 
           b[index] = numbers[i];
}
cout << b.size() << endl;
    

Compiler output:
a.cc:1:1: error: 'string' does not name a type
    1 | string line;
      | ^~~~~~
a.cc:2:1: error: 'cin' does not name a type
    2 | cin >> line;
      | ^~~
a.cc:3:16: error: 'line' was not declared in this scope
    3 | int num = stoi(line);
      |                ^~~~
a.cc:3:11: error: 'stoi' was not declared in this scope
    3 | int num = stoi(line);
      |           ^~~~
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int> numbers;
      | ^~~~~~
a.cc:5:1: error: expected unqualified-id before 'for'
    5 | for (int i = 0; i < num; i++) {
      | ^~~
a.cc:5:17: error: 'i' does not name a type
    5 | for (int i = 0; i < num; i++) {
      |                 ^
a.cc:5:26: error: 'i' does not name a type
    5 | for (int i = 0; i < num; i++) {
      |                          ^
a.cc:11:1: error: 'vector' does not name a type
   11 | vector<int> b;
      | ^~~~~~
a.cc:12:1: error: expected unqualified-id before 'for'
   12 | for (int i = 0; i < numbers.size(); i++) {
      | ^~~
a.cc:12:17: error: 'i' does not name a type
   12 | for (int i = 0; i < numbers.size(); i++) {
      |                 ^
a.cc:12:37: error: 'i' does not name a type
   12 | for (int i = 0; i < numbers.size(); i++) {
      |                                     ^
a.cc:19:1: error: 'cout' does not name a type
   19 | cout << b.size() << endl;
      | ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> arr;
int newl;
int n;
int main()
    {
    cin >> n;
    int iii;
    while (n--)
        {
            cin >> iii;
            arr.push_back(iii);
        }
    int mid = 0;
    newl = 0;
    vector<int> P (n);
    vector<int> M (n-1);
    int l = 0;
    for (int i = 0;i < (n-1);i++)
        {
            lo = 1;
            hi = l;
            while (lo <= hi)
                {
                    mid = (lo+hi)/2;
                    if (M[mid] < X[i])
                        {
                            lo = mid + 1;
                        }
                    else
                        {
                            hi = mid + 1;
                        }
                }
            newl = lo;
            P[i] = M[newl - 1];
            M[newl] = i;
            if (newl > l)
                {
                    l = newl;
                }
        }
    cout << l;
        
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:24:13: error: 'lo' was not declared in this scope; did you mean 'l'?
   24 |             lo = 1;
      |             ^~
      |             l
a.cc:25:13: error: 'hi' was not declared in this scope; did you mean 'i'?
   25 |             hi = l;
      |             ^~
      |             i
a.cc:29:34: error: 'X' was not declared in this scope
   29 |                     if (M[mid] < X[i])
      |                                  ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> arr;
int newl;
int n;
int main()
    {
    cin >> n;
    int iii;
    while (n--)
        {
            cin >> iii;
            arr.push_back(iii);
        }
    int mid = 0;
    newl = 0;
    vector<int> P (n);
    vector<int> M (n-1);
    int l = 0;
    lo = 1;
            hi = l;
    for (int i = 0;i < (n-1);i++)
        {
            lo = 1;
            hi = l;
            while (lo <= hi)
                {
                    mid = (lo+hi)/2;
                    if (M[mid] < arr[i])
                        {
                            lo = mid + 1;
                        }
                    else
                        {
                            hi = mid + 1;
                        }
                }
            newl = lo;
            P[i] = M[newl - 1];
            M[newl] = i;
            if (newl > l)
                {
                    l = newl;
                }
        }
    cout << l;
        
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'lo' was not declared in this scope; did you mean 'l'?
   22 |     lo = 1;
      |     ^~
      |     l
a.cc:23:13: error: 'hi' was not declared in this scope
   23 |             hi = l;
      |             ^~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
vector<int> arr;
int newl;
int n;
int main()
    {
    cin >> n;
    int iii;
    while (n--)
        {
            cin >> iii;
            arr.push_back(iii);
        }
    int mid = 0;
    newl = 0;
    vector<int> P (n);
    vector<int> M (n-1);
    int l = 0;
    lo = 1;
    hi = l;
    for (int i = 0;i < (n-1);i++)
        {
            while (lo <= hi)
                {
                    mid = (lo+hi)/2;
                    if (M[mid] < arr[i])
                        {
                            lo = mid + 1;
                        }
                    else
                        {
                            hi = mid + 1;
                        }
                }
            newl = lo;
            P[i] = M[newl - 1];
            M[newl] = i;
            if (newl > l)
                {
                    l = newl;
                }
        }
    cout << l;
        
    }
    


Compiler output:
a.cc: In function 'int main()':
a.cc:22:5: error: 'lo' was not declared in this scope; did you mean 'l'?
   22 |     lo = 1;
      |     ^~
      |     l
a.cc:23:5: error: 'hi' was not declared in this scope
   23 |     hi = l;
      |     ^~
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#include<set>
#include<complex>
#include<complex>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define INF 200000000
#define FER 0.0000000001

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;

int dp[100001];

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

	fill(dp, dp + 100001, INT_MAX);

	int n;

	cin >> n;

	int a;
	int length = 1;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (dp[length - 1] < a)
		{
			dp[length++] = a;
		}
		else
		{
			*lower_bound(dp, dp + length, a) = a;
		}
	}

	cout << length << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:31: error: 'INT_MAX' was not declared in this scope
   40 |         fill(dp, dp + 100001, INT_MAX);
      |                               ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include<map>
  +++ |+#include <climits>
   21 |
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#include<iostream>
#include<array>
#include<string>
#include<sstream>
#include<stack>
#include<queue>
#include<list>
#include<functional>
#include<set>
#include<complex>
#include<complex>
#define _USE_MATH_DEFINES

#include<math.h>
#include<map>

#define INF 200000000
#define FER 0.0000000001

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;

int dp[100001];

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

	fill(dp, dp + 100001, INT_MAX);

	int n;

	cin >> n;

	int a;
	int length = 1;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (dp[length - 1] < a)
		{
			dp[length++] = a;
		}
		else
		{
			(*lower_bound(dp, dp + length, a)) = a;
		}
	}

	cout << length << endl;
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:31: error: 'INT_MAX' was not declared in this scope
   40 |         fill(dp, dp + 100001, INT_MAX);
      |                               ^~~~~~~
a.cc:21:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   20 | #include<map>
  +++ |+#include <climits>
   21 |
Language: C++

#include<iostream>
#include<algorithm>
#define MAX 100000
using namespace std;

int n, A[MAX+1], L[MAX];

int lis() {
  L[0] = A[0];
  int length = 1;

  for ( int i = 1; i < n; i++ ) {
    if ( L[length - 1] < A[i] )
      L[lenght++] = A[i];
    else
      *lower_bound(L, L + length, A[i]) = A[i];
  }

  return length;
}

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

  cout << lis() << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int lis()':
a.cc:14:9: error: 'lenght' was not declared in this scope; did you mean 'length'?
   14 |       L[lenght++] = A[i];
      |         ^~~~~~
      |         length
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int A[100100],L[100100],P[100100];
int n,ans;

int main(){
    cin>>n;
    for(int i=1;i<=n;++i){
        cin>>A[i];
    }
    A[0]=-1;
    P[0]=-1;

    for(int i=1;i<=n;++i){//DP about A[i]
        int k=0;
        for(int j=0;j<i;++j){//define recurrence relation
            if(L[j]>L[k] && A[j]<A[i]){
                k=j;
            }
            L[i]=L[k]+1;
            P[i]=k;
        }
    }

    ans=0;
    for(int i=1;i<=n;++i){
        ans=max(ans,L[i]);
    }

    cout<<ans<<endl;

    /*for debug
    for(int i=1;i<=n;++i){
        cout<<L[i]<<endl;
    }
}


Compiler output:
a.cc:33:5: error: unterminated comment
   33 |     /*for debug
      |     ^
a.cc: In function 'int main()':
a.cc:31:21: error: expected '}' at end of input
   31 |     cout<<ans<<endl;
      |                     ^
a.cc:7:11: note: to match this '{'
    7 | int main(){
      |           ^
Language: C++

n = int(input())
a = [int(input()) for i in range(n)]
dp = [0 for i in range(n)]
dp[0] = a[0]
length = 1
for i in range(1, n):
    if dp[length-1] < a[i]:
        dp[length] = a[i]
        length += 1        
    else:
        for j in range(length):
            if dp[j] >= a[i]:
                dp[j] = a[i]
                break
print(length)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

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

set<int> my_set;
set<int>::iterator it;
vector <int> out;
int main(){
        int n;
        cin>>n;
        for(int i = 1; i <= n; i++) {
        int x;
        cin>>x;
        it = my_set.find(x);
        if(it!=my_set.end() && *it==x){
                continue;
        }
        my_set.insert(x);
        it = my_set.find(x);
        it++;
        if(it != my_set.end())
                my_set.erase(it);
        else
                out.push_back(*it);
//      for(set<int>::iterator it2=my_set.begin();it2!=my_set.end();it2++){
//              cout<<(*it2)<<'*';
//      }
//      cout<<endl;

        }
        cout<<out.size();
}
~            


Compiler output:
a.cc:34:2: error: expected class-name at end of input
   34 | ~
      |  ^
Language: C++

/*
 * Contents   : AOJ DPL 1 D 
 * Author     : KitauraHiromi
 * LastUpdate : 20180613
 * Since      : 20180613
 */
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int N;
int dp[100001]; // dp[i]: i番目までの文字を見たときのLIS
int a[100001];
int main(void){
    cin >> N;
    memset(dp, 0, sizeof(dp));
    for(int i=0; i<N; ++i) cin >> a[i];
    for(int i=0; i<N; ++i){
        for(int j=0; j<N; ++j){
            (a[j] < a[i]) ? dp[i] = max(dp[j] + 1, dp[i])
        }
    }
    cout << dp[N] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:58: error: expected ':' before '}' token
   20 |             (a[j] < a[i]) ? dp[i] = max(dp[j] + 1, dp[i])
      |                                                          ^
      |                                                          :
   21 |         }
      |         ~                                                 
a.cc:21:9: error: expected primary-expression before '}' token
   21 |         }
      |         ^
Language: C++

/*
 * Contents   : AOJ DPL 1 D 
 * Author     : KitauraHiromi
 * LastUpdate : 20180613
 * Since      : 20180613
 */
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int N;
int dp[100001]; // dp[i]: i番目までの文字を見たときのLIS
int a[100001];
int main(void){
    cin >> N;
    memset(dp, 0, sizeof(dp));
    for(int i=0; i<N; ++i) cin >> a[i];
    for(int i=0; i<N; ++i){
        for(int j=0; j<N; ++j){
            (a[j] < a[i]) ? dp[i] = max(dp[j] + 1, dp[i]);
        }
    }
    cout << dp[N] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:58: error: expected ':' before ';' token
   20 |             (a[j] < a[i]) ? dp[i] = max(dp[j] + 1, dp[i]);
      |                                                          ^
      |                                                          :
a.cc:20:58: error: expected primary-expression before ';' token
Language: C++

/*
 * Contents   : AOJ DPL 1 D 
 * Author     : KitauraHiromi
 * LastUpdate : 20180613
 * Since      : 20180613
 */
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int N;
int dp[100001]; // dp[i]: i番目までの文字を見たときのLIS
long long a[100001];
int main(void){
    cin >> N;
    for(int i=0; i<N; ++i) dp[i] = 1;
    for(int i=0; i<N; ++i) cin >> a[i];
    for(int i=0; i<N; ++i){
        for(int j=0; j<i; ++j){
            if(a[j] < a[i]) dp[i] = max(dp[j] + 1, dp[i]);
            else dp[i] = max(dp[j]);
        }
    }
    cout << dp[N-1] << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: no matching function for call to 'max(int&)'
   21 |             else dp[i] = max(dp[j]);
      |                          ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:7:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

/*
 * Contents   : AOJ DPL 1 D 
 * Author     : KitauraHiromi
 * LastUpdate : 20180613
 * Since      : 20180613
 */
#include <iostream>
#include <cmath>
#include <cstring>
using namespace std;
int N;
int dp[100001]; // dp[i]: i番目までの文字を見たときのLIS
long long a[100001];
int main(void){
    cin >> N;
    fill(dp, dp+N, INF);
    for(int i=0; i<N; ++i){
        *lower_bound(dp, dp+N, a[i]) = a[i];
    }
    cout << *lower_bound(dp, dp+N, INF) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'INF' was not declared in this scope
   16 |     fill(dp, dp+N, INF);
      |                    ^~~
Language: C++

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

int getLIS(int n,int a[n]){
	int dp[n];
	fill(dp, dp + n, INT_MAX);
	rep(i,n) *lower_bound(dp, dp+n, a[i]) = a[i];
	return lower_bound(dp, dp+n, INT_MAX) - dp;
}
int main(void){
    int n;
    cin >> n;
    int a[n];
    rep(i,n)cin >> a[i];
    cout << getLIS(n,a) << endl;
}


Compiler output:
a.cc:5:25: error: use of parameter outside function body before ']' token
    5 | int getLIS(int n,int a[n]){
      |                         ^
a.cc: In function 'int getLIS(...)':
a.cc:6:16: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |         int dp[n];
      |                ^
      |                yn
a.cc:7:14: error: 'dp' was not declared in this scope; did you mean 'dup'?
    7 |         fill(dp, dp + n, INT_MAX);
      |              ^~
      |              dup
a.cc:8:41: error: 'a' was not declared in this scope
    8 |         rep(i,n) *lower_bound(dp, dp+n, a[i]) = a[i];
      |                                         ^
Language: C++

#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <bitset>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

int lis(const vector<int>& a){
    vector<int> dp(n+1, INF);
    dp[1] = a[0];
    for(int i = 1; i < n; i++){
        int l = 0;
        int r = n;
        while(r - l > 1){
            int m = (r + l) / 2;
            if(dp[m] < a[i]){
                l = m;
            }else{
                r = m;
            }
        }
        dp[l+1] = a[i];
    }
    int ans;
    for(int i = 1; i <= n; i++){
        if(dp[i] != INF){
            ans = i;
        }
    }
    return ans;
}

signed main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    cout << lis(a) << endl;

    return 0;
}



Compiler output:
a.cc: In function 'long long int lis(const std::vector<long long int>&)':
a.cc:26:20: error: 'n' was not declared in this scope
   26 |     vector<int> dp(n+1, INF);
      |                    ^
Language: C++

#include <algorithm>
#include <cmath>
#include <ctime>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
#include <cstring>
#include <climits>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin >> n;
    vector<ll> seq(n);
    for (int i=0; i<n; ++i) {
        cin >> seq[i];
    }

    vector<ll> lis(n, INT_MAX);
    int ans = 0;
    for (int i=0; i<n; ++i) {
        vector<ll>::iterator pos = lower_bound(lis.begin(), lis.end(), seq[i]);
        *pos = seq[i];
        ans = max(ans, pos - lis.begin() + 1);
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: no matching function for call to 'max(int&, __gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type)'
   31 |         ans = max(ans, pos - lis.begin() + 1);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:31:18: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >::difference_type' {aka 'long int'})
   31 |         ans = max(ans, pos - lis.begin() + 1);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:31:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   31 |         ans = max(ans, pos - lis.begin() + 1);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

public class Main{
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1=sc.next();
        String s2=sc.next();
        int[][] dp= new int[1010][1010];
        int count=0;
        for(int i=0; i<s1.length(); i++) {
        	if(s1.charAt(0)!=s2.charAt(0))
        		dp[i][0]=i+1;
        	else
        		dp[i][0]=i;
        }
        for(int i=0; i<s2.length(); i++) {
        	if(s1.charAt(0)!=s2.charAt(0))
        		dp[0][i]=i+1;
        	else 
        		dp[0][i]=i;
        }
        
        for(int i=1; i<s1.length(); i++) {
        	for(int j=1; j<s2.length(); j++) {
        		
        		if(s1.charAt(i)==s2.charAt(j)) {
        			count=0;
        		}
        		else {
        			count=1;
        		}
        		dp[i][j]=Math.min(dp[i-1][j-1]+count, Math.min(dp[i-1][j]+1, dp[i][j-1]+1));
        	}
        }
        
        System.out.println(dp[s1.length()-1][s2.length()-1]);
	}
}


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

//03-170609
//?????¶????´?
//kawashima-tomoki003@g.ecc.u-tokyo.ac.jp

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

int read_file(char *fname,char **buf)
{
  int n;
  char *p;
  FILE *fin;
  fin=fopen(fname,"r");
  if(fin==NULL){
    printf("cannot open %s\n",fname);
    exit(1);
  }
  fseek(fin,0,SEEK_END);
  n=ftell(fin)-1;
  fseek(fin,0,SEEK_SET);
  p=malloc(n*sizeof(char));
  if(p==NULL){
    printf("not enough memory\n");
    exit(1);
  }
  fread(p,sizeof(char),n,fin);
  fclose(fin);
  *buf=p;
  return n;
}

void print(int **A,int n,int m)
{
  int i;
  int j;
  for(i=0;i<=n;i++){
    for(j=0;j<=m;j++){
      printf("%d",A[i][j]);
        if(j<m){
          printf(" ");
        }
    }
    printf("\n");
  }
}

int min(int x,int y,int z)
{
  int n;
  if(x<y){
    n=x;
  }else{
    n=y;
  }
  if(z<n) n=z;
  return n;
}

int sm(int n,int m,char *X,char *Y)
{
  int **A;
  int i,j;
  int c1,c2,c3;
  A=malloc((n+1)*sizeof(int*));
  for(i=0;i<=n;i++){
    A[i]=malloc((m+1)*sizeof(int));
  }

  //0??????0???????????????./
  for(i=0;i<=n;i++){
    A[i][0]=2*i;
    A[0][i]=2*i;
  }

  for(i=1;i<=n;i++){
    for(j=1;j<=m;j++){
      if(X[i-1]==Y[j-1]) c1=A[i-1][j-1];
      if(X[i-1]!=Y[j-1]) c1=A[i-1][j-1]+1;
      c2=A[i][j-1]+2;
      c3=A[i-1][j]+2;
      A[i][j]=min(c1,c2,c3);
    }
  }
  return A[n][m];
}


int main(int argc,char *argv[])
{
  int n,m;
  int i,c;
  FILE *fin;
  char *X,*Y;

  if(argc<3){
    printf("%s file1 file2\n",argv[0]);
    return 1;
  }
  n=read_file(argv[1],&X);
  m=read_file(argv[2],&Y);
  printf("n=%d,m=%d\n",n,m);
  c=sm(n,m,X,Y);
  printf("%d\n",c);
  return 0;
}

Compiler output:
main.c:8:10: fatal error: graph.h: No such file or directory
    8 | #include "graph.h"
      |          ^~~~~~~~~
compilation terminated.
Language: C

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
 
using namespace std;
 
int LevenshteinDistance(string s, string t) {
   
  int len_s = s.size();
  int len_t = t.size();
   
  vector<vector<int> > dp(len_s+1, vector<int>(len_t+1, 0));
 
  for(int i=0; i<=len_s; i++)
    dp[i][0] = i;
   
  for(int i=0; i<=len_t; i++)
    dp[0][i] = i;
   
  int cost;
  for(int i=1; i<=len_s; i++) {
    for(int j=1; j<=len_t; j++) {
      if(s[i-1] == t[j-1]) cost = 0;
      else cost = 1;
       
      dp[i][j] = min(dp[i-1][j] + 1, min(dp[i][j-1] + 1, dp[i-1][j-1] + cost));
    }
  }
   
  return dp[len_s][len_t];
}
 
int main() {
   
  string s, t;
   
  cin >> s >> t;
   
  cout << LevenshteinDistance(s, t) << endl;
   
  return 0;
}

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

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

using namespace std;

int Levenstein(string a,string b){
  int dp[a.size()+1][b.size()+1];

  for(int i=0;i<=a.size();i++)dp[i][0]=i;
  for(int i=0;i<=b.size();i++)dp[0][i]=i;

  for(int i=1;i<=a.size();i++){
    for(int j=1;j<=b.size();j++){
      int cost=(a[i-1]==b[i-1])?0:1;
      dp[i][j]=min(dp[i-1][j]+1,min(dp[i][j-1]+1,dp[i-1][j-1]+cost));
    }
  }
  return dp[a.size()][b.size()];
}

int main(void){

  string a,b;
  cin >> a >> b;
  cout << Levenstein(a,b) << endl;

  return 0;
}

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

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

using namespace std;

int Levenstein(string a,string b){
  int dp[1001][1001];

  for(int i=0;i<=a.size();i++)dp[i][0]=i;
  for(int i=0;i<=b.size();i++)dp[0][i]=i;

  for(int i=1;i<=a.size();i++){
    for(int j=1;j<=b.size();j++){
      int cost=(a[i-1]==b[i-1])?0:1;
      dp[i][j]=min(dp[i-1][j]+1,min(dp[i][j-1]+1,dp[i-1][j-1]+cost));
    }
  }
  return dp[a.size()][b.size()];
}

int main(void){

  string a,b;
  cin >> a >> b;
  cout << Levenstein(a,b) << endl;

  return 0;
}

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

#include<stdio.h>
#include<string.h>
#define max(a,b)a>b?a:b

char s[1001],t[1001];
int n,m;
int dp[1001][1001]={0};
int main()
{
	gets(s);
	gets(t);
	n=strlen(s),m=strlen(t);
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
		{
			if(s[i]==t[j])
				dp[i+1][j+1]=dp[i][j]+1; //max(dp[i][j]+1,max(dp[i+1][j]+1,dp[i][j+1]+1));
			else
				dp[i+1][j+1]=max(dp[i+1][j],dp[i][j+1]);
		}
	printf( "%d\n",(n>m?n:m)-dp[n][m]);
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   10 |         gets(s);
      |         ^~~~
      |         fgets