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

#include<iostream>
using namespace std;
p;
main() {
	string c,s,u="++++++++++";
	int t[10]={},i,j,k,a,b,d;
	c=">+++++[<++++++>-]>+++++[<++++++++>-]>+++++[<"+u+">-]>++++++[<"+u+">-]>+++++++[<"+u+">-]>++++++++[<"+u+">-]>+++++++++[<"+u+">-]>"+u+"[<"+u+">-]>+++++++++++[<"+u+">-]>++++++++++++[<"+u+">-]<<<<<<<<<<";
	for(cin>>s,i=0;i<s.length();++i){
		a=(s[i]/10)-3,b=a-p,p=a,d=s[i]-(a+3)*10;
		for(j=b>0?b:-b;j--;)c+=(b>=0?">":"<");
		for(k=d;k--;)c+="+";
		c+=".";
		for(k=d;k--;)c+="-";
	}
	cout<<c<<endl;
}

Compiler output:
a.cc:3:1: error: 'p' does not name a type
    3 | p;
      | ^
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:35: error: 'p' was not declared in this scope
    9 |                 a=(s[i]/10)-3,b=a-p,p=a,d=s[i]-(a+3)*10;
      |                                   ^
Language: C++

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

int n;
int order[128][128];
vector<string> t;

//[from, to] not [from, to)
bool check(int x, int from, int to){
  for(int i = from; i <= to; i++){
    if(t[i].size() <= x) continue;

    for(int j = i + 1; j <= to; j++){
      if(t[j].size() <= x) return false;

      char a = t[i][x];
      char b = t[j][x];

      if(order[a][b] != -1 && order[a][b] == 1){
        return false;
      }
      order[a][b] = -1;
      order[b][a] = +1;
    }
  }

  int i = from;
  while(i <= to && t[i].size() <= x) i++;

  for( ; i <= to; i++){
    int j = i;
    for( ; j <= to && t[i][x] == t[j][x]; j++);
    if(!check(x + 1, i, j - 1)) return false;
    i = j - 1;
  }

  return true;
}

int main(){
  while(cin >> n, n){
    t.clear();

    for(int i = 0; i < n; i++){
      string s;
      cin >> s;
      t.push_back(s);
    }

    memset(order, -1, sizeof(order));

    cout << (check(0, 0, n - 1) ? "yes" : "no") << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:5: error: 'memset' was not declared in this scope
   52 |     memset(order, -1, sizeof(order));
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

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

int g[30][30];

int main(){
  int n;
  while(cin >> n, n){
    vector<string> s(n);
    for(int i=0;i<n;i++)cin >> s[i];

    for(int i=0;i<26;i++){
      for(int j=0;j<26;j++){
	  g[i][j] = 1e9;
      }
      g[i][i] = 0;
    }

    bool f = true;
    for(int i=1;i<n;i++){
      int len = min(s[i-1].size(), s[i].size()), j;
      for(j=0;j<len;j++){
	if(s[i-1][j]!=s[i][j])break;
      }

      if(j==len){
	if(s[i-1].size() > s[i].size()){
	  f = false;
	}
      }else{
	g[s[i-1][j]-'a'][s[i][j]-'a'] = -1;
      }
    }

    for(int k=0;k<26;k++){
      for(int i=0;i<26;i++){
	for(int j=0;j<26;j++){
	  g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
	}
      }
    }

    for(int i=0;i<26;i++){
      if(g[i][i] < 0) f = false;
    }

    cout << (f?"yes":"no") << endl;
  }   
}
#include<bits/stdc++.h>
using namespace std;

int g[30][30];

int main(){
  int n;
  while(cin >> n, n){
    vector<string> s(n);
    for(int i=0;i<n;i++)cin >> s[i];

    for(int i=0;i<26;i++){
      for(int j=0;j<26;j++){
	  g[i][j] = 1e9;
      }
      g[i][i] = 0;
    }

    bool f = true;
    for(int i=1;i<n;i++){
      int len = min(s[i-1].size(), s[i].size()), j;
      for(j=0;j<len;j++){
	if(s[i-1][j]!=s[i][j])break;
      }

      if(j==len){
	if(s[i-1].size() > s[i].size()){
	  f = false;
	}
      }else{
	g[s[i-1][j]-'a'][s[i][j]-'a'] = -1;
      }
    }

    for(int k=0;k<26;k++){
      for(int i=0;i<26;i++){
	for(int j=0;j<26;j++){
	  g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
	}
      }
    }

    for(int i=0;i<26;i++){
      if(g[i][i] < 0) f = false;
    }

    cout << (f?"yes":"no") << endl;
  }   
}

Compiler output:
a.cc:53:5: error: redefinition of 'int g [30][30]'
   53 | int g[30][30];
      |     ^
a.cc:4:5: note: 'int g [30][30]' previously declared here
    4 | int g[30][30];
      |     ^
a.cc:55:5: error: redefinition of 'int main()'
   55 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <queue>
#include <string>

using namespace std;

string arr[501];
string arr2[501],arr3[501];

// a 譏ッ b 逧?燕郛?inline bool startswith(const string &a, const string &b)
{
    if (a.size()>b.size()) return false;
    if (a==b.substr(0,a.size())) return true;
    return false;
}

bool cmp(const string &a, const string &b) { if (startswith(a,b)) return true; else  return a>b;}

int main()
{
    int n;

//freopen("fuck.in","r",stdin);

    ios::sync_with_stdio(false);
    while (cin>>n && n!=0)
    {
        bool right1=true, right2=true;

        for (int i=0; i<n; i++)
        {
            cin>>arr[i];
            arr2[i]=arr3[i]=arr[i];
        }

        sort(arr2,arr2+n);
        sort(arr3,arr3+n,cmp);

        for (int i=0; i<n; i++)
        {
            if (arr[i]!=arr2[i]) {right1=false; break;}
        }
        for (int i=0; i<n; i++)
        {
            if (arr[i]!=arr3[i]) {right2=false; break;}
        }

        if (right1 || right2)
        {
            cout<<"yes\n";
        }
        else
        {
            cout<<"no\n";
        }
    }
}

Compiler output:
a.cc:15:1: error: expected unqualified-id before '{' token
   15 | {
      | ^
a.cc: In function 'bool cmp(const std::string&, const std::string&)':
a.cc:21:50: error: 'startswith' was not declared in this scope
   21 | bool cmp(const string &a, const string &b) { if (startswith(a,b)) return true; else  return a>b;}
      |                                                  ^~~~~~~~~~
a.cc:21:97: warning: control reaches end of non-void function [-Wreturn-type]
   21 | bool cmp(const string &a, const string &b) { if (startswith(a,b)) return true; else  return a>b;}
      |                                                                                                 ^
Language: C

#include<bits/stdc++.h>

using namespace std;

const int MAXN = 1000 + 10, MAXM = 1e5 + 100;

int fa[MAXN], ans[MAXN], tot, n, m;

struct lnk {
	int a, b, l;
	const operator < (const lnk p) {
		return l < p.l;
	}
}l[2 * MAXM];

int findfa(int x) {
	return (fa[x] == x ? x : (fa[x] = findfa(fa[x])));
}

int main() {
	while ((~scanf("%d%d", &n, &m)) && (n + m)) {
		for (int i = 1; i <= m; i++) {
			scanf("%d%d%d", &l[i].a, &l[i].b, &l[i].l);
		}
		sort(l + 1, l + m + 1);
		tot = 0;
		for (int i = 1; i <= n; i++) fa[i] = i;
		for (int i = 1; i <= m; i++) {
			if (findfa(l[i].a) != findfa(l[i].b)) {
				fa[findfa(l[i].a)] = findfa(l[i].b);
				ans[++tot] = l[i].l;
				if (tot == n - 1) break;
			}
		}
		printf("%d\n", ans[(tot >> 1) + 1]);
	}
	return 0;
}

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

2 1
1 2 5
4 6
1 2 1
1 3 2
1 4 3
2 3 4
2 4 5
3 4 6
8 17
1 4 767
3 1 609
8 3 426
6 5 972
8 1 607
6 4 51
5 1 683
3 6 451
3 4 630
8 7 912
3 7 43
4 7 421
3 5 582
8 4 538
5 7 832
1 6 345
8 2 608
0 0

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 2 1
      | ^
Language: C++

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

int solve(int n, vector< vector< pair<int,int> > > &G){
  vector<bool> connected(n,false);
  priority_queue< pair<int,int> > wait;
  vector<int> costs;
  wait.emplace(0,0);
  while(!wait.empty()){
    int c = -wait.top().first, v = wait.top().second;
    wait.pop();
    if(connected[v]) continue;
    connected[v] = true;
    costs.push_back(c);
    for(int i = 0; i < G[v].size(); ++i){
      int v_ = G[v][i].first, c_ = G[v][i].second;
      if(!connected[v_]){
        wait.emplace(-c_,v_);
      }
    }
  }
  sort(costs.begin(),costs.end());
  return costs[n/2];
}

int main(){
  int n, m;
  while(cin >> n >> m, n){
    vector< vector< pair<int,int> > > G(n);
    int s, t, c;
    for(int i = 0; i < m; ++i){
      cin >> s >> t >> c;
      --s;--t;
      G[s].emplace_back(t,c);
      G[t].emplace_back(s,c);
    }

    cout << solve(n,G) << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int solve(int, std::vector<std::vector<std::pair<int, int> > >&)':
a.cc:24:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |   sort(costs.begin(),costs.end());
      |   ^~~~
      |   short
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

struct Edge {
    int from, to, cost;
    Edge(int a, int b, int c) : from(a), to(b), cost(c) {}
    bool operator<(const Edge &x) const {
        return cost < x.cost;
    }
};

struct UnionFind {
    int node[1010];
    UnionFind() {
        memset(node, -1, sizeof(node));
    }
    int find(int x) {
        return node[x] < 0 ? x : node[x] = find(node[x]);
    }
    int size(int x) {
        return -node[find(x)];
    }
    bool unite(int x, int y) {
        x = find(x), y = find(y);
        if(x == y) return false;
        if(size(x) > size(y)) swap(x, y);
        node[y] += node[x];
        node[x] = y;
        return true;
    }
};

int main() {
    int N, M;
    while(1) {
        scanf("%d%d", &N, &M);
        if(!N) break;
        vector<Edge> edges;
        for(int i=0; i<M; i++) {
            int s, t, c;
            scanf("%d%d%d", &s, &t, &c); s--; t--;
            edges.push_back(Edge(s, t, c));
        }

        sort(edges.begin(), edges.end());
        vector<int> use_cost;
        UnionFind uf;
        for(int i=0; i<M; i++) {
            Edge e = edges[i];
            if(uf.unite(e.from, e.to)) {
                use_cost.push_back(e.cost);
            }
        }
        int mid = (N-1) / 2;
        printf("%d\n", use_cost[mid]);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: 'vector' was not declared in this scope
   40 |         vector<Edge> edges;
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:40:20: error: expected primary-expression before '>' token
   40 |         vector<Edge> edges;
      |                    ^
a.cc:40:22: error: 'edges' was not declared in this scope
   40 |         vector<Edge> edges;
      |                      ^~~~~
a.cc:48:16: error: expected primary-expression before 'int'
   48 |         vector<int> use_cost;
      |                ^~~
a.cc:53:17: error: 'use_cost' was not declared in this scope
   53 |                 use_cost.push_back(e.cost);
      |                 ^~~~~~~~
a.cc:57:24: error: 'use_cost' was not declared in this scope
   57 |         printf("%d\n", use_cost[mid]);
      |                        ^~~~~~~~
Language: C++

#include <stdio.h>
#include <queue>
#include <iostream>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <cmath>
using namespace std;
#define MAX 1005
int father[MAX];   /* father[x]陦ィ遉コx逧?宛闃らせ*/
int Rank[MAX];     /*Rank[x]陦ィ遉コx逧?キア蠎ヲ*/
struct Edge{
    int from,to,c;
}edge[10005];
int Tot;
void Make_Set(int x)
{
	father[x] = x; //譬ケ謐ョ螳樣刔諠??謖?ョ夂噪辷カ闃らせ蜿ッ蜿伜喧
	Rank[x] = 0;   //譬ケ謐ョ螳樣刔諠??蛻晏ァ句喧遘ゥ荵滓怏謇?序蛹?}

/* 譟・謇セx蜈?エ?園蝨ィ逧?寔蜷?蝗樊コッ譌カ蜴狗シゥ霍ッ蠕?/
int Find_Set(int x)
{
	if (x != father[x])
	{
		father[x] = Find_Set(father[x]); //霑吩クェ蝗樊コッ譌カ逧?視郛ゥ霍ッ蠕?弍邊セ蜊?	}
	return father[x];
}
/*

謖臥ァゥ蜷亥ケカx,y謇?惠逧?寔蜷?
荳矩擇逧?ぅ荳ェif else扈捺桷荳肴弍扈晏ッケ逧?シ悟?菴捺?謐ョ諠??蜿伜喧

菴?弍?悟ョ玲葎譏ッ荳榊序逧?叉?梧潔遘ゥ蜷亥ケカ?悟ョ樊慮譖エ譁ー遘ゥ縲?
*/

void Union(int x, int y)
{
	x = Find_Set(x);
	y = Find_Set(y);
	if (x == y) return;
	if (Rank[x] > Rank[y])
	{
		father[y] = x;
	}
	else
	{
		if (Rank[x] == Rank[y])
		{
			Rank[y]++;
		}
		father[x] = y;
	}
}

int cmp(Edge a,Edge b)
{
    return a.c<b.c;
}
int ans[1005],k;
bool Kruskal(int N,int &mst)
{
    int i,x,y;
    int count=0;//譛?ー冗函謌先焚譚??諤サ蜥鯉シ御ク主キイ豺サ蜉?せ
    mst=0;
    for(i=0;i<N;++i)//蛻晏ァ句喧髮?粋
    Make_Set(i);
    sort(edge,edge+Tot,cmp);
    for(i=0;i<Tot;++i)
    {
        if(count==N-1)
        return true;//莉・謇セ蛻ー譛?ー冗函謌先?
        x=Find_Set(edge[i].from);
        y=Find_Set(edge[i].to);
        if(x!=y)
        {
            Union(x,y);
            //mst+=edge[i].c;
            ans[k++]=edge[i].c;
            ++count;
        }
    }
    return false;
}
int main()
{
    //freopen("a.txt","r",stdin);
    int n,m;
    int u,v,c;
    while(~scanf("%d%d",&n,&m)&&n+m)
    {
        k=0;
        for(int i=0;i<m;++i)
        {
            scanf("%d%d%d",&u,&v,&c);
            edge[i].from=u;
            edge[i].to=v;
            edge[i].c=c;
        }
        Tot=m;
        Kruskal(n,c);
        printf("%d\n",ans[(n>>1)-1]);
    }
    return 0;
}

Compiler output:
a.cc: In function 'void Make_Set(int)':
a.cc:39:1: error: a function-definition is not allowed here before '{' token
   39 | {
      | ^
a.cc:58:1: error: a function-definition is not allowed here before '{' token
   58 | {
      | ^
a.cc:63:1: error: a function-definition is not allowed here before '{' token
   63 | {
      | ^
a.cc:86:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   86 | int main()
      |         ^~
a.cc:86:9: note: remove parentheses to default-initialize a variable
   86 | int main()
      |         ^~
      |         --
a.cc:86:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:87:1: error: a function-definition is not allowed here before '{' token
   87 | {
      | ^
a.cc:106:2: error: expected '}' at end of input
  106 | }
      |  ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class StackMaze {
	static Scanner sc = new Scanner(System.in);
	static int H, W;
	static char[][] f;
	static int[][][] hole = new int[26][50][51];
	static boolean[][][][] reach;
	static int[][][][] dp;

	public static void main(String[] args) {
		while (true) {
			H = sc.nextInt();
			W = sc.nextInt();
			if (H == 0) break;
			f = new char[H][];
			for (int i = 0; i < H; ++i) {
				f[i] = sc.next().toCharArray();
				for (char j = 'A'; j <= 'Z'; ++j) {
					int pos = 0;
					for (int x = 0; x < W; ++x) {
						if (f[i][x] == j) hole[j - 'A'][i][pos++] = x;
					}
					hole[j - 'A'][i][pos] = 99;
				}
			}
			System.out.println(solve());
		}
	}

	static int solve() {
		reach = new boolean[H][W][H][W];
		dp = new int[H][W][H][W];
		for (int y1 = H - 1; y1 >= 0; --y1) {
			for (int x1 = W - 1; x1 >= 0; --x1) {
				if (f[y1][x1] == '#') continue;
				reach[y1][x1][y1][x1] = true;
			}
		}
		for (int h = 0; h < H; ++h) {
			for (int w = 0; w < W; ++w) {
				for (int y1 = 0; y1 < H - h; ++y1) {
					for (int x1 = 0; x1 < W - w; ++x1) {
						update(y1, x1, y1 + h, x1 + w);
					}
				}
			}
		}
		return reach[0][0][H - 1][W - 1] ? dp[0][0][H - 1][W - 1] : -1;
	}

	static void update(int y1, int x1, int y2, int x2) {
		char v1 = f[y1][x1];
		if (v1 == '#') return;
		char v2 = f[y2][x2];
		if (v2 == '#') return;
		if (!(y2 > 0 && reach[y1][x1][y2 - 1][x2] || x2 > 0 && reach[y1][x1][y2][x2 - 1])) return;
		reach[y1][x1][y2][x2] = true;
		if (!('a' <= v1 && v1 <= 'z')) {
			if (y1 < H - 1) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1 + 1][x1][y2][x2]);
			if (x1 < W - 1) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1 + 1][y2][x2]);
		} else if (!('A' <= v2 && v2 <= 'Z')) {
			if (y2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1][y2 - 1][x2]);
			if (x2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1][y2][x2 - 1]);
		} else {
			if (v1 - 'a' == v2 - 'A') {
				if (y1 < H - 1 && y2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1 + 1][x1][y2 - 1][x2] + 1);
				if (y1 < H - 1 && x2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1 + 1][x1][y2][x2 - 1] + 1);
				if (x1 < W - 1 && y2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1 + 1][y2 - 1][x2] + 1);
				if (x1 < W - 1 && x2 > 0) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1 + 1][y2][x2 - 1] + 1);
			}
			for (int y = y1; y <= y2; ++y) {
				for (int i = 0; hole[v1 - 'a'][y][i] <= x2; ++i) {
					int x = hole[v1 - 'a'][y][i];
					if (x < x1) continue;
					if (y < H - 1) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1][y][x] + dp[y + 1][x][y2][x2]);
					if (x < W - 1) dp[y1][x1][y2][x2] = Math.max(dp[y1][x1][y2][x2], dp[y1][x1][y][x] + dp[y][x + 1][y2][x2]);
				}
			}
		}
	}
}

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

// ConsoleApplication22.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
//

#include <cstdio>
#include<iostream>
#include<vector>
#include<utility>
#include<cctype>
#include<algorithm>

using namespace std;

int H, W;
char C[50][52];
vector<pair<int, int> > p[256];
bool memed[52][52][52][52];
int mem[52][52][52][52];

int rec(int hy, int hx, int ty, int tx) {
	if (ty < hy || tx < hx || C[hy][hx] == '#')return -1e9;
	if (hy == ty&&hx == tx)return 0;
	if (memed[hy][hx][ty][tx]++)return mem[hy][hx][ty][tx];
	int mx = max(rec(hy + 1, hx, ty, tx), rec(hy, hx + 1, ty, tx));//??????????????£?????´???
	if (islower(C[hy][hx])) {
		for (auto e : p[toupper(C[hy][hx])]) {
			if (ty < e.first || tx < e.second || e.first < hy || e.second < hx)continue;
			int sx = -1e9;
			if (hy + 1 == e.first&&hx == e.second || hy == e.first&&hx + 1 == e.second) {
				sx = 1;
			}else {
				for (int i = 0; i < 2; i++) {
					for (int j = 0; j < 2; j++) {
						sx = max(sx, rec(hy + i, hx + (i ^ 1), e.first - j, e.second - (j ^ 1)) + 1);
					}
				}
			}
			if (e.first == ty&&e.second == tx) {
				mx = max(mx, sx);
			}
			else {
				for (int i = 0; i < 2; i++) {//00,01->(0,1),(1,0)
					mx = max(mx, sx + rec(e.first + i, e.second + (i ^ 1), ty, tx));
				}
			}
		}
	}
	return mem[hy][hx][ty][tx] = mx;
}

int main() {
	while (cin >> H >> W, H | W) {
		fill(***begin(memed), ***end(memed), false);
		for (auto &e : p) {
			e.clear();
		}
		for (int i = 0; i < H; i++) {
			cin >> C[i];
			for (int j = 0; j < W; j++) {
				p[C[i][j]].emplace_back(i, j);
			}
		}
		int ans = rec(0, 0, H - 1, W - 1);
		cout << ((ans < 0) ? -1 : ans) << endl;
	}
}

Compiler output:
a.cc: In function 'int rec(int, int, int, int)':
a.cc:22:33: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   22 |         if (memed[hy][hx][ty][tx]++)return mem[hy][hx][ty][tx];
      |             ~~~~~~~~~~~~~~~~~~~~^
Language: C++

#include <bits/stdc++.h>
#define INF 100000000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,P> PP;
typedef pair<ll,int> PPP;

struct edge{
	int t;
	ll c;
	edge(){}
	edge(int tt,ll cc){
		t=tt;
		c=cc;
	}
};

int n,m,s1,s2,t;
ll a[2001],b[2001];
string w[2001];
vector<edge> G[1001];
vector<edge> G2[1001];
ll dist[2][1001][101];

ll labs(ll x){
	if(x<0LL)return -x;
	return x;
}

ll getnumber(string s){
	ll ans=0;
	for(int i=0;i<s.size();i++){
		ans*=10LL;
		ans+=(ll)(s[i]-'0');
	}
	return ans;
}

int ag2;

void dijk(int type,int s){
	dist[type][s][0]=0;
	priority_queue<PP,vector<PP>,greater<PP> > que;
	que.push(PP(0,P(s,0)));
	while(que.size()){
		PP p=que.top();
		que.pop();
		ll curc=p.first;
		int curv=p.second.first;
		int curu=p.second.second;
		if(dist[type][curv][curu]<curc)continue;
		for(int i=0;i<G[curv].size();i++){
			edge e=G[curv][i];
			if(e.c+dist[type][curv][curu]<dist[type][e.t][curu]){
				dist[type][e.t][curu]=e.c+dist[type][curv][curu];
				que.push(PP(dist[type][e.t][curu],P(e.t,curu)));
			}
		}
		for(int i=0;i<G2[curv].size();i++){
			edge e=G2[curv][i];
			if(e.c+dist[type][curv][curu]<dist[type][e.t][curu+1]){
				dist[type][e.t][curu+1]=e.c+dist[type][curv][curu];
				que.push(PP(dist[type][e.t][curu+1],P(e.t,curu+1)));
			}
		}
	}
}

ll getMin(int i,int j){
	if(i==j){
		if(dist[0][t][i]>=INF)return INF;
		if(dist[1][t][j]>=INF)return INF;
		return labs(dist[0][t][i]-dist[1][t][j]);
	}
	ll b=(ll)(dist[1][t][j]-dist[0][t][i])/(i-j);
	ll ans=INF;
	for(ll k=max(b-1LL,0LL);k<=b+1LL;k++){
		vector<PPP> vec;
		for(ll l=0;l<=ag2;l++){
			vec.push_back(PPP(dist[0][t][l]+l*k,0));
			vec.push_back(PPP(dist[1][t][l]+l*k,1));
		}
		sort(vec.begin(),vec.end());
		for(int l=0;l<(int)vec.size()-1;l++){
			if(vec[l].first>=INF)continue;
			if(vec[l].second!=vec[l+1].second){
				ans=min(ans,vec[l+1].first-vec[l].first);
			}
		}
	}
	return ans;
}

void solve(){
	ll l=0,r=1000000000001LL;
	for(int i=0;i<n;i++){
		G[i].clear();
		G2[i].clear();
	}
	if(ag2>100)return 0;
	for(int i=0;i<m;i++){
		if(w[i]!="x"){
			ll val=getnumber(w[i]);
			G[a[i]].push_back(edge(b[i],val));
			G[b[i]].push_back(edge(a[i],val));
		}else{
			G2[a[i]].push_back(edge(b[i],0));
			G2[b[i]].push_back(edge(a[i],0));
		}
	}
	for(int i=0;i<2;i++){
		for(int j=0;j<n;j++){
			for(int k=0;k<=ag2;k++){
				dist[i][j][k]=INF;
			}
		}
	}
	dijk(0,s1);
	dijk(1,s2);
	ll ans=INF;
	for(int i=0;i<=ag2;i++){
		for(int j=0;j<=ag2;j++){
			ans=min(ans,getMin(i,j));
		}
	}
	printf("%lld\n",ans);
}

int main(void){
	while(1){
		scanf("%d%d%d%d%d",&n,&m,&s1,&s2,&t);
		if(n==0 && m==0 && s1==0 && s2==0 && t==0)break;
		s1--;
		s2--;
		t--;
		ag2=0;
		for(int i=0;i<m;i++){
			cin >> a[i] >> b[i] >> w[i];
			a[i]--;
			b[i]--;
			if(w[i]=="x")ag2++;
		}
		solve();
	}
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:101:27: error: return-statement with a value, in function returning 'void' [-fpermissive]
  101 |         if(ag2>100)return 0;
      |                           ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int a,b;
  cin>>a>>b;
  string ans="kogakubu10gokan";
  rep(i,a){
    string s,int n;
    cin>>n>>s;
    if(n<=b)ans=s;
  }
  cout<<ans<<endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected unqualified-id before 'int'
   24 |     string s,int n;
      |              ^~~
a.cc:25:10: error: 'n' was not declared in this scope
   25 |     cin>>n>>s;
      |          ^
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <map>
#include <set>
#include <stack>
#include <queue>
 
using namespace std;
 
#define pb(n)	push_back(n)
#define mp(n,m) make_pair(n,m)
#define fi 	first
#define se 	second
#define all(r) (r).begin(),(r).end()
 
#define REP(i,s,e)	for(ll i=(s); i<(e); i++)
#define rep(i,n)	REP(i,0,n)
#define REPE(i,s,e)	for(ll i=s; i>e; i--)
#define repe(i,n)	REPE(i,n,-1)
 
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<vi> vvi;
 
const int IMAX=((1<<30)-1)*2+1;
const int INF=100000000;
const double EPS=1e-10;
//int mod=1000000007




int main(){
	int n, m;
	cin>>n>>m;
	map<int,string> mp;
	int t;
	string s;
	for(int i = 0; i < n; i++) {
		cin>>t>>s;
		mp[t] = s;
	}
	m[0] = "kogakubu10gokan";
	auto it = mp.upper_bound(m);
	it--;
	cout<<it->se<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:10: error: invalid types 'int[int]' for array subscript
   57 |         m[0] = "kogakubu10gokan";
      |          ^
Language: C++

#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <queue>
#define rep(i,n) for(int i = 0; i < n; ++i)
#define rrep(i,n) for(int i = 1; i <= n; ++i)
using namespace std;
typedef pair<int,int> P;
const int INF = 1000000000;

int main(){
	int n,q,a;
	char s[50],e[50];
	rep(i,n){
		sacnf("%d%s",a,s);
		if(a<=q)strcpy(e,s);
	} 
	printf("%s\n",e);
	return 0;
}

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

using System;
using System.Linq;

namespace Aizu {
    public class OnlineJudge {
        static void Main() {
            var name = "kogakubu10gokan";
            var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            for (var i = 0; i < input[0]; ++i) {
                var year = Console.ReadLine().Split();
                if (int.Parse(year[0]) > input[1]) {
                    for (Console.WriteLine(name); ++i < input[0]; Console.ReadLine());
                    return;
                }

                name = year[1];
            }

            Console.WriteLine(name);
        }
    }
}



Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Linq;
      |       ^~~~~~
a.cc:5:5: error: expected unqualified-id before 'public'
    5 |     public class OnlineJudge {
      |     ^~~~~~
Language: C

#include<stdio.h>

int N,X,M,L[11],R[11],S[11],i,C[11],dp[11];

int dfs(int d)
{
	int i;
	if(d==N)
	{
		for(i=0,dp[0]=0;i<N;i++)dp[i+1]=dp[i]+C[i];
		for(i=0;i<M;i++)
		{
			if(dp[R[i]]-dp[L[i]]!=S[i])return 0;
		}
		for(i=0;i<N;i++)
			printf("%d%s",dp[i+1],i==N-1?"\n":" ");
		return 1;
	}
	for(i=0;i<=X;i++)
	{
		C[d]=i;
		if(dfs(d+1))
			return 1;
	}
	return 0;
}

int main()
{
	scanf("%d%d%d",&N,&X,&M);
	for(i=0;i<M;i++)javascript:void(0)
		scanf("%d%d%d",L+i,R+i,S+i);
	if(!dfs(0))puts("-1");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:36: error: expected expression before 'void'
   31 |         for(i=0;i<M;i++)javascript:void(0)
      |                                    ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
#define f(a) for(a=0;a<=x;a++)
struct com{
    bool operator()(const vector<int>& v1,const vector<int>& v2){
        int s1=0,s2=0;
        for(int i=0;i<v1.size();i++)s1+=v1[i];
        for(int i=0;i<v2.size();i++)s2+=v2[i];
        return s1>s2;
    }
} com;
int main(){
    int n,x,m;
    cin>>n>>x>>m;
    vector<vector<int> >vec;
    int l[12],r[12],s[12],o[7];
    for(int i=0;i<m;i++){
        cin>>l[i]>>r[i]>>s[i];
    }
    f(o[0])f(o[1])f(o[2])f(o[3])f(o[4])f(o[5]){
        bool ok=true;
        for(int i=0;i<m;i++){
            int c=0;
            for(int j=l[i]-1;j<=r[i]-1;j++){
                c+=o[j];
            }
            if(c!=s[i]){
                ok=false;
                break;
            }
        }
        if(ok){
            vector<int>v;
            for(int i=0;i<n;i++){
                v.push_back(o[i]);
            }
            vec.push_back(v);
        }
    }
    if(vec.size()==0){
        cout<<-1<<endl;
        return 0;
    }
    sort(vec.begin(),vec.end(),com);
    for(int i=0;i<vec[0].size()-1;i++){
        cout<<vec[0][i]<<" ";
    }
    cout<<vec[0][vec[0].size()-1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   45 |     sort(vec.begin(),vec.end(),com);
      |     ^~~~
      |     short
Language: C++

#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<functional>
#include<algorithm>
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


int n,x,m;
int l[10],r[10],s[10];
int lion[7]={};

int ans[6]={-1},ma=-1;


bool ok(){
	rep(i,m){
		if(lion[l[i]]-lion[r[i]+1]!=s[i])return false;
	}
	return true;
}
void dfs(int d){
	if(d==-1){
		if(ok()&&ma<lion[0]){
			ma=lion[0];
			rep(i,n){
				ans[i]=lion[i]-lion[i+1];
			}
		}
		return;
	}
	rep(i,x+1){
		lion[d]=lion[d+1]+i;
		dfs(d-1);
	}
}
int main(){
	cin>>n>>x>>m;
	bool impossible=false;
	rep(i,m){
		cin>>l[i]>>r[i]>>s[i];
		l[i]--;r[i]--;
	}
	dfs(n-1);
	if(ans[0]==-1){
		cout<<-1<<endl;
	}
	else{
		cout<<ans[0];
		rep(i,n-1)cout<<' '<<ans[i+1];
		cout<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'cin' was not declared in this scope
   44 |         cin>>n>>x>>m;
      |         ^~~
a.cc:10:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    9 | #include<algorithm>
  +++ |+#include <iostream>
   10 | #define INF (1<<29)
a.cc:52:17: error: 'cout' was not declared in this scope
   52 |                 cout<<-1<<endl;
      |                 ^~~~
a.cc:52:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:52:27: error: 'endl' was not declared in this scope
   52 |                 cout<<-1<<endl;
      |                           ^~~~
a.cc:10:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    9 | #include<algorithm>
  +++ |+#include <ostream>
   10 | #define INF (1<<29)
a.cc:55:17: error: 'cout' was not declared in this scope
   55 |                 cout<<ans[0];
      |                 ^~~~
a.cc:55:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:57:23: error: 'endl' was not declared in this scope
   57 |                 cout<<endl;
      |                       ^~~~
a.cc:57:23: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
Language: C++

#include <cstdio>
#include <algorithm>

using namespace std;

#define MAX_N 7
#define MAX_M 11

struct P{
  int l, r, s;

  bool operator < (const P p)const{
    if(l != p.l){
      return l < p.l;
    }else{
      return r < p.r;
    }
  }
};

int N, X, M;
P p[MAX_M];

bool check(int lion[]){
  for(int i = 0 ; i < M ; i++){
    if(lion[p[i].r] - lion[p[i].l-1] != p[i].s){
      return false;
    }
  }
  return true;
}

void print(int lion[]){
  for(int i = 0 ; i < N ; i++){
    printf("%d%c",lion[i], i != N-1 ? ' ' : '\n');
  }
}

bool rec(int pos, int lion[]){
  if(pos == N){
    if(check(lion)){
      return true;
    }else{
      return false;
    }
  }

  for(int i = X ; i >= 0 ; i--){
    lion[pos] = i;
    if(rec(pos+1, lion)){
      return true;
    }
  }
  return false;
}

void solve(){
  int lion[MAX_N];
  memset(lion, 0, sizeof(lion));

  if(rec(0, lion)){
    print(lion);
  }else{
    printf("-1\n");
  }
}

int main(){
  scanf("%d%d%d" ,&N ,&X, &M);
  for(int i = 0 ; i < M ; i++){
    scanf("%d%d%d" ,&p[i].l , &p[i].r, &p[i].s);
  }
  sort(p, p+M);
  solve();

  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:59:3: error: 'memset' was not declared in this scope
   59 |   memset(lion, 0, sizeof(lion));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: C++

#include <stdio.h>
int n, a[200000], ret;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		if(i) if(a[i - 1] < a[i]) ret++;
	}
	printf("%d\n", ret + (N ? a[0] > a[1] ? 1 : 0 : 0) + 1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: 'N' was not declared in this scope
    9 |         printf("%d\n", ret + (N ? a[0] > a[1] ? 1 : 0 : 0) + 1);
      |                               ^
Language: C++

#include <stdio.h>
int n, a[200000], ret;
int main() {
	scanf("%d", &n);
	for(int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		if(i) if(a[i - 1] < a[i]) ret++;
	}
	printf("%d\n", ret + (N ? (a[0] > a[1] ? 1 : 0) : 0) + 1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: 'N' was not declared in this scope
    9 |         printf("%d\n", ret + (N ? (a[0] > a[1] ? 1 : 0) : 0) + 1);
      |                               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(ll i=(a);i<ll(b);i++)
#define rep(i,b) loop(i,0,b)

#ifdef DEBUG
#define dump(x) cerr << #x << " =  " << x << endl;
#endif

int get(){
    int dice;
    scanf("%d", &dice);
    return dice-1;
}

void put(int dir){
    printf("%d\n",dir); fflush(stdout);
}

int main(){
    srand(time(0));
    int M;
    cin >> M;
    int a[6];
    rep(i,6) cin >> a[i];
    int s,g;
    cin >> s >> g;
    s--, g--;
    int m[400];
    rep(i,M) cin >> m[i];
    int cur = s;
    rep(step,3000){
        dump(step);
        dump(cur);
        int x = get();
        int cand_[3];
        int * cand = cand_+1;
        cand[0] = cur;
        for(int i : {1,-1}){
            cand[i] = cur + a[x]*i;
            cand[i] += m[cand[i]];
            if(cand[i] < 0 || M <= cand[i]) cand[i] = -1;
        }
        int opt;
        do {
            opt = rand()%3-1;
        } while(cand[opt] == -1);
        put(opt);
        cur = cand[opt];
        if(cur == g){
            exit(0);
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'dump' was not declared in this scope; did you mean 'dup'?
   34 |         dump(step);
      |         ^~~~
      |         dup
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(ll i=(a);i<ll(b);i++)
#define rep(i,b) loop(i,0,b)

#ifdef DEBUG
#define dump(x) cerr << #x << " =  " << x << endl;
#endif
#else
#define dump(...)
#endif

int get(){
    int dice;
    scanf("%d", &dice);
    return dice-1;
}

void put(int dir){
    printf("%d\n",dir); fflush(stdout);
}

int main(){
    srand(time(0));
    int M;
    cin >> M;
    int a[6];
    rep(i,6) cin >> a[i];
    int s,g;
    cin >> s >> g;
    s--, g--;
    int m[400];
    rep(i,M) cin >> m[i];
    int cur = s;
    rep(step,3000){
        dump(step);
        dump(cur);
        int x = get();
        int cand_[3];
        int * cand = cand_+1;
        cand[0] = cur;
        for(int i : {1,-1}){
            cand[i] = cur + a[x]*i;
            cand[i] += m[cand[i]];
            if(cand[i] < 0 || M <= cand[i]) cand[i] = -1;
        }
        int opt;
        do {
            opt = rand()%3-1;
        } while(cand[opt] == -1);
        put(opt);
        cur = cand[opt];
        if(cur == g){
            exit(0);
        }
    }
}

Compiler output:
a.cc:10:2: error: #else without #if
   10 | #else
      |  ^~~~
a.cc:12:2: error: #endif without #if
   12 | #endif
      |  ^~~~~
Language: C++

#include<cstdio>
#include<vector>
#include<cstring>
#include<queue>
#include<cassert>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int m,a[6],s,g,n[330];
int d[330];
vector<int> G[330];

int main(){
  scanf("%d",&m);
  rep(i,6)scanf("%d",a+i);
  scanf("%d%d",&s,&g); s--; g--;
  rep(i,m)scanf("%d",n+i);

  rep(i,m)rep(j,6){
    int nxt = i+a[j];
    if(0<=nxt && nxt<m){
      nxt += n[nxt];
      G[nxt].push_back(i);
    }
    nxt = i-a[j];
    if(0<=nxt && nxt<m){
      nxt += n[nxt];
      G[nxt].push_back(i);
    }
  }
  
  memset(d,-1,sizeof(d));
  d[g] = 0;
  queue<int> q;
  q.push(g);

  while(q.size()){
    int cur = q.front(); q.pop();
    rep(i,G[cur].size()){
      int nxt = G[cur][i];
      if(d[nxt]<0){
	d[nxt] = d[cur]+1;
	q.push(nxt);
      }
    }
  }

  while(true){
    int dice;
    scanf("%d",&dice); dice--;

    int res = 0, nxt = s + a[dice];
    if(0<=nxt && nxt<m){
      nxt += n[nxt];
      if(d[nxt]>=0 && d[s]>d[nxt]){
      s = nxt; res = 1;
    } 

    nxt = s - a[dice];
    if(0<=nxt && nxt<m){
      nxt += n[nxt];
      if(d[nxt]>=0 && d[s]>d[nxt]){
      s = nxt; res = -1;
    } 
    
    printf("%d\n",res); fflush(stdout);
    if(s == g)return 0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:2: error: expected '}' at end of input
   69 | }
      |  ^
a.cc:48:14: note: to match this '{'
   48 |   while(true){
      |              ^
a.cc:69:2: error: expected '}' at end of input
   69 | }
      |  ^
a.cc:13:11: note: to match this '{'
   13 | int main(){
      |           ^
Language: C++

n = 40
k = 5
 
print n
a = [[] for i in range(n)]
for i in range(n):
  for j in range(n):
    if i == j:
      a[i].append("N")
      continue
 
    if i < k:
      if j >= k:
        a[i].append("Y")
      else:
        a[i].append("Y")
    else:
      if j >= k:
        a[i].append("N")
      else:
        a[i].append("Y")
 
for i in range(n):
  print "".join(a[i])

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = 40
      | ^
Language: C

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iomanip>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<list>

using namespace std;
typedef long long LL;
typedef unsigned long long ULL;

#define rep(i,k,n) for(int i=(k);i<=(n);i++)
#define red(i,k,n) for(int i=(k);i>=(n);i--)
#define sqr(x) ((x)*(x))
#define clr(x,y) memset((x),(y),sizeof(x))
#define mod 1000000007
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)>(b)?(b):(a))
//const int maxn = ;

int n,m;
int skl[110][110];
int skr[110][110];
int in[110];
int out[110];
bool vis[110];
vector<int> e[110];
queue<int> q;

char s[10];

bool solve()
{
    int kk,num,p,v;
    rep(i,1,n)rep(j,1,m)skl[i][j]=0,skr[i][j]=100;
    rep(i,1,n)
    {
        scanf("%d",&kk);
        rep(j,1,kk)
        {
            scanf("%d%s%d",&num,s,&p);
            if(s[0]=='>')
            {
                if(skl[i][num]<p)
                {
                    if(skr[i][num]<p)
                    {
                        return 0;
                    }
                    else skl[i][num]=p;
                }
            }
            else if(s[0]=='<')
            {
                if(skr[i][num]>p)
                {
                    if(skl[i][num]>p)
                    {
                        return 0;
                    }
                    else skr[i][num]=p;
                }
            }

        }
        e[i].clear();
    }
    clr(in,0);
    clr(out,0);
    rep(i,1,n)
    {
        rep(j,1,n)
        {
            if(i==j)continue;
            bool flag=true;
            rep(k,1,m)
            {
                if(skr[j][k]<skl[i][k])
                {
                    flag=false;
                    break;
                }
            }
            if(flag)
            {
                e[i].push_back(j);
                in[j]++;
                out[i]++;
            }
        }
    }
    int cnt;
    rep(i,1,n)
    {
        clr(vis,0);
        cnt=0;q.push(i);vis[i]=1;cnt++;
        while(!q.empty())
        {
            p=q.front();
            q.pop();
            if(!e[p].empty())
            {
                rep(i,0,e[p].size()-1)
                {
                    v=e[p][i];
                    if(vis[v])continue;
                    q.push(v);
                    vis[v]=1;
                    cnt++;
                }
            }
        }
        if(cnt==n)return 1;
    }
    return 0;
}

int main()
{
//#define LOCAL
#ifdef LOCAL
    freopen("e:\\read.txt","r",stdin);
    //freopen("e:\\write.txt","w",stdout);
#endif
    while(cin>>n>>m)
    {
        if(solve())puts("Yes");
        else puts("No");
    }


    return 0;
}

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

#include <vector>
#include <iostream>
#include <set>
#include <cstdio>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <tuple>
#include <algorithm>
#include <limits>
#include <map>

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const int MN = 110;
int V;
vector<int> G[MN];
vector<int> rG[MN];
vector<int> vs;
bool used[MN];
int cmp[MN];

void add_edge(int from, int to) {
    G[from].push_back(to);
    rG[to].push_back(from);
}

void dfs(int v) {
    used[v] = true;
    for(int i=0;i<G[v].size();i++) {
        if(!used[G[v][i]]) dfs(G[v][i]);
    }
    vs.push_back(v);
}

void rdfs(int v, int k) {
    used[v] = true;
    cmp[v] = k;
    for(int i=0;i<rG[v].size();i++) {
        if (!used[rG[v][i]]) rdfs(rG[v][i], k);
    }
}

int scc() {
    memset(used, 0, sizeof(used));
    vs.clear();
    for(int v=0;v<V;v++) {
        if (!used[v]) dfs(v);
    }
    memset(used, 0, sizeof(used));
    int k = 0;
    for(int i=vs.size() - 1; i >= 0; i--) {
        if (!used[vs[i]]) rdfs(vs[i], k++);
    }
    return k;
}
int m;
int g[MN][MN];
bool solve() {
    for (int i = 0; i < m; i++) {
        if (g[i][i]) return false;
    }
    V = m;
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < m; j++) {
            if (g[i][j]) add_edge(i, j);
        }
    }
    scc();
    int c[MN] = {};
    for (int i = 0; i < m; i++) {
        c[cmp[i]]++;
    }
    for (int i = 0; i < MN; i++) {
        if (c[i] > 1) return false;
    }
    return true;
}

int main() {
    int n;
    int s[MN][MN][2];
    for (int i = 0; i < MN; i++) {
        for (int j = 0; j < MN; j++) {
            s[i][j][0] = 0;
            s[i][j][1] = 1000;
        }
    }
    cin >> m >> n;
    for (int i = 0; i < m; i++) {
        int k;
        cin >> k;
        for (int j = 0; j < k; j++) {
            int a, b;
            char c;
            scanf("%d %c= %d", &a, &c, &b);
            s[i][a][(c == '<') ? 1 : 0] = b;
        }
    }
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < m; j++) {
            bool f = false;
            for (int k = 0; k < MN; k++) {
                if (s[i][k][0] > s[j][k][1]) {
                    f = true;
                }
            }
            g[i][j] = f ? 1 : 0;
        }
    }
    if (solve()) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int scc()':
a.cc:51:5: error: 'memset' was not declared in this scope
   51 |     memset(used, 0, sizeof(used));
      |     ^~~~~~
a.cc:15:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   14 | #include <map>
  +++ |+#include <cstring>
   15 |
Language: C++

#include<iostream>
#include<bitset>
#include<vector>
#include<numeric>
#include<algorithm>

using namespace std;

typedef bitset<300000> BS;

BS ref;
BS is[3000];
vector<int> idx;
int a[32345],b[32345];

int rec(const BS &bs,int nth,int r){
  if(r<0)return r;
  if(bs==ref)return r;
  while((is[idx[nth]]&~bs).none()){
    nth++;
  }
  BS n=is[idx[nth]]&~bs;
  if(n.count()==1){
    for(int i=0;;i++){
      if(n[i]){
	return rec(bs|is[a[i]^b[i]^idx[nth]],nth+1,r-1);
      }
    }
  }else{
    int rv=rec(bs|is[idx[nth]],nth+1,r-1);
    BS o=bs;
    int c=0;
    for(int i=0;n.any();i++){
      if(n[i]){
	o|=bs|is[a[i]^b[i]^idx[nth]];
	c++;
	n[i]=false;
      }
    }
    return max(rv,rec(o,nth+1,r-c));
  }
}

int main(){
  int N,M,K;
  cin>>N>>M>>K;
  int pop[32345]={};
  for(int i=0;i<M;i++){
    ref[i]=true;
    cin>>a[i]>>b[i];
    a[i]--;
    b[i]--;
    pop[a[i]]++;
    pop[b[i]]++;
    is[a[i]][i]=true;
    is[b[i]][i]=true;
  }
  idx.resize(N);
  iota(begin(idx),end(idx),0);
  sort(begin(idx),end(idx),[pop](int a,int b){
      return pop[a]>pop[b];
    });
  int r=rec(BS(),0,K);
  if(r<0){
    cout<<"Impossible"<<endl;
  }else{
    cout<<K-r<<endl;
  }
}

Compiler output:
a.cc: In function 'int rec(const BS&, int, int)':
a.cc:18:10: error: reference to 'ref' is ambiguous
   18 |   if(bs==ref)return r;
      |          ^~~
In file included from /usr/include/c++/14/string:52,
                 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:1:
/usr/include/c++/14/bits/refwrap.h:445:5: note: candidates are: 'template<class _Tp> std::reference_wrapper<_Tp> std::ref(reference_wrapper<_Tp>)'
  445 |     ref(reference_wrapper<_Tp> __t) noexcept
      |     ^~~
/usr/include/c++/14/bits/refwrap.h:436:10: note:                 'template<class _Tp> void std::ref(const _Tp&&)'
  436 |     void ref(const _Tp&&) = delete;
      |          ^~~
/usr/include/c++/14/bits/refwrap.h:425:5: note:                 'template<class _Tp> std::reference_wrapper<_Tp> std::ref(_Tp&)'
  425 |     ref(_Tp& __t) noexcept
      |     ^~~
a.cc:11:4: note:                 'BS ref'
   11 | BS ref;
      |    ^~~
a.cc: In function 'int main()':
a.cc:49:5: error: reference to 'ref' is ambiguous
   49 |     ref[i]=true;
      |     ^~~
/usr/include/c++/14/bits/refwrap.h:445:5: note: candidates are: 'template<class _Tp> std::reference_wrapper<_Tp> std::ref(reference_wrapper<_Tp>)'
  445 |     ref(reference_wrapper<_Tp> __t) noexcept
      |     ^~~
/usr/include/c++/14/bits/refwrap.h:436:10: note:                 'template<class _Tp> void std::ref(const _Tp&&)'
  436 |     void ref(const _Tp&&) = delete;
      |          ^~~
/usr/include/c++/14/bits/refwrap.h:425:5: note:                 'template<class _Tp> std::reference_wrapper<_Tp> std::ref(_Tp&)'
  425 |     ref(_Tp& __t) noexcept
      |     ^~~
a.cc:11:4: note:                 'BS ref'
   11 | BS ref;
      |    ^~~