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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   16 |     sort(D.begin, D.end);
      |     ~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:16:9: note:   couldn't deduce template parameter '_RAIter'
   16 |     sort(D.begin, D.end);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: 'n' was not declared in this scope
   11 |     for (int i = 0; i < n; i++){
      |                         ^
a.cc:16:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   16 |     sort(D.begin, D.end);
      |     ~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:16:9: note:   couldn't deduce template parameter '_RAIter'
   16 |     sort(D.begin, D.end);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
a.cc:18:5: error: expected ',' or ';' before 'for'
   18 |     for (int i = 1; i < N; i++){
      |     ^~~
a.cc:18:21: error: 'i' was not declared in this scope
   18 |     for (int i = 1; i < N; i++){
      |                     ^
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 count=0;
  for(int i=1;i<N-1;i++){
    if(vec.at(i)==vec.at(i-1)){
      count++;
    }
  }
  
  cout<<count<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: no matching function for call to 'end()'
   13 |   sort(vec.begin(),vec,end());
      |                        ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 's' was not declared in this scope
   12 |     s.insert(d);
      |     ^
a.cc:14:9: error: 's' was not declared in this scope
   14 |   cout<<s.size()<<endl;
      |         ^
Language: C++

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

#include <algorithm>
#include <vector>
#include <cstdio>
#include <random>
#include <functional>



int main(){
  int N, count = 1, i;
  cin >> N;
  
  int v[N-1];
  
  for(i=0; i<N; i++){
    cin >> N[i];
  }
  
  for(i =1; i<N; i++){
    
    for(int t = 0; t<i; t++){
    if(N[i] == N[t]){
      break;
      if(t+1==i){
        count++;
      }
    }
    }
    
  }

  
 cout << count <<  endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: invalid types 'int[int]' for array subscript
   20 |     cin >> N[i];
      |             ^
a.cc:26:9: error: invalid types 'int[int]' for array subscript
   26 |     if(N[i] == N[t]){
      |         ^
a.cc:26:17: error: invalid types 'int[int]' for array subscript
   26 |     if(N[i] == N[t]){
      |                 ^
Language: C++

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

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

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

# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

def printd(str)
  print str if $debugFlag
end

# input
inputs = []
lc = 0
arr = []
while l = $stdin.gets do
  if lc == 0
  else
    arr << l.chomp.to_i
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

# body
if $debugFlag
  p arr
end

puts arr.uniq.size


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #util
    1 | # util functions
      |   ^~~~
a.cc:3:3: error: invalid preprocessing directive #debug
    3 | # debug
      |   ^~~~~
a.cc:15:3: error: invalid preprocessing directive #input
   15 | # input
      |   ^~~~~
a.cc:27:3: error: invalid preprocessing directive #input
   27 | # input check
      |   ^~~~~
a.cc:37:3: error: invalid preprocessing directive #body
   37 | # body
      |   ^~~~
a.cc:4:1: error: '$debugFlag' does not name a type
    4 | $debugFlag = ( ARGV[0] != nil )
      | ^~~~~~~~~~
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int mochiCount = sc.nextInt();
        Map<Integer, Integer> mochiMap = new TreeMap<>(Comparator.reverseOrder());
        for (int i = 0; i < n; i++) {
            int mochi = sc.nextInt();
            if (mochiMap.containsKey(mochi)) {
                mochiMap.put(mochi, (mochiMap.get(mochi) + 1));
            } else {
                mochiMap.put(mochi, 1);
            }
        }
        
        int result = 0;
        for(Integer mochiKey : mochiMap.keySet()) {
            result++;
        }
        System.out.println(result);
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        for (int i = 0; i < n; i++) {
                            ^
  symbol:   variable n
  location: class Main
1 error
Language: C++

\#include<bits/stdc++.h>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
int main(void) {
  int n;
  cin >> n;
  vector<int> data(n);
  rep(i,n) {
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  reverse(data.begin(),data.end());
  int ahead = 101;
  int ans = 0;
  rep(i,n){
    if(data.at(i) < ahead){
      ahead = data.at(i);
      cout << ahead <<endl;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:1:1: error: stray '\' in program
    1 | \#include<bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | \#include<bits/stdc++.h>
      |  ^
a.cc:1:3: error: 'include' does not name a type
    1 | \#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> data(n);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> data(n);
      |          ^~~
a.cc:9:12: error: 'data' was not declared in this scope
    9 |     cin >> data.at(i);
      |            ^~~~
a.cc:11:8: error: 'data' was not declared in this scope
   11 |   sort(data.begin(),data.end());
      |        ^~~~
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());
      |   ^~~~~~~
a.cc:18:7: error: 'cout' was not declared in this scope
   18 |       cout << ahead <<endl;
      |       ^~~~
a.cc:18:23: error: 'endl' was not declared in this scope
   18 |       cout << ahead <<endl;
      |                       ^~~~
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout << ans << endl;
      |   ^~~~
a.cc:22:18: error: 'endl' was not declared in this scope
   22 |   cout << ans << endl;
      |                  ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  int D[110];
  for (int i; i < N; i++) cin >> D.at(i);

  set<int> values;
  
  for (int i; i < N; i++) values.insert(D[i]);
  
  cout << values.size() << endl;
}
      
  
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:36: error: request for member 'at' in 'D', which is of non-class type 'int [110]'
    9 |   for (int i; i < N; i++) cin >> D.at(i);
      |                                    ^~
Language: C++

#include<iostream>
#include<vector>

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 = 0;
    int now = 9999999;
    for (int i = 0; i < N; i++) {
        if (now != d.at(i)) {
            cnt++;
            now = d.at(i);
        }
    }

    cout << cnt << endl;

}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: expected ';' before '}' token
   24 |     count++
      |            ^
      |            ;
   25 |   }
      |   ~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |   for ( i = 0 ; i < N ; i++ ){
      |         ^
a.cc:22:9: error: 'i' was not declared in this scope
   22 |   for ( i = 0 ; i < N ; i++ ){
      |         ^
a.cc:24:12: error: expected ';' before '}' token
   24 |     count++
      |            ^
      |            ;
   25 |   }
      |   ~
Language: C++

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

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'revers' was not declared in this scope
   12 |   revers(a.begin(),a.end());
      |   ^~~~~~
Language: C++

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

int main () {
  int N, prev = 0, C = 0;
  cin >> N;
  vector<int> A(N);
  for (i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  sort(A.begin(), A.end());
  for (i = 0; i < N; i++) {
    if(A.at(i) == prev) {
    }
    else {
      C++;
      prev = A.at(i);
    }
  }
  cout << C;
  }

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

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

int main () {
  int N, prev = 0, C = 0;
  cin >> N;
  vector<int> A(N);
  for (i = 0; i < N; i++) {
    cin >> N.at(i);
  }
  sort(A.begin(), A.end());
  for (i = 0; i < N; i++) {
    if(A.at(i) == prev) {
    }
    else {
      C++;
      prev = A.at(i);
    }
  }
  cout << C;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < N; i++) {
      |        ^
a.cc:9:14: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     cin >> N.at(i);
      |              ^~
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   for (i = 0; i < N; i++) {
      |        ^
Language: C++

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

int main () {
  int N, prev = 0, C = 0;
  cin >> N;
  vector<int> A(N);
  for (i = 0; i < N; i++) {
    cin >> N.at(i);
  }
  sort(A.begin(), A.end());
  for (i = 0; i < N; i++) {
    if(A.at(i) == prev) {
    }
    else {
      C++;
      prev = A.at(i);
    }
  }
  cout << C
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   for (i = 0; i < N; i++) {
      |        ^
a.cc:9:14: error: request for member 'at' in 'N', which is of non-class type 'int'
    9 |     cin >> N.at(i);
      |              ^~
a.cc:12:8: error: 'i' was not declared in this scope
   12 |   for (i = 0; i < N; i++) {
      |        ^
a.cc:20:12: error: expected ';' before '}' token
   20 |   cout << C
      |            ^
      |            ;
   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();
  sort(vec.begin(), vec.end();
  int ans = 0;
  int num = 0;
  for(int i = 0; i < N; i++) {
    if(num != vec.at(i)) {
      ans++;
      num = vec.at(i);
    }
  }
  cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: no matching function for call to 'std::vector<int>::at()'
    9 |     cin >> vec.at();
      |            ~~~~~~^~
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:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 0 provided
a.cc:10:30: error: expected ')' before ';' token
   10 |   sort(vec.begin(), vec.end();
      |       ~                      ^
      |                              )
Language: C++

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

int flag[101];

int main() {
  cin>>N;
  int d;
  for(int i=0;i<N;i++){
    cin>>d;
    flag[d]=1;
  }
  int ans=0;
  for(int i=1;i<=100;i++){
    ans+=flag[d];
  }
  cout<<ans<<endl;
}

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

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

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

Compiler output:
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,count=0;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++)cin>>a[i];
  sort(a.begin(),a.end());
  while(a.size()==0){
    int m=a[a.size()-1];
    while(a[a.size()-1]==m)a.pop_back;
    count++;
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:30: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]'
   12 |     while(a[a.size()-1]==m)a.pop_back;
      |                            ~~^~~~~~~~
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:1324:7: note: declared here
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

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

int main(){
  int N;
  map<int,int> mp;
  cin >> N;
  for(int i=0;i<N; i++){
    int k;
    cin >> k;
    mp[k]++;
  }
  int res;
  for(auto t :mp){
    auto k = mp.first;
    auto v = mp.second;
    res++;
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'class std::map<int, int>' has no member named 'first'
   15 |     auto k = mp.first;
      |                 ^~~~~
a.cc:16:17: error: 'class std::map<int, int>' has no member named 'second'
   16 |     auto v = mp.second;
      |                 ^~~~~~
Language: C++

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

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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<int> v(N);
  for(int i=0;i<N;i++){
    cin >> v[i];
  }
  int A;
  for(int i=0;i<N-1;i++){
    if(a[i]==a[i+1]){
    }else{
      A++;
    }
  }
  cout << A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'a' was not declared in this scope
   12 |     if(a[i]==a[i+1]){
      |        ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
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;
  
  for(int i=0;i<N-1;i++){

    if(d.at(i+1)>d.at(i))count++;

  }
  
  cout<<count;
}

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

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

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: 'vector' was not declared in this scope
    4 |   vector<int> S(N);
      |   ^~~~~~
a.cc:4:10: error: expected primary-expression before 'int'
    4 |   vector<int> S(N);
      |          ^~~
a.cc:6:8: error: 'S' was not declared in this scope
    6 |   cin>>S.at(i);}
      |        ^
a.cc:7:8: error: 'S' was not declared in this scope
    7 |   sort(S.begin(),S.end());
      |        ^
a.cc:7:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    7 |   sort(S.begin(),S.end());
      |   ^~~~
      |   short
a.cc:14:3: error: 'cout' was not declared in this scope
   14 |   cout<<X<<endl;}
      |   ^~~~
a.cc:14:12: error: 'endl' was not declared in this scope
   14 |   cout<<X<<endl;}
      |            ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected unqualified-id before '(' token
   12 |     if(S.(i)==S.(i+1)){
      |          ^
a.cc:12:17: error: expected unqualified-id before '(' token
   12 |     if(S.(i)==S.(i+1)){
      |                 ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: expected unqualified-id before '(' token
   12 |     if(S.(i)=S.(i+1)){
      |          ^
a.cc:12:16: error: expected unqualified-id before '(' token
   12 |     if(S.(i)=S.(i+1)){
      |                ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int N'
   10 |   int N=S.size();
      |       ^
a.cc:4:6: note: 'int N' previously declared here
    4 |  int N;
      |      ^
a.cc:12:10: error: expected unqualified-id before '(' token
   12 |     if(S.(i)=S.(i+1)){
      |          ^
a.cc:12:16: error: expected unqualified-id before '(' token
   12 |     if(S.(i)=S.(i+1)){
      |                ^
Language: Java

import java.util.Scanner;
public class Otoshidama {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int Y = sc.nextInt();
		int count=0;
		for(int a=0;a<=N;a++) {
			if(a*10000>Y) {
				break;
			}
			for(int b=0;b<=N;b++) {
				if((a*10000)+(b*5000)>Y) {
					break;
				}
					for(int c=0;c<=N;c++) {
						int sum = (10000*a)+(5000*b)+(1000*c);
						count++;
						if(sum==Y&&a+b+c==N) {
							System.out.println(a+" "+b+" "+c);
							System.out.println(count);
							System.exit(0);
					}
			}
		}
	}
		System.out.print("-1 "+"-1 "+"-1");
}
}


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

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


Compiler output:
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;
 
int main() {
  ll n;
  cin >> n;
  ll d;
  inputv(d,n);
  sort(d.begin(),d.end());
  ll ans = 1;
  for(ll i=0;i<n;i++){
    if(d[i] != d[i-1]){
      ans++;
    }
  }
  cout << ans;
    
 return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: request for member 'push_back' in 'd', which is of non-class type 'll' {aka 'long long int'}
   11 |     v.push_back(x);\
      |       ^~~~~~~~~
a.cc:20:3: note: in expansion of macro 'inputv'
   20 |   inputv(d,n);
      |   ^~~~~~
a.cc:21:10: error: request for member 'begin' in 'd', which is of non-class type 'll' {aka 'long long int'}
   21 |   sort(d.begin(),d.end());
      |          ^~~~~
a.cc:21:20: error: request for member 'end' in 'd', which is of non-class type 'll' {aka 'long long int'}
   21 |   sort(d.begin(),d.end());
      |                    ^~~
a.cc:24:9: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(d[i] != d[i-1]){
      |         ^
a.cc:24:17: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   24 |     if(d[i] != d[i-1]){
      |                 ^
Language: C++

#include<bits.stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  int d[110];
  for(int i=0;i<N;i++){
    cin >> d[i];
  }
  set<int> values;
  for(int i=0;i<N;i++){
    values.insert(d[i]);
  }
  cout << values.size() << endl;
}

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

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

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

  int num[110] = { 0 };
  for (int i = 0; i < n; i++) {
    num[d[i]]++;
  }

  int res = 0;
  for (i = 1; i <= 100; i++) {
    if (num[i]) {
      res++;
    }
  }
  cout << res << endl;
  return 0;
}

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

#incldue<stdio.h>
int main()
{
	int n,d,i,j,cnt,a;
	scanf("%d",&n);
	cnt=n;
	for(i=0;i<n;i++){
		scanf("%d",&p[i]);
	}
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if(d[i]==d[j]){
				cnt-=1;
			}
		}
	}
	cnt-=1;
	printf("%d\n",cnt);
	return 0;
	

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<stdio.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:5:9: error: 'scanf' was not declared in this scope
    5 |         scanf("%d",&n);
      |         ^~~~~
a.cc:8:29: error: 'p' was not declared in this scope
    8 |                 scanf("%d",&p[i]);
      |                             ^
a.cc:12:29: error: invalid types 'int[int]' for array subscript
   12 |                         if(d[i]==d[j]){
      |                             ^
a.cc:12:35: error: invalid types 'int[int]' for array subscript
   12 |                         if(d[i]==d[j]){
      |                                   ^
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("%d\n",cnt);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | #incldue<stdio.h>
a.cc:19:18: error: expected '}' at end of input
   19 |         return 0;
      |                  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> M(N);
  for(int i=0;i<N;i++){
    cin>>M.at(i);
  }
  sort(M.begin(),M.end());
  T.push_back(10000);
  reverse(M.begin(),M.end());
  
  int s=0;
  for(int i=1;i<=N;i++){
    if(T.at(i)<T.at(i-1)){
      s+=1;
    }
  }
  cout<<s<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'T' was not declared in this scope
   12 |   T.push_back(10000);
      |   ^
Language: C++

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

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

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

#include<bits/stdc++.h>
using namespace std;
int n,x[110],ans,prev;
int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d",&x[i]);
	}
	sort(x,x+n);
	prev = x[n-1];
	ans = 1;
	for(int i=n-1;i>=0;i--)
	{
		if(x[i]<prev)
		{
			ans++;
			prev = x[i];
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: reference to 'prev' is ambiguous
   12 |         prev = x[n-1];
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:3:18: note:                 'int prev'
    3 | int n,x[110],ans,prev;
      |                  ^~~~
a.cc:16:25: error: reference to 'prev' is ambiguous
   16 |                 if(x[i]<prev)
      |                         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:3:18: note:                 'int prev'
    3 | int n,x[110],ans,prev;
      |                  ^~~~
a.cc:19:25: error: reference to 'prev' is ambiguous
   19 |                         prev = x[i];
      |                         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:3:18: note:                 'int prev'
    3 | int n,x[110],ans,prev;
      |                  ^~~~
Language: C++

// Problem7.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	int N;
	vector <int> d;

	cin >> N;
	for (int i = 0; i < N; i++)
	{
		int val;
		cin >> val;
		d.push_back(val);
	}
	sort(d.begin(), d.end(), greater<int>());

	int cur, next;
	int cnt = 1;
	for (int i = 0; i < d.size()-1; i++)
	{
		cur = d[i];
		next = d[i+1];
		if (cur != next) cnt++;
	}

	cout << cnt << endl;

    return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
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 sum=0;
  for(int i=0;i<N-1;i++){
    if(vec.at(i)!=vec.at(i+1)){
      sum++;
    }else{
      continue;
    }
    cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
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>
#include <algorithm>
#include <vector>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected ';' before '}' token
   12 |         cin >> a[i]
      |                    ^
      |                    ;
   13 |     }
      |     ~
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);
  }
  int ans=1;
  sort(d.begin(),d.end());
  for(int i=1;i<n;i++){
    int j=d.at(i-1);
    if(j!=d.at(i)){
      ans++;
    }
  }
  cout << ans << endl;
}

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<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);
  }
  int ans;
  sort(d.begin(),d.end());
  for(int i=1;i<n;i++){
    int j=d.at(i-1);
    if(j!=d.at(i)){
      ans++
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before '}' token
   15 |       ans++
      |            ^
      |            ;
   16 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int M, sum = 1;
cin >> M;
  vector<int> vec(M);
  for(int i = 0; i < M; i++)
  {
    cin >> vec(i);
  }
  sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
 for(int j = 0; j < M; j++){
   if(vec(j) < vec(j++))
     sum += 1
 }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> vec(i);
      |            ~~~^~~
a.cc:15:10: error: no match for call to '(std::vector<int>) (int&)'
   15 |    if(vec(j) < vec(j++))
      |       ~~~^~~
a.cc:15:19: error: no match for call to '(std::vector<int>) (int)'
   15 |    if(vec(j) < vec(j++))
      |                ~~~^~~~~
a.cc:16:14: error: expected ';' before '}' token
   16 |      sum += 1
      |              ^
      |              ;
   17 |  }
      |  ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int M, sum = 1;
cin >> M;
  vector<int> vec(M);
  for(int i = 0; i < M; i++)
  {
    cin >> vec(i);
  }
  sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
 for(int j = 0; j < M; j++){
   if(vec(i) < vec(i++))
     sum += 1
 }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> vec(i);
      |            ~~~^~~
a.cc:15:11: error: 'i' was not declared in this scope
   15 |    if(vec(i) < vec(i++))
      |           ^
a.cc:16:14: error: expected ';' before '}' token
   16 |      sum += 1
      |              ^
      |              ;
   17 |  }
      |  ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int M, sum == 1;
cin >> M;
  vector<int> vec(M);
  for(int i = 0; i < M; i++)
  {
    cin >> vec(i);
  }
  sort(vec.begin(), vec.end());
    reverse(vec.begin(), vec.end());
 for(int j = 0; j < M; j++){
   if(vec(i) < vec(i++))
     sum += 1
 }
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before '==' token
    5 |   int M, sum == 1;
      |              ^~
a.cc:10:15: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> vec(i);
      |            ~~~^~~
a.cc:15:11: error: 'i' was not declared in this scope
   15 |    if(vec(i) < vec(i++))
      |           ^
a.cc:16:6: error: 'sum' was not declared in this scope
   16 |      sum += 1
      |      ^~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] moti = new int[num];
        int ans = 0;
        for(int i = 0;i < num;i++){
            moti[i] = sc.nextInt();
        }
        Arrays.sor(moti);
        for(int i = 0;i < num-1;i++){
            if(moti[i] == moti[i+1])
            continue;
            ans++;
        }

        System.out.println(ans);
    }
}

Compiler output:
Main.java:12: error: cannot find symbol
        Arrays.sor(moti);
              ^
  symbol:   method sor(int[])
  location: class Arrays
1 error
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> V(N);
      |   ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> V(N);
      |          ^~~
a.cc:11:12: error: 'V' was not declared in this scope
   11 |     cin >> V[i];
      |            ^
a.cc:14:8: error: 'V' was not declared in this scope
   14 |   sort(V.begin(), V.end(), greater<int>());
      |        ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define pb push_back

int main() {
  int n,cnt;
  cin >> n;
  cnt=n;
  vector<int> mochi(n,0);

  for(int i = 0; i < n; i++){
      cin >> mochi[i];
  }
  sort(mochi.begin(), mochi.end());
  int i=n-1;
  for(int i = 0; i < n-1; i++){
      if(mochi[i]==mochi[i+1]){
          cnt--;
      } 
  }

  cout << cnt << endl;

}


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


int main(){
  int n;
  cin >> n;
  vector<int> d(n);
  for(int i = 0; i < n; ++i) cin >> d[i];
  int num[999] = {0};
  for(int i = 0; i < n; ++i){
	  ++num(d[i]);
  }
  int res = 0;
  for(int i = 1; i <= 100; ++i){
	  if(num[i]){
		  ++res;
	  }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> n;
      |   ^~~
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> d(n);
      |   ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> d(n);
      |          ^~~
a.cc:6:37: error: 'd' was not declared in this scope
    6 |   for(int i = 0; i < n; ++i) cin >> d[i];
      |                                     ^
a.cc:9:17: error: 'd' was not declared in this scope
    9 |           ++num(d[i]);
      |                 ^
a.cc:9:21: error: 'num' cannot be used as a function
    9 |           ++num(d[i]);
      |                     ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << res << endl;
      |   ^~~~
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << res << endl;
      |                  ^~~~
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];
  vector<int> num(n) = {0};
  for(int i = 0; i < n; ++i){
	  ++num(d[i]);
  }
  int res = 0;
  for(int i = 1; i <= 100; ++i){
	  if(num[i]){
		  ++res;
	  }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:22: error: expected ',' or ';' before '=' token
    9 |   vector<int> num(n) = {0};
      |                      ^
a.cc:11:16: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   11 |           ++num(d[i]);
      |             ~~~^~~~~~
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];
  vector<int> num = {0};
  for(int i = 0; i < n; ++i){
	  ++num(d[i]);
  }
  int res = 0;
  for(int i = 1; i <= 100; ++i){
	  if(num[i]){
		  ++res;
	  }
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: no match for call to '(std::vector<int>) (__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&)'
   11 |           ++num(d[i]);
      |             ~~~^~~~~~