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

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

int main() {
  int N, ,B = 0,G = 0;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++){
     cin >> v.at(i);
  }
 for (int i = 0; i < N; i++){
   int MAX = -5;
   for (int b = 0; b < N; b++){
     if (v.at(b) > MAX){
          MAX = v.at(b);
          TOP = b;
     }
   }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: expected unqualified-id before ',' token
    5 |   int N, ,B = 0,G = 0;
      |          ^
a.cc:16:11: error: 'TOP' was not declared in this scope
   16 |           TOP = b;
      |           ^~~
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
int N, flag[101]; // Global variables are initially all 0.
// Also note that we need [101], not [100]!
int main(){
cin >> N;
for(int i = 0; i < N; ++i){
int d;
cin >> d;
  flag[d] = 1;
 }
 int ans = 0;
 for(int i = 0; i < N; ++i){
  ans += flag[i];
 }
 cout << ans << endl;

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,A;
  cin >> N;
  A=N;
  vector<int>V(N);
  for (int i=0 ; i<N ; i++)
    cin >> V.at(i);
  V=sort(V.begin(),V.end());
  for(int i=0; i<N-1; i++){
    if (V.at(i)==V.at(i+1))
      A--;
  }
  cout << A << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'void')
   10 |   V=sort(V.begin(),V.end());
      |                           ^
In file included from /usr/include/c++/14/vector:72,
                 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/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'void' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'void' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'void' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,A;
  cin >> N;
  A=N;
  vetor<int>V(N);
  for (int i=0 ; i<N ; i++)
    cin >> V.at(i);
  V=sort(V.begin(),V.end());
  for(int i=0; i<N-1; i++){
    if (V.at(i)==V.at(i+1))
      A--;
  }
  cout << A << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vetor' was not declared in this scope
    7 |   vetor<int>V(N);
      |   ^~~~~
a.cc:7:9: error: expected primary-expression before 'int'
    7 |   vetor<int>V(N);
      |         ^~~
a.cc:9:12: error: 'V' was not declared in this scope
    9 |     cin >> V.at(i);
      |            ^
a.cc:10:3: error: 'V' was not declared in this scope
   10 |   V=sort(V.begin(),V.end());
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std
  int main(){
int N;
  cin>>N;
  set<int>S;
  for(int i=0;i<N;i++){
  int x;
    cin>>x;
  S.insert(x);
  }int ans=S.size();
  cout<<ans<<endl;
   return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
 
int main() {
 int n, c(1);
 cin >> n;
 vector<int> f(101, 0);
 for(int i(0);i<n;i++){
   cin >> d;
   f.at(d)=1;
 }
  for(int i(0);i<101;i++)
    c += f.at(i);
 cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'd' was not declared in this scope
    9 |    cin >> d;
      |           ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a={0};
  int i,j;
  cin>>a.at(0);
  //dainyu-
  for(i=1;i<N;i++){
  int s,flag=1;
  cin >> s;
    for(j=0;j<a.size();j++){
      if(a.at(j)==s)flag=0;
    }
    if(flag==1)a.push_back(s) 

  }
  cout<<a.size()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '}' token
   17 |     if(flag==1)a.push_back(s)
      |                              ^
      |                              ;
   18 | 
   19 |   }
      |   ~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a={0};
  int i,j;
  cin>>a.at(0);
  //dainyu-
  for(i=1;i<N;i++){
  int s,flag=1;
  cin >> s;
    for(j=0;j<a.size();j++){
      if(a.at(j)==s)flag=0;
    }
    if(flag==1)a.push_back(s) 

  }
  cout<<a.size<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:30: error: expected ';' before '}' token
   17 |     if(flag==1)a.push_back(s)
      |                              ^
      |                              ;
   18 | 
   19 |   }
      |   ~                           
a.cc:20:7: error: invalid use of non-static member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]'
   20 |   cout<<a.size<<endl;
      |   ~~~~^~~~~~~~
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
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int d[120];
  cin>>N;
  for(int i=0;i<N;i++){
    sort(d,d+N,greater<int>());
    int ans=1;
    if(d(i)>d(i+1)){
      ans++;
    }
  }
 cout<<ans<<endl;
}
    



Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'd' cannot be used as a function
   10 |     if(d(i)>d(i+1)){
      |        ~^~~
a.cc:10:14: error: 'd' cannot be used as a function
   10 |     if(d(i)>d(i+1)){
      |             ~^~~~~
a.cc:14:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |  cout<<ans<<endl;
      |        ^~~
      |        abs
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int>d(N);
  for(int i = 0; i < N; i++){
    cin >> d.at(i);
  }
  sort(d.begin(), d.end());
  int count = 0;
  for(int i = 0; i < N - 1; i+){
    if(d.at(i) < d.at(i + 1)) count++;
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expected primary-expression before ')' token
   13 |   for(int i = 0; i < N - 1; i+){
      |                               ^
Language: C++

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

int main(){
	int N;
	cin >> N;
	vector<int> Dss(N);
	
	for(int i = 0;i<N;i++){
		cin >> Dss.at(i);
	}
	
	sort(Dss.begin(),Dss.end());
	
	int MXD = 0;
	int cnt = 0;
	
	for(int j = 0;i<N;j++){
		int c = Dss.at(j);
		
		if(c > MXD){
			MXD = c;
			cnt++;
		}
	}
	
	long int RST = 0;
	
	for(int k =1;k<cnt + 1;k++){
		long int d = 1;
		
		for(int l=0;l<k+1;l++){
			d = d*(cnt-l);
		}
		for(int m=0;m<k+1;m++){
			d = d/(m+1);
		}
		RST = RST + d;
	}
	
	cout << RST << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: 'i' was not declared in this scope
   18 |         for(int j = 0;i<N;j++){
      |                       ^
Language: Java

import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextint();
		Set<Integer> num = new HashSet<>();
		for(int i=0; i<N ; i++){
			int di = sc.nextInt();
			num.add(di);
		}
		System.out.println(num.size());
	}
}

Compiler output:
Main.java:6: error: cannot find symbol
		int N = sc.nextint();
		          ^
  symbol:   method nextint()
  location: variable sc of type Scanner
1 error
Language: C++

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

int main() {
  int N;
  cin>>N;
  int count=N;
  vector<int> vec(N);
  for(i=0;i<N;i++)cin>>vec[i];
  sort(vec.begin(), vec.end());
  for(i=0;i<N-1;i++){
    if(vec[i]-vec[i+1]==0)count--;
  }
  cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<N;i++)cin>>vec[i];
      |       ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=0;i<N-1;i++){
      |       ^
Language: C++

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

int main() {
  int N,i,j;
  cin>>N;
  int count=N
  vector<int> num(N);
  for(i=0;i<N;i++)cin>>num[i];
  for(i=1;i<N;i++){
    for(j=0;j<i;j++){
      if(num[i]==num[j]){
        count--;
        num[j]=0;
      }
    }
  }
  cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected ',' or ';' before 'vector'
    8 |   vector<int> num(N);
      |   ^~~~~~
a.cc:9:24: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |   for(i=0;i<N;i++)cin>>num[i];
      |                        ^~~
      |                        enum
a.cc:12:10: error: 'num' was not declared in this scope; did you mean 'enum'?
   12 |       if(num[i]==num[j]){
      |          ^~~
      |          enum
Language: C++

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


int main(){
  int n;
  int A[100];
  cin >> n;
  for (int i=0;i<n;i++){
    cin >> A[i];
  }
  sort(A, A+n);
  int base = 0;
  int cnt =0;
  for (int i=0;i<n;i++){
    if (base < A[i]){
      base = A[i];
      cnt++;
    }
  }
  cout << cnt << endl;
}


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

#include<bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int>diameter(n);
  for(int i=0;i<n;i++) {
    cin >> diameter.at(i);}
  sort(diameter.begin(),diameter.end());
  reverse(diameter.begin(),diameter.end());
  int sum=0;
  for(int i=1;i<n;i++) {
    if(diameter(i)<diameter(i-1)) {
      sum+=1;}
    else {
      sum+=0;}}
  cout << sum << endl;
return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: no match for call to '(std::vector<int>) (int&)'
   13 |     if(diameter(i)<diameter(i-1)) {
      |        ~~~~~~~~^~~
a.cc:13:28: error: no match for call to '(std::vector<int>) (int)'
   13 |     if(diameter(i)<diameter(i-1)) {
      |                    ~~~~~~~~^~~~~
Language: C++

int main() {
    int N;
    cin>>N;
    int a[N];
    for(int i=0;i<N;i++){
        cin>>a[i];
    }
    sort(a,a+N);
    int ans=1;
    for(int i=0;i<N-1;i++){
        if(a[i]!=a[i+1])
            ans++;
    }
    cout<<ans<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>N;
      |     ^~~
a.cc:8:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |     sort(a,a+N);
      |     ^~~~
      |     short
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout<<ans<<endl;
      |     ^~~~
a.cc:14:16: error: 'endl' was not declared in this scope
   14 |     cout<<ans<<endl;
      |                ^~~~
Language: C++

int main(){
  int n;
  cin >> n;
  set<int> s;
  int a;
  for(int i=0;i<n;i++) {
    cin >> a;
    s.insert(a);
  }
  cout << s.size() << endl;
  return 0;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> n;
      |   ^~~
a.cc:4:3: error: 'set' was not declared in this scope
    4 |   set<int> s;
      |   ^~~
a.cc:4:7: error: expected primary-expression before 'int'
    4 |   set<int> s;
      |       ^~~
a.cc:8:5: error: 's' was not declared in this scope
    8 |     s.insert(a);
      |     ^
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << s.size() << endl;
      |   ^~~~
a.cc:10:11: error: 's' was not declared in this scope
   10 |   cout << s.size() << endl;
      |           ^
a.cc:10:23: error: 'endl' was not declared in this scope
   10 |   cout << s.size() << endl;
      |                       ^~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <string>
#include <array>
#include <functional>
#include < vector >
#include <set>

void test();
void ABC157A();
void ABC155B();
void ABC154B();
void ABC153B();
void oturi();
void tttt();
void vectorInput();
/*-------- sort --------*/
//vector<int> homeDistance(0);
//for (int i = 0; i < kensu; i++) {
//    cin >> in;
//    homeDistance.push_back(in);
//}
//sort(homeDistance.begin(), homeDistance.end(),);               //昇順
//sort(homeDistance.begin(), homeDistance.end(), greater<int>());//降順
//for (auto a : homeDistance) {
//    std::cout << a << " ";
//}
//std::cout << '\n';
/* ----end----  */

using namespace std;
int main()
{
    int count, input;

    cin >> count; 
    set<int> cyokei;
    for (int i = 0; i < count; i++) {
        cin >> input;
        cyokei.insert(input);    
    }

 //   for (auto itr = cyokei.begin(); itr != cyokei.end(); ++itr) { 
//        cout << endl << *itr << endl;
//    }
    auto k = cyokei.size();

    cout << k << endl;


}

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

//
#include <algorithm>
#include <iostream>
#include <string>
#include <array>
#include <functional>
#include < vector >
#include <set>

void test();
void ABC157A();
void ABC155B();
void ABC154B();
void ABC153B();
void oturi();
void tttt();
void vectorInput();
/*-------- sort --------*/
//vector<int> homeDistance(0);
//for (int i = 0; i < kensu; i++) {
//    cin >> in;
//    homeDistance.push_back(in);
//}
//sort(homeDistance.begin(), homeDistance.end(),);               //昇順
//sort(homeDistance.begin(), homeDistance.end(), greater<int>());//降順
//for (auto a : homeDistance) {
//    std::cout << a << " ";
//}
//std::cout << '\n';
/* ----end----  */

using namespace std;
int main()
{
    int count, input;

    cin >> count; 
    set<int> cyokei;
    for (int i = 0; i < count; i++) {
        cin >> input;
        cyokei.insert(input);    
    }

 //   for (auto itr = cyokei.begin(); itr != cyokei.end(); ++itr) { 
//        cout << endl << *itr << endl;
//    }
    auto k = cyokei.size();

    cout << k << endl;


}

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

#include<iostream>
#include<vector>
#include<algotithm>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int> data(N);
  for(int i=0;i<N;i++){
    cin>>data.at(i);
  }
  sort(data.begin(), data.end());
  reverse(data.begin(), data.end());
  int i = 0;
  int cnt = 1;
  int tmp = data.at(i);
  while (true)
  {
    if(tmp>data.at(i)){
      cnt++;
    }
    tmp = data.at(i);
    i++;
    if(i==N)
      break;
  }
  cout << cnt << endl;
}


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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<int> data(N);
  for(int i=0;i<N;i++){
    cin>>data.at(i);
  }
  sort(data.begin(), data.end());
  reverse(data.begin(), data.end());
  int i = 0;
  int cnt = 1;
  int tmp = data.at(i);
  while (true)
  {
    if(tmp>data.at(i)){
      cnt++;
    }
    tmp = data.at(i);
    i++;
    if(i==N)
      break;
  }
  cout << cnt << endl;
}


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

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

int main(){
  int n,m;
  m=0;
  cin >> n;
  vector<int> vec.(n);
  
  for(int i=0;i<n;i++)
    cin >> vec.at(i);
  
  sort(vec.begin(),vec.end());
  
  for(int i=0;i<n;i++){
    if(vec.at(i)<vec.at(i+1))
      m++;
    else
      continue;
  }
  cout << m << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: expected initializer before '.' token
    8 |   vector<int> vec.(n);
      |                  ^
a.cc:11:12: error: 'vec' was not declared in this scope
   11 |     cin >> vec.at(i);
      |            ^~~
a.cc:13:8: error: 'vec' was not declared in this scope
   13 |   sort(vec.begin(),vec.end());
      |        ^~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> mochi(n);
  for (int i=0;i<n;i++){
    cin >> mochi[i];
  }
  sort(mochi.begin(),mochi.end());
  int before=0,ans=0;
  for(int i=0;i<n;i++){
    if (before!=mochi[i]){
      before=mochi[i];
      ans++;
    }
  }
  cout << ans << << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: expected primary-expression before '<<' token
   19 |   cout << ans << << endl;
      |                  ^~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[110];
  for (int i=0; i<N; ++i) cin >> a[i];
 int num[110]; 
  for (int i=0; i<N; ++i) num[a[i]]++;
  int sum;
    for (int i=0; i<101 ++i){
      if (num[i]>0){
        sum++;
      }
    }
  cout<<sum<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: lvalue required as increment operand
   11 |     for (int i=0; i<101 ++i){
      |                     ^~~
a.cc:11:27: error: expected ';' before 'i'
   11 |     for (int i=0; i<101 ++i){
      |                           ^
      |                           ;
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[110];
  for (int i=0; i<N; ++i) cin >> a[i];
 int num[110]; 
  for (int i=0; i<N; ++i) num[a[i]]++;
  int sum
    for (int i=0; i<101 ++i){
      if (num[i]>0){
        sum++;
      }
    }
  cout<<sum<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected initializer before 'for'
   11 |     for (int i=0; i<101 ++i){
      |     ^~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |     for (int i=0; i<101 ++i){
      |                   ^
a.cc:11:21: error: lvalue required as increment operand
   11 |     for (int i=0; i<101 ++i){
      |                     ^~~
a.cc:16:9: error: 'sum' was not declared in this scope; did you mean 'num'?
   16 |   cout<<sum<<endl;
      |         ^~~
      |         num
a.cc:16:19: error: expected '}' at end of input
   16 |   cout<<sum<<endl;
      |                   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> vec(N);
  for (i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  int x = 0, y = 0;
  for (i = 0; i < N - 1; i++) {
    if (vec.at(i) != vec.at(i+1))
      x += 1;
  }
  cout << N - x <<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>
using namespace std;
int main(){
  int N;
  cin >> N;
  int x;
  vector<int> d(N, 0);
  int cnt = 0;
  for(int i = 0; i < N; i++){
    cin >> x;
    d[x-1]++;
    if(d[x-1] == 1){
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}


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

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int N;
  cin >> N;
  int x;
  vector<int> d(N, 0);
  int cnt = 0;
  for(int i = 0; i < N; i++){
    cin >> x;
    d[x-1]++;
    if(d[x-1] == 1){
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}


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

#include <iostream>
#include<vector>
using namespace std;
int main(){
  int N;
  cin >> N;
  int x;
  vector<int> d(N, 0);
  int cnt = 0;
  for(int i = 0; i < N; i++){
    cin >> x;
    d[x-1]++;
    if(d[x-1] == 1){
      cnt++;
    }
  }
  cout << cnt << 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<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
#incldue<set>
using namespace std;
#define rep(i,x,n) for(int i=x;i<n;i++)
using ll=long long;

string ans;

void ps(int n,char a){
    for(int i=0;i<n;i++) ans+=a;
    return;
}

int sumd(int n){
    int res=0;
    while(n>0){
        res=n%10;
        n/=10;
    }
    return res;
}

int main(){
    int n;cin>>n;
    set<int> D;
  int d;
    rep(i,0,n){
      cin>>d;
      D.insert(d);
    }
  printf("%d\n",D.size());
}    

Compiler output:
a.cc:7:2: error: invalid preprocessing directive #incldue; did you mean #include?
    7 | #incldue<set>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:30:5: error: 'set' was not declared in this scope
   30 |     set<int> D;
      |     ^~~
a.cc:7:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    6 | #include<cstdio>
  +++ |+#include <set>
    7 | #incldue<set>
a.cc:30:9: error: expected primary-expression before 'int'
   30 |     set<int> D;
      |         ^~~
a.cc:34:7: error: 'D' was not declared in this scope
   34 |       D.insert(d);
      |       ^
a.cc:36:17: error: 'D' was not declared in this scope
   36 |   printf("%d\n",D.size());
      |                 ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<utility>
#include<cstdio>
using namespace std;
#define rep(i,x,n) for(int i=x;i<n;i++)
using ll=long long;

string ans;

void ps(int n,char a){
    for(int i=0;i<n;i++) ans+=a;
    return;
}

int sumd(int n){
    int res=0;
    while(n>0){
        res=n%10;
        n/=10;
    }
    return res;
}

int main(){
    int n;cin>>n;
    set<int> D;
  int d;
    rep(i,0,n){
      cin>>d;
      D.insert(d);
    }
  printf("%d\n",D.size());
}    

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: 'set' was not declared in this scope
   29 |     set<int> D;
      |     ^~~
a.cc:7:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    6 | #include<cstdio>
  +++ |+#include <set>
    7 | using namespace std;
a.cc:29:9: error: expected primary-expression before 'int'
   29 |     set<int> D;
      |         ^~~
a.cc:33:7: error: 'D' was not declared in this scope
   33 |       D.insert(d);
      |       ^
a.cc:35:17: error: 'D' was not declared in this scope
   35 |   printf("%d\n",D.size());
      |                 ^
Language: C++

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

int main()
{
  int n;
  cin >> n;
  vector<int> d(n);
  for (int i=0; i<n; i++)
    cin >> d.at(i);
  
  sort(d.begin(), d.end());
  
  int cnt = 1;
  
  for (int i=0; i<n; i++)
    if (d.at(i) != d.at(i+1)) cnt++;
  
  cout << cnt << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inlude; did you mean #include?
    1 | #inlude <bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin >> n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inlude <bits/stdc++.h>
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> d(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inlude <bits/stdc++.h>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> d(n);
      |          ^~~
a.cc:10:12: error: 'd' was not declared in this scope
   10 |     cin >> d.at(i);
      |            ^
a.cc:12:8: error: 'd' was not declared in this scope
   12 |   sort(d.begin(), d.end());
      |        ^
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(d.begin(), d.end());
      |   ^~~~
      |   short
a.cc:19:3: error: 'cout' was not declared in this scope
   19 |   cout << cnt << endl;
      |   ^~~~
a.cc:19:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:18: error: 'endl' was not declared in this scope
   19 |   cout << cnt << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inlude <bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
   int n;
   cin >> n;
   vector<int> d(n);
   for (int i = 0; i < n; i++) cin >> d[i];

   sort(d.begin(), d.end());
   erase(unique(d.begin(), d.end()), d.end());
   cout << d.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: 'erase' was not declared in this scope
   10 |    erase(unique(d.begin(), d.end()), d.end());
      |    ^~~~~
Language: C++

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

int main()
{
  int n;
  cin >> n;
  vector<int> d(n);
  for (int i=0; i<n; i++)
    cin >> d.at(i);
  
  for (int i=0;　i<n-1; i++) {
    for (int j=i+1; j<n; j++) {
      if (d.at(i) < d.at(j)) {
        int tmp = d.at(i);
        d.at(i) = d.at(j);
        d.at(j) = tmp;
      }
    }
  }
  int cnt = 1;
  for (int i=0; i<n; i++) {
    if (d.at(i) > d.at(i+1)) cnt++;
  }
  cout << cnt << endl;
}

Compiler output:
a.cc:12:16: error: extended character 　 is not valid in an identifier
   12 |   for (int i=0;　i<n-1; i++) {
      |                ^
a.cc: In function 'int main()':
a.cc:12:16: error: '\U00003000i' was not declared in this scope
   12 |   for (int i=0;　i<n-1; i++) {
      |                ^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; ++i) cin >> d[i];
  set<int> values; // insert するときに重複を取り除いてくれます
  for (int i = 0; i < N; ++i) {
    values.insert(v.at(i)); // 挿入します
  }
    // set のサイズを出力します
  cout << values.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:38: error: 'd' was not declared in this scope
    8 |   for (int i = 0; i < N; ++i) cin >> d[i];
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  a = 0;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  int j = 0;
  while (j < vec.size() - 1) {
    if (vec.at(j) != vec.at(j + 1)) {
      a++;
    }
    j++;
    }
  }
  cout << vec.size() << endl;
}


Compiler output:
a.cc:20:3: error: 'cout' does not name a type
   20 |   cout << vec.size() << endl;
      |   ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, a;
  a = 0;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  int j = 0;
  while (j < vec.size() - 1) {
    if (vec.at(j) != vec.at(j + 1)) {
      a++
    }
    j++;
    }
  }
  cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:10: error: expected ';' before '}' token
   15 |       a++
      |          ^
      |          ;
   16 |     }
      |     ~     
a.cc: At global scope:
a.cc:20:3: error: 'cout' does not name a type
   20 |   cout << vec.size() << endl;
      |   ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  int j = 0;
  while (j < vec.size() - 1) {
    if (vec.at(j) == vec.at(j + 1)) {
      swap (vec.at(j + 1), vec.at(vec.size() - 1));
      vec.pop_back();
    }
    else {
      j++;
    }
  }
  cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
    5 |   cin >> N;
      |   ^~~
a.cc:6:19: error: 'N' was not declared in this scope
    6 |   vector<int> vec(N);
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  int j = 0;
  while (j < vec.size() - 1);
    if (vec.at(j) == vec.at(j + 1));
      swap (vec.at(j + 1), vec.at(vec.size() - 1));
      vec.pop_back();
    }
    else {
      j++;
    }
  cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
    5 |   cin >> N;
      |   ^~~
a.cc:6:19: error: 'N' was not declared in this scope
    6 |   vector<int> vec(N);
      |                   ^
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else {
      |     ^~~~
a.cc:20:3: error: 'cout' does not name a type
   20 |   cout << vec.size() << endl;
      |   ^~~~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  i = 0;
  while (i < vec.size() - 1);
    if (vec.at(i) == vec.at(i + 1)) {
      swap (vec.at(i + 1), vec.at(vec.size() - 1));
      vec.pop_back();
    }
    else {
      i++;
    }
  }
  cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'i' was not declared in this scope
   11 |   i = 0;
      |   ^
a.cc: At global scope:
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << vec.size() << endl;
      |   ^~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i;
  cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  sort (vec.begin(), vec.end());
  int i = 0;
  while (i < vec.size() - 1);
    if (vec.at(i) == vec.at(i + 1));
      swap (vec.at(i + 1), vec.at(vec.size() - 1));
      vec.pop_back();
    }
    else {
      i++;
    }
  }
  cout << vec.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: redeclaration of 'int i'
   11 |   int i = 0;
      |       ^
a.cc:4:10: note: 'int i' previously declared here
    4 |   int N, i;
      |          ^
a.cc: At global scope:
a.cc:17:5: error: expected unqualified-id before 'else'
   17 |     else {
      |     ^~~~
a.cc:20:3: error: expected declaration before '}' token
   20 |   }
      |   ^
a.cc:21:3: error: 'cout' does not name a type
   21 |   cout << vec.size() << endl;
      |   ^~~~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  itn n;
  cin>>n;
  vector<int> vec(n);
  for(int i=0;i<n;i++){
    cin>>vec.at(i);
  }
  sort(vec.begin(),vec.end());
  reverse(vec.begin(),vec.end());
  
  int sum=1;
  for(int i=1;i<n;i++){
    if(vec.at(i)<vec.at(i-1))
      sum++;
    else
      break;
  }
  cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'itn' was not declared in this scope; did you mean 'int'?
    4 |   itn n;
      |   ^~~
      |   int
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin>>n;
      |        ^
      |        yn
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i< int (n); i++)
using namespace std;

//与えられるN個の整数のうちに異なるものはいくつあるか。

int main(){

int N=0;
cin >> N;
int d[110];
for(int i=0; i<N; i++) cin >> d[i];
int num[110]={0}; / ={0} が超重要！！やらないと変なの入ってる！
for (int i=0; i<N; i++){
    num[d[i]]++;
}
int ans=0;
for(int i=0; i<110; i++){
    if(num[i]) ans++;
}
cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected primary-expression before '/' token
   13 | int num[110]={0}; / ={0} が超重要！！やらないと変なの入ってる！
      |                   ^
a.cc:13:21: error: expected primary-expression before '=' token
   13 | int num[110]={0}; / ={0} が超重要！！やらないと変なの入ってる！
      |                     ^
a.cc:14:15: error: 'i' was not declared in this scope
   14 | for (int i=0; i<N; i++){
      |               ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
  int N,ans=1,a;
  vector<int> num;
  cin >> N;
  
  for (int i=0;i<N;++i)
    cin >> num.at(i);
  
  sort(num.begin(),num.end());
  
  for(i=1;i<N;++i){
    a = i-1;
    if (num.at(i) != num.at(a))
      ++ans;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=1;i<N;++i){
      |       ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
  int N,ans=0;
  vector<int> num[109];
  cin >> N;
  
  for (int i=0;i<N;++i)
    cin >> num.at(i);
  
  sort(num.begin(),num.end());
  
  for(int j=0;j<N;++j){
    if (num.at(j) != num.at(j-1))
      ++ans;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: request for member 'at' in 'num', which is of non-class type 'std::vector<int> [109]'
   10 |     cin >> num.at(i);
      |                ^~
a.cc:12:12: error: request for member 'begin' in 'num', which is of non-class type 'std::vector<int> [109]'
   12 |   sort(num.begin(),num.end());
      |            ^~~~~
a.cc:12:24: error: request for member 'end' in 'num', which is of non-class type 'std::vector<int> [109]'
   12 |   sort(num.begin(),num.end());
      |                        ^~~
a.cc:15:13: error: request for member 'at' in 'num', which is of non-class type 'std::vector<int> [109]'
   15 |     if (num.at(j) != num.at(j-1))
      |             ^~
a.cc:15:26: error: request for member 'at' in 'num', which is of non-class type 'std::vector<int> [109]'
   15 |     if (num.at(j) != num.at(j-1))
      |                          ^~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main(){
  int N,ans=0;
  vector<int> num[109];
  cin >> N;
  
  for (int i=0;i<N;++i)
    cin >> num.at(i);
  
  sort(num.begin(),num.end());
  
  for(int j=0;j<N;++j){
    if (num[j] != num[j-1])
      ++ans;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: request for member 'at' in 'num', which is of non-class type 'std::vector<int> [109]'
   10 |     cin >> num.at(i);
      |                ^~
a.cc:12:12: error: request for member 'begin' in 'num', which is of non-class type 'std::vector<int> [109]'
   12 |   sort(num.begin(),num.end());
      |            ^~~~~
a.cc:12:24: error: request for member 'end' in 'num', which is of non-class type 'std::vector<int> [109]'
   12 |   sort(num.begin(),num.end());
      |                        ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,ans=0;
  vector<int> num[109];
  cin >> N;
  
  for (int i=0;i<N;++i)
    cin >> num.at(i);
  
  sort(num.begin(),num.end());
  
  for(int j=0;j<N;++j){
    if (num[j] != num[j-1])
      ++ans;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: request for member 'at' in 'num', which is of non-class type 'std::vector<int> [109]'
    9 |     cin >> num.at(i);
      |                ^~
a.cc:11:12: error: request for member 'begin' in 'num', which is of non-class type 'std::vector<int> [109]'
   11 |   sort(num.begin(),num.end());
      |            ^~~~~
a.cc:11:24: error: request for member 'end' in 'num', which is of non-class type 'std::vector<int> [109]'
   11 |   sort(num.begin(),num.end());
      |                        ^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int>mochi(N);
  
  for(int i = 0;i < N;i++) {
    cin >> mochi.at(i);
  }
  
  sort(mochi.begin(),mochi.end());
  reverse(mochi.begin(),mochi.end());
  
  int dan = 0
  for(int i = 0;i < N;i++) {
    
   if(mochi.at(i) > mochi.at(i-1)) {
     dan++
   }
  
  else {
    break;
  }
 }  
  
  cout << dan << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: expected ',' or ';' before 'for'
   18 |   for(int i = 0;i < N;i++) {
      |   ^~~
a.cc:18:17: error: 'i' was not declared in this scope
   18 |   for(int i = 0;i < N;i++) {
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,c=0;
  cin>>N;
  vector<int> vec(N);
  for(int i=0;i<N;i++){
    cin>>vec[i];
  }
  vec.sort();
  for(int i=0,i<N-1,i++){
    if(vec[i]!=vec[i+1]){
      c++;
    }
  }
  cout<<c<<endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: 'class std::vector<int>' has no member named 'sort'
   10 |   vec.sort();
      |       ^~~~
a.cc:11:16: error: expected ';' before '<' token
   11 |   for(int i=0,i<N-1,i++){
      |                ^
      |                ;
a.cc:11:16: error: expected primary-expression before '<' token
a.cc:11:24: error: expected ';' before ')' token
   11 |   for(int i=0,i<N-1,i++){
      |                        ^
      |                        ;
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> Diameter(N);
   for (int i = 0; i < N; i++) {
    cin >> Diameter.at(i);
  }
  int Answer;
  Answer=1;
  int k;
  k=0;
  int difference;
    sort(Diameter.begin(), Diameter.end()); // {1, 2, 2, 5}
    reverse(Diameter.begin(), Diameter.end()); // {5, 2, 2, 1}
  while(k<N-1){

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: expected '}' at end of input
   18 |   while(k<N-1){
      |               ~^
a.cc:18:16: error: expected '}' at end of input
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        Set<Integer> s = new HashSet<Integer>();
        for(int i = 0; i < n; i++)
        {
            int num = Integer.parseInt(sc.next());
            s.add(num);
        }
        
        System.out.println(s.size());
        sc.close();
    }
}

Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:5: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
        Set<Integer> s = new HashSet<Integer>();
        ^
  symbol:   class Set
  location: class Main
Main.java:7: error: cannot find symbol
        Set<Integer> s = new HashSet<Integer>();
                             ^
  symbol:   class HashSet
  location: class Main
4 errors
Language: C++

import java.util.Scanner;

public class Main {

    public static void main() {
        // write your code here
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        List<Integer> d = new ArrayList<Integer>();
        for(int i = 0; i < n; i++)
        {
            int num = Integer.parseInt(s.next());
            d.add(num);
        }

        Set<Integer> set = new HashSet<Integer>();
        for(int num : d) set.add(num);

        System.out.println(set.size());
        s.close();
    }
}

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

import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        List<Integer> d = new ArrayList<Integer>();
        for(int i = 0; i < n; i++)
        {
            int num = Integer.parseInt(s.next());
            d.add(num);
        }

        Set<Integer> set = new HashSet<Integer>();
        for(int num : d) set.add(num);

        System.out.println(set.size());
    }
}


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

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        List<Integer> d = new ArrayList<Integer>();
        for(int i = 0; i < n; i++)
        {
            int num = Integer.parseInt(s.next());
            d.add(num);
        }

        Set<Integer> set = new HashSet<Integer>();
        for(int num : d) set.add(num);

        out.println(set.size());
    }
}


Compiler output:
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public class Main {
      | ^~~~~~
Language: C++

import java.util.*;
import static java.lang.System.out;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        List<Integer> d = new ArrayList<Integer>();
        for(int i = 0; i < n; i++)
        {
            int num = Integer.parseInt(s.next());
            d.add(num);
        }

        Set<Integer> set = new HashSet<Integer>();
        for(int num : d) set.add(num);

        out.println(set.size());
    }
}

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

#include <iostream>
#include <vector>

int main()
{
    int N;
    std::cin >> N;

    std::vector<int> a(N);
    for (int i=0; i<N; ++i)
        std::cin >> a[i];

    std::sort(a.begin(), a.end());
    auto n = std::unique(a.begin(), a.end());
    a.erase(n, a.end());
    std::cout << a.size() << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   13 |     std::sort(a.begin(), a.end());
      |          ^~~~
      |          qsort
a.cc:14:19: error: 'unique' is not a member of 'std'
   14 |     auto n = std::unique(a.begin(), a.end());
      |                   ^~~~~~
Language: C++

//B-Kagami Mochi
#include<iostream>

using namespace std;
int N;
int main()
{
    cin >> N;
    int d[N];
    for(int i=0;i<N;++i) cin >> d[i];

    sort(d,d+N,greater<int>());
    int counter=1;
    int temp=d[0];
    for(int i=1;i<N;++i)
    {
        if(d[i]!=temp)
        {
            ++counter;
            temp = d[i];
        }
    }
    cout << counter << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  
  vector<int> mochi(N);
  for(int i = 0; i < N; i++){
    cin >> mochi.at(i);
  }
  
  int max_all, count = N;
  for(int i = 0; i < N; i++){
    int max = 0;
    
    for(int j = 0; j < N; j++){
      max = max(max, mochi.at(j));
    }
    
    for(int j = 0; j < N; j++){
      if(max == mochi.at(j)){
        mochi.at(j) = 0;
        break;
      }
    }
    
    if(max == max_all){
      count--;
    }
    
    max_all = max;
  }
  
  cout << count << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: 'max' cannot be used as a function
   18 |       max = max(max, mochi.at(j));
      |             ~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
int main()	{
  int n;
  int ans=0;
  cin>>n;
  vector<int>d(n),num[101];
  rep(i,n){cin>>d[i];}
  rep(i,n){
    num[d[i]]++;   
  }
  rep(i,n){
    if(num[i])
      ans++;
  }
   cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   14 |     num[d[i]]++;
      |     ~~~~~~~~~^~
a.cc:17:13: error: could not convert 'num[i]' from 'std::vector<int>' to 'bool'
   17 |     if(num[i])
      |        ~~~~~^
      |             |
      |             std::vector<int>
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = ((int)(s)); i < (int)(n); i++)
int main(){
    int step, max_step = 0;
    cin >> step;
    vector<int> mochi(step);
    rep(i, 0, mochi.size()){
        cin >> mochi.at(i);
    }
    sort(mochi.begin(), mochi.end());
    mochi.erase(unique(mochi.begin(), mochi.end()), mochi.end());
    cout << mocni.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: 'mocni' was not declared in this scope; did you mean 'mochi'?
   13 |     cout << mocni.size() << endl;
      |             ^~~~~
      |             mochi
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<int> d(N);
  for(int i=0;i<N;i++)
    cin >> d.at(i);
  sort(d.begin(),d.emd());
  int count = 1;
  for(int i=0;i<N-1;i++){
    if(d.at(i)<d.at(i+1))
      count++;
  }
  cout << count << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'class std::vector<int>' has no member named 'emd'; did you mean 'end'?
   10 |   sort(d.begin(),d.emd());
      |                    ^~~
      |                    end