criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class bublesort {
	public static void main(String[] args) throws Exception{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(bf.readLine());
		int temp;
		int[] nums = new int[N];
		for(int i=0; i<N;i++){
			nums[i] = Integer.parseInt(bf.readLine());
		}
		int rta =0;
		boolean cambio = true;
		while(cambio){
			cambio = false;
			for(int i=0; i<N-2;i++){
				if(nums[i]>nums[i+2]){
					cambio=true;
					temp=nums[i];
					nums[i]=nums[i+2];
					nums[i+2]=temp;
				}
			}
		}
		for(int i=0; i<N-1;i++){
			if(nums[i]>nums[i+1]){
				rta++;
				temp = nums[i];
				nums[i]=nums[i+1];
				nums[i+1]=temp;
			}
		}
		System.out.println(rta);
	}
}


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

#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <algorithm> 
#include <iterator> 
#include <map> 

using namespace std;


long long int N;
vector <long long int> A;
//vector <long long int> B;
long long int ka;
long long int co=0;
//int dp[1000][1000];//右が1、左が2
map<long long int,long long  int> mp;

int main(){
	scanf("%lld",&N);
	for(int i=0;i<N;i++){
		scanf("%lld",&ka);
		A.push_back(ka);
		mp[ka]=i;
	}
	
	sort(B.begin(),B.end());
	
	for(int i=0;i<N;i++){
		if(mp[A[i]]%2 != i%2)co++;
	}
	
	printf("%lld\n",(long long int)co/2);
	
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'B' was not declared in this scope
   28 |         sort(B.begin(),B.end());
      |              ^
Language: C++

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

int main() {

    int n; cin >> n;
    vector<int> odd,even;
    for(int i=0; i<n; i++){
	int in; scanf("%d",&in);
	if(i%2==0)
	    even.push_back(in);
	else
	    odd.push_back(in);
    }

    sort(odd.begin(),odd.end());   reverse(odd.begin(),odd.end());
    sort(even.begin(),even.end()); reverse(even.begin(),even.end());

    int ans = 0,a=0,b=0;
    for(int i=0; i<n; i++){
	if( odd.size() == 0 or even.size() == 0 ) {
	    if( odd.size()
	    break;
	}
	int odd_min = odd[odd.size()-1];
	int even_min = even[even.size()-1];
	cout << "even_min : " << even_min << ", odd_min : " << odd_min << endl;
	if(i%2 == 0) { // even をいれるはず
	    if( odd_min < even_min ) {
		a ++;
		odd.pop_back();
		even.pop_back();
		odd.push_back( even_min );
	    }
	    else
		even.pop_back();
	}
	else{
	    if( odd_min > even_min ) { // odd をいれるはず
		b ++;
		even.pop_back();
		odd.pop_back();
		even.push_back( odd_min );
	    }
	    else
		odd.pop_back();
	}
    }
	cout << min(a,b) << endl;
    
    

    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: expected ';' before 'break'
   22 |             if( odd.size()
      |                           ^
      |                           ;
   23 |             break;
      |             ~~~~~          
a.cc:22:25: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   22 |             if( odd.size()
      |                 ~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:992:7: note: declared here
  992 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
a.cc:23:19: error: expected ')' before '}' token
   23 |             break;
      |                   ^
      |                   )
   24 |         }
      |         ~          
a.cc:22:15: note: to match this '('
   22 |             if( odd.size()
      |               ^
a.cc:24:9: error: expected primary-expression before '}' token
   24 |         }
      |         ^
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define Pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define PI 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE() freopen("out0.txt","w",stdout)
#define IN scanf
#define OUT(x) cout<<x<<endl
#define LL long long
#define ll long long
#define ULL unsigned long long
#define EPS 1e-14
#define FST first
#define SEC second

#define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))

#include<iostream>
#include <vector> 

using namespace std;
int main()
{
  // 入力
  int N;
  cin >> N;
  int A[N];
  REP(i, N) {
    cin >> A[i];
  }
  // ダミー入力
  /*
  int N = 5;
  int A[] = {10, 8, 5, 3, 2};
  */

  int B[N];
  int count = 0;

  copy(A, A + N, B);
  sort(B, B + N);

  REP(i, N) {
    if (i % 2 != FIND(B, N, A[i]) % 2) count++;
  }
  OUT(count/2);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   58 |   sort(B, B + N);
      |   ^~~~
      |   short
a.cc:33:50: error: no matching function for call to 'find(int [N], int*, int&)'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:18: note: in expansion of macro 'FIND'
   61 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
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:35:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:33:50: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:18: note: in expansion of macro 'FIND'
   61 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define Pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define PI 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE() freopen("out0.txt","w",stdout)
#define IN scanf
#define OUT(x) cout<<x<<endl
#define LL long long
#define ll long long
#define ULL unsigned long long
#define EPS 1e-14
#define FST first
#define SEC second

#define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))

#include<iostream>

using namespace std;
int main()
{
  // 入力
  int N;
  cin >> N;
  int A[N];
  REP(i, N) {
    cin >> A[i];
  }
  // ダミー入力
  /*
  int N = 5;
  int A[] = {10, 8, 5, 3, 2};
  */

  int B[N];
  int count = 0;

  copy(A, A + N, B);
  sort(B, B + N);

  REP(i, N) {
    if (i % 2 != FIND(B, N, A[i]) % 2) count++;
  }
  OUT(count/2);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   57 |   sort(B, B + N);
      |   ^~~~
      |   short
a.cc:33:50: error: no matching function for call to 'find(int [N], int*, int&)'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
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:35:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:33:50: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define Pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define PI 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE() freopen("out0.txt","w",stdout)
#define IN scanf
#define OUT(x) cout<<x<<endl
#define LL long long
#define ll long long
#define ULL unsigned long long
#define EPS 1e-14
#define FST first
#define SEC second

#define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))

#include<iostream>

using namespace std;
int main()
{
  // 入力
  int N;
  cin >> N;
  int A[N];
  REP(i, N) {
    cin >> A[i];
  }
  // ダミー入力
  /*
  int N = 5;
  int A[] = {10, 8, 5, 3, 2};
  */

  int B[N];
  int count = 0;

  std::copy(A, A + N, B);
  std::sort(B, B + N);

  REP(i, N) {
    if (i % 2 != FIND(B, N, A[i]) % 2) count++;
  }
  OUT(count/2);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   57 |   std::sort(B, B + N);
      |        ^~~~
      |        qsort
a.cc:33:50: error: no matching function for call to 'find(int [N], int*, int&)'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
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:35:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:33:50: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   33 | #define FIND(ary, length, val) distance(ary, find(ary, ary + length, val))
      |                                              ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
Language: C++

using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define Pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define PI 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE() freopen("out0.txt","w",stdout)
#define IN scanf
#define OUT(x) cout<<x<<endl
#define LL long long
#define ll long long
#define ULL unsigned long long
#define EPS 1e-14
#define FST first
#define SEC second

#define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))

#include<iostream>

int main()
{
  // 入力
  int N;
  cin >> N;
  int A[N];
  REP(i, N) {
    cin >> A[i];
  }
  // ダミー入力
  /*
  int N = 5;
  int A[] = {10, 8, 5, 3, 2};
  */

  int B[N];
  int count = 0;

  std::copy(A, A + N, B);
  std::sort(B, B + N);

  REP(i, N) {
    if (i % 2 != FIND(B, N, A[i]) % 2) count++;
  }
  OUT(count/2);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   58 |   std::sort(B, B + N);
      |        ^~~~
      |        qsort
a.cc:35:60: error: no matching function for call to 'find(int [N], int*, int&)'
   35 | #define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:18: note: in expansion of macro 'FIND'
   61 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
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:37:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:35:60: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   35 | #define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:61:18: note: in expansion of macro 'FIND'
   61 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
Language: C++

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

#define INF INT_MAX/3
#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define SET(a,c) memset(a,c,sizeof a)
#define CLR(a) memset(a,0,sizeof a)
#define PII pair<int,int>
#define PCC pair<char,char>
#define PIC pair<int,char>
#define Pci pair<char,int>
#define VS vector<string>
#define VI vector<int>
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define PI 2*acos(0.0)
#define INFILE() freopen("in0.txt","r",stdin)
#define OUTFILE() freopen("out0.txt","w",stdout)
#define IN scanf
#define OUT(x) cout<<x<<endl
#define LL long long
#define ll long long
#define ULL unsigned long long
#define EPS 1e-14
#define FST first
#define SEC second

#define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))

#include<iostream>

using namespace std;
int main()
{
  // 入力
  int N;
  cin >> N;
  int A[N];
  REP(i, N) {
    cin >> A[i];
  }
  // ダミー入力
  /*
  int N = 5;
  int A[] = {10, 8, 5, 3, 2};
  */

  int B[N];
  int count = 0;

  std::copy(A, A + N, B);
  std::sort(B, B + N);

  REP(i, N) {
    if (i % 2 != FIND(B, N, A[i]) % 2) count++;
  }
  OUT(count/2);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   57 |   std::sort(B, B + N);
      |        ^~~~
      |        qsort
a.cc:33:60: error: no matching function for call to 'find(int [N], int*, int&)'
   33 | #define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
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:35:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:33:60: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   33 | #define FIND(ary, length, val) std::distance(ary, std::find(ary, ary + length, val))
      |                                                   ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:60:18: note: in expansion of macro 'FIND'
   60 |     if (i % 2 != FIND(B, N, A[i]) % 2) count++;
      |                  ^~~~
Language: Java

/* Filename: AGC003C.java
 * Author: Mushiyo
 */

import java.util.Scanner;
import java.util.TreeSet;

public class AGC003C {

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

		while (input.hasNext()) {
			int N = input.nextInt();
			TreeSet<Integer> even = new TreeSet<Integer>();
			TreeSet<Integer> odd = new TreeSet<Integer>();
			
			for(int i = 0; i < N; ++i){
				if(i % 2 == 0){
					even.add(input.nextInt());
				} else {
					odd.add(input.nextInt());
				}
			}
			
			Integer[] evenA = even.toArray(new Integer[0]);
			Integer[] oddA = odd.toArray(new Integer[0]);
			int[] A = new int[N];
			
			for(int i = 0; i < A.length; ++i){
				if(i % 2 == 0){
					A[i] = evenA[i / 2];
				} else {
					A[i] = oddA[i / 2];
				}
			}
			
			long swap2 = 0;
			for(int i = 0; i < A.length; ++i){
				for(int j = i + 1; j < A.length; ++j){
					if(A[j] < A[i]){
						++swap2;
					}
				}
			}
			
			System.out.println(swap2);
		}
	}

}


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

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

int N;
vector<int> L1;
vector<int> L2;

int main() {
    int a, b, c;
    scanf("%d", &N);
    for (int i = 0; i < N/2; i++) {
        scanf("%d %d", &a, &b);
        L1.push_back(a);
        L2.push_back(b);
    }
    if (N & 1) {
        scanf("%d", &a);
        L1.push_back(a);
    }
    sort(L1.begin(), L1.end());
    sort(L2.begin(), L2.end());

    int res = 0;
    a = L1[0];
    b = L2[0];
    if (a > b) {
        swap(a, b);
        res++;
    }
    for (int i = 2; i < N; i++) {
        if ((i & 1) == 0) c = L1[i / 2];
        else              c = L2[i / 2];
        if (c < a) {
            res++;
        } else if (c < b) {
            a = c;
            b = b;
            res++;
        } else {
            a = b;
            b = c;
        }
    }
    printf("%d\n", res);
}


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

#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <cstring>
#include <math.h>
#include <bitset>
#include <time.h>
#include <set>
#define Inf 100000000000ll
#define MAXN 100000
#define MAXX 5
#define ll long long
using namespace std;


int A[MAXN+2];
int main() {
    int N;
    cin>>N;
    map<int,int> init_pos;
    //srand(time(NULL));
    for(int i=0;i<N;i++) {
        cin>>A[i];
        //A[i]=rand()%1000000000;
        init_pos[A[i]]=i;
    }
    
    map<int,int> final_pos;
    sort(A,A+N);
    for(int i=0;i<N;i++) {
        final_pos[A[i]]=i;
    }
    
    int ct = 0;
    for(int i=0;i<N;i++) {
        int d = abs(final_pos[A[i]] - init_pos[A[i]]);
        d = d % 2;
        if (d != 0)
            ct++;
    }
    
    cout << ct / 2 << endl;
    
    
}

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

#include <iostream>

using namespace std;

int main() {
    int N;
    int a[100000];
    int b[100000];
    cin >> N;
    int t = 0;
    for (int j = 0; j < N; ++j) {
        cin >> a[j];
        b[j] = a[j];
    }
    sort(a, a + N);
    for (int j = 0; j < N; ++j) {
        int i = find(a, a + N, b[j]) - a;
        if (i % 2 != j % 2) {
            t ++;
        }
    }
    cout << t / 2 << 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 + N);
      |     ^~~~
      |     short
a.cc:17:21: error: no matching function for call to 'find(int [100000], int*, int&)'
   17 |         int i = find(a, a + N, b[j]) - a;
      |                 ~~~~^~~~~~~~~~~~~~~~
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:1:
/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> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_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:17:21: note:   mismatched types 'std::istreambuf_iterator<_CharT>' and 'int*'
   17 |         int i = find(a, a + N, b[j]) - a;
      |                 ~~~~^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

struct B {
    int v;
    bool t;
};

B b[100005];

bool comp(B a1, B a2) {
    return a1.v < a2.v;
}

int main() {
    int N;
    cin >> N;
    for(int i = 0; i < N; i++) {
        cin >> b[i].v;
        b[i].t = i%2;
    }
    sort(b, b+N, comp);
    int ans =0;
    for(int i = 0; i < N; i += 2) {
        if(b[i].t) {
            ans++;
        }

    }
    cout << ans << "\n";
}


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

#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <ctime>
#include <cstdlib>
#include <bitset>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int N = 101010;
int n,a[N];
vi V;

int main(){
    scanf("%d",&n);
    rep(i,0,n) scanf("%d",a + i) , V.pb(a[i]);
    sort(all(V));
    rep(i,0,n) a[i] = lower_bound(all(V),a[i]) - V.begin();
    int ans = 0;
    rep(i,0,n) ans += (a[i]&1) != (i&1);
    ans >>= 1;
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   34 |     sort(all(V));
      |     ^~~~
      |     sqrt
Language: C++

/**
 * Created by abhishek on 8/4/2016.
 */
import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int array[] = new int[n + 1];
        int temp[] =  new int[n + 1];
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 1; i <= n; i++) {
            int a = Integer.parseInt(br.readLine());
            array[i] = a;
            temp[i] = a;
        }
        Arrays.sort(temp);
        for(int i = 1;i <= n;i++){
            int pos = Arrays.binarySearch(temp,array[i]);
            map.put(array[i],pos);
        }
        int cnt = 0;
        for (int i = 1; i <= n; i++) {
            int pos = map.get(array[i]);
            //System.out.println(array[i] + " " + pos + " " + i);
            if(pos >= i)continue;
            if (((i - pos) & 1) == 1) cnt++;
        }
        System.out.println((int) Math.ceil(cnt * 1.0 / 2));
    }
}


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

/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author RiaD
 */

#include <iostream>
#include <fstream>

#include <iostream>

using namespace std;

class Third {
public:
	void solve(std::istream& in, std::ostream& out) {
		int n;
		in >> n;
		vector<pair<int, int>> v(n);
		for (int i: range(n)) {
			in >> v[i].first;
			v[i].second = i;
		}


		sort(v);

		int ans = 0;
		for (int i = 0; i < n; i += 2) {
			if (v[i].second % 2) {
				++ans;
			}
		}

		out << ans;



	}
};


int main() {
	std::ios_base::sync_with_stdio(false);
	Third solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	in.tie(0);
	out << std::fixed;
	out.precision(20);
	solver.solve(in, out);
	return 0;
}


Compiler output:
a.cc: In member function 'void Third::solve(std::istream&, std::ostream&)':
a.cc:19:17: error: 'vector' was not declared in this scope
   19 |                 vector<pair<int, int>> v(n);
      |                 ^~~~~~
a.cc:9:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    8 | #include <fstream>
  +++ |+#include <vector>
    9 | 
a.cc:19:37: error: expected primary-expression before '>' token
   19 |                 vector<pair<int, int>> v(n);
      |                                     ^~
a.cc:19:40: error: 'v' was not declared in this scope
   19 |                 vector<pair<int, int>> v(n);
      |                                        ^
a.cc:20:29: error: 'range' was not declared in this scope
   20 |                 for (int i: range(n)) {
      |                             ^~~~~
a.cc:26:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |                 sort(v);
      |                 ^~~~
      |                 short
Language: C++

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

#define vist fuckitwholefamily
#define int long long
#define MAXN 100005
#define Int int

int n,ans,s[MAXN];
map <int,int> tot;
map <int,bool> vis;

template <typename T> inline void read (T &t){t = 0;char c = getchar();int f = 1;while (c < '0' || c > '9'){if (c == '-') f = -f;c = getchar();}while (c >= '0' && c <= '9'){t = (t << 3) + (t << 1) + c - '0';c = getchar();} t *= f;}
template <typename T,typename ... Args> inline void read (T &t,Args&... args){read (t);read (args...);}
template <typename T> inline void write (T x){if (x < 0){x = -x;putchar ('-');}if (x > 9) write (x / 10);putchar (x % 10 + '0');}

int cnt,prime[MAXN],visit[MAXN];

void Euler (int up){
	for (Int i = 2;i <= up;++ i){
		if (!visit[i]) prime[++ cnt] = i;
		for (Int j = 1;j <= cnt && i * prime[j] <= up;++ j){
			visit[i * prime[j]] = 1;
			if (i % prime[j] == 0) break; 
		}
	}
}

signed main(){
	read (n);Euler (1e5);
	for (Int i = 1;i <= n;++ i){
		read (s[i]);
		for (Int p = 2;p * p * p <= s[i];++ p) while (s[i] % (p * p * p) == 0) s[i] /= p * p * p; 
		if (s[i] != 1) tot[s[i]] ++;
		else ans = 1;
	}
	for (Int i = 1;i <= n;++ i) 
		if (vis[s[i]] || s[i] == 1) continue;
		else{
			int now = s[i],nowto = 1;
			for (Int j = 1;j <= cnt && prime[j] * prime[j] <= now;++ j)
				if (now % (prime[j] * prime[j]) == 0){
					now /= prime[j] * prime[j],nowto *= prime[j];
				}
			nowto *= now * now;
			vis[s[i]] = vis[nowto] = 1,ans += max (tot[s[i]],tot[nowto]);
		}
	write (ans),putchar ('\n');
	return 0;
}

Compiler output:
a.cc: In function 'void Euler(long long int)':
a.cc:21:22: error: reference to 'visit' is ambiguous
   21 |                 if (!visit[i]) prime[++ cnt] = i;
      |                      ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:21: note:                 'long long int visit [100005]'
   17 | int cnt,prime[MAXN],visit[MAXN];
      |                     ^~~~~
a.cc:23:25: error: reference to 'visit' is ambiguous
   23 |                         visit[i * prime[j]] = 1;
      |                         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:17:21: note:                 'long long int visit [100005]'
   17 | int cnt,prime[MAXN],visit[MAXN];
      |                     ^~~~~
Language: C++

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

#define int long long
#define MAXN 100005
#define Int int

int n,ans,s[MAXN];
map <int,int> tot;
map <int,bool> vis;

template <typename T> inline void read (T &t){t = 0;char c = getchar();int f = 1;while (c < '0' || c > '9'){if (c == '-') f = -f;c = getchar();}while (c >= '0' && c <= '9'){t = (t << 3) + (t << 1) + c - '0';c = getchar();} t *= f;}
template <typename T,typename ... Args> inline void read (T &t,Args&... args){read (t);read (args...);}
template <typename T> inline void write (T x){if (x < 0){x = -x;putchar ('-');}if (x > 9) write (x / 10);putchar (x % 10 + '0');}

int cnt,prime[MAXN],visit[MAXN];

void Euler (int up){
	for (Int i = 2;i <= up;++ i){
		if (!visit[i]) prime[++ cnt] = i;
		for (Int j = 1;j <= cnt && i * prime[j] <= up;++ j){
			visit[i * prime[j]] = 1;
			if (i % prime[j] == 0) break; 
		}
	}
}

signed main(){
	read (n);Euler (1e5);
	for (Int i = 1;i <= n;++ i){
		read (s[i]);
		for (Int p = 2;p * p * p <= s[i];++ p) while (s[i] % (p * p * p) == 0) s[i] /= p * p * p; 
		if (s[i] != 1) tot[s[i]] ++;
		else ans = 1;
	}
	for (Int i = 1;i <= n;++ i) 
		if (vis[s[i]] || s[i] == 1) continue;
		else{
			int now = s[i],nowto = 1;
			for (Int j = 1;j <= cnt && prime[j] * prime[j] <= now;++ j)
				if (now % (prime[j] * prime[j]) == 0){
					now /= prime[j] * prime[j],nowto *= prime[j];
				}
			nowto *= now * now;
			vis[s[i]] = vis[nowto] = 1,ans += max (tot[s[i]],tot[nowto]);
		}
	write (ans),putchar ('\n');
	return 0;
}

Compiler output:
a.cc: In function 'void Euler(long long int)':
a.cc:20:22: error: reference to 'visit' is ambiguous
   20 |                 if (!visit[i]) prime[++ cnt] = i;
      |                      ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:21: note:                 'long long int visit [100005]'
   16 | int cnt,prime[MAXN],visit[MAXN];
      |                     ^~~~~
a.cc:22:25: error: reference to 'visit' is ambiguous
   22 |                         visit[i * prime[j]] = 1;
      |                         ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:21: note:                 'long long int visit [100005]'
   16 | int cnt,prime[MAXN],visit[MAXN];
      |                     ^~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;


typedef long long ll ;
const ll mk = 100055;
const ll logn  = 29;
const ll mod = 1e9 + 7;

#define endl "\n"
#define IOS  ios::sync_with_stdio(0); cin.tie(0);
#define fi first
#define se second
#define pii pair<ll,ll>
#define pq priority_queue
#define UwU              uwu
#define mp make_pair
#define Miku             best_waifu
#define Miku_dancing     god_waving
#define Miku_singing     god_shaking
#define a_Miku           cho_doi_bot_ngu

vector <ll> Pr;
int d[mk + 5];

unordered_map <ll,int> occurance;
 
unordered_map <ll,pii> cnt;


vector < pii > Rev; 


void Sieve()
{
  
    for(int i = 2; i <= mk; i++) {
	    if(d[i]) Pr.push_back(i);
	    for(int j = 0 ; Pr[j] * i <=mk&& j < Pr.size() && Pr[j] <= d[i] ; j++) {
	    	d[i * Pr[j]] = Pr[j];
		}
	}
}
inline pair<ll,ll> root(ll x)
{
    ll val=1,reverse_val=1;
    for (auto i: Pr)
    {
        if(i*i>x) break;
        if(x%i==0)
        {
            int num=0;
            while(x%i==0)
            {
                num++;
                x/=i;
            }
            num%=3;
            for(int j = 0 ; j < num ; j++) val *= i;
            for(int j = 0 ; j < 3 - num) reverse_val *= i;
        }
    }
    if(x>1)
    {
    	int num = 1; 
    	for(int i = 0 ; i < num; i++) val *= x; 
    	for(int i = 0 ; i < 3 - num ; i++) reverse_val *= x; 
    }
    return mp(val,reverse_val);
}
  

void solve()
{
    Sieve();
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        ll x; cin >> x; 
        if(cnt.count(x)==0)
        {
            pair<ll,ll> cur= root(x);
            Rev.push_back(cur);
            cnt[x]=cur;
        }
        else
            Rev.push_back(cnt[x]);
            occurance[Rev.back().first]++;
    }
    ll ans=0;
    if(occurance[1]>=1) ans++;
    for (int i = 0; i < n; i++)
    {
    	
        ll value = Rev[i].first;
        int cur_val = occurance[value];
        if(cur_val==0) continue;
        if(value==1) continue;
        ll rever = Rev[i].second;
        ans += max(cur_val, occurance[rever]);
        occurance[rever]=0;
        occurance[value]=0;
       /// cout <<  " Miku huhuhu"
    }
    cout << ans << endl;
}
 
int main()
{
    solve();
}


Compiler output:
a.cc: In function 'std::pair<long long int, long long int> root(ll)':
a.cc:61:40: error: expected ';' before ')' token
   61 |             for(int j = 0 ; j < 3 - num) reverse_val *= i;
      |                                        ^
      |                                        ;
Language: C++

#include<bits/stdc++.h>

using namespace std;


typedef long long ll ;
const ll mk = 100055;
const ll logn  = 29;
const ll mod = 1e9 + 7;

#define endl "\n"
#define IOS  ios::sync_with_stdio(0); cin.tie(0);
#define fi first
#define se second
#define pii pair<ll,ll>
#define pq priority_queue
#define UwU              uwu
#define mp make_pair
#define Miku             best_waifu
#define Miku_dancing     god_waving
#define Miku_singing     god_shaking
#define a_Miku           cho_doi_bot_ngu

vector <ll> Pr;
int d[mk + 5];

unordered_map <ll,int> occurance;
 
unordered_map <ll,pii> cnt;


vector < pii > Rev; 


void Sieve()
{
  
    for(int i = 2; i <= mk; i++) {
	    if(d[i]) Pr.push_back(i);
	    for(int j = 0 ; Pr[j] * i <=mk&& j < Pr.size() && Pr[j] <= d[i] ; j++) {
	    	d[i * Pr[j]] = Pr[j];
		}
	}
}
inline pair<ll,ll> root(ll x)
{
    ll val=1,reverse_val=1;
    for (auto i: Pr)
    {
        if(i*i>x) break;
        if(x%i==0)
        {
            int num=0;
            while(x%i==0)
            {
                num++;
                x/=i;
            }
            num%=3;
            for(int j = 0 ; j < num ; j++) val *= i;
            for(int j = 0 ; j < 3 - num) reverse_val *= i;
        }
    }
    if(x>1)
    {
    	num = 1; 
    	for(int i = 0 ; i < num; i++) val *= x; 
    	for(int i = 0 ; i < 3 - num ; i++) reverse_val *= x; 
    }
    return mp(val,reverse_val);
}
  

void solve()
{
    Sieve();
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        ll x; cin >> x; 
        if(cnt.count(x)==0)
        {
            pair<ll,ll> cur= root(x);
            Rev.push_back(cur);
            cnt[x]=cur;
        }
        else
            Rev.push_back(cnt[x]);
            occurance[Rev.back().first]++;
    }
    ll ans=0;
    if(occurance[1]>=1) ans++;
    for (int i = 0; i < n; i++)
    {
    	
        ll value = Rev[i].first;
        int cur_val = occurance[value];
        if(cur_val==0) continue;
        if(value==1) continue;
        ll rever = Rev[i].second;
        ans += max(cur_val, occurance[rever]);
        occurance[rever]=0;
        occurance[value]=0;
       /// cout <<  " Miku huhuhu"
    }
    cout << ans << endl;
}
 
int main()
{
    solve();
}

Compiler output:
a.cc: In function 'std::pair<long long int, long long int> root(ll)':
a.cc:61:40: error: expected ';' before ')' token
   61 |             for(int j = 0 ; j < 3 - num) reverse_val *= i;
      |                                        ^
      |                                        ;
a.cc:66:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   66 |         num = 1;
      |         ^~~
      |         enum
Language: C++

#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
#define LL long long
const int maxn = 1e5 + 5;
const int maxP = 1e4;
using namespace std;
LL a[maxn], b[maxn]; int n;
map <LL, int> m;
vector <LL> p;
bool f[maxn];
void install(){
	for (int i = 2; i <= maxP; i++){
		if (!f[i]) p.push_back(i);
		for (int j = 0; j < p.size() && i * p[j] <= maxP; j++){
			f[i * p[j]] = 1;
			if (i % p[j] == 0) continue;
		}
	}
}
LL split(LL &x){
	LL res1 = 1, res2 = 1;
	for (int i = 0; i < p.size(); i++){
		if (x % p[i] != 0) continue;
		int cnt = 0;
		while (x % p[i] == 0) ++cnt, x /= p[i];
		cnt %= 3;
		if (cnt == 2) res1 = res1 * p[i] * p[i], res2 = res2 * p[i];
		else if (cnt == 1) res1 = res1 * p[i], res2 = res2 * p[i] * p[i];
	}
	if (x != 1){
		if ((LL)sqrt(x) * (LL)sqrt(x) == x) res1 *= x, res2 *= (LL)sqrt(x);
		else res1 *= x, res2 *= x * x;
	}
	x = res1;
	return res2;
} 
int main(){
	scanf("%d", &n); install();
//	for (int i = 0; i < 20; i++) printf("%d\n", p[i]);
	for (int i = 1; i <= n; i++){
		scanf("%lld", a + i);
		b[i] = split(a[i]);
		m[a[i]]++;
	} int ans = (m[1] != 0); m[1] = 0;
	for (int i = 1; i <= n; i++){
		if (m[b[i]] != 0) ans += max(m[a[i]], m[b[i]]), m[a[i]] = 0, m[b[i]] = 0;
		else ans += m[a[i]], m[a[i]] = 0;
	} printf("%d\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'long long int split(long long int&)':
a.cc:33:25: error: 'sqrt' was not declared in this scope
   33 |                 if ((LL)sqrt(x) * (LL)sqrt(x) == x) res1 *= x, res2 *= (LL)sqrt(x);
      |                         ^~~~
Language: C++


#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
#define IN(a,n) rep(i,n){ cin>>a[i]; }
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}



vector< int > prime_table(int n) {
  vector< bool > prime(n + 1, true);
  vi res;
  if(n >= 0) prime[0] = false;
  if(n >= 1) prime[1] = false;
  for(int i = 2; i * i <= n; i++) {
    if(!prime[i]) continue;
    for(int j = i + i; j <= n; j += i) {
      prime[j] = false;
    }
  }

  rep(i,n+1){
    if(prime[i]) res.PB(i);
  }
  return res;
}




bool isSquare(int n){
  ll l=0,r=n+1;
  while(r-l>1){
    ll m=(r+l)/2;
    if(m*m>n) r=m;
    else l=m;
  }


  return (l*l==n);
}


signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(20);

  int n;
  map<int,int> mp;
  vi prime=prime_table(2500);
  vi a,b;
  cin>>n;
  rep(i,n){
    int s;
    cin>>s;
    int t=1,u=1;

    for(int p:prime){
      int c=0;
      while(s%p==0){
        c++;
        s/=p;
      }
      
      c%=3;
      if(c==0) continue;
      if(c==1){
        t*=p;
        u*=p*p;
      }
      else{
        t*=p*p;
        u*=p;
      }
    }
    if(is_squre(s)){      
      t*=s;
      u*=sqrt(s);
    }else{
      t*=s;
      u*=s*s;
    }

    //cout<<t<<' '<<u<<endl;
      
    a.PB(t);
    b.PB(u);
    mp[t]++;
  }

  int ans=0;

  rep(i,n){
    if(a[i]==1) continue;
    //cout<<a[i]<<' '<<b[i]<<endl;
    ans+=max(mp[a[i]],mp[b[i]]);
    //cout<<ans<<endl;
    mp[a[i]]=0;
    mp[b[i]]=0;
  }

  cout<<ans+!!mp[1]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:100:8: error: 'is_squre' was not declared in this scope
  100 |     if(is_squre(s)){
      |        ^~~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<set>
#include<queue>
#include<map>
#include<algorithm>
#include<cstring>
#include<string>
#include<cassert>
#include<cmath>
#include<climits>
#include<iomanip>
#include<stack>
#include<unordered_map>
#include<bitset>
using namespace std;
#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define REP(i,n) rep(i,0,n)
#define ll long long
const long long INF = 1LL << 60;
typedef vector<ll> Array;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
  
	Array prime;
	Array isPrime(101010, 1);
    isPrime[0]=isPrime[1]=0;
	map<ll, int> pSqrt;

	REP(i, 101010) {
		if (isPrime[i] == 1){
			prime.push_back(i);
			for (int j = i * 2; j < s; j += i)isPrime[j] = 0;
			pSqrt[i * i] = i;
		}
	}

    ll n;
    cin>>n;
	map<ll, int> mp;
	Array b(n, 1);
	Array p(n, 1);
  
	REP(i, n) {
		ll s;
		cin >> s;
		REP(j, prime.size()) {
			if (s < prime[j] * prime[j] * prime[j])break;
			ll cnt = 0;
            if(s%prime[j])continue;
			while (true) {
				if (s % prime[j] == 0) {
					cnt++;
					s /= prime[j];
				}
				else {
					break;
				}
			}
			cnt %= 3;
			REP(k, cnt)b[i] *= prime[j];
			if (cnt != 0)REP(k, 3 - cnt)p[i] *= prime[j];
		}
		if (pSqrt[s]) {
			b[i] *= s;
			p[i] *= pSqrt[s];
		}
		else {
			b[i] *= s;
			p[i] *= s * s;
		}
		mp[b[i]]++;
	}
    int ans=0;
	ans += !!mp[1];
	REP(i, n) {
		if (b[i]==1)continue;
        if (mp[b[i]]>mp[p[i]])ans++;
		else if (mp[b[i]] == mp[p[i]] && b[i] > p[i])ans++;
	
    }
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:49: error: 's' was not declared in this scope
   36 |                         for (int j = i * 2; j < s; j += i)isPrime[j] = 0;
      |                                                 ^