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

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

#define INC(i, a, b) for(int i = a; i < b; ++i)
#define DEC(i, a, b) for(int i = a; i > b; --i)
#define REP(i, n) INC(i, 0, n)

typedef unsigned int uint;
typedef unsigned long ul;
typedef long long  ll;
typedef unsigned long long ull;

void TFprint(bool b, std::string T, std::string F){
    if(b){
        std::cout << T << std::endl;
    }else{
        std::cout << F << std::endl;
    }
}

int main(){
    int n; std::cin >> n;
    std::vector<ull> a;
    ull temp;
    ull ans = 0;

    REP(i, 3 * n){
        std::cin >> temp;
        a.push_back(temp);
    }
    std::sort(a.begin(), a.end(), std::greater<ull>());

    REP(i, n){
        //std::cout << a[2 * i + 1] << ' ';
        ans += a[2 * i + 1];
    }
    std::cout << std::endl;
    std::cout << ans << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   32 |     std::sort(a.begin(), a.end(), std::greater<ull>());
      |          ^~~~
      |          qsort
Language: C++

#include<cstdio>

using namespace std;

int N;
int A[300005];

int main(){
	scanf("%d", &N);
	for(int i=0;i<3*N;i++){
		scanf("%d", &A[i]);
	}
	sort(A, A+3*N);
	long long tot = 0;
	for(int i=N;i<2*N;i++){
		tot += (long long)A[i];
	}
	printf("%lld\n", tot);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |         sort(A, A+3*N);
      |         ^~~~
      |         short
Language: C++

#include <algorithm>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <list>
#define INF 1000000000ll
#define MOD 1000000007ll
#define EPS 1e-10
#define REP(i,m) for(long long i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define DUMP(a) for(long long dump=0; dump<(ll)a.size(); dump++) { cout<<a[dump]; if(dump!=(ll)a.size()-1) cout<<" "; else cout<<endl; }
#define ALL(v) v.begin(),v.end()
#define pb push_back
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef long double ld;
using namespace std;
int main(){
	int n;
	cin >> n;
	ll a[n];
	REP(i, n) cin >> a[i];
	sort(a, a+n);
	ll ans = 0;
	for(i = 1; i <= 3 * n; i += 3) ans += a[i];
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'i' was not declared in this scope
   32 |         for(i = 1; i <= 3 * n; i += 3) ans += a[i];
      |             ^
Language: C++

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

int main(){
 int N;
 int a[100000];
 unsigned __int64 ans=0;
 int num;
 int i;
 int j;
 int c;
 int temp;
 cin>>N;
 for(i=0;i<N*3;i++){
 	cin>>a[i];
 }
 
 for(i=0;i<N;i++){
 	num=i*3;
 	for(j=0;j<2;j++){
		for(c=0;c<2;c++){
 			if(a[num+c]>a[num+c+1]){
				temp=a[num+c+1];
				a[num+c+1]=a[num+c];
				a[num+c]=temp;
			}
		}
	}
 }
 
 for(i=1;i<N*3;i=i+3){
 	ans=ans+a[i];
 }
 
 cout<<ans;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected initializer before 'ans'
    8 |  unsigned __int64 ans=0;
      |                   ^~~
a.cc:33:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         ans=ans+a[i];
      |         ^~~
      |         abs
a.cc:36:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |  cout<<ans;
      |        ^~~
      |        abs
Language: C++

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

typedef long long ll;

int N;
ll A[300030];
ll ans = 0;

int main()
{
    scanf("%d",&N);
    for(int i = 0; i < N * 3; i++)
    {
        scanf("%d",&A[i]);
    }
    sort(A,A + N * 3);
    for(int i = 0; i < N; i++)ans += A[i + N];
    printf("%lld\n",ans);
    return 0;
}


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

#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
#include <vector>

using namespace std;
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for(int i=1;i<=(int)(y);i++)
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
typedef long long ll;
vector<int> v;

void solve() {
  sci(N);
  REP(i,3*N) {
    sci(a);
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  ll sum=0;
  REP(i,N) {
    sum+=v[v.size()-2-i];
  }
  printf("%lld\n",sum);
}

int main() {
  solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:22:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
Language: Java

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

public class A12
{

	public static void main( String[] args )
	{

		Scanner s = new Scanner( System.in );

		int n = s.nextInt();
		int[] strengths = new int[3*n];
		
		for(int i = 0; i < 3*n; i++)
		{
			strengths[i] = s.nextInt();
		}
		
		Arrays.sort( strengths );
		
		int l = 0, r = 3*n - 1;
		long sum = 0;
		while(l < r)
		{
			sum += strengths[r-1];
			r -= 2;
			l++;
		}

		System.out.println( sum );
		
		s.close();

	}

}


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

#include<bits/stdc++.h>
#include<unordered_map>
/*
*▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*    ▀▀       ▀▀▀▀▀▀    ▀     ▀▀▀▀▀▀      ▀    ▀
*   ▀  ▀      ▀         ▀     ▀            ▀  ▀
*  ▀    ▀     ▀ ▀ ▀     ▀     ▀ ▀ ▀         ▀
* ▀ ▀▀▀▀ ▀    ▀         ▀     ▀             ▀
*▀        ▀   ▀         ▀     ▀             ▀
*▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*/
using namespace std;
void afify()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
#define ll long long
#define ld long double
#define loopi(i,intial,n)  for(ll i=ll(intial);i<n;i++)
#define loopj(j,intial,n) for(ll j=ll(intial);j<n;j++)
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))
#define all(v) v.begin(),v.end()
///////////////////////////////////////
#define SCD(a) scanf("%d",&a)
#define SCD2(a,b) scanf("%d %d",&a,&b)
#define SCLL(a) scanf("%lld",&a)
#define SCLL2(a,b) scanf("%lld %lld",&a,&b)
#define PRD(a) printf("%d\n",a)
#define PRLL(a) printf("%lld\n",a)
///////////////////////////////////////
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <vi> vvi;
typedef vector <vll> vvll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<vpii> vvpii;
typedef stringstream ss;
const ll oo = (ll) 1e13;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
//ifstream ifs("input.txt");
//ofstream ofs("output.txt");

int main()
{
   afify();
   ll n;
   cin>>n;ll sum=0;
   loopi(i,0,n){
	   ll a,b,c;
	   cin>>a>>b>>c;
	   ll x=max3(a,b,c);
	   ll y=min3(a,b,c);
	   ll  mid=a+b+c-x-y;
	   sum+=mid;
   }
   cout<<sum<<endl;
	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: expected primary-expression before 'long'
   20 | #define ll long long
      |            ^~~~
a.cc:22:37: note: in expansion of macro 'll'
   22 | #define loopi(i,intial,n)  for(ll i=ll(intial);i<n;i++)
      |                                     ^~
a.cc:57:4: note: in expansion of macro 'loopi'
   57 |    loopi(i,0,n){
      |    ^~~~~
Language: C++

n = int(raw_input())
ls = map(int, raw_input().split())
ls.sort()
sum = 0
for i in range(n):
    sum += ls[n+i*2]
print sum


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

import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Solution {

	public Solution() {
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int N = sc.nextInt();
		BigInteger[] a = new BigInteger[3*N];
		for(int i = 0; i < 3*N; i++)
			a[i] = BigInteger.valueOf(sc.nextLong());
		sc.close();
		List<BigInteger> aList = Arrays.asList(a);
		Collections.sort(aList);
		System.out.println(aList);
		BigInteger sum = BigInteger.ZERO;
		for(int i = aList.size() - 2; i >= N; i -= 2) {
			sum = sum.add(aList.get(i));
			System.out.println(aList.get(i));
			System.out.println(sum);
		}
		
		System.out.println(sum);
	}

}


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

#include<iostream>
#include<stack>
using namespace std;
static const int N = 100001;
int n, m,q,color[N];

void dfs(int v,int d,int c) {
  color[v]=c;
  if(d==0) return;
  d--;

  for(int i=1;i<=n;i++){
    if(M[v][i]==1||M[i][v]==1){
      dfs(i,d,c);
    }
  }
  
  for(int i=1;i<=n;i++){
  //ぬる  
  }
}


int main()
{
  
	int a,b,v[N],d[N],c[N],M[N];
	cin >> n >>m;
  
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			M[i][j] = 0;
		}
	}
  
	for (int i = 0; i < m; i++) {
		cin >> a >> b;
    M[a][b]=M[b][a]=1;
  }

  cin>>q;
  
  for(int i=0;i<q;i++){
    cin>>v[i]>>d[i]>>c[i];
  }
  
  for (int i = 1; i <= n; i++) {
    color[i] = 0;
  }

  for(int i=q-1;i>0;i++){
    dfs(v[i],d[i],c[i]);
  }

  for(int i=1;i<=n;i++){
    cout<<color[i]<<endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:13:8: error: 'M' was not declared in this scope
   13 |     if(M[v][i]==1||M[i][v]==1){
      |        ^
a.cc: In function 'int main()':
a.cc:32:29: error: invalid types 'int[int]' for array subscript
   32 |                         M[i][j] = 0;
      |                             ^
a.cc:38:9: error: invalid types 'int[int]' for array subscript
   38 |     M[a][b]=M[b][a]=1;
      |         ^
a.cc:38:17: error: invalid types 'int[int]' for array subscript
   38 |     M[a][b]=M[b][a]=1;
      |                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;




int main () {
//    freopen("1.txt", "r", stdin);
//    freopen("2.txt", "w", stdout);

    int n;
    cin >> n;

    vector <long long> a(3 * n);
    for (int i = 0; i < 3 * n; i++) {
        cin >> a[i];
    }
    sort(a.begin(), a.end());

    ll ans = 0;
    for (int i = 0, j = 3 * n - 2; i < n; i++, j -= 2) {
        ans += a[j];
    }
    cout << ans << endl;
    

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'll' was not declared in this scope
   21 |     ll ans = 0;
      |     ^~
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         ans += a[j];
      |         ^~~
      |         abs
a.cc:25:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <algorithm>

using namespace std

int main(){
  int a[1000000010];
  int N;
  cin >> N;
  for (int i=0;i<N*3;i++){
    cin >> a[i];
  }
  sort(a,a+N*3);
  int sum=0;
  for (int i=0;i<N;i++){
    sum += a[i*3+1];
  }
  cout << sum <<endl;
  return 0;
}

Compiler output:
a.cc:4:20: error: expected ';' before 'int'
    4 | using namespace std
      |                    ^
      |                    ;
    5 | 
    6 | int main(){
      | ~~~
Language: C++

#include <iostream>
#include <algorythm>

using namespace std

int main(){
  int a[1000000010];
  int N;
  cin >> N;
  for (int i=0;i<N*3;i++){
    cin >> a[i];
  }
  sort(a,a+N*3);
  int sum=0;
  for (int i=0;i<N;i++){
    sum += a[i*3+1];
  }
  cout << sum <<endl;
  return 0;
}

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

#include<iostream>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<cassert>
#include<cstring>
#include<bitset>
#include<queue>
typedef long long ll;
using namespace std;

int const N = 100 * 1000 + 16;
int const M = 1000 * 1000 * 1000 + 7;
int const inf = 1000 * 1000 * 1000;

int n, m, k;
int a[3*N];

int main()
{
	cin.tie(0);
	cin.sync_with_stdio(0);

	cin >> n;
	copy_n(istream_iterator<int>(cin), 3 * n, a);
	sort(a, a+n);
	ll sum = 0;
	for(int i = 1; i < n + n + n; i += 3)
	  sum += a[i]; 
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: 'istream_iterator' was not declared in this scope
   27 |         copy_n(istream_iterator<int>(cin), 3 * n, a);
      |                ^~~~~~~~~~~~~~~~
a.cc:11:1: note: 'std::istream_iterator' is defined in header '<iterator>'; this is probably fixable by adding '#include <iterator>'
   10 | #include<queue>
  +++ |+#include <iterator>
   11 | typedef long long ll;
a.cc:27:33: error: expected primary-expression before 'int'
   27 |         copy_n(istream_iterator<int>(cin), 3 * n, a);
      |                                 ^~~
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

# define MAX_N
# define MAX_W 

int solve();
int dp[MAX_N+1][MAX_W+1];

int main(void){
  int n;
  cout << n;
    
  solve();
}

int rec(int i,int j){
  if(dp[i][j]>0){
    return dp[i][j];
  }
  int res;
  if(i == n){
    res = 0;  
  }
  else if(j < w[i]) {
    res = rec(i+1,j);
  }
  else {
    res = max(rec(i+1,j),rec(i,j-w[i])+v[i]);
  }
  return dp[i][j];
}

void solve(){

  memset(dp,-1,sizeof(dp));
  printf("%d\n",rec(0,W));
}




Compiler output:
a.cc: In function 'int rec(int, int)':
a.cc:24:11: error: 'n' was not declared in this scope
   24 |   if(i == n){
      |           ^
a.cc:27:15: error: 'w' was not declared in this scope
   27 |   else if(j < w[i]) {
      |               ^
a.cc:31:40: error: 'v' was not declared in this scope
   31 |     res = max(rec(i+1,j),rec(i,j-w[i])+v[i]);
      |                                        ^
a.cc: At global scope:
a.cc:36:6: error: ambiguating new declaration of 'void solve()'
   36 | void solve(){
      |      ^~~~~
a.cc:9:5: note: old declaration 'int solve()'
    9 | int solve();
      |     ^~~~~
a.cc: In function 'void solve()':
a.cc:38:3: error: 'memset' was not declared in this scope
   38 |   memset(dp,-1,sizeof(dp));
      |   ^~~~~~
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 | 
a.cc:39:23: error: 'W' was not declared in this scope
   39 |   printf("%d\n",rec(0,W));
      |                       ^
Language: C++

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

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

  int a[3*n];

  for (int i=0; i<3*n; i++) {
    cin >> a[i];
  }

  sort(a, a+3*n);
  
  long long sum=0;
  for (int i=n+1; i<2*n+1; i++) {
    sum += a[i];
  }

  cout << sum << endl;

}


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

#include<bits/stdc++.h>
int a[600010],n,s;
int main()
{
    scanf("%d",&n);
    for(int i=6*n;i;--i)scanf("%d",&a[i]);
    std::sort(a+1,a+6*n+1;++i);
    for(int i=1;i<=n;++i)s+=a[6*n-2*i+1];
    printf("%d\n",s);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: expected ')' before ';' token
    7 |     std::sort(a+1,a+6*n+1;++i);
      |              ~           ^
      |                          )
a.cc:7:29: error: 'i' was not declared in this scope
    7 |     std::sort(a+1,a+6*n+1;++i);
      |                             ^
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long LL;
 
const int nmax = 100010; const LL mod = 1000003;
 
int N,M,c[nmax],lg[2005][2005],w,as[nmax];
vector<int>G[nmax];

void fct(int nod,,tata,int d,int cul){
 if(d >= 0&&!c[nod])c[nod] = cul;
 if(!d) return;
 
  for(auto it: G[nod])
   if(it != tata)
    fct(it,nod,d-1,cul);
}
 
int main(void){
   int i,j,x,y,T,z,t,e,nod,dist,cul;
//   freopen("txt.in","r",stdin);
//   freopen("txt.out","w",stdout);
   ios::sync_with_stdio(false);
   cin >> N >> M;
   for(i = 1; i <= M; ++i){
      cin >> x >> y;
      G[x].push_back(y);
      G[y].push_back(x);
   }
   
   cin >> T;
   for(i =1 ; i <= T; ++i)
      cin >> as[0] >> as[1] >> as[2];
   while(T--)
    fct(as[T],as[1],as[2]);
  
   for(i = 1; i <= N; ++i)
      cout << c[i] << '\n';
    return 0;
}

Compiler output:
a.cc:12:18: error: expected identifier before ',' token
   12 | void fct(int nod,,tata,int d,int cul){
      |                  ^
a.cc:12:19: error: 'tata' has not been declared
   12 | void fct(int nod,,tata,int d,int cul){
      |                   ^~~~
a.cc: In function 'void fct(int, int, int, int, int)':
a.cc:17:13: error: 'tata' was not declared in this scope
   17 |    if(it != tata)
      |             ^~~~
a.cc:18:8: error: too few arguments to function 'void fct(int, int, int, int, int)'
   18 |     fct(it,nod,d-1,cul);
      |     ~~~^~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | void fct(int nod,,tata,int d,int cul){
      |      ^~~
a.cc: In function 'int main()':
a.cc:37:8: error: too few arguments to function 'void fct(int, int, int, int, int)'
   37 |     fct(as[T],as[1],as[2]);
      |     ~~~^~~~~~~~~~~~~~~~~~~
a.cc:12:6: note: declared here
   12 | void fct(int nod,,tata,int d,int cul){
      |      ^~~
Language: C

#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main() {

  int N;
  cin >> N;

  vector<int64_t> array(3*N);
  for(int64_t i=0;i<3*N;i++)
    cin >> array[i];

  sort(array.begin(), array.end());

  int64_t ans = 0;
  for(int64_t i=N;i<3*N;i+=2)
    ans += array[i];

  cout << ans << endl;

  return 0;
}


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

#include <cstdio>
#include <iostream>
#include <vector>

using namespace std;

int main() {

  int N;
  cin >> N;

  vector<int64_t> array(3*N);
  for(int64_t i=0;i<3*N;i++)
    cin >> array[i];

  sort(array.begin(), array.end());

  int64_t ans = 0;
  for(int64_t i=N;i<3*N;i+=2)
    ans += array[i];

  cout << ans << endl;

  return 0;
}


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

#include <algorithm>
#include <stdio.h>
#include <functional>
using namespace std;

int N, M, i;
long long int r;

template<typename ...> static inline int gc(void) { return getchar(); }
static inline void read(int &x){int k=gc();x=0;for(;;k=gc()){if(isdigit(k)){x=k-48;break;}}for(;;){k=gc();if(!isdigit(k))break;x=x*10+k-48;}}

int main(){
    read(N);
    M = N;
    N <<= 1;
    M += N;
    ++N;
    vector<int> a(M);
    for(; i ^ M; ++i){
        read(a[i]);
    }
    sort(a.begin(), a.end(), greater<int>());
    for(i = 1; i ^ N; i += 2){
        r += a[i];
    }
    printf("%lld", r);
    return 0;
}


Compiler output:
a.cc: In function 'void read(int&)':
a.cc:10:65: error: 'isdigit' was not declared in this scope
   10 | static inline void read(int &x){int k=gc();x=0;for(;;k=gc()){if(isdigit(k)){x=k-48;break;}}for(;;){k=gc();if(!isdigit(k))break;x=x*10+k-48;}}
      |                                                                 ^~~~~~~
a.cc:10:111: error: 'isdigit' was not declared in this scope
   10 | static inline void read(int &x){int k=gc();x=0;for(;;k=gc()){if(isdigit(k)){x=k-48;break;}}for(;;){k=gc();if(!isdigit(k))break;x=x*10+k-48;}}
      |                                                                                                               ^~~~~~~
Language: C++

#include <algorithm>
#include <stdio.h>
using namespace std;

long long int N, M, a[114514], r;

template<typename ...> static inline int gc(void) { return getchar(); }
static inline void read(long long int &x){int k,m=0;x=0;for(;;){k=gc();if(k==45){m=1;break;}if(48<=k&&k<=57){x=k-48;break;}}for(;;){k=gc();if(k<48||k>57)break;x=x*10+k-48;}if(m)x=-x;}

int main(){
    read(N);
    M = N + (N << 1);
    for(int i = 0; i ^ M; ++i){
        read(a[i]);
    }
    sort(a, a + N * 3, greater<long long int>());
    N <<= 1;
    ++N;
    for(int i = 1; i ^ N; i += 2){
        r += a[i];
    }
    printf("%lld", r);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'greater' was not declared in this scope
   16 |     sort(a, a + N * 3, greater<long long int>());
      |                        ^~~~~~~
a.cc:16:32: error: expected primary-expression before 'long'
   16 |     sort(a, a + N * 3, greater<long long int>());
      |                                ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
bool cmp(int x,int y){
	return x>y;
}
int main(){
	int n;
ll sum=0;
	long long a[1000005];
	cin>>n;
	for(int i=0;i<3*n;i++)cin>>a[i];
	sort(a,a+3*n,cmp); 
	for(int i=1;i<=2*n;i+=2){
		sum+=a[i];
	}
	cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: 'll' was not declared in this scope
   11 | ll sum=0;
      | ^~
a.cc:17:17: error: 'sum' was not declared in this scope
   17 |                 sum+=a[i];
      |                 ^~~
a.cc:19:15: error: 'sum' was not declared in this scope
   19 |         cout<<sum<<endl;
      |               ^~~
Language: C++

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

int main(){
    int N;
    scanf("%d", &N);

    int a[3*N];
    for (int i = 0; i < 3*N; i++){
        scanf(" %d", &a[i]);
    }


    sort(a, a+3*N);

    int sum=0;
    for (int i = 0; i < N; i++){
        sum += a[3*N-(2*i+1)-1];
    }
    printf("%d\n", sum);

    return 0;
}
[ohwa

Compiler output:
a.cc:25:1: error: expected unqualified-id before '[' token
   25 | [ohwa
      | ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <deque>
#include <iostream>
using namespace std;
deque<int> A;
long long n;
int tol;
void solve(long long n) {
	if (n==0ll) return;
	if (n%2ll==0ll) {
		solve(n-1ll);
		A.push_back(++tol);
		A.push_back(tol);
	}
	else {
		solve(n/2ll);
		A.front(++tol);
		A.push_back(tol);
	}
}
int main() {
	cin >> n;
	solve(n);
	cout << A.size() << endl;
	for (int i = 0; i < A.size(); ++i) cout << A[i] << " ";
}

Compiler output:
a.cc: In function 'void solve(long long int)':
a.cc:18:24: error: no matching function for call to 'std::deque<int>::front(int&)'
   18 |                 A.front(++tol);
      |                 ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_deque.h:1444:7: note: candidate: 'std::deque<_Tp, _Alloc>::reference std::deque<_Tp, _Alloc>::front() [with _Tp = int; _Alloc = std::allocator<int>; reference = int&]'
 1444 |       front() _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1444:7: note:   candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/stl_deque.h:1456:7: note: candidate: 'std::deque<_Tp, _Alloc>::const_reference std::deque<_Tp, _Alloc>::front() const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&]'
 1456 |       front() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/stl_deque.h:1456:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

const int N = 1e5;
typedef long long LL;

int a[N * 3 + 5];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 1 ; i <= 3 * n ; i++) scanf("%d",&a[i]);
	sort(a + 1 , a + 1 + 3 * n );
	LL sum1 = 0 , sum2 = 0;
	int cnt ;
	for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt++ ) sum1 += a[i];

	for(int i = n + 1 ; i <= 2 * n ; i++) sum2 += a[i];
	printf("%lld\n",max(sum1 , sum2));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: unable to find numeric literal operator 'operator""n'
   21 |         for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt++ ) sum1 += a[i];
      |                     ^~
Language: C

#include <iostream>
#include <algorithm>
 
 
using namespace std;
int main() {
	int n;
	cin >> n;
 
	long a[3 * n];
 
	for (int i = 0; i < n * 3; i++) {
		cin >> a[i]; 
	}
 
	sort(a, a + (3 * n) );
 
	long long count = 0;
	for (int i = 0; i < n; i++) {
		count +=  a[3 * n  - 1 - (i * 2 + 1)] ;
	}
	cout << count << endl;
 
	return 0;
}

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

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

const int N = 1e5;
typedef long long LL;

int a[N * 3 + 5];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 1 ; i <= 3 * n ; i++) scanf("%d",&a[i]);
	sort(a + 1 , a + 1 + 3 * n );
	LL sum1 = 0 , sum2 = 0;
	int cnt ;
	for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt-- ) sum1 += a[i];

	for(int i = n + 1 ; i <= 2 * n ; i++) sum2 += a[i];
	printf("%lld\n",max(sum1 , sum2));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: unable to find numeric literal operator 'operator""n'
   21 |         for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt-- ) sum1 += a[i];
      |                     ^~
Language: C++

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

const int N = 1e5;
typedef long long LL;

int a[N * 3 + 5];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i = 1 ; i <= 3 * n ; i++) scanf("%d",&a[i]);
	sort(a + 1 , a + 1 + 3 * n );
	LL sum1 = 0 , sum2 = 0;
	for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt-- ) sum1 += a[i];
	for(int i = n + 1 ; i <= 2 * n ; i++) sum2 += a[i];
	printf("%lld\n",max(sum1 , sum2));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: unable to find numeric literal operator 'operator""n'
   20 |         for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt-- ) sum1 += a[i];
      |                     ^~
a.cc:20:39: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |         for(int i = 3n - 1 ,cnt = 1 ; cnt <= n ; i -= 2 , cnt-- ) sum1 += a[i];
      |                                       ^~~
      |                                       int
Language: C++

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

int main(int argc, char const *argv[]) {
    int N;
    cin >> N;
    vector<int> a;
    for(int i=0;i<3*N;i++){
        int ai;
        cin >> ai;
        a.push_back(ai);
    }
    sort(a.begin(),a.end());
    long long int ans=0;
    for(int i=N;i<2*N;i++){
        ans+=a[i];
        cout << "added " << a[i] << endl;
    }
    cout << ans << endl;
    return 0;
}


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

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define rep(i,n) for(i=0;i<n;i++)
long long dp[50][50];
int in(void){
	int i;
	scanf("%d",&i);
	return i;
}
long long llin(void){
	long long i;
	scanf("%lld",&i);
	return i;
}
int cmp(const void *a,const void *b){
	return *a-*b;
}
long long min(long long a,long long b){
	return a<b?a:b;
}
long long max(long long a,long long b){
	return a>b?a:b;
}
long long a[300000];
int main(void){
	int i,n;
	long long ans=0;
	n=in();
	rep(i,3*n){
		a[i]=llin();
	}
	qsort(a,3*n,sizeof(long long),cmp);
	for(i=n;i<2*n;i++){
		ans+=a[i];
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
main.c: In function 'cmp':
main.c:18:16: warning: dereferencing 'void *' pointer
   18 |         return *a-*b;
      |                ^~
main.c:18:19: warning: dereferencing 'void *' pointer
   18 |         return *a-*b;
      |                   ^~
main.c:18:16: error: void value not ignored as it ought to be
   18 |         return *a-*b;
      |                ^~
main.c:18:19: error: void value not ignored as it ought to be
   18 |         return *a-*b;
      |                   ^~
Language: C++

#include <iostream>
using namespace std;


int main(){

  int m;

  cin >> m;

  int n = 3*m;

  long long int a[n];

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

  // sort

  int max;

  long long int sum = 0;


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

    if(i >= m*2) break;

    flag swap = false;
    max = i;

    for(int j = i+1; j < n; j++){
      if(a[max] < a[j]) {
	max = j;
	swap = true;
      }
    }

    // swap(&a, i, max);
    if(swap){
      long long int tmp = a[i];
      a[i] = a[max];
      a[max] = tmp;
    }
    

    if(1 == i%2 && i < m*2) sum += a[i];

  }

  cout << sum << endl;

  return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: 'flag' was not declared in this scope
   30 |     flag swap = false;
      |     ^~~~
a.cc:36:16: error: overloaded function with no contextual type information
   36 |         swap = true;
      |                ^~~~
a.cc:41:12: error: cannot resolve overloaded function 'swap' based on conversion to type 'bool'
   41 |     if(swap){
      |            ^
Language: C++

#include <iostream>
#include <iomanip>
#include <cmath>
#include <queue>
#include <map>
#include <cstdlib>
#include <string>
#include <functional>
using namespace std;

int main(void)
{
	int n;
	vector <int>aaaa(300000);
	cin >> n;
	for (int i = 0; i < n * 3; ++i) {
		cin >> aaaa[i];
	}
	long long int sum = 0;
	sort(aaaa.begin(), aaaa.end(), greater<int>());
	for (int i = 0; i < n; ++i) {
		sum += aaaa[n + i];
	}
	cout << sum << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   20 |         sort(aaaa.begin(), aaaa.end(), greater<int>());
      |         ^~~~
      |         sqrt
Language: C++

#include <bits/stdc++.h>

using namespace std;
long long sum=0;
int n,st=1,V[100001];

int main()
{
    cin>>n;
    n*=3;
    for(int i=1;i<=n;i++) f>>V[i];
    sort(V+1,V+1+n);
    for(int i=n-1;i>=st;i-=2) sum+=V[i],st++;


    cout<<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'f' was not declared in this scope
   11 |     for(int i=1;i<=n;i++) f>>V[i];
      |                           ^
Language: Java

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

public class A {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int a[]=new int[3*n];

		for(int i =0;i<n;i++){
			a[3*i]=scan.nextInt();
			a[3*i + 1]=scan.nextInt();
			a[3*i + 2]=scan.nextInt();
		}

		Arrays.sort(a);

		long strength=0;
		for(int i=0;i<n;i++){
			strength+=a[3*n-2 -2*i];
		}
		System.out.println(strength);

	}

}


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

#include <iostream>
#include <vector>
#include "unordered_map"
#include <cmath>
#include <climits>


using ull=unsigned long long;



using namespace std;








int main() {



//    freopen("/Users/balazskemenes/Documents/temp/practise/src/problems/input.txt","r",stdin);


    int N;
    cin >> N;

    int limit = N * 3;

    vector<ull> vec(limit);



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



        cin >> vec[i];

    }




    sort(vec.begin(), vec.end(), [](int a, int b) {return a > b;});



    int counter = 0;

    int subCounter = 0;



    ull sum = 0;


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



        if(subCounter == N) {

            break;

        }

        if(counter % 2 != 0) {


            sum += vec[i];

            ++subCounter;

        }




        ++counter;


    }




    cout << sum;



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   48 |     sort(vec.begin(), vec.end(), [](int a, int b) {return a > b;});
      |     ^~~~
      |     sqrt
Language: C++

include<bits/stdc++.h>
#define INF 1e9+7
#define ll long long
#define F first
#define S second
#define N 300005
#define M 1000000009
#define mp make_pair
#define ull unsigned long long
#define sc(n) scanf("%d",&n)
#define gcd __gcd
#define pb push_back
using namespace std;
int a[N];
int main(){
	ios_base::sync_with_stdio(0);
	int n,k;
	ll sum =0;
	cin>>n;
	for(int i=0;i<3*n;i++)
		cin>>a[i];
	sort(a,a+3*n);
	for(int i=n;i<2*n;i++){
		sum+=a[i];
	}
	cout<<sum<<endl;
	return 0; 	
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'ios_base' has not been declared
   16 |         ios_base::sync_with_stdio(0);
      |         ^~~~~~~~
a.cc:19:9: error: 'cin' was not declared in this scope
   19 |         cin>>n;
      |         ^~~
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |         sort(a,a+3*n);
      |         ^~~~
      |         short
a.cc:26:9: error: 'cout' was not declared in this scope
   26 |         cout<<sum<<endl;
      |         ^~~~
a.cc:26:20: error: 'endl' was not declared in this scope
   26 |         cout<<sum<<endl;
      |                    ^~~~
Language: C++

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

int main(){
  int N;
  long long X=0;
  cin >> N;
  int a[3*N];
  for (int i=0;i<3*N;i++){
    cin >> a[i];
  }
  sort(a.rbegin(),a.rend());
  for(int i=0;i<N;i++){
    X+=a[i*2];
  }
  cout << X << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'rbegin' in 'a', which is of non-class type 'int [(N * 3)]'
   12 |   sort(a.rbegin(),a.rend());
      |          ^~~~~~
a.cc:12:21: error: request for member 'rend' in 'a', which is of non-class type 'int [(N * 3)]'
   12 |   sort(a.rbegin(),a.rend());
      |                     ^~~~
Language: C

#include <iostream>
#include <algorithm>


using namespace std;
int main() {
	int n;
	cin >> n;

	long a[3 * n];

	for (int i = 0; i < n * 3; i++) {
		cin >> a[i]; 
	}

	sort(a, a + (3 * n) );

	long long count = 0;
	for (int i = 0; i < n; i++) {
		count +=  a[3 * n  - 1 - (i * 2 + 1)] ;
	}
	cout << count << endl;

	return 0;
}


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

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

int n;
ll a[300010];

int main() {
	while(scanf("%d", &n)!=EOF){
        for(int i=0; i<3*n; i++) scanf("%lld", &a[i]);
        sort(a, a+3*n);
        ll sum=0;
        for(
            sum += a[3*n-2-2*i];
        }
        printf("%lld\n", sum);
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: 'i' was not declared in this scope
   14 |             sum += a[3*n-2-2*i];
      |                              ^
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:14:33: error: expected ';' before '}' token
   14 |             sum += a[3*n-2-2*i];
      |                                 ^
      |                                 ;
   15 |         }
      |         ~                        
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:14:33: error: expected ')' before '}' token
   14 |             sum += a[3*n-2-2*i];
      |                                 ^
      |                                 )
   15 |         }
      |         ~                        
a.cc:13:12: note: to match this '('
   13 |         for(
      |            ^
a.cc:15:9: error: expected primary-expression before '}' token
   15 |         }
      |         ^
a.cc:16:26: error: 'sum' was not declared in this scope
   16 |         printf("%lld\n", sum);
      |                          ^~~
a.cc: At global scope:
a.cc:18:9: error: expected unqualified-id before 'return'
   18 |         return 0;
      |         ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

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

int main() {
int N;
cin >> N;
vector<int> v(N);
for (int i = 0; i < 3*N; i++) {
sort(v.begin(), v.end());
long long ans = 0;
for (int i = 0; i < N; i++) {
ans += v[N-1+i];
}
cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
   16 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main()
{
	int N;
	cin >> N;
	vector<int> a(3 * N);
	for (int i = 0; i < 3 * N; i++) cin >> a[i];
	long long ans = 0;
	sort(a.begin(), a.end());
	int index = 3 * N - 2;
	for (int i = 0; i < N; i++) {
		ans += a[index];
		index -= 2;
	}
	cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: expected '}' at end of input
   21 |         cout << ans << endl;
      |                             ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include <iostream>

using namespace std;

const int maxN = 1e5;
int a[4 * maxN];

int main() {
    int n;
    ios_base::sync_with_stdio(0);
    cin >> n;
    for (int i = 0; i < 3 * n; i++) {
        cin >> a[i];
    }
    sort(a, a + 3 * n);
    long long sum = 0;
    for (int i = n; i < 3 * n; i += 2) {
        sum += a[i];
    }
    cout << sum << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |     sort(a, a + 3 * n);
      |     ^~~~
      |     short
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())
 
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
using namespace std;
int main(void)
{
  int n;
  cin >> n;
  vector<int> a(n*3);
  REP(i,n*3) cin >> a[i];
  SORT(a);
  LL answer = 0ll;
  REP(i,n) answer+=a[n+i*2]
  cout << answer << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected ';' before 'cout'
   17 |   REP(i,n) answer+=a[n+i*2]
      |                            ^
      |                            ;
   18 |   cout << answer << endl;
      |   ~~~~
Language: C++

#include <algorithm>

using namespace std;

const int MAXN = 3E5 + 10;

int n;
int a[MAXN];

int main(){
	scanf("%d", &n);
	int n0 = n * 3;
	for (int i = 0; i < n0; ++i)
		scanf("%d", a + i);
	sort(a, a + n0);
	long long ans = 0;
	for (int i = 0; i < n; ++i)
		ans += a[n + (i << 1)];
	printf("%lld\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'scanf' was not declared in this scope
   11 |         scanf("%d", &n);
      |         ^~~~~
a.cc:19:9: error: 'printf' was not declared in this scope
   19 |         printf("%lld\n", ans);
      |         ^~~~~~
a.cc:2:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    1 | #include <algorithm>
  +++ |+#include <cstdio>
    2 |
Language: C++

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

typedef long long int lli;

int main(void)
{
	lli n;
	scanf("%lld", &n);
	lli a[3*n];
	for(lli i = 0;i < 3*n;i++) scanf("%lld", &a[i]);
	sort(a, a+3*n);
	lli res = 0;
	for(lli i = n;i < 2*n;i++) res += a[i];
	printf("%lld\n", res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |         sort(a, a+3*n);
      |         ^~~~
      |         short
Language: C++

#include <iostream>
#include <vector>
#define ll long long
using namespace std;
#define pb push_back
const int N = 1e5 + 5;

inline int read() {
    int x = 0; char ch = getchar();
    for (; !isdigit(ch); ch = getchar());
    for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
    return x;
}

void W(int x) { if (x >= 10) W(x / 10); putchar(x % 10 + '0'); }

vector<int> g[N];
int mx[N], n, col[N], Q, d[N], c[N], m, p[N];

void dfs(int x) {
    if (!col[x]) col[x] = c[Q];
    for (int i : g[x]) if (mx[x] - 1 > mx[i]) mx[i] = mx[x] - 1, dfs(i);
}

int main() {
    memset(mx, -1, sizeof(mx));

    n = read(), m = read();
    for (int i = 1, uu, vv; i <= m; i++)
        uu = read(), vv = read(), g[uu].pb(vv), g[vv].pb(uu);
    Q = read();
    for (int i = 1; i <= Q; i++) p[i] = read(), d[i] = read(), c[i] = read();

    for (; Q; Q--) if (d[Q] > mx[p[Q]]) mx[p[Q]] = d[Q], dfs(p[Q]);

    for (int i = 1; i <= n; i++) W(col[i]), puts("");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'memset' was not declared in this scope
   26 |     memset(mx, -1, sizeof(mx));
      |     ^~~~~~
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 | #define ll long long
Language: C++

#include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
using namespace std;
#define ll long long
const int maxn = 1e5+10;
int n,m,q;
vector <int> vec[maxn];
int ans[maxn];
int dp[maxn][11];
int x[maxn],y[maxn],z[maxn];
int vis[maxn];
void dfs(int u,int d,int c)
{
	if(!ans[u]) ans[u]=z[c];
	if(dp[u][d]) return ;
	dp[u][d]=1;
	if(vis[u]==c) return ; 
	vis[u]=c;
	if(d==0) return ;
	for(auto v:vec[u]) dfs(v,d-1,c);
}

int main()
{
	scanf("%d%d",&n,&m);
	int u,v;
	while(m--)
	{
		scanf("%d%d",&u,&v);
		vec[u].push_back(v);
		vec[v].push_back(u);
	}
	scanf("%d",&q);
	for(int i=1;i<=q;i++)
	scanf("%d%d%d",&x[i],&y[i],&z[i]);
	for(int i=q;i;i--) dfs(x[i],y[i],i),dfs2(x[i],y[i]);
	for(int i=1;i<=n;i++) printf("%d\n",ans[i]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:45: error: 'dfs2' was not declared in this scope; did you mean 'dfs'?
   41 |         for(int i=q;i;i--) dfs(x[i],y[i],i),dfs2(x[i],y[i]);
      |                                             ^~~~
      |                                             dfs
Language: C++

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

const int dm = 1 << 20;
char dn[dm], * di = dn;
inline void putint(int X) {
	if (X == 0) {
		*di++ = '0';
		*di++ = '\n';
		return;
	}
	int keta = 0;
	char C[10];
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}


int E[200001], ne[200001];
int H[100001];
int kotae[100001];
char Vis[100001];
void sagasu(int P, char D, int C) {
	if (D == 0 && kotae[P] == 0) kotae[P] = C;
	else if (Vis[P] < D) {
		Vis[P] = D;
		if (kotae[P] == 0) kotae[P] = C;
		for (int p = H[P]; p; p = E[p].second) {
			sagasu(E[p].first, D - 1, C);
		}
	}
}

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


	int N, M, Q;
	N = getint();
	M = getint();
	for (int i = 1; i < 2 * M;) {
		int a = getint(), b = getint();
		E[i] = a;
		ne[i] = H[b];
		H[b] = i++;
		E[i] = b;
		ne[i] = H[a];
		H[a] = i++;
	}
	Q = getint();
	int v[100000], d[100000], c[100000];
	rep(i, Q) {
		v[i] = getint();
		d[i] = getint();
		c[i] = getint();
	}
	for (int i = Q - 1; i >= 0; i--) {
		sagasu(v[i], d[i], c[i]);
	}
	rep1(i, N) {
		putint(kotae[i]);
	}

	fwrite_unlocked(dn, di - dn, 1, stdout);

	Would you please return 0;
}

Compiler output:
a.cc: In function 'void sagasu(int, char, int)':
a.cc:62:48: error: request for member 'second' in 'E[p]', which is of non-class type 'int'
   62 |                 for (int p = H[P]; p; p = E[p].second) {
      |                                                ^~~~~~
a.cc:63:37: error: request for member 'first' in 'E[p]', which is of non-class type 'int'
   63 |                         sagasu(E[p].first, D - 1, C);
      |                                     ^~~~~
Language: C++

#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;	// 998244353
using ll = long long;
using namespace std;

struct query{
	int vert;
	int dist;
	int col;
};

vector<int> graph[100010];
vector<query> ql;
// farbe[v] := 頂点 v は何色か？（初期値 0）
int farbe[100010];
// dmax[v] := 頂点 v から距離いくつまでのノードが塗られているか？
int dmax[100010];

void init(){
	for( int i = 0; i < 100010; ++i ) dmax[i] = -1;
}

/*
void dfs( int i, int now, int nowd ){
	query &q = ql[i];
	if( nowd > q.dist ) return;
	if( farbe[now] == 0 ) farbe[now] = q.col;
	for( auto next : graph[now] ){
		dfs( i, next, nowd+1 );
	} 
}
*/

int main(){
	init();
	int n, m; cin >> n >> m;
	for( int i = 0; i < m; ++i ){
		int a, b; cin >> a >> b; --a; --b;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
	int qnum; cin >> qnum;
	for( int i = 0; i < qnum; ++i ){
		int vt, dt, ct; cin >> vt >> dt >> ct; --vt;
		ql.push_back((query){vt, dt, ct});
	}
	reverse( ql.begin(), ql.end() );
	for( int i = 0; i < qnum; ++i ){
		query &q = ql[i];
		if( q.dist <= dmax[q.vert] ) continue;
		dmax[q.vert] = q.dist;
		int d[n];
		for( int j = 0; j < n; ++j ) d[j] = -1;
		queue<int> que;
		que.insert(q.vert);
		d[q.vert] = 0;
		while( !que.empty() ){
			int v = que.top(); que.pop();
			if( farbe[v] == 0 ) farbe[v] = q.col;
			if( d[v] == q.dist ) continue;
			for( auto next : graph[v] ){
				if( d[next] != -1 ) continue;
				que.insert(next);
				d[next] = d[v]+1;
			} 
		}
	}
	for( int i = 0; i < n; ++i ){
		cout << farbe[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:21: error: 'class std::queue<int>' has no member named 'insert'
   57 |                 que.insert(q.vert);
      |                     ^~~~~~
a.cc:60:37: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
   60 |                         int v = que.top(); que.pop();
      |                                     ^~~
      |                                     pop
a.cc:65:37: error: 'class std::queue<int>' has no member named 'insert'
   65 |                                 que.insert(next);
      |                                     ^~~~~~
Language: C

#include<bits/stdc++.h>
using namespace std;
inline int read(int &a){a=0;int f=1;char c=getchar();
for(;c<'0'||c>'9';c=getchar())if(c=='-')f=-1;
for(;c<='9' && c>='0';a=a*10+c-'0',c=getchar());return a*=f;}
inline void print(int a){int s[20],t=0;if(!a){putchar('0');putchar('\n');return;}
while(a){s[t++]=a%10,a/=10;}for(;t--;putchar(s[t]+'0'));putchar('\n');}
struct pricture{
	int next,y;
} e[200010];
int link[100010],lin;
void add(int a,int b){e[++lin].next=link[a],link[a]=lin,e[lin].y=b;}
int n,m,q;
int v[100010],d[100010],c[100010];
int s[100010],a[100010];

void dfs(int x,int d,int l)
{
	if(!a[x]) a[x]=l;
	if(!d || s[x]>=d) return;
	s[x]=d;
	for(int i=link[x];i;i=e[i].next)
	dfs(e[i].y,d-1,l);
}

int main()
{
	read(n),read(m);
	for(int i=1;i<=m;i++)
	{
		int s,t;
		read(s),read(t);
		add(s,t);
		add(t,s);
	}
	read(q);
	for(int i=1;i<=q;i++) read(v[i]),read(d[i]),read(c[i]);
	for(int i=q;i>=1;i--) dfs(v[i],d[i],c[i]);
	for(int i=1;i<=n;i++) print(a[i]);
	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.