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

#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define all(x) (x).begin(),(x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define pob pop_back
#define sw swap
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, m, n) for(int i = m;i < n;i++)
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,c;
     cin >> N;
     vector<int>Mochi(N);
     rep(i,N){
         int x;
         cin >> x;
       Mochi.pb(x);
     }
     
      SORT(Mochi);
      rep(i,N-1){
      if (Mochi[i]<Mochi[i-1]){
      N++;
      }
    }
    cout << N-1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope
   23 |     cin.tie(0);
      |     ^~~
a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    6 | #include <string>
  +++ |+#include <iostream>
    7 | using namespace std;
a.cc:24:10: error: incomplete type 'std::ios' {aka 'std::basic_ios<char>'} used in nested name specifier
   24 |     ios::sync_with_stdio(false);
      |          ^~~~~~~~~~~~~~~
a.cc:27:6: error: 'vector' was not declared in this scope
   27 |      vector<int>Mochi(N);
      |      ^~~~~~
a.cc:7:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    6 | #include <string>
  +++ |+#include <vector>
    7 | using namespace std;
a.cc:27:13: error: expected primary-expression before 'int'
   27 |      vector<int>Mochi(N);
      |             ^~~
a.cc:31:8: error: 'Mochi' was not declared in this scope
   31 |        Mochi.pb(x);
      |        ^~~~~
a.cc:34:12: error: 'Mochi' was not declared in this scope
   34 |       SORT(Mochi);
      |            ^~~~~
a.cc:9:22: note: in definition of macro 'SORT'
    9 | #define SORT(x) sort(x.begin(),x.end())
      |                      ^
a.cc:40:5: error: 'cout' was not declared in this scope
   40 |     cout << N-1;
      |     ^~~~
a.cc:40:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(x) sort(x.begin(),x.end())
#define REVE(x) reverse(x.begin(),x.end())
#define all(x) (x).begin(),(x).end()
#define fst first
#define mp make_pair
#define pb push_back
#define pob pop_back
#define sw swap
using LL = long long;
using ULL = unsigned long long;
#define FOR(i, m, n) for(int i = m;i < n;i++)
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
     cin >> N;
     vector<int>Mochi(N);
     while(N--){
         int x;
         cin >> x;
       Mochi.pb(x);
     }
      SORT(Mochi);
      for(int i = N;0<=i;i--){
      if (Mochi[i]=Mochi[i-1]){
         Mochi.pob();
      }
  }
   cout << Mochi.size;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: 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]'
   41 |    cout << Mochi.size;
      |    ~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:992:7: note: declared here
  992 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

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

int N;
vector<int> d_list;

bool cmp(const int& a, const int& b) {
  if (a < b) return false;
  return true;
}

int main() {
  cin >> N;
  d_list.resize(N);
  for(int i=0;i<N;i++) cin >> d_list[i];

  sort(d_list.begin(), d_list.end(), cmp);

  int pre = 101;
  int ans = 0;
  for(auto s: d_list) {
    if (pre > s) {
      ans++;
    }
    pre = s;
  }
  cout << ans << "\n";
#if 0
  // cout << N << "\n";
  for(auto s: d_list) cout << s << " "; 
#endif
  return 0;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'a' was not declared in this scope
   12 |     if (a.at(i) < a.at (i+1) ) answer++;
      |         ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;

int main(){

    int N;
    vector(int) d[N];

    sort(d.begin(), d.end());
    reverse(d.begin(),d.end());
    int tmp = 0;
    int ans = 0;
    for(int i=0; i<N; i++){
        if(tmp != d[i])
            ans++;
        tmp = d[i];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: missing template arguments before '(' token
   10 |     vector(int) d[N];
      |           ^
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector(int) d[N];
      |            ^~~
a.cc:12:10: error: 'd' was not declared in this scope
   12 |     sort(d.begin(), d.end());
      |          ^
Language: C++

#include<iostream>
#include<vector>

int main(){
  int n;
 vector<int>d(1);

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

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

x=1;
for(i=0;i<n;i++){
  if(d[i]<d[i+1])
     x++;
}
course<<x<<endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:2: error: 'vector' was not declared in this scope
    6 |  vector<int>d(1);
      |  ^~~~~~
a.cc:6:2: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:9: error: expected primary-expression before 'int'
    6 |  vector<int>d(1);
      |         ^~~
a.cc:8:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |  cin>>n;
      |  ^~~
      |  std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:7: error: 'd' was not declared in this scope
   10 |  cin>>d[i];
      |       ^
a.cc:12:6: error: 'd' was not declared in this scope
   12 | sort(d.begin(),d.end());
      |      ^
a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 | sort(d.begin(),d.end());
      | ^~~~
      | short
a.cc:14:1: error: 'x' was not declared in this scope
   14 | x=1;
      | ^
a.cc:15:5: error: 'i' was not declared in this scope
   15 | for(i=0;i<n;i++){
      |     ^
a.cc:19:1: error: 'course' was not declared in this scope
   19 | course<<x<<endl;
      | ^~~~~~
a.cc:19:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 | course<<x<<endl;
      |            ^~~~
      |            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
#include<vector>

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

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

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

x=1;
for(i=0;i<n;i++){
  if(d[i]<d[i+1])
     x++;
}
course<<x<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:2: error: 'vector' was not declared in this scope
    6 |  vector<int>d;
      |  ^~~~~~
a.cc:6:2: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:9: error: expected primary-expression before 'int'
    6 |  vector<int>d;
      |         ^~~
a.cc:8:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |  cin>>n;
      |  ^~~
      |  std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:7: error: 'd' was not declared in this scope
   10 |  cin>>d[i];
      |       ^
a.cc:12:6: error: 'd' was not declared in this scope
   12 | sort(d.begin(),d.end());
      |      ^
a.cc:12:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 | sort(d.begin(),d.end());
      | ^~~~
      | short
a.cc:14:1: error: 'x' was not declared in this scope
   14 | x=1;
      | ^
a.cc:15:5: error: 'i' was not declared in this scope
   15 | for(i=0;i<n;i++){
      |     ^
a.cc:19:1: error: 'course' was not declared in this scope
   19 | course<<x<<endl;
      | ^~~~~~
a.cc:19:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 | course<<x<<endl;
      |            ^~~~
      |            std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int a[100];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  sort(a,a+n);
  int sum=0;
  int before=0;
  for(int i=0;i<n;i++){
    if(before != a[i]){
      sum++;
      before = a[i];
    }
  }
  cout << sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(a,a+n);
      |   ^~~~
      |   short
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(),greater<int>());

	int ans=1;


	for(int i=1;i<N;i++){
		if(D[i-1]!=D[i]){
			ans++;
		}

	}

	cout << ans;
	
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'n' was not declared in this scope
   10 |         vector<int> D(n);
      |                       ^
Language: C++

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


int main() {
    int N;
    int mochi = 0;
    int cntm =0; //もちの段
    cin >> N;
    vector <int> a(100);
    for(int i=0;i<N;++i){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for(int i=0;i<N;++i){
        if(mochi < a[i]){
            mochi = a[i];
            ++cntm; 
        }
    }
    cont << cntm <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'cont' was not declared in this scope; did you mean 'const'?
   21 |     cont << cntm <<endl;
      |     ^~~~
      |     const
Language: C++

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


int main() {
    int N;
    int mochi = 0;
    int cntm =0; //もちの段
    cin >> N;
    vector <int> a(100);
    for(int i=0;i<N;++i){
        cin >> a[i];
    }
    sort(a.begin(), end());
    for(int i=0;i<N;++i){
        if(mochi < a[i]){
            mochi = a[i];
            ++cntm; 
        }
    }
    cont << cntm <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: no matching function for call to 'end()'
   14 |     sort(a.begin(), 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
a.cc:21:5: error: 'cont' was not declared in this scope; did you mean 'const'?
   21 |     cont << cntm <<endl;
      |     ^~~~
      |     const
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
typedef long long ll;
using namespace std;

int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}

int main() {
	int n; cin >> n;
	vector<int> v(n),vv;
	rep(i,n){
		cin >> v[i];
		
	}
	sort(rall(v));
	rep(i,n){
		if (i == 0){
			vv.push_back[v[i]];
			continue;
		}
		if (vv[vv.size()-1] != v[i]){
			vv.push_back(v[i]);
		}
	}
	cout << vv.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:37: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   35 |                         vv.push_back[v[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 = 0,i < N, i++) {
   if (vec.at(i) < vec.at(i+1)) {
    count+=1;
   }
  }
  
  cout << count + 1 << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: expected ';' before '<' token
    8 |   for (int i = 0,i < N, i++) {
      |                   ^~
      |                   ;
a.cc:8:20: error: expected primary-expression before '<' token
    8 |   for (int i = 0,i < N, i++) {
      |                    ^
a.cc:8:28: error: expected ';' before ')' token
    8 |   for (int i = 0,i < N, i++) {
      |                            ^
      |                            ;
a.cc:15:19: error: expected ';' before '<' token
   15 |   for (int i = 0,i < N, i++) {
      |                   ^~
      |                   ;
a.cc:15:20: error: expected primary-expression before '<' token
   15 |   for (int i = 0,i < N, i++) {
      |                    ^
a.cc:15:28: error: expected ';' before ')' token
   15 |   for (int i = 0,i < N, i++) {
      |                            ^
      |                            ;
Language: C++

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

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

    set<int> values; // insert するときに重複を取り除いてくれます
    for (int i = 0; i < N; ++i) {
        values.insert(d[i]); // 挿入します
    }

    // set のサイズを出力します
    cout << values.

Compiler output:
a.cc: In function 'int main()':
a.cc:17:20: error: expected unqualified-id at end of input
   17 |     cout << values.
      |                    ^
a.cc:17:20: error: expected '}' at end of input
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include<iostream>
#include<set>
using namespace std;
int main(){
  int N;
  int d[110];
  cin>>N;

  int i=0;
  for(auto &i:d)cin>>i;

  set<int>values//insertするときに重複を取り除いてくれる
  for(int i=0;i<N;i++){
    values.insert(d[i]);
  }

  //setのサイズを出力
  cout<<values.size()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:3: error: expected initializer before 'for'
   13 |   for(int i=0;i<N;i++){
      |   ^~~
a.cc:13:22: error: expected ';' before ')' token
   13 |   for(int i=0;i<N;i++){
      |                      ^
      |                      ;
a.cc:18:9: error: 'values' was not declared in this scope
   18 |   cout<<values.size()<<endl;
      |         ^~~~~~
Language: C++

#include<iostream>
#include<vector>
#define REP(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(){
    int n, t;
    cin >> n;
    vector<int> d;
    REP(i,n){
        cin >> t;
        d.push_back(t);
    }
    sort(d.begin(), d.end());
    int num[n];
    REP(i,n){
        if(i == 0) num[i] = 1;
        else{
            num[i] = num[i-1];
            if(d[i] != d[i-1] ) num[i]++;
        }
    }
    cout << num[n-1] << endl;
    
}

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

#include <bits/stdc++>
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.rbegin(),a.rend());
  
  int layers = N;
  
  for(int j = 0; j < N-1; j++){
    if(a.at(j) == a.at(j+1)){
      layers -= 1;
    }
  }
  
  cout << layers << endl;

}

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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>k;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>k;
      |          ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |     cin>>k.at(i);
      |          ^
a.cc:11:8: error: 'k' was not declared in this scope
   11 |   sort(k.begin(),k.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(k.begin(),k.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> k(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> k(N);
      |          ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |     cin>>k.at(i);
      |          ^
a.cc:11:8: error: 'k' was not declared in this scope
   11 |   sort(k.begin(),k.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(k.begin(),k.end());
      |   ^~~~
      |   short
a.cc:14:17: error: 'K' was not declared in this scope
   14 |     if(k.at(i)==K.at(i+1)){
      |                 ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>k(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>k(N);
      |          ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |     cin>>k.at(i);
      |          ^
a.cc:11:8: error: 'k' was not declared in this scope
   11 |   sort(k.begin(),k.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(k.begin(),k.end());
      |   ^~~~
      |   short
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>k(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>k(N);
      |          ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |     cin>>k.at(i);
      |          ^
a.cc:11:8: error: 'k' was not declared in this scope
   11 |   sort(k.begin(),k.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(k.begin(),k.end());
      |   ^~~~
      |   short
a.cc:14:17: error: 'K' was not declared in this scope
   14 |     if(k.at(i)==K.at(i+1)){
      |                 ^
Language: C++

#include <iostream>
using namespace;

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

Compiler output:
a.cc:2:16: error: expected identifier before ';' token
    2 | using namespace;
      |                ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int>k(N);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int>k(N);
      |          ^~~
a.cc:9:10: error: 'k' was not declared in this scope
    9 |     cin>>k.at(i);
      |          ^
a.cc:11:8: error: 'k' was not declared in this scope
   11 |   sort(k.begin(),k.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(k.begin(),k.end());
      |   ^~~~
      |   short
a.cc:14:17: error: 'K' was not declared in this scope
   14 |     if(k.at(i)==K.at(i+1)){
      |                 ^
a.cc:18:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |   cout<<count<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:18:16: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   18 |   cout<<count<<endl;
      |                ^~~~
      |                std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> mochi;
  int i,j;
  int d;
  bool check;
  
  for(i=0;i<N;i++){
    cin >> d;
    check = false;
    for(j=0;j<mochi.size;j++){
      if(mochi.at(j) == d){
        check = true;
        break;
      }
    }
    if(check == false){
      mochi.push_back(d);
    }
  }
  
  cout << mochi.size << endl;
        
      
  
  



}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: invalid use of 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]' (did you forget the '()' ?)
   16 |     for(j=0;j<mochi.size;j++){
      |               ~~~~~~^~~~
      |                         ()
a.cc:27:8: 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]'
   27 |   cout << mochi.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;
  cin >> n;
  int d[100];
  int save[100]={0};
  int ans=0;
  for(int i=0;i<n;i++) cin >> d[i];
  
  for(int i=0;i<n;i++){
    save[d[i]]++;
  }
  
  for(int i=1;i<=100;i++){
    if(save[i]>0) ans++;
  }
  
  cout << ans <<endl;
}

  
  
  cout << ans << endl;
}

Compiler output:
a.cc:25:3: error: 'cout' does not name a type
   25 |   cout << ans << endl;
      |   ^~~~
a.cc:26:1: error: expected declaration before '}' token
   26 | }
      | ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  int d[100];
  int save[100];
  int ans=0;
  for(int i=0;i<n;i++)　cin >> d[i];
  
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      if(save[j]==d[i]) break;
    }
    save[ans]=d[i];
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc:10:23: error: extended character 　 is not valid in an identifier
   10 |   for(int i=0;i<n;i++)　cin >> d[i];
      |                       ^
a.cc: In function 'int main()':
a.cc:10:23: error: '\U00003000cin' was not declared in this scope
   10 |   for(int i=0;i<n;i++)　cin >> d[i];
      |                       ^~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  int d[100];
  int save[100];
  int ans=0;
  for(int i=0;i<n;i++)　cin >> d[i];
  
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j+){
      if(save[j]==d[i]) break;
    }
    save[ans]=d[i];
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc:10:23: error: extended character 　 is not valid in an identifier
   10 |   for(int i=0;i<n;i++)　cin >> d[i];
      |                       ^
a.cc: In function 'int main()':
a.cc:10:23: error: '\U00003000cin' was not declared in this scope
   10 |   for(int i=0;i<n;i++)　cin >> d[i];
      |                       ^~~~~
a.cc:13:23: error: expected primary-expression before ')' token
   13 |     for(int j=0;j<n;j+){
      |                       ^
Language: C++

#include <iostream>
using namespace std;

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

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

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

int main() {
  int n;cin>>n;
  int max=10000000,ans=0;
  for(int i=0;i<n;i++)
  {
	int d;cin>>d;
    if(max>d)
    {
      max=d;
      ans++;
    }
  }
  cout<<ans<<endl;
}
      
    
}

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

#include iostream
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 s=0;
  int count=0;
  for(int i=0;i<N;i++){
     if(A.at(i)!=s){
       count++;
       s=A.at(i);
     }
  }
  cout<<count<<endl;
}

  

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include iostream
      |          ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #include iostream
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(N);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #include iostream
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:10: error: 'A' was not declared in this scope
    9 |     cin>>A.at(i);
      |          ^
a.cc:11:6: error: 'A' was not declared in this scope
   11 | sort(A.begin(),A.end());
      |      ^
a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 | sort(A.begin(),A.end());
      | ^~~~
      | short
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<<count<<endl;
      |   ^~~~
a.cc:20:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:16: error: 'endl' was not declared in this scope
   20 |   cout<<count<<endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #include iostream
Language: C++

#include iostream
using namespace
  
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 s=0;
  int count=0;
  for(int i=0;i<N;i++){
     if(A.at(i)!=s){
       count++;
       s=A.at(i);
     }
  }
  cout<<count<<endl;
}

  

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include iostream
      |          ^~~~~~~~
a.cc:4:1: error: expected identifier before 'int'
    4 | int main(){
      | ^~~
a.cc:2:16: error: expected ';' before 'int'
    2 | using namespace
      |                ^
      |                ;
    3 | 
    4 | int main(){
      | ~~~             
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> A(N);
      |   ^~~~~~
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(N);
      |          ^~~
a.cc:9:10: error: 'A' was not declared in this scope
    9 |     cin>>A.at(i);
      |          ^
a.cc:11:6: error: 'A' was not declared in this scope
   11 | sort(A.begin(),A.end());
      |      ^
a.cc:11:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 | sort(A.begin(),A.end());
      | ^~~~
      | short
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   20 |   cout<<count<<endl;
      |   ^~~~
      |   count
a.cc:20:16: error: 'endl' was not declared in this scope
   20 |   cout<<count<<endl;
      |                ^~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     ans = 0;
      |     ^~~
      |     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[i];
  }
  int x = 0;
  int y = 101;
  int max;
  for(int i = 0; i < N; i++){
    max = 0;
    for(int j = 0; j < N; j++){
      if(max <= a[j] && a[j] < y ){
        max = a[j];
      }
    }
    y = max;
    if(max != 0){
      x++;
    }
  }
  cout << x << endl;
}

    


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'a' was not declared in this scope
   17 |       if(max <= a[j] && a[j] < y ){
      |                 ^
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];
  }
  int x = 0;
  int y = 101;
  int max;
  for(int i = 0; i < N; i++){
    max = 0
    for(int j = 0; j < N; j++){
      if(max <= a[j] && a[j] < y ){
        max = a[j];
      }
    }
    y = max;
    if(max != 0){
      x++;
    }
  }
  cout << x << endl;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: expected ';' before 'for'
   15 |     max = 0
      |            ^
      |            ;
   16 |     for(int j = 0; j < N; j++){
      |     ~~~     
a.cc:16:20: error: 'j' was not declared in this scope
   16 |     for(int j = 0; j < N; j++){
      |                    ^
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++)
  {
    int s;
    cin>>s;
    a[i]=s;
  }
  sort(a.begin,a.end());
  int count=1;
  for(int j =0;j<n-1;j++)
  {
    if(a[j]!=a[j+1])
    {
      count+=1;
    }
    else
    {
      continue;
    }
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<int>::iterator)'
   14 |   sort(a.begin,a.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: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/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 <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
    int n;
    int ans = 0;
    cin >> n;
    vector<int> d(n);
    rep(i, n) {
        cin >> d[i];
    }
    sort(d.begin(), d.end());
    rep(i, n) {
        if (i == 0) {
            ans++;
        } else if (d[i] != d[i - 1]) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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

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

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

  vector <int> M(101);

  //鏡餅の大きさを配列Mに格納する
  for (int i = 0; i < N; i++) {
    cin >> M.at(i);
    /* code */
  }
  //鏡餅を大きい順に並び替える
  sort(M.begin(),M.end());
  reverse(M.begin(),M.end());

  int ans = 1
  //鏡餅の大きさを比較する
  for (int i = 0; i < N; i++) {
    if(M.at(i) > M.at(i+1)) ans++;     
  }
  cout << ans;


}


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

#include <iostream>
#include <algorithm>
#include <math.h> 
#include <string>
#include <iomanip>
#include <vector>
using namespace std;
int main(){
    int n;
    cin >> n;
    int d[110];
    for(int i = 0; i < n; i++) cin >> d[i];
    int a[110] = {0};
    int ans = 0;

    for(int i = 0; i < n; i++){
        a[d[i]] = 1;
    }
    
    for(int i = 0; i < 110; i++){
        if(a[i] != 0) ans++;
    }
    

Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: expected '}' at end of input
   22 |     }
      |      ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: C++

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

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

#include <iostream>
#include <algorithm>
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 ans = 0;
    for (int i = 1; i <= 100; i++){
        if(num[i]>0){
            ++res;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'res' was not declared in this scope
   22 |             ++res;
      |               ^~~
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.at(i);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  
  int s = 1;
  
  if( n == 1) break;
  else {
    for(int i = 0; i <n-1 ; i++) {
      if(v.at(i) != v.at(i++)) s++;
    }
  }
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: break statement not within loop or switch
   17 |   if( n == 1) break;
      |               ^~~~~
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.at(i);
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  
  int s = 1;
  
  for(int i = 0; i <n ; i++) {
    if(v.at(i) != v.at(i++)) s++
  }
  
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:33: error: expected ';' before '}' token
   18 |     if(v.at(i) != v.at(i++)) s++
      |                                 ^
      |                                 ;
   19 |   }
      |   ~
Language: C++

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

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


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

#inclde <bits/tsdc++.h>
using namespace std;

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

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde <bits/tsdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   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 | #inclde <bits/tsdc++.h>
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> v(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inclde <bits/tsdc++.h>
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> v(n);
      |          ^~~
a.cc:10:12: error: 'v' was not declared in this scope
   10 |     cin >> v.at(i);
      |            ^
a.cc:12:8: error: 'v' was not declared in this scope
   12 |   sort(v.begin(), v.end());
      |        ^
a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:13:3: error: 'reverse' was not declared in this scope
   13 |   reverse(v.begin(), v.end());
      |   ^~~~~~~
a.cc:18:33: error: expected ';' before '}' token
   18 |     if(v.at(i) != v.at(i++)) s++
      |                                 ^
      |                                 ;
   19 |   }
      |   ~                              
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout << s << endl;
      |   ^~~~
a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:16: error: 'endl' was not declared in this scope
   21 |   cout << s << endl;
      |                ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclde <bits/tsdc++.h>