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

#include <iostream>
#include <vector>

using namespace std;

constexpr int MAX = 100000;

int res;
int num[MAX], visited[MAX];

void dfs(int v, int c, const vector<int>& a)
{
    visited[v] = 0; num[v] = c;
    int to = (v + a[v]) % a.size();
    if (visited[to] == -1) {
        dfs(to, c + 1, a);
    } else if(visited[to] == 0) {
        res += num[v] - num[to] + 1;
        return;
    }
    visited[v] = 1;
}

int main()
{
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    
    memset(num, -1, sizeof(num));
    memset(visited, -1, sizeof(visited));
    
    res = 0;
    for (int i = 0; i < N; i++) {
        if (visited[i] == -1) {
            dfs(i, 1, a);
        }
    }
    cout << res << endl;
    return 0;
}

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

#include <vector>
#include <iostream>
using namespace std;
int n, a[100009]; bool cycle[100009], vis1[100009], vis2[100009];
int main() {
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	for (int i = 0; i < n; i++) {
		vector<int> w;
		int p = i;
		while (!vis1[p]) {
			p = (p + a[p]) % n;
			if (vis2[p]) {
				int pos = find(w.begin(), w.end(), p) - w.begin();
				for (int j = pos; j < w.size(); j++) cycle[j] = true;
				break;
			}
			w.push_back(p);
			vis2[p] = true;
		}
		for (int j : w) vis1[j] = true, vis2[j] = false;
	}
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		if (cycle[i]) cnt++;
	}
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:47: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   14 |                                 int pos = find(w.begin(), w.end(), p) - w.begin();
      |                                           ~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT, std::char_traits<_CharT> > >::__type std::find(istreambuf_iterator<_CharT, char_traits<_CharT> >, istreambuf_iterator<_CharT, char_traits<_CharT> >, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:14:47: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT, std::char_traits<_CharT> >'
   14 |                                 int pos = find(w.begin(), w.end(), p) - w.begin();
      |                                           ~~~~^~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<map>
#include<unordered_map>
using namespace std;

bool a[10000],s[10000];
int b[10000], c[10000];
signed main() {
	int d, sum = 0;
	cin >> d;
	for (int e = 0; e < d; e++) {
		scanf("%d", &b[e]);
	}
	for (int i = 0; i < d; i++) {
		if (!a[i]) {
			memset(c, 0, sizeof(c));
			int now = i;
			while (1) {
				a[now] = true;
				if (c[now] == 2)break;
				else if (c[now] == 1)s[now] = true;
				c[now]++;
				now += b[now];
				now %= d;
			}
		}
	}
	for (bool u : s)sum += u;
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:25: error: 'memset' was not declared in this scope
   25 |                         memset(c, 0, sizeof(c));
      |                         ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include<map>
  +++ |+#include <cstring>
   12 | #include<unordered_map>
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<stack>
#include<functional>
#include<list>
#include<map>
#include<unordered_map>
using namespace std;

bool a[100000],s[100000];
int b[100000], c[100000];
signed main() {
	int d, sum = 0;
	cin >> d;
	for (int e = 0; e < d; e++) {
		scanf("%d", &b[e]);
	}
	for (int i = 0; i < d; i++) {
		if (!a[i]) {
			memset(c, 0, sizeof(c));
			int now = i;
			while (1) {
				a[now] = true;
				if (c[now] == 2)break;
				else if (c[now] == 1)s[now] = true;
				c[now]++;
				now += b[now];
				now %= d;
			}
		}
	}
	for (bool u : s)sum += u;
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:25: error: 'memset' was not declared in this scope
   25 |                         memset(c, 0, sizeof(c));
      |                         ^~~~~~
a.cc:12:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   11 | #include<map>
  +++ |+#include <cstring>
   12 | #include<unordered_map>
Language: C++

#include <iostream>
#include <queue>

using namespace std;

int n, a[100000], v[100000];

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    
    for (int i = 0; i < n; ++i) {
        if (v[i] == 0) {
            int t = i;
            queue<int> q;
            while (1) {
                if (v[t] == 1) { //?????????
                    while (!q.empty()) {
                        if (q.front() != t)
                            v[q.front()] = 2;
                        else
                            break;
                        q.pop();
                    }
                    break;
                }
                
                v[t] = 1;
                q.push(t);
                
                (t += a[t]) %= n;
            }
        }
    }
    
    cout << count(v, v + n, 1) << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:13: error: 'count' was not declared in this scope
   37 |     cout << count(v, v + n, 1) << endl;
      |             ^~~~~
Language: C++

#include<iostream>
using namespace std;
int n;
#define MAX 100005
int a[MAX], x[MAX], y[MAX];

int main() {
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	memset(x, -1, sizeof(x));
	memset(y, -1, sizeof(y));
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int p = i, c = 0;
		while (x[p] == -1) {
			x[p] = c++;
			y[p] = i;
			p = (p + a[p]) % n;
		}
		if (y[p] == i)ans += (c - x[p]);
	}
	cout << ans << endl;
	return 0;
}

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

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), m[] = new int[n],l[]=new int[n], c = 0;
        boolean[] t=new boolean[n];
        for (int i = 0; i < n; i++) {
            m[i] = sc.nextInt();
        }
        for(int i=0;i<n;i++)
            l[(i+m[i])%n]++;
        for(int i=0;i<n;i++) {
            int j=i;
            while(!t[j]&&l[j]==0) {
                t[j]=true;
                j=(j+m[j])%n;
                l[j]--;
            }
        }
        for(int i:m)
            c+=i>0?1:0;
        System.out.println(c);
    }
}



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

#include <string>
#include <iostream>
using namespace std;
int gcd(int x, int y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}
string s;
int main() {
	cin >> s;
	string t1 = s.substr(0, s.find('.')), t2 = s.substr(s.find('.') + 1);
	int d1 = stoi(t1), d2 = 1;
	if (s.find('(') == string::npos) {
		d2 = t2.size(); d1 *= d2;
		d2 += stoi(t2);
	}
	else {
		string t3 = t2.substr(0, t2.find('(')), t4 = t2.substr(t2.find('(') + 1); t4.pop_back();
		if (t3.size()) {
			d2 = t3.size(); d1 *= d2;
			d2 += stoi(t3);
		}
		int e1 = stoi(t4), e2 = (int)pow(10, t4.size()) - 1;
		d1 = d1 * e2 + d2 * e1;
		d2 *= e2;
	}
	int g = gcd(d1, d2);
	d1 /= g, d2 /= g;
	cout << d1 << '/' << d2 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:46: error: 'pow' was not declared in this scope
   23 |                 int e1 = stoi(t4), e2 = (int)pow(10, t4.size()) - 1;
      |                                              ^~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
string s;
int a,b,c,d,e;
int main(){
  cin>>s;
  for(int i=0;i<s.size();i++){
    if(isdigit(s[i]))a=a*10+(s[i]-'0'),d*=10;
    else if(s[i]=='.')d++;
    else while(isdigit(s[++i]))b=b*10+(s[i]-'0'),c=c*10+9;
  }
  if(c)a=b+a*c,d=d*c;
  cout<<a/__gcd(a,d)<<'/'<<d/__gcd(a,d)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: '__gcd' was not declared in this scope
   14 |   cout<<a/__gcd(a,d)<<'/'<<d/__gcd(a,d)<<endl;
      |           ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)

typedef pair<int, int> P;

const int inf = 1LL << 55;

struct edge
{
  int to, cost;
  edge(){}
  edge(int to, int cost):to(to), cost(cost){}
};

vector< vector<edge> > graph;
vector< vector<int> > mincost;

void dijkstra(int s)
{
  priority_queue<P, vector<P>, greater<P> > que;
  que.push(P(0, s));
  mincost[s][s] = 0;
  while(!que.empty()) {
    int cost, now;
    tie(cost, now) = que.top(); que.pop();
    if(mincost[s][now] < cost) continue;
    for(edge& e : graph[now]) {
      if(e.cost + cost < mincost[s][e.to]) {
	mincost[s][e.to] = e.cost + cost;
	que.push(P(mincost[s][e.to], e.to));
      }
    }
  }
  //return *max_element(all(mincost[s]));
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int N, R;
  cin >> N >> R;
  graph.resize(N);
  rep(i, R) {
    int s, t, d;
    cin >> s >> t >> d; s--, t--;
    graph[s].emplace_back(t, d);
    graph[t].emplace_back(s, d);
  }

  mincost.resize(N, vector<int>(N, inf));
  int maxdist = 0;
  rep(i, N) dijkstra(i); //maxdist = max(maxdist, dijkstra(i));
  rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]);

  vector<P> ep;
  rep(i, N) reps(j, i+1, N) {
    if(mincost[i][j] == maxdist) ep.emplace_back(i, j);
  }

  vector<int> ans;
  rep(i, N) {
    bool flag = true;
    for(auto& p : ep) {
      int s, t; tie(s, t) = p;
      if(mincost[s][i] + mincost[i][t] == maxdist) flag = false;
    }
    if(flag) ans.push_back(i+1);
  }
  
  cout << ans.size() << endl;
  rep(i, ans.size()) cout << ans[i] << endl;
  
  return 0;
}

Compiler output:
a.cc:61:26: error: macro "rep" passed 3 arguments, but takes just 2
   61 |   rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]);
      |                          ^
a.cc:6:9: note: macro "rep" defined here
    6 | #define rep(i, n) for(int i = 0; i < (int)(n); i++)
      |         ^~~
a.cc:11:21: warning: overflow in conversion from 'long long int' to 'int' changes value from '36028797018963968' to '0' [-Woverflow]
   11 | const int inf = 1LL << 55;
      |                 ~~~~^~~~~
a.cc: In function 'int main()':
a.cc:61:13: error: 'rep' was not declared in this scope
   61 |   rep(i, N) rep(j, i+1, N) maxdist = max(maxdist, mincost[i][j]);
      |             ^~~
Language: C++

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

struct edge {int to, cost;};

int n, r;
vector<edge> g[1501];
int d[1501][1501];
map<int, int> mp;

void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d[s], d[s] + n, 1145141919);
  d[s][s] = 0;
  que.push(P(0, s));

  while(!que.empty()) {
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[s][v] < p.first) continue;
    rep(i, 0, g[v].size()) {
      edge e = g[v][i];
      if(d[s][e.to] > d[s][v] + e.cost) {
        d[s][e.to] = d[s][v] + e.cost;
        que.push(P(d[s][e.to], e.to));
      }
    }
  }
}

int solve(int i, int j) {
  while(1) {
    mp[j] = 1;
    if(j == i) break;
    rep(k, 0, g[j].size()) {
      edge e = g[j][k];
      if(d[i][j] == d[i][e.to] + e.cost) {
        j = e.to;
        break;
      }
    }
  }
}

int main() {
  cin >> n >> r;
  rep(i, 0, r) {
    int a, b, c;
    cin >> a >> b >> c;
    edge e;
    e.to = b, e.cost = c;
    g[a].pb(e);
    e.to = a;
    g[b].pb(e);
  }
  rep(i, 1, n + 1) {
    dijkstra(i);
  }
  int mas = 0;
  rep(i, 1, n + 1) {
    rep(j, 1, n + 1) {
      mas = max(mas, d[i][j]);
    }
  }
  int done[1501][1501] = 0;
  rep(i, 1, n + 1) {
    rep(j, 1, n + 1) {
      if(!done[i][j] && mas == d[i][j]) {
        solve(i, j);
        done[j][i] = 1;
      }
    }
  }
  int count = 0;
  rep(i, 1, n + 1 ) {
    if(!mp[i]) count++;
  }
  cout << count << endl;
  rep(i, 1, n + 1) {
    if(!mp[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'int solve(int, int)':
a.cc:57:1: warning: no return statement in function returning non-void [-Wreturn-type]
   57 | }
      | ^
a.cc: In function 'int main()':
a.cc:79:26: error: array must be initialized with a brace-enclosed initializer
   79 |   int done[1501][1501] = 0;
      |                          ^
Language: C++

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

struct edge {int to, cost;};

int n, r;
vector<edge> g[1501];
int d[1501][1501];
map<int, int> mp;

void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d[i], d[i] + n + 1, 1145141919);
  d[s][s] = 0;
  que.push(P(0, s));

  while(!que.empty()) {
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[s][v] < p.first) continue;
    rep(i, 0, g[v].size()) {
      edge e = g[v][i];
      if(d[s][e.to] > d[s][v] + e.cost) {
        d[s][e.to] = d[s][v] + e.cost;
        que.push(P(d[s][e.to], e.to));
      }
    }
  }
}

int solve(int i, int j) {
  while(1) {
    mp[j] = 1;
    if(j == i) break;
    rep(k, 0, g[j].size()) {
      edge e = g[j][k];
      if(d[i][j] == d[i][e.to] + e.cost) {
        j = e.to;
        break;
      }
    }
  }
}

int main() {
  cin >> n >> r;
  rep(i, 0, r) {
    int a, b, c;
    cin >> a >> b >> c;
    edge e;
    e.to = b, e.cost = c;
    g[a].pb(e);
    e.to = a;
    g[b].pb(e);
  }
  rep(i, 1, n + 1) {
    dijkstra(i);
  }
  int mas = 0;
  rep(i, 1, n + 1) {
    rep(j, 1, n + 1) {
      mas = max(mas, d[i][j]);
    }
  }
  rep(i, 1, n + 1) {
    rep(j, i + 1, n + 1) {
      if(mas == d[i][j]) solve(i, j);
    }
  }
  int count = 0;
  rep(i, 1, n + 1) {
    if(!mp[i]) count++;
  }
  cout << count << endl;
  rep(i, 1, n + 1) {
    if(!mp[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:27:10: error: 'i' was not declared in this scope
   27 |   fill(d[i], d[i] + n + 1, 1145141919);
      |          ^
a.cc: In function 'int solve(int, int)':
a.cc:57:1: warning: no return statement in function returning non-void [-Wreturn-type]
   57 | }
      | ^
Language: C++

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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

struct edge {int to, cost;};

int n, r;
vector<edge> g[1501];
int d[1501][1501];
int mp[1501];

inline void dijkstra(int s) {
  priority_queue<P, vector<P>, greater<P> > que;
  fill(d[s], d[s] + n + 1, 1145141919);
  d[s][s] = 0;
  que.push(P(0, s));

  while(!que.empty()) {
    P p = que.top(); que.pop();
    int v = p.second;
    if(d[s][v] < p.first) continue;
    rep(i, 0, g[v].size()) {
      if(d[s][e.to] > d[s][v] + g[v][i].cost) {
        d[s][e.to] = d[s][v] + g[v][i].cost;
        que.push(P(d[s][e.to], g[v][i].to));
      }
    }
  }
}

inline void solve(int i, int j) {
  stack<int> st;
  st.push(j);
  while(!st.empty()) {
    int tp = st.top(); st.pop();
    mp[tp] = 1;
    rep(k, 0, g[tp].size()) {
      if(d[i][tp] == d[i][g[tp][k].to] + g[tp][k].cost && g[tp][k].to != i) {
        st.push(g[tp][k].to);
      }
    }
  }
}

int main() {
  cin >> n >> r;
  rep(i, 0, r) {
    int a, b, c;
    cin >> a >> b >> c;
    edge e;
    e.to = b, e.cost = c;
    g[a].pb(e);
    e.to = a;
    g[b].pb(e);
  }
  rep(i, 1, n + 1) {
    dijkstra(i);
  }
  int mas = 0;
  rep(i, 1, n + 1) {
    rep(j, 1, n + 1) {
      mas = max(mas, d[i][j]);
    }
  }
  rep(i, 1, n + 1) {
    rep(j, i + 1, n + 1) {
      if(mas == d[i][j]) {
        mp[i] = 1;
        solve(i, j);
      }
    }
  }
  int count = 0;
  rep(i, 1, n + 1) {
    if(!mp[i]) count++;
  }
  cout << count << endl;
  rep(i, 1, n + 1) {
    if(!mp[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'void dijkstra(int)':
a.cc:36:15: error: 'e' was not declared in this scope
   36 |       if(d[s][e.to] > d[s][v] + g[v][i].cost) {
      |               ^
Language: C++

#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i <= (int) b; ++i) #define ii pair <int, int> using namespace std; const int N = 1503; int n, m; vector <ii> adj[N]; void init() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("main.inp","r",stdin); freopen("main.out","w",stdout); } priority_queue <ii, vector <ii>, greater <ii> > Q; int d[N][N], Max; void dijk(int st) { d[st][st] = 0; Q.push({ 0, st }); while (Q.size()) { int u = Q.top().second, du = Q.top().first; Q.pop(); if (du != d[st][u]) continue; Max = max(Max, du); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][v] > du + w) d[st][v] = du + w, Q.push({ d[st][v], v }); } } } queue <int> dm; int vis[N]; void trace(int st) { FOR(i, 1, n) if (d[st][i] == Max) dm.push(i), vis[i] = st; while (dm.size()) { int u = dm.front(); dm.pop(); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][u] == d[st][v] + w && vis[v] < st) vis[v] = st, dm.push(v); } } } void solve() { cin >> n >> m; FOR(i, 1, m) { int u, v, w; cin >> u >> v >> w; adj[u].push_back({ w, v }), adj[v].push_back({ w, u }); } memset(d, 0x3f, sizeof d); FOR(i, 1, n) dijk(i); FOR(i, 1, n) trace(i); int dem = 0; FOR(i, 1, n) if (vis[i] == 0) ++dem; cout << dem << '\n'; FOR(i, 1, n) if (vis[i] == 0) cout << i << '\n'; } main() { init(); solve(); }


Compiler output:
a.cc:1:26: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++.h> #define FOR(i, a, b) for (int i = a; i <= (int) b; ++i) #define ii pair <int, int> using namespace std; const int N = 1503; int n, m; vector <ii> adj[N]; void init() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen("main.inp","r",stdin); freopen("main.out","w",stdout); } priority_queue <ii, vector <ii>, greater <ii> > Q; int d[N][N], Max; void dijk(int st) { d[st][st] = 0; Q.push({ 0, st }); while (Q.size()) { int u = Q.top().second, du = Q.top().first; Q.pop(); if (du != d[st][u]) continue; Max = max(Max, du); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][v] > du + w) d[st][v] = du + w, Q.push({ d[st][v], v }); } } } queue <int> dm; int vis[N]; void trace(int st) { FOR(i, 1, n) if (d[st][i] == Max) dm.push(i), vis[i] = st; while (dm.size()) { int u = dm.front(); dm.pop(); for (ii it : adj[u]) { int v = it.second, w = it.first; if (d[st][u] == d[st][v] + w && vis[v] < st) vis[v] = st, dm.push(v); } } } void solve() { cin >> n >> m; FOR(i, 1, m) { int u, v, w; cin >> u >> v >> w; adj[u].push_back({ w, v }), adj[v].push_back({ w, u }); } memset(d, 0x3f, sizeof d); FOR(i, 1, n) dijk(i); FOR(i, 1, n) trace(i); int dem = 0; FOR(i, 1, n) if (vis[i] == 0) ++dem; cout << dem << '\n'; FOR(i, 1, n) if (vis[i] == 0) cout << i << '\n'; } main() { init(); solve(); }
      |                          ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Sort {

	public static void main(String[] args) throws NumberFormatException, IOException {

		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);

		int num = sc.nextInt();

		List<Integer> list = new LinkedList<Integer>();

		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);

		String str;
		if((str=br.readLine())!=null){
			String[] sp = str.split(" ");

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

				list.add(Integer.parseInt(sp[i]));
			}
		}
		int cnt = 0;
		for(int i = 1; i < num; i++){
			int temp = list.get(i - 1);
			if(temp > list.get(i)){

				list.remove(i - 1);
				list.add(temp);

				cnt++;

				i = 0;
			}
		}
		System.out.println(cnt);
	}
}

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

import java.io.*;
import java.util.ArrayList;
import java.util.List;

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// ??\????????????????????????
            String line; // ??\???????????????????????\???
            int cnt = 0;
            int check = 0;
            List<Integer> numList = new ArrayList<Integer>();
            int row = 0;
            while ((line = br.readLine()) != null) {
            	if(cnt == 0){
            		cnt++;
            		row = Integer.parseInt(line);
            	}else{
            		for(int n = 0; n < row; n++){
            			int a = Integer.parseInt(list[n]);
            			numList.add(a);
            		}
            		int count = 0;
            		for(int j = 0; j < row; j++){
            			if(j + 1 >= row){
            				break;
            			}
            			int num = numList.get(j);
                		int secondNum = numList.get(j+1);
                		if(num > secondNum){
                			numList.remove(j);
                			numList.add(num);
                			j = -1;
                			count++;
                		}
            		}
            	System.out.println(count);
            	cnt = 0;
            	numList.clear();
            	}  	
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Compiler output:
Main.java:20: error: cannot find symbol
            			int a = Integer.parseInt(list[n]);
            			                         ^
  symbol:   variable list
  location: class Main
1 error
Language: Java

class Main {
    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// ??\????????????????????????
            String line; // ??\???????????????????????\???
            int cnt = 0;
            List<Integer> numList = new ArrayList<Integer>();
            int row = 0;
            while ((line = br.readLine()) != null) {
            	if(cnt == 0){
            		cnt++;
            		row = Integer.parseInt(line);
            	}else{
            		String[] list = line.split(" ", 0);
            		for(int n = 0; n < row; n++){
            			int a = Integer.parseInt(list[n]);
            			numList.add(a);
            		}
            		int count = 0;
            		for(int j = 0; j < row; j++){
            			if(j + 1 >= row){
            				break;
            			}
            			int num = numList.get(j);
                		int secondNum = numList.get(j+1);
                		if(num > secondNum){
                			numList.remove(j);
                			numList.add(num);
                			j = -1;
                			count++;
                		}
            		}
            	System.out.println(count);
            	cnt = 0;
            	numList.clear();
            	}  	
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

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

import java.util.Scanner;

public class Main{
    
    public static void main (String [ ] args){
        Scanner sc = new Scanner (System.in);
        int a = sc.next Int( );
        int b = sc.nextInt( );
        
        System.out.printLn((a+b)/2);
    }
}


Compiler output:
Main.java:7: error: ';' expected
        int a = sc.next Int( );
                       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    
    public static void main (String [] args){
        Scanner sc = new Scanner (System.in);
        int a = sc.next Int();
        int b = sc.nextInt();
        
        System.out.printLn((a+b)/2);
    }
}


Compiler output:
Main.java:7: error: ';' expected
        int a = sc.next Int();
                       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    
    public static void main (String [] args){
        Scanner sc = new Scanner (System.in);
        int a = sc.next Int();
        int b = sc.nextInt();
        
        System.out.println((a+b)/2);
    }
}


Compiler output:
Main.java:7: error: ';' expected
        int a = sc.next Int();
                       ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
    
    public static void main (String [] args){
        Scanner sc = new Scanner (System.in);
        int a = sc.next Int();
        int b = sc.next Int();
        
        System.out.println((a+b)/2);
    }
}


Compiler output:
Main.java:7: error: ';' expected
        int a = sc.next Int();
                       ^
Main.java:8: error: ';' expected
        int b = sc.next Int();
                       ^
2 errors
Language: Java

import java.util.Scanner;
import java.util.stream.IntStream;

public class Solution{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		System.out.println((getInt()+getInt())/2);
	}
}

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

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

class Main{
private void compute(){
Scanner scanner = new Scanner(System.in);

int a=Scanner.nextInt();
int b=Scanner.nextInt();
System.out.println((a+b)/2);
}

public static void main(String a[]){
new Main().compute();
}
}

Compiler output:
Main.java:8: error: non-static method nextInt() cannot be referenced from a static context
int a=Scanner.nextInt();
             ^
Main.java:9: error: non-static method nextInt() cannot be referenced from a static context
int b=Scanner.nextInt();
             ^
2 errors
Language: Java

package volume3;

import java.util.Scanner;

public class Q0357 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println((sc.nextInt() + sc.nextInt()) / 2);
    }
}

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

#include
main(){
    int a,b;
    scanf("%d %d",&a,&b);
    printf("%d\n",(a+b)/2);
    return 0;
}


Compiler output:
main.c:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |     scanf("%d %d",&a,&b);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #include
main.c:4:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |     scanf("%d %d",&a,&b);
      |     ^~~~~
main.c:4:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 |     printf("%d\n",(a+b)/2);
      |     ^~~~~~
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:5:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:5:5: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>

int main(){
int a, b;

scanf("%d %d", &a, &b);
printf(???%d\n???, (a+b)/2);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:8: error: expected expression before '?' token
    7 | printf(???%d\n???, (a+b)/2);
      |        ^
main.c:7:13: error: stray '\' in program
    7 | printf(???%d\n???, (a+b)/2);
      |             ^
Language: C

#include <stdio.h>

int main() {

	int a;
	int b;
	int nAnswer;

	scanf_s("%d%d", &a, &b);

	nAnswer = ( a + b ) / 2;

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

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    9 |         scanf_s("%d%d", &a, &b);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <stdio>
int main(void){
	int a,b;
	scanf("%d %d",&a,&b);
	printf("%d\n",(a+b)/2);
	return 0;
}


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

#include <iostream>
#include <bits/stdc++.h>

#define Max(a,b) max({a,b})
#define Min(a,b) min({a,b})
#define rep(i,m,n) for(int (i)=(m);(i)<(int)(n);(i)++)
#define len(n) n.size()
#define print(n) cout << (n) << endl;


// s.substr(i,n)

typedef long long ll;

using namespace std;

//char a = 65;
long long int inf = 1000000007;
int n,m,a,b,c,d,cou,co;
long long int lla,llb,llc;
double k;
const ll LINF = 1e18;
char num = 65;
string s,t;
int lis[20];
/*
int binary(int bina){
    int ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}
*/

int main(){
    
    whlie(true){
        cin >> a >> b;
        cout << (a+b)/2 << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:5: error: 'whlie' was not declared in this scope
   40 |     whlie(true){
      |     ^~~~~
Language: C++

#include
using namespace std;
int main(){
  int a, b;
  cin>>a>>b
  cost<<(a+b)/2<<end
}


Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a>>b
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
Language: C++

#include
using namespace std;
int main(){
  int a, b;
  cin>>a>>b;
  cost<<(a+b)/2<<endl:
}





Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a>>b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:6:3: error: 'cost' was not declared in this scope; did you mean 'const'?
    6 |   cost<<(a+b)/2<<endl:
      |   ^~~~
      |   const
a.cc:6:18: error: 'endl' was not declared in this scope
    6 |   cost<<(a+b)/2<<endl:
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include
Language: C++

#include
using namespace std;

main(){
  int a, b;
  cin >> a >> b;
  cout << (a+b)/2 << endl;
}


Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include
      |         ^
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:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a >> b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include
a.cc:7:3: error: 'cout' was not declared in this scope
    7 |   cout << (a+b)/2 << endl;
      |   ^~~~
a.cc:7:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:22: error: 'endl' was not declared in this scope
    7 |   cout << (a+b)/2 << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include
Language: C++

using namespace std;
 
int main(){
  int a,b;
  cin>>a>>b;
cost<<(a+b)/2<<endl:
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a>>b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:1: error: 'cost' was not declared in this scope; did you mean 'const'?
    6 | cost<<(a+b)/2<<endl:
      | ^~~~
      | const
a.cc:6:16: error: 'endl' was not declared in this scope
    6 | cost<<(a+b)/2<<endl:
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

using namespace std;
 
int main(){
  int a,b;
  cin>>a>>b;
cost<<(a+b)/2<<endl:
 return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>a>>b;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:6:1: error: 'cost' was not declared in this scope; did you mean 'const'?
    6 | cost<<(a+b)/2<<endl:
      | ^~~~
      | const
a.cc:6:16: error: 'endl' was not declared in this scope
    6 | cost<<(a+b)/2<<endl:
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int a,b;
  cin>>a>>b;
cost<<(a+b)/2<<endl:
 return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'cost' was not declared in this scope; did you mean 'const'?
    7 | cost<<(a+b)/2<<endl:
      | ^~~~
      | const
Language: C++

#incloude <iostream>
using namespace std;
int main(){

int a,b;
cin>>a>>b;
cout<<(a+b)/2<<endl;
return0;
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incloude; did you mean #include?
    1 | #incloude <iostream>
      |  ^~~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>a>>b;
      | ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incloude <iostream>
a.cc:7:1: error: 'cout' was not declared in this scope
    7 | cout<<(a+b)/2<<endl;
      | ^~~~
a.cc:7:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:16: error: 'endl' was not declared in this scope
    7 | cout<<(a+b)/2<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incloude <iostream>
a.cc:8:1: error: 'return0' was not declared in this scope
    8 | return0;
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){

int a,b;
cin>>a>>b;
cout<<(a+b)/2<<endl;
return0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'return0' was not declared in this scope
    8 | return0;
      | ^~~~~~~
Language: C++

a,b=gets.chomp.split(" ").map(&:to_i);
print("#{(a+b)/2}\n")

Compiler output:
a.cc:1:1: error: 'a' does not name a type
    1 | a,b=gets.chomp.split(" ").map(&:to_i);
      | ^
a.cc:2:6: error: expected constructor, destructor, or type conversion before '(' token
    2 | print("#{(a+b)/2}\n")
      |      ^
Language: C++

#include<cstdio>
using namespace std;

int main() {
	int a, b;
	scanf_s("%d %d", &a, &b);
	printf("%d", (a + b) / 2);
	return 0;
}

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OthloKyopro
{
    class Program
    {
        static void Main(string[] args)
        {
            /* 101*/
            var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
            var sum = 0;
            foreach(var i in a)
            {
                sum += i;
            }
            Console.WriteLine(sum / a.Count());


        }
    }
}

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.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:11:26: error: 'string' has not been declared
   11 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
   11 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:24:6: error: expected ';' after class definition
   24 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void OthloKyopro::Program::Main(int*)':
a.cc:14:13: error: 'var' was not declared in this scope
   14 |             var a = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToList();
      |             ^~~
a.cc:15:17: error: expected ';' before 'sum'
   15 |             var sum = 0;
      |                 ^~~
a.cc:16:25: error: expected ')' before 'i'
   16 |             foreach(var i in a)
      |                         ^
a.cc:16:20: note: to match this '('
   16 |             foreach(var i in a)
      |                    ^
a.cc:16:13: error: 'foreach' was not declared in this scope
   16 |             foreach(var i in a)
      |             ^~~~~~~
a.cc:20:13: error: 'Console' was not declared in this scope
   20 |             Console.WriteLine(sum / a.Count());
      |             ^~~~~~~
a.cc:20:31: error: 'sum' was not declared in this scope
   20 |             Console.WriteLine(sum / a.Count());
      |                               ^~~
a.cc:20:37: error: 'a' was not declared in this scope
   20 |             Console.WriteLine(sum / a.Count());
      |                                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;



int main(){
  int a, b, c;
  cin >> a >> b;
  
  c = (a + b)/2
  cout << c
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before 'cout'
   11 |   c = (a + b)/2
      |                ^
      |                ;
   12 |   cout << c
      |   ~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int a, b, c;
  cin >> a >> b;
  
  int c =  (a + b) / 2;
  cout << c;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: redeclaration of 'int c'
    9 |   int c =  (a + b) / 2;
      |       ^
a.cc:6:13: note: 'int c' previously declared here
    6 |   int a, b, c;
      |             ^
Language: C++

#include <iostream>

int main(void){int a,b;std::cin>>a>>b;std::cout<<(a+b)/2<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:59: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    3 | int main(void){int a,b;std::cin>>a>>b;std::cout<<(a+b)/2<<endl;}
      |                                                           ^~~~
      |                                                           std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include "stdafx.h"

#include<iostream>;

using namespace std;

int main()
{
	int a, b,sum;
	a = 0;
	b = 0;
	sum = 0;
	cin >> a >> b;
	sum = a + b;
	cout << sum/2;
	return 0;
}



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

#include<iostream>;

using namespace std;

int main()
{
	int a, b;
	a = 0;
	b = 0;
	sum = 0;
	cin >> a >> b;
	cout << (a+b)/2;
	return 0;
}


Compiler output:
a.cc:1:19: warning: extra tokens at end of #include directive
    1 | #include<iostream>;
      |                   ^
a.cc: In function 'int main()':
a.cc:10:9: error: 'sum' was not declared in this scope
   10 |         sum = 0;
      |         ^~~
Language: C++

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

int main(){
    int a,b;
    cin>>a,b;
    cout<<(a+b)/2<<endl;
    rerturn 0;
}


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

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

int main(){
    int a,b;
    cin>>a>>b;
    cout<<(a+b)/2<<endl;
    rerturn 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'rerturn' was not declared in this scope
    8 |     rerturn 0;
      |     ^~~~~~~
Language: Java

import java.util.Scanner;

public class PCK201703 {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int a,f,b;

		a = stdIn.nextInt();
		f = stdIn.nextInt();
		b = stdIn.nextInt();

		if(a > b) {
			System.out.println("0");
		}else if(a + f < b) {
			System.out.println("NA");
		}else {
			System.out.println(b -a);
		}
	}

}



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

#include <stdio.h>

int main() {

	int m;
	int f;
	int b;
	int nFanswer;

	scanf_s("%d%d%d", &m, &f, &b);

	if (b > m) {
		nFanswer = b - m;
		if (nFanswer <= 0) nFanswer = 0;
		if (nFanswer < f) {
			printf("%d\n", nFanswer);
		}
		else {
			printf("NA\n");
		}
	}

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   10 |         scanf_s("%d%d%d", &m, &f, &b);
      |         ^~~~~~~
      |         scanf
Language: C

#include<stdio.h>

int main(void)
{
	int m,f,b,sum;
	scanf("%d %d %d", &m, &f, &b);
	if(m>=b){
		sum = 0;
		printf("%d\n", sum);
	}
	else if(m+f>=b){
		sum = b-m;
		printf("%d\n", sum);
	else printf("NA\n");

	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:14:9: error: expected '}' before 'else'
   14 |         else printf("NA\n");
      |         ^~~~
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int a,f,b;

		a = stdIn.nextInt();
		f = stdIn.nextInt();
		b = stdIn.nextInt();

		if(a > b) {
			System.out.println("0");
		}else if(a + f < b) {
			System.out.println("NA");
		}else {
			System.out.println(b -a);
		}
	}

}



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

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);

		int a,f,b;

		a = stdIn.nextInt();
		f = stdIn.nextInt();
		b = stdIn.nextInt();

		if(a > b) {
			System.out.println(0);
		}else if(a + f < b) {
			System.out.println("NA");
		}else {
			System.out.println(b -a);
		}
	}

}



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

#include<iostream>
using namespace std;
int main()
{
    int m, f, b;
    cin >> m >> f >> b;
    if (m + f >= b)
        cout << b - m << endl;
    else if (m >= b)
        cout << "0" << endl;
    else
        cout << "NA" << endl;
    return 0;



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

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <stack>
#include <cmath>
#define ll long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
using namespace std;
//
const int inf=1e9+7;
const int mod=1e9+7;
//
struct poi{
	int X;int Y;int Z;
	bool operator<(const poi&R)const{
		return X==R.X ? Y==R.Y ? Z<R.Z : Y<R.Y : X<R.X;
	}
};
//
ll GCD(ll a,ll b){
	return (b==0)?(a):(GCD(b,a%b));
}
ll LCM(ll a,ll b){
	return a/GCD(a,b)*b;
}
//
int main(){
	int M,F,B;
	cin>>M>>F>>B;
	if(M>=B){
		cout<<0<<endl;
	}else if(B-M>=A){
		cout<<(B-M)<<endl;
	}else{
		cout<<"NA"<<endll;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:23: error: 'A' was not declared in this scope
   36 |         }else if(B-M>=A){
      |                       ^
a.cc:39:29: error: 'endll' was not declared in this scope
   39 |                 cout<<"NA"<<endll;
      |                             ^~~~~