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

#include <bits/stdc++.h>

using namespace std;

int main() {
  int N, M;
  while(cin >> N >> M && (N || M)) {
    vector<int> L(N);
    rep(i, N) cin >> L[i];
    bool ok = 0;
    rep(m, 1<<M) {
      if(__builtin_popcount(m) != L[0]) continue;
      string temp;
      int count = L[0];
      rep(k, M)
        temp.push_back('0' + (m >> k & 1));
      bool ng = 0;
      REP(k, 1, N) {
        count -= temp[k-1] == '1';
        if(L[k] == count) temp.push_back('0');
        else if(L[k] == count + 1) temp.push_back('1'), count ++;
        else {
          ng = 1;
          break;
        }
      }
      if(ng) continue;
      cout << temp << endl;
      ok = 1;
      break;
    }
    if(!ok) cout << "Goofy" << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
    9 |     rep(i, N) cin >> L[i];
      |         ^
a.cc:9:5: error: 'rep' was not declared in this scope
    9 |     rep(i, N) cin >> L[i];
      |     ^~~
a.cc:11:9: error: 'm' was not declared in this scope
   11 |     rep(m, 1<<M) {
      |         ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()
#define pb         push_back
const int W = 20,H = 20;

int vol;
bool vis[H][W];
bool liv[H][W];
int    h[H][W];
int dx[]={0,0,1,-1};
int dy[]={1,-1,0,0};


void dfs(int r,int c,int y,int x,int water,bool &flag){
  if (x ==0 || y == 0 || x == c-1||y==r-1||liv[y][x]){
    flag=false;
  }
  if (vis[y][x])return ;
  vol+=water-h[y][x];
  vis[y][x]=true;
  
  rep(i,4){
    int nex=x+dx[i],ney=y+dy[i];
    if (nex == -1||ney==-1||nex==c||ney==r)continue;
    if (h[ney][nex] <water){
      dfs(r,c,ney,nex,water,flag);
    }
  }
  return;
}

bool compute(int r,int c,int C,int water){
  rep(i,r)rep(j,c)vis[i][j]=false;

  REP(i,1,r-1){
    REP(j,1,c-1){
      if (!vis[i][j] && h[i][j] < water){
	bool flag=true;
	vol=0;
	dfs(r,c,i,j,water,flag);
	//cout << i <<" " << j << " " <<flag <<" " <<  vol <<" " <<water << endl;
	if (flag&&vol >=C)return true;
      }
    }
  }
  return false;
}

bool solve(int r,int c,int C){
  rep(i,r){
    rep(j,c){
      h[i][j]++;
      vector<int> val(r*c);
      rep(ii,r)rep(jj,c)val[ii*c+jj]=h[i][j];
      sort(ALL(val));
      val.erase(unique(ALL(val)),val.end());
      rep(ii,val.size())if (compute(r,c,C,val[ii]))return true;
      h[i][j]--;
    }
  }
  return false;
}

main(){
  int r,c,C,R;
  while(cin>>r>>c>>C>>R && r){
    rep(i,r){
      rep(j,c){
	cin>>h[i][j];
	liv[i][j]=false;
      }
    }
    rep(i,R){
      int y,x;
      cin>>y>>x;y--;x--;
      liv[y][x]=true;
    }
    if (solve(r,c,C))cout <<"Yes"<<endl;
    else cout << "No"<<endl;
  }
  return false;
}

Compiler output:
a.cc: In function 'bool solve(int, int, int)':
a.cc:59:7: error: 'sort' was not declared in this scope; did you mean 'short'?
   59 |       sort(ALL(val));
      |       ^~~~
      |       short
a.cc:60:17: error: 'unique' was not declared in this scope
   60 |       val.erase(unique(ALL(val)),val.end());
      |                 ^~~~~~
a.cc: At global scope:
a.cc:68:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   68 | main(){
      | ^~~~
Language: C

#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <map>
#include <queue>

using namespace std;

typedef pair<int,int> pii;

const int INF=1000000000;
int n,m;
map<string,int> indice;
vector<pii> points;
vector<int> G[1001];
// node,どちらから来たか
int d[1001][4];
int src,dst;

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

int dijkstra(int ang){
  for(int i=0;i<1001;i++)
    for(int j=0;j<4;j++)d[i][j]=INF;
  priority_queue<pair<int,pii> > pq;
  d[src][ang]=0;
  pq.push(make_pair(0,pii(src,ang)));
  while(pq.size()){
    pair<int,pii> p=pq.top();pq.pop();
    int cost=p.first;
    int node=p.second.first;
    int curAng=p.second.second;
    if(d[node][curAng]<cost)continue;
    // まっすぐ進む
    for(int i=0;i<G[node].size();i++){
      int to=G[node][i];
      int movey=points[to].first-points[node].first;
      int movex=points[to].second-points[node].second;
      if((movey>0&&dy[curAng]>0)
	 ||(movey<0&&dy[curAng]<0)
	 ||(movex<0&&dx[curAng]<0)
	 ||(movex>0&&dx[curAng]>0)){
	if(d[to][curAng]>cost+1){
	  d[to][curAng]=cost+1;
	  pq.push(make_pair(d[to][curAng],pii(to,curAng)));
	}
      }
    }
    // 左に曲がる
    for(int i=0;i<G[node].size();i++){
      int to=G[node][i];
      int movey=points[to].first-points[node].first;
      int movex=points[to].second-points[node].second;
      int nxtAng=(curAng+1)%4;
      if((movey>0&&dy[nxtAng]>0)
	 ||(movey<0&&dy[nxtAng]<0)
	 ||(movex<0&&dx[nxtAng]<0)
	 ||(movex>0&&dx[nxtAng]>0)){
	if(d[to][nxtAng]>cost+1){
	  d[to][nxtAng]=cost+1;
	  pq.push(make_pair(d[to][nxtAng],pii(to,nxtAng)));
	}
      }
    }
  }
  int res=INF;
  for(int i=0;i<4;i++)res=min(res,d[dst][i]);
  return res;
}

int main(){

  while(cin>>n>>m&&(n|m)){
    indice.clear();points.clear();
    for(int i=0;i<1001;i++)G[i].clear();
    for(int i=0;i<n;i++){
      string name;
      int x,y;
      cin>>name>>x>>y;
      indice[name]=i;
      points.push_back(pii(y,x));
    }
    for(int i=0;i<m;i++){
      string p,q;
      cin>>p>>q;
      int a=indice[p];
      int b=indice[q];
      G[a].push_back(b);G[b].push_back(a);
    }
    string a,b;
    cin>>a>>b;
    src=indice[a];dst=indice[b];
    int res=INF;
    for(int i=0;i<4;i++)res=min(res,dijkstra(i));
    if(res==INF)cout<<"impossible"<<endl;
    else cout<<res+1<<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<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;

int main(){
  ll n;
  string m;

  while(cin>>n>>m,n){
    ll s=0;
    for(int i=0;i<(int)m.size();i++){
      if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
      if('A'<=m[i]&&m[i]<='Z')s*=n,s+=m[i]-'A'+10;
    }
    ll ans=0;
    for(long double i=5;i<=s+0.5;i*=5){
      ans+=s/(ll)(i+0.5);
    }
    cout<<ans<<endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: two consecutive '[' shall only introduce an attribute before '[' token
   12 |       if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
      |                ^
a.cc:12:16: error: expected ')' before '[' token
   12 |       if('0'<=m[[i]&&m[i]<='9' )s*=n,s+=m[i]-'0';
      |         ~      ^
      |                )
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const ll INF = 1000000000000000000LL;
const double EPS = 1e-8;
const int MOD = 1000000007;

map<ll, ll> prime_factor(ll n){
	map<ll, ll> res;
	for(int i = 2; (ll)i * i <= n; i++){
		while(n % i == 0){
			++res[i];
			n /= i;
		}
	}
	if(n != 1) res[n] = 1;
	return res;
}
int main(){
	int N;
	string M;
	while(cin>>N>>M){
		if(N == 0 && M == "0")break;
		if(M == "0"){
			cout<<0<<endl;
			continue;
		}
		map<ll, ll> factor = prime_factor(N);
		map<ll, ll> cnt;
		ll L = strtoll(M.c_str(), NULL, N);
		if(L == 0) while(true);
		ll ans = LLONG_MAX;
		for(map<ll,ll>::iterator it = factor.begin(); it!=factor.end(); it++){
			for(ll i = it->first; i <= L ; i *= it->first){
				cnt[it->first] += L / i;
				if(L / i < it->first) break;
			}
			cnt[it->first] /= it->second;
			ans = min(cnt[it->first], ans);
		}
		cout<<ans<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:26: error: 'LLONG_MAX' was not declared in this scope
   53 |                 ll ans = LLONG_MAX;
      |                          ^~~~~~~~~
a.cc:15:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <cassert>
  +++ |+#include <climits>
   15 |
Language: C++

#include<queue>
#include<cstdio>
#include<cstring>

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

using namespace std;

const int INF=1<<29;

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

struct Node{
	int x,y,mask;
	Node(int X,int Y,int MA):x(X),y(Y),mask(MA){}
	bool operator<(const Node &i)const{ return true; }
};

int main(){
	for(int w,h;scanf("%d%d",&w,&h),w;){
		char grid[30][31];
		rep(i,h)	scanf("%s",grid[i]);
		int sx,sy;
		int key[128],keynum=0;
		memset(key,-1,sizeof(key));
		rep(i,h)rep(j,w){
			if(grid[i][j]=='@')	sx=j,sy=i;
			if(islower(grid[i][j]) && key[grid[i][j]]==-1){
				key[grid[i][j]]=keynum;
				key[toupper(grid[i][j])]=keynum++;
			}
		}

		int ans=-1;
		int d[30][30][1<<8];
		rep(i,h)rep(j,w)rep(mask,1<<8)	d[i][j][mask]=INF;
		d[sy][sx][0]=0;
		priority_queue< pair<int,Node> > pq;	pq.push(mp(0,Node(sx,sy,0)));
		while(!pq.empty()){
			pair<int,Node> a=pq.top();	pq.pop();
			int x=a.second.x,y=a.second.y,mask=a.second.mask;
			if(d[y][x][mask]<-a.first)	continue;

			if(grid[y][x]=='<'){ ans=d[y][x][mask]; break; }

			rep(i,4){
				int xx=x+dx[i],yy=y+dy[i],nextmask=mask;
				if(0<=xx && xx<w && 0<=yy && yy<h){
					if(grid[yy][xx]=='#')	continue;
					if(isupper(grid[yy][xx]) && (mask&(1<<key[grid[yy][xx]]))==0)	continue;
					if(islower(grid[yy][xx]))	nextmask^=1<<key[grid[yy][xx]];
					if(d[y][x][mask]+1<d[yy][xx][nextmask]){
						d[yy][xx][nextmask]=d[y][x][mask]+1;
						pq.push(mp(-d[yy][xx][nextmask],Node(xx,yy,nextmask)));
					}
				}
			}
		}

		printf("%d\n",ans);
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:28: error: 'islower' was not declared in this scope
   29 |                         if(islower(grid[i][j]) && key[grid[i][j]]==-1){
      |                            ^~~~~~~
a.cc:31:37: error: 'toupper' was not declared in this scope
   31 |                                 key[toupper(grid[i][j])]=keynum++;
      |                                     ^~~~~~~
a.cc:51:44: error: 'isupper' was not declared in this scope
   51 |                                         if(isupper(grid[yy][xx]) && (mask&(1<<key[grid[yy][xx]]))==0)   continue;
      |                                            ^~~~~~~
a.cc:52:44: error: 'islower' was not declared in this scope
   52 |                                         if(islower(grid[yy][xx]))       nextmask^=1<<key[grid[yy][xx]];
      |                                            ^~~~~~~
Language: Java

mport java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);

	void run() {
		for (;;) {
			String in = sc.next();
			if (in.equals("#END")) {
				return;
			}
			String ans = "";
			for (int i = 1; i < in.length(); i++) {
				String lcs = lcs(in.substring(0, i), in.substring(i, in.length()));
				if (lcs.length() > ans.length()) {
					ans = lcs;
				}
			}
			System.out.println(ans);
		}
	}

	String lcs(String s, String t) {
		int n = s.length();
		int m = t.length();
		int[][] dp = new int[n + 1][m + 1];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {
				if (s.charAt(i) == t.charAt(j)) {
					dp[i + 1][j + 1] = dp[i][j] + 1;
				} else {
					dp[i + 1][j + 1] = Math.max(dp[i + 1][j], dp[i][j + 1]);
				}
			}
		}
		char[] res = new char[dp[n][m]];
		while (n > 0 && m > 0) {
			if (dp[n][m] == dp[n - 1][m]) {
				n--;
			} else if (dp[n][m] == dp[n][m - 1]) {
				m--;
			} else {
				res[dp[n - 1][m - 1]] = s.charAt(n - 1);
				n--;
				m--;
			}
		}
		return String.valueOf(res);
	}

	public static void main(String[] args) {
		new Main().run();
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
Language: Java

import java.util.Scanner;

public Main{
    public static void main(String[] args){
	
	Scanner scan = new Scanner(System.in);
	
	String str = "";
	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		break;
	    }else{
		System.out.println(rs(str));
	    }	    
	}
    }


    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	//int[][] c = new int[cl][cl];
	String[][] RS = new String[cl][cl];
	int split = 1;
	int maxl = 0;
	String maxRS = "";

	for(int i = 0; i < cl; i++){RS[i][0] = "";}
	for(int i = 0; i < cl; i++){RS[0][i] = "";}
	    
	//for(int i = 0; i < cl; i++){c[i][0] = 0;}
	//for(int i = 0; i < cl; i++){c[0][i] = 0;}

	for(int k = 1; k < cl; k++){
	    for(int i = 1; i <= split; i++){
		for(int j = 1; j <= cl - split; j++){
		    if(chr[i-1] == chr[split+j-1]){
			RS[i][j] = RS[i-1][j-1] + chr[i-1];
			//c[i][j] = c[i-1][j-1]+1;
		    }else if(RS[i-1][j].length() >= RS[i][j-1].()){
			RS[i][j] = RS[i-1][j];
			//c[i][j] = c[i-1][j];
		    }else{
			RS[i][j] = RS[i][j-1];
			//c[i][j] = c[i][j-1];
		    }
		    if(maxl < RS[i][j].length()){
			maxl = RS[i][j].length();
			maxRS = RS[i][j];
		    }
		}
	    }
	    split++;
	}
	return maxRS;
    }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Main{
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args){
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:42: error: <identifier> expected
		    }else if(RS[i-1][j].length() >= RS[i][j-1].()){
		                                               ^
Main.java:59: error: class, interface, enum, or record expected
}
^
4 errors
Language: Java

import java.util.Scanner;

public Main{
    public static void main(String[] args){
	
	Scanner scan = new Scanner(System.in);
	
	String str = "";
	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		break;
	    }else{
		System.out.println(rs(str));
	    }	    
	}
    }


    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	//int[][] c = new int[cl][cl];
	String[][] RS = new String[cl][cl];
	int split = 1;
	int maxl = 0;
	String maxRS = "";

	for(int i = 0; i < cl; i++){RS[i][0] = "";}
	for(int i = 0; i < cl; i++){RS[0][i] = "";}
	    
	//for(int i = 0; i < cl; i++){c[i][0] = 0;}
	//for(int i = 0; i < cl; i++){c[0][i] = 0;}

	for(int k = 1; k < cl; k++){
	    for(int i = 1; i <= split; i++){
		for(int j = 1; j <= cl - split; j++){
		    if(chr[i-1] == chr[split+j-1]){
			RS[i][j] = RS[i-1][j-1] + chr[i-1];
			//c[i][j] = c[i-1][j-1]+1;
		    }else if(RS[i-1][j].length() >= RS[i][j-1].length()){
			RS[i][j] = RS[i-1][j];
			//c[i][j] = c[i-1][j];
		    }else{
			RS[i][j] = RS[i][j-1];
			//c[i][j] = c[i][j-1];
		    }
		    if(maxl < RS[i][j].length()){
			maxl = RS[i][j].length();
			maxRS = RS[i][j];
		    }
		}
	    }
	    split++;
	}
	return maxRS;
    }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public Main{
       ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args){
                  ^
  (use --enable-preview to enable unnamed classes)
Main.java:59: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.Scanner;

public class copy{
    public static void main(String[] args){
	
	Scanner scan = new Scanner(System.in);
	
	String str = "";
	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		break;
	    }else{
		System.out.println(rs(str));
	    }	    
	}
    }


    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	String[][] RS = new String[cl][cl];
	int split = 1;
	int maxl = 0;
	String maxRS = "";

	for(int i = 0; i < cl; i++){RS[i][0] = "";}
	for(int i = 0; i < cl; i++){RS[0][i] = "";}

	for(int k = 1; k < cl-1; k++){
	    for(int i = 1; i <= split; i++){
		for(int j = 1; j <= cl - split; j++){
		    if(chr[i-1] == chr[j-1+split]){
			RS[i][j] = RS[i-1][j-1] + chr[i-1];
		    }else if(RS[i-1][j].length() >= RS[i][j-1].length()){
			RS[i][j] = RS[i-1][j];
		    }else{
			RS[i][j] = RS[i][j-1];
		    }
		    if(maxl < RS[i][j].length()){
			maxl = RS[i][j].length();
			maxRS = RS[i][j];
		    }
		}
	    }
	    split++;
	}
	return maxRS;
    }
}

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

import java.util.Scanner;

public class copy{
    public static void main(String[] args){
	
	Scanner scan = new Scanner(System.in);
	
	String str = "";
	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		break;
	    }else{
		System.out.println(rs(str));
	    }	    
	}
    }


    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	int[][] RS = new int[cl][cl];
	int maxl = 0;
	int memol = 0;
	String memoRS = "";
	String maxRS = "";

	for(int i = 0; i < cl; i++){RS[i][0] = 0;}
	for(int i = 0; i < cl; i++){RS[0][i] = 0;}

	for(int split = 1; split < cl; split++){
	    memoRS = "";
	    memol = 0;
	    for(int i = 1; i <= split; i++){
		for(int j = 1; j <= cl - split; j++){
		    if(chr[i-1] == chr[j-1+split]){
			RS[i][j] = RS[i-1][j-1] + 1;
		    }else if(RS[i-1][j] >= RS[i][j-1]){
			RS[i][j] = RS[i-1][j];
		    }else{
			RS[i][j] = RS[i][j-1];
		    }
		
		    if(memol < RS[i][j]){
			memol = RS[i][j];
			memoRS = memoRS + chr[i-1];
		    }
		}
	    }
	    if(memol > maxl){
		maxl = memol;
		maxRS = memoRS;
	    }	    
	}
	return maxRS;
    }
}

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

import java.util.Scanner;
public class RepeatedSubsequences{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	String str = "";	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		return;
	    }else{
		str = rs(str);
		System.out.println(str);
	    }	    
	}
    }
    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	int[][] m = new int[cl][cl];
	String[] tmpLCS = new String[(cl/2)+1];
	String lcs = "";
	int i = 1;
	int j = 1;
	for(int k = 0; k < cl; k++) m[k][0] = 0;
	for(int k = 0; k < cl; k++) m[0][k] = 0;
	for(int split = 1; split < cl; split++){
	    for(int k = 0; k < cl/2; k++) tmpLCS[k] = "";
	    i = 1;
	    while(i <= split){
		j = 1;
		while(j <= cl - split){
		    if(chr[i-1] == chr[j-1+split]){
			m[i][j] = m[i-1][j-1] + 1;
			tmpLCS[m[i][j]] = tmpLCS[m[i][j]-1] + chr[i-1];
		    }else{
			m[i][j] = Math.max(m[i-1][j],m[i][j-1]);
		    }
		    j++;
		}
		i++;
	    }
	    if(m[i-1][j-1] >= lcs.length()) lcs = tmpLCS[m[i-1][j-1]];
	}
	return lcs;
    }
}

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

import java.util.Scanner;
public class RepeatedSubsequences{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);
	String str = "";	
	while(true){
	    str = scan.next();
	    if(str.equals("#END")){
		return;
	    }else{
		System.out.println(rs(str));
	    }	    
	}
    }
    public static String rs(String str){
	char[] chr = str.toCharArray();
	int cl = chr.length;
	int[][] m = new int[cl][cl];
	String RS = "";
	char[] c_RS = new char[cl/2 + 1];
	int RSl = 0;
	for(int k = 0; k < cl; k++) m[k][0] = 0;
	for(int k = 0; k < cl; k++) m[0][k] = 0;
	
	int i = 1;
	int j = 1;
	for(int split = 1; split < cl; split++){
	    for(int k = 0; k < cl/2 + 1; k++) c_RS[k] = ' ';
	    i = 1;
	    while(i <= split){
		j = 1;
		while(j <= cl - split){
		    if(chr[i-1] == chr[j-1+split]) m[i][j] = m[i-1][j-1] + 1;
		    else m[i][j] = Math.max(m[i-1][j],m[i][j-1]);
		    j++;
		}
		i++;
	    }

	    i--;
	    j--;
	    RSl = m[i][j];
	    if(RSl > RS.length()){
		RS = "";
		while(i > 0 && j > 0){
		    if(m[i][j] == m[i][j-1])j--;
		    else if(m[i][j] == m[i-1][j])i--;
		    else{
			c_RS[m[i][j]] = chr[i-1];
			i--;
			j--;
		    }
		}
		for(int k = 1; k <= RSl; k++){
		  RS += c_RS[k];
		}
	    }
	}
	return RS;
    }
}

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

import java.util.Scanner;

//Repeated Subsequences
public class Main {

	String lcs(String a, String b){
		int na = a.length(), nb = b.length();
		int dp[][] = new int[na+1][nb+1];
		for(int i=1;i<=na;i++)for(int j=1;j<=nb;j++){
			if(a.charAt(i-1)==b.charAt(j-1))dp[i][j] = dp[i-1][j-1] + 1;
			else dp[i][j] = Math.max(dp[i-1][j], dp[i][j-1]);
		}
		char[] r = new char[dp[na][nb]];
		int i = na, j = nb;
		while(0<i&&0<j){
			if(dp[i][j]==dp[i-1][j])i--;
			else if(dp[i][j]==dp[i][j-1])j--;
			else{
				r[dp[i-1][j-1]] = a.charAt(i-1);
				i--; j--;
			}
		}
		return new String(r);
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			String s = sc.next();
			if("#END".equals(s))break;
			String res = "";
			for(int i=1;i<s.length();i++){
				String l = lcs(s.substring(0, i), s.substring(i));
				if(res.length()<l.length())res = l;
			}
			System.out.println(res);
		}
	}
	
	public static void main(String[] args) {
		new Main.run();
	}
}

Compiler output:
Main.java:41: error: cannot find symbol
		new Main.run();
		        ^
  symbol:   class run
  location: class Main
1 error
Language: C++

#include <string>
#include <cstring>
#include <iostream>

using namespace std;

string dp[301][301];

inline string LCS(const char S[], const char T[])
{
	for (int i = 0; i <= 300; i++)
	{
		dp[0][i] = "";
		dp[i][0] = "";
	}

	int SS = strlen(S);
	int TS = strlen(T);

	for (int i = 1; i <= TS; i++)
	{
		for (int j = 1; j <= SS; j++)
		{
			if (S[j - 1] == T[i - 1])
			{
				dp[i][j] = dp[i - 1][j - 1] + T[i - 1];
			}
			else
			{
				string A = dp[i][j - 1];
				string B = dp[i - 1][j];

				if (A.size() > B.size())
				{
					dp[i][j] = A;
				}
				else
				{
					dp[i][j] = B;
				}
			}
		}
	}

	return dp[TS][SS];
}

int main()
{
	string STR;

	while (true)
	{
		cin >> STR;

		STR = TMP;

		if (STR == "#END") { break; }

		string Ans = "";

		int size_ = STR.size();

		for (int i = 2; i < size_ - 1; i++)
		{
			string L = STR.substr(0, i);
			string R = STR.substr(i, size_);

			string A = LCS(L.c_str(), R.c_str());

			if (A.size() > Ans.size())
			{
				Ans = A;
			}
		}

		printf("%s\n", Ans.c_str());
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:23: error: 'TMP' was not declared in this scope
   56 |                 STR = TMP;
      |                       ^~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <time.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define FOR(i, a) for(i = 0; i < (a); i++)
#define FORM(i, a) for(i = (a) i >= 0; i--)
using namespace std;

int dp[301][301];
string ans[301][301];
char final[300];
int main(){
int i, j, N, K, m, n, o = 0;
string str;
string str1, str2;

     
while(str != "#END"){
    cin >> str;
	memset((char*)final, 0, 301);
     FOR(i, str.size()){
         str1.clear();
		 str2.clear();
		
		 for(j = 0; j <= i; j++){
			 str1.push_back(str[j]);
		 }

		 for(j = i+1; j < str.size(); j++){
			 str2.push_back(str[j]);
		 }


		 for(m = 1; m <= 300; m++){
		   for(n = 1; n <= 300; n++)
			   dp[m][n] = 0;
		       ans[m][n].clear();
		 }

		 for(m = 1; m <= str1.size(); m++){
		  for(n = 1; n <= str2.size(); n++){
			  if(str1[m-1] == str2[n-1]){
			  dp[m][n] = dp[m-1][n-1]+1;
			   ans[m][n] = ans[m-1][n-1];
			   ans[m][n].push_back(str1[m-1]);
			  }
			  else if(dp[m-1][n] <= dp[m][n-1]){
				  dp[m][n] = dp[m][n-1];
				  ans[m][n] = ans[m][n-1];
			  }
			  else{
				  dp[m][n] = dp[m-1][n];
				  ans[m][n] = ans[m-1][n];
			  }

		  }
		 }

		 if(strlen(final) <= ans[str1.size()][str2.size()].size()){
			FOR(m, ans[str1.size()][str2.size()].size()){
				final[m] = (char)ans[str1.size()][str2.size()][m];
			}
		 }

		 	
	 }

	  cout << final << endl;
  }
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'memset' was not declared in this scope
   24 |         memset((char*)final, 0, 301);
      |         ^~~~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <algorithm>
  +++ |+#include <cstring>
    8 | #include <string>
a.cc:63:21: error: 'strlen' was not declared in this scope
   63 |                  if(strlen(final) <= ans[str1.size()][str2.size()].size()){
      |                     ^~~~~~
a.cc:63:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

def lcs(x, y):
    rec = []
    idx = []
    for c in y:
        s = 0
        for i, k in enumerate(idx):
            t = x.find(c, s) + 1
            if t < 1:
                break
            if t < k:
                idx[i] = t
            s = k
        else:
            t = x.find(c, s) + 1
            if t:
                idx.append(t)
        rec.append(idx.copy())
    
    if idx:
        lcs = ''
        pos = len(idx) - 1
        for line, yc in zip(rec[::-1], y[::-1]):
            i = line[pos] - 1
            xc = x[i]
            if xc == yc:
                lcs += xc
                if pos == 0:
                    return lcs[::-1]
                pos -= 1
    else:
        return ''

def solve():
    import sys
    file_input = sys.stdin
    ans_out = []
    for s in file_input:
        s = s.rstrip()
        if s == '#END':
            break
        sep = len(s) // 2
        ans = lcs(s[:sep], s[sep:])
        ans_len = len(ans)
        print(ans)

solve()


Compiler output:
a.cc:20:15: error: empty character constant
   20 |         lcs = ''
      |               ^~
a.cc:31:16: error: empty character constant
   31 |         return ''
      |                ^~
a.cc:39:17: warning: multi-character character constant [-Wmultichar]
   39 |         if s == '#END':
      |                 ^~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def lcs(x, y):
      | ^~~
Language: C++

#include<string>
#include<iostream>

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

using namespace std;

string LCS(const string &s,const string &t){
	const int LMAX=___;
	int m=s.length(),n=t.length();
	static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];

	rep(i,m+1) dp[i][0]=0, from[i][0]=-1;
	rep(j,n+1) dp[0][j]=0, from[0][j]=-1;

	rep(i,m) rep(j,n) {
		if(s[i]==t[j]){
			dp[i+1][j+1]=dp[i][j]+1;
			from[i+1][j+1]=2;
		}
		else{
			if(dp[i][j+1]<dp[i+1][j]){
				dp[i+1][j+1]=dp[i+1][j];
				from[i+1][j+1]=1;
			}
			else{
				dp[i+1][j+1]=dp[i][j+1];
				from[i+1][j+1]=0;
			}
		}
	}

	int idx=dp[m][n];
	string ans(idx,'@');
	for(int i=m,j=n;~from[i][j];){
		switch(from[i][j]){
			case 0: j--; break;
			case 1: i--; break;
			case 2: i--; j--; idx--; ans[idx]=s[i]; break;
		}
	}

	return ans;
}

int main(){
	for(string s;cin>>s,s!="#END";){
		int len=s.length();
		string ans;
		for(int i=1;i<len;i++){
			if(min(i,len-i)<=ans.length()) break;
			string tmp=LCS(s.substr(0,i),s.substr(i));
			if(ans.length()<tmp.length()) ans=tmp;
		}
		cout<<ans<<endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::string LCS(const std::string&, const std::string&)':
a.cc:9:24: error: '___' was not declared in this scope
    9 |         const int LMAX=___;
      |                        ^~~
a.cc:11:35: error: size of array 'dp' is not an integral constant-expression
   11 |         static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];
      |                               ~~~~^~
a.cc:11:27: error: size of array 'dp' is not an integral constant-expression
   11 |         static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];
      |                       ~~~~^~
a.cc:11:56: error: size of array 'from' is not an integral constant-expression
   11 |         static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];
      |                                                    ~~~~^~
a.cc:11:48: error: size of array 'from' is not an integral constant-expression
   11 |         static int dp[LMAX+1][LMAX+1],from[LMAX+1][LMAX+1];
      |                                            ~~~~^~
Language: C++

include <iostream>

using namespace std;

bool ruijo[1000001];

int main(){
  for(int i=1;i*i<=1000000;i++)ruijo[i*i]=true;
  int n;
  while(cin>>n&&n){
    int res=0;
    int cnt=0;
    int lim=0;
    int idx=3;
    int sum=3;
    for(int i=1;i<=n;i++){
      if(lim==cnt+1)res=30;
      else if(lim==cnt+2)res=30;
      else if(lim==cnt+3)res=96;
      else if(lim==cnt){
	res=6;
	lim=sum;
	sum+=idx;
	idx++;
	cnt=0;
      }
      else if(cnt%2)res=36;
      else res=78;
      cnt++;
    }
    cout<<res<<endl;
  }
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |   while(cin>>n&&n){
      |         ^~~
a.cc:31:5: error: 'cout' was not declared in this scope
   31 |     cout<<res<<endl;
      |     ^~~~
a.cc:31:16: error: 'endl' was not declared in this scope
   31 |     cout<<res<<endl;
      |                ^~~~
Language: C++

#include<cmath>
#include<iostream>
#include<map>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()

const int N = 100;

typedef long long ll;

class Point{
public:
  double x,y,z;
  bool operator<(const Point & a)const{
    return z > a.z;
  }
};

ll gethash(int a,int b,int c,int d){//a>b>c>d
  static ll mult[]={
    1LL,
    1000LL,
    1000000LL,
    1000000000LL,
  };
  int deal[]={a,b,c,d};
  ll hash=0;
  rep(i,4){
    if (deal[i] == -1)deal[i]=999;
    hash+=deal[i]*mult[i];
  }
  return hash;
}


double dist[N][N];
void calc_dist(Point *in,int n){
  rep(i,n){
    rep(j,n){
      dist[i][j]=sqrt((in[i].x-in[j].x)*(in[i].x-in[j].x)+
		      (in[i].y-in[j].y)*(in[i].y-in[j].y)+
		      (in[i].z-in[j].z)*(in[i].z-in[j].z));
    }
  }
}


double solve(int n,int now,Point *data,int *last,int k,
	     map<ll,double> & M){
  if (n == now)return 0;

  int in[4]={last[0],last[1],last[2],last[3]};
  sort(in,in+4);

  ll hash = gethash(in[0],in[1],in[2],in[3]);
  if (M.find(hash) != M.end())return M[hash];
  
  double ret = 1e100;

  rep(i,k){
    int tmp = last[i];
    if (last[i] != -1 && data[last[i]].z == data[now].z)continue;
    last[i]=now;
    ret=min(ret,solve(n,now+1,data,last,k,M) + (tmp==-1?0:
					      dist[tmp][now]));
    last[i]=tmp;
  }
  
  return M[hash]=ret;
}

main(){
  int n,k;
  while(cin>>n>>k && n){
    Point in[n];
    int somen[4];
    rep(i,4)somen[i]=-1;
    rep(i,n){
      cin>>in[i].x>>in[i].y>>in[i].z;
    }
    sort(in,in+n);
    calc_dist(in,n);

    map<ll,double> M;
    double ans=solve(n,0,in,somen,k,M);
    if (ans > 1e80)puts("-1");
    else printf("%.10lf\n",ans);
  }
}

Compiler output:
a.cc: In function 'double solve(int, int, Point*, int*, int, std::map<long long int, double>&)':
a.cc:55:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   55 |   sort(in,in+4);
      |   ^~~~
      |   sqrt
a.cc: At global scope:
a.cc:74:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   74 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:83:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   83 |     sort(in,in+n);
      |     ^~~~
      |     sqrt
Language: C++

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

#define INF 100000000000

#define SOUR (M+7)
#define SINK (M+7+1)

class Node
{
public:	
	vector<int> to;
};

int main()
{
	int M;
	long long N;
	while(cin >> M >> N, (M||N))
	{
		Node n[150];
		long long flow[150][150]={0},cap[150][150]={0},all=0;
		
		for(int i=0; i<M; i++)
		{
			long long T,C;
			cin >> T >> C;
			n[SOUR].to.push_back(i);
			
			cap[SOUR][i]+=T;
			cap[i][SOUR]+=T;
			all+=T;
			
			while(C--)
			{
				string s;
				cin >> s;
				int p;
				if(s=="Sunday") 	p=0;
				if(s=="Monday") 	p=1;
				if(s=="Tuesday") 	p=2;
				if(s=="Wednesday") 	p=3;
				if(s=="Thursday")	p=4;
				if(s=="Friday")		p=5;
				if(s=="Saturday") 	p=6;
				
				n[i].to.push_back(M+p);
				n[M+p].to.push_back(i);
				
				flow[M+p][i]+=N;
				
				cap[i][M+p]+=N;
				cap[M+p][i]+=N;
			}
		}
		
		for(int i=0; i<7; i++)
		{
			n[M+i].to.push_back(SINK);
			cap[M+i][SINK]+=N;
		}
		
		long long total=0;
		while(1)
		{		
			int v[150];
			for(int i=0; i<=SINK; i++)
				v[i]=-1;
				
			v[SOUR]=SOUR;
			
			queue<int> q;
			q.push(SOUR);
			
			bool g=false;
			while(!q.empty())
			{
				int t=q.front(); q.pop();
				if(t==SINK)
				{
					g=true;
					break;
				}
				
				for(int i=0; i<n[t].to.size(); i++)
				{
					int next=n[t].to[i];
					if(flow[t][next]==cap[t][next]) continue;
					if(v[next]>=0) continue;
					
					v[next]=t;
					
					q.push(next);
				}
			}
			
			if(!g) break;
			
			long long f=INF;
			for(int j=SINK; v[j]!=j; j=v[j])
			{
				f=min(f,cap[v[j]][j]-flow[v[j]][j]);
			}
			
			total+=f;
			for(int j=SINK; v[j]!=j; j=v[j])
			{
				flow[v[j]][j]+=f;
				flow[j][v[j]]-=f;
			}
		}
		
		puts((all==total?"Yes":"No"));
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'cin' was not declared in this scope
   22 |         while(cin >> M >> N, (M||N))
      |               ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
Language: Java

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-- > 0){
			int n=sc.nextInt()-1;
			int h=sc.nextInt();
			int mc = 0;
			int mf = 0;

			while(n-->0){
				int nh = sc.nextInt();
				if(nh-h>mc)mc=nh-h;
				if(h-nh>mf)mf=h-nh;
				h=nh;
			}
			System.out.println(mc+" "+mf);
		}
	}
}

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

#include <cstdio>
#include <iostream>

using namespace std;

int main(void)
{
	int t, n;
	int array[128];
	
	cin >> t;
	for (int c = 0; c < t; c++){
		cin >> n;
		
		int up_max = 0, dn_max = 0;
		for (int i = 0; i < n; i++){
			cin >> array[i];
			
			if (i > 0){
				if (up_max < array[i] - array[i-1]){
					up_max = array[i] - array[i-1];
				}
				if (dn_max < array[i-1] - array[i]){
					dn_max = array[i-1] - array[i];
				}
			}
		}
		
		cout << up_max << " " << dn_max << endl;
	}
	
	return (0);
}

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

#include <stdio.h>

int main(){
  int t,n,i,a[100],t,Max,Min;

  scanf("%d",&t);

  while(t--){
    scanf("%d",&n);

    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<n-1;i++){
      a[i] = a[i+1]-a[i];
    }
    for(i=n-3;i >= 0;i--){
      if(a[i] < a[i+1]) t=a[i];a[i] = a[i+1];a[i+1] = t;
    }
    Max = a[0];

    for(i=n-3;i >= 0;i--){
      if(a[i] > a[i+1]) t=a[i];a[i] = a[i+1];a[i+1] = t;
    }

    Min = a[0];

    if(Max >= 0 && Min <= 0) printf("%d %d\n",Max,-Min);
    if(Max < 0) printf("%d %d\n",0,-Min);
    if(Min > 0) printf("%d %d\n",Max,0);

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: redeclaration of 't' with no linkage
    4 |   int t,n,i,a[100],t,Max,Min;
      |                    ^
main.c:4:7: note: previous declaration of 't' with type 'int'
    4 |   int t,n,i,a[100],t,Max,Min;
      |       ^
Language: C

#include <stdio.h>

int main(){
  int t,n,i,a[100],t,Max,Min;

  scanf("%d",&t);

  while(t--){
    scanf("%d",&n);

    for(i=0;i<n;i++){
      scanf("%d",&a[i]);
    }
    for(i=0;i<n-1;i++){
      a[i] = a[i+1]-a[i];
    }
    for(i=n-3;i >= 0;i--){
      if(a[i] < a[i+1]) {t=a[i];a[i] = a[i+1];a[i+1] = t;}
    }
    Max = a[0];

    for(i=n-3;i >= 0;i--){
      if(a[i] > a[i+1]) {t=a[i];a[i] = a[i+1];a[i+1] = t;}
    }

    Min = a[0];

    if(Max >= 0 && Min <= 0) printf("%d %d\n",Max,-Min);
    if(Max < 0) printf("%d %d\n",0,-Min);
    if(Min > 0) printf("%d %d\n",Max,0);

  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:20: error: redeclaration of 't' with no linkage
    4 |   int t,n,i,a[100],t,Max,Min;
      |                    ^
main.c:4:7: note: previous declaration of 't' with type 'int'
    4 |   int t,n,i,a[100],t,Max,Min;
      |       ^
Language: C

#include<stdio.h>
int main(){
int n,m,a[200],up,down,i;
scanf("%d",&n);
while(n-->0){
up=0;
down=0;
scanf("%d",&m);
for(i=0;i<m-1;i++)
scanf("%d ",&a[i]);
scanf("%d",&a[m-1]);
for(i=0;i<m-1;i++){
if(a[i]<a[i+1]){
if(a[i+1]-a[i]>up)
up=a[i+1]-a[i];
}
else if(a[i]>a[i+1]){
if(a[i]-a[i+1]>down)
down=a[i]-a[i+1];
}
printf("%d %d\n",up,down);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:1: error: expected declaration or statement at end of input
   24 | }
      | ^
Language: C

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

int main(void){
	int length;
	int max=0, min=0;
	int dif = 0;
	int step;
	char steps[256];
	char index[1001];
	int now;
	int next = 0;
	int i, n, m;

	scanf("%d", &length);
	for(i=0; i<length; i++){
		scanf("%d", &step);
		scanf("%s", steps);
		for(n=0; steps[n] != '\0'; n++){
			if(0 == isspace(steps[n])){  // スペースの時
				m = 0;
				now = next;
				next = atoi(index) 
			}else{
				m ++;
				index[m] = steps[n];
			}
			dif = now - next;
			if(dif < 0){
				max = abs(dif);
			}else if(dif > 0){
				min = abs(dif);
			}
		}
		printf("%d %d", max, min);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:51: error: expected ';' before '}' token
   25 |                                 next = atoi(index)
      |                                                   ^
      |                                                   ;
   26 |                         }else{
      |                         ~
Language: C++

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

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int m;
    cin>>m;
    int obs[m+1];
    obs[0]=0;
    int prev,min,max;
    max=0;
    min=10000;
    for(int j=1;j<=m;j++){
      prev=obs[j-1];
      cin>>obs[j];
      if(max<abs(obs[j]-prev) && obs[j]>prev)max=abs(obs[j]-prev);
      if(min>abs(obs[j]-prev) && obs[j]<prev)min=abs(obs[j]-prev);
    }
    if(min==10000)min=0;
    cout  << max << " " << min << endl;
  }
  return 0;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclucd; did you mean #include?
    1 | #inclucd<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclucd<bits/stdc++.h>
a.cc:18:14: error: 'abs' was not declared in this scope; did you mean 'obs'?
   18 |       if(max<abs(obs[j]-prev) && obs[j]>prev)max=abs(obs[j]-prev);
      |              ^~~
      |              obs
a.cc:19:14: error: 'abs' was not declared in this scope; did you mean 'obs'?
   19 |       if(min>abs(obs[j]-prev) && obs[j]<prev)min=abs(obs[j]-prev);
      |              ^~~
      |              obs
a.cc:22:5: error: 'cout' was not declared in this scope
   22 |     cout  << max << " " << min << endl;
      |     ^~~~
a.cc:22:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:35: error: 'endl' was not declared in this scope
   22 |     cout  << max << " " << min << endl;
      |                                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclucd<bits/stdc++.h>
Language: C++

#include <stdio.h>

int main(){
	
	int i,j,n,m,sai;
	int a[100],up[100],down[100],dan[100];
	int h=0,k=0,s=0,maxup,maxdown;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&m);
		for(j=0;j<m;j++){
			scanf("%d",&a[j]);
		}
		
		for(j=0;j<m-1;j++){
			sai = a[j+1] - a[j];
			if(sai>0){
				up[k] = sai;
				k++;
			}else if(sai<0){
				down[h] = sai;
				h++;
			}else{
				dan[s]=0;
				s++;
			}
		}
		
		for(j=0;j<k;j++){
			if(j==0){
				maxup = up[j];
			}else{
				if(up[j]>maxup){
					maxup = up[j];
				}
			}
		}
		
		for(j=0;j<h;j++){
			if(j==0){
				maxdown = down[j];
			}else{
				if(down[j]<maxdown){
					maxdown = down[j];
				}
			}
		}
		
		
		printf("%d %d\n",maxup,abs(maxdown));
		for(j=0;j<100;j++){
			up[j]=0;
			down[j]=0;
			dan[j]=0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
   51 |                 printf("%d %d\n",maxup,abs(maxdown));
      |                                        ^~~
Language: C++

#include <stdio.h>

int main(){
	
	int i,j,n,m,sai;
	int a[1000],up[1000],down[1000],dan[1000];
	int h=0,k=0,s=0,maxup,maxdown;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&m);
		for(j=0;j<m;j++){
			scanf("%d",&a[j]);
		}
		
		for(j=0;j<m-1;j++){
			sai = a[j+1] - a[j];
			if(sai>0){
				up[k] = sai;
				k++;
			}else if(sai<0){
				down[h] = sai;
				h++;
			}else{
				dan[s] = sai;
				s++;
			}
		}
		
		for(j=0;j<k;j++){
			if(j==0){
				maxup = up[j];
			}else{
				if(up[j]>maxup){
					maxup = up[j];
				}
			}
		}
		
		for(j=0;j<h;j++){
			if(j==0){
				maxdown = down[j];
			}else{
				if(down[j]<maxdown){
					maxdown = down[j];
				}
			}
		}
		
		
		printf("%d %d\n",maxup,abs(maxdown));
		for(j=0;j<100;j++){
			up[j]=0;
			down[j]=0;
			dan[j]=0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:40: error: 'abs' was not declared in this scope
   51 |                 printf("%d %d\n",maxup,abs(maxdown));
      |                                        ^~~
Language: C++

#include <stdio.h>

int main(){
	
	int i,j,n,m,sai;
	int a[1000],up[1000],down[1000],dan[1000];
	int h=0,k=0,s=0,y=0,maxup,maxdown;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&m);
		for(j=0;j<m;j++){
			scanf("%d",&a[j]);
		}
		
		for(j=0;j<m-1;j++){
			sai = a[j+1] - a[j];
			if(sai>0){
				up[k] = sai;
				k++;
			}else if(sai<0){
				down[h] = sai;
				h++;
			}else{
				dan[s] = sai;
				s++;
			}
		}
		
		for(j=0,y=0;j<k,y<h;j++,y++){
			if(j==0){
				maxup = up[j];
				maxdown = down[y];
			}else{
				if(up[j]>maxup){
					maxup = up[j];
				}
				if(down[y]<maxdown){
					maxdown = down[y];
				}
			}
		}
		
	//	for(j=0;j<h;j++){
	//		if(j==0){
	//			maxdown = down[j];
	//		}else{
	//			if(down[j]<maxdown){
	//				maxdown = down[j];
	//			}
	//		}
	//	}
		
		
		printf("%d %d\n",maxup,abs(maxdown));
		for(j=0;j<100;j++){
			up[j]=0;
			down[j]=0;
			dan[j]=0;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:40: error: 'abs' was not declared in this scope
   55 |                 printf("%d %d\n",maxup,abs(maxdown));
      |                                        ^~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<fstream>
#include<stack>
#include<math.h>

using namespace std;



int main()

	int n;
	int c=0;
	cin >> n;
	for (int i = 0; i < n; i++){
		int bn;
		int b[101];
		int max = 0, min = 1000;
		cin >> bn;
		for (int j = 0; j < n; j++)cin >> b[j];
		for (int j = 0; j < n; j++){
			if (j == 0)continue;

			if (b[i] - b[i - 1]>0){
				if (b[i] - b[i - 1]>max) max = b[i] - b[i - 1];
			}

			if (b[i] - b[i - 1]<0){
				if (b[i - 1] - b[i]>min) min = b[i - 1] - b[i];
			}
		}
		cout << max << ' ' << min << endl;
	}

	return 0;

}

Compiler output:
a.cc:13:9: error: expected initializer before 'int'
   13 |         int n;
      |         ^~~
a.cc:15:9: error: 'cin' does not name a type
   15 |         cin >> n;
      |         ^~~
a.cc:16:9: error: expected unqualified-id before 'for'
   16 |         for (int i = 0; i < n; i++){
      |         ^~~
a.cc:16:25: error: 'i' does not name a type
   16 |         for (int i = 0; i < n; i++){
      |                         ^
a.cc:16:32: error: 'i' does not name a type
   16 |         for (int i = 0; i < n; i++){
      |                                ^
a.cc:36:9: error: expected unqualified-id before 'return'
   36 |         return 0;
      |         ^~~~~~
a.cc:38:1: error: expected declaration before '}' token
   38 | }
      | ^
Language: C++

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

int main(){
	int n ,t, tt;
	cin>>tt;
	for(int j = 0; j < tt; j++){
		int cu = 0, cd = 0, m = 0,
		cin>>n;
		for(int i = 0; i < n; i++){
			cin>>t;
			
			if(t - m > cu) cu = t - m;
			if(m - t > cd) cd = m - t;
			m = t;
		}
		cout<<cu<<" "<<cd<<endl;
	}
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:20: error: expected initializer before '>>' token
    9 |                 cin>>n;
      |                    ^~
Language: C++

for(int i=0;i<n;i++){

    cin >> m;

    for(int j=0;j<m;j++) cin >> a[j];

    //   for(int j=1;j<m;j++) b[j-1] = a[j] - a[j-1];

    mx = 0;

    mn = 0;
    
    for(int j=0;j+1<m;j++)
      if(a[j] < a[j+1] )
	mx = max(mx,a[j+1]-a[j]); 
			   
    for(int j=0;j+1<m;j++)
      if(a[j] > a[j+1])
	mn = max(mn,a[j]-a[j+1]);

    //    if(mn<0) mn2 = -mn;

    //    if(mx<0) mx2 = -mx;

    cout << mx << " " << mn << endl;

  }

   
  




  }
  


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for(int i=0;i<n;i++){
      | ^~~
a.cc:1:13: error: 'i' does not name a type
    1 | for(int i=0;i<n;i++){
      |             ^
a.cc:1:17: error: 'i' does not name a type
    1 | for(int i=0;i<n;i++){
      |                 ^
a.cc:35:3: error: expected declaration before '}' token
   35 |   }
      |   ^
Language: C++

#include<cstdio>
#include<calgorithm>

int main(){
int a,b,c,umax,dmax;
while(1){
 umax=0;
 dmax=0;
 scanf("%d",a);
if(a==0) return 0;
 scanf("%d",b);
 for(int i=1;i<a;i++){
 scanf("%d",c);
 if(b<c) umax=max(umax,c-b);
 else dmax=max(dmax,b-c);
 b=c;
}
printf("%d %d\n",umax,dmax);
}
}

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

/*Kim Jong Il. Do you like him?*/

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stdlib.h>
#include<limits.h>
using namespace std;

int main(){
  int n,n2,hn[1000][1000],sn[1000],xmax=0,xmin=0,ma[1000],mi[1000];

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> n2;
    for(int j=0;j<n2;j++){
      cin >> hn[i][j];
     
      if(j>0 && hn[i][j]-hn[i][j-1]>0)xmax=max(xmax,(hn[i][j]-hn[i][j-1]));
      else if(j>0 && hn[i][j]-hn[i][j-1]<0)xmin=min(xmin,(hn[i][j]-hn[i][j-1]));
    }
    ma[i]=xmax;
    mi[i]=xmin;
    xmax=0;
    xmin=0;
    
  }
  for(int i=0;i<n;i++){
    cout << ma[i] << " " << -mi[i] << endl;

  }
  



}

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stdlib.h>
#include<limits.h>
using namespace std;

int main(){
  int n,n2,hn[1000][1000],sn[1000],xmax=0,xmin=0,ma[1000],mi[1000];

  cin >> n;
  for(int i=0;i<n;i++){
    cin >> n2;
    for(int j=0;j<n2;j++){
      cin >> hn[i][j];
     
      if(j>0 && hn[i][j]-hn[i][j-1]>0)xmax=max(xmax,(hn[i][j]-hn[i][j-1]));
      else if(j>0 && hn[i][j]-hn[i][j-1]<0)xmin=min(xmin,(hn[i][j]-hn[i][j-1]));
    }
    ma[i]=xmax;
    mi[i]=xmin;
    xmax=0;
    xmin=0;
    
  }
  for(int i=0;i<n;i++){
    cout << ma[i] << " " << -mi[i] << endl;

  }
  



}

Compiler output:
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main(){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main(){
      |     ^~~~