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

#include <iostream>
#include <algorithm>
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, a + N);
     for (int i = 0; i < N - 1; i++) {
         if (a.at(i) == a.at(i+1)){
             N--;
         }
     }
     cout << N << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'vector' was not declared in this scope
    8 |      vector<int> a(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 | using namespace std;
a.cc:8:13: error: expected primary-expression before 'int'
    8 |      vector<int> a(N);
      |             ^~~
a.cc:10:17: error: 'a' was not declared in this scope
   10 |          cin >> a.at(i);
      |                 ^
a.cc:13:11: error: 'a' was not declared in this scope
   13 |      sort(a, a + N);
      |           ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
 int main(){
     int N;
     int a[110];
     cin >> N;
     for(int i = 0; i < N; i++) {
         cin > >a[i];
     }
     
   int x = N;
     sort(a, a + N);
     for (int i = 0; i < N - 1; i++) {
         if (a[i] == a[i+1]){
             x--;
         }
     }
     cout << x << endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected primary-expression before '>' token
   10 |          cin > >a[i];
      |                ^
Language: C++

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

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

    int i;
    vector<int> d(N);
    for(i=0;i<N;i++){
        cin >> d.at(i);
    }

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

    int flag=0;
    for(i=0;i<N-1;i++){
        if(d.at(i)==d.at(i+1)) flag++;
    }

    cout << N - flag << endl;
}



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

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

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

    int i;
    vector<int> d(N);
    for(i=0;i<N;i++){
        cin >> d.at(i);
    }

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

    int flag=0;
    for(i=0;i<N-1;i++){
        if(d.at(i)==d.at(i+1)) flag++;
    }

    cout << N - flag << endl;
}



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

#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
int main(){
  int n;
  cin>>n;
  vector<int> d(n);
  rep(i,n) cin>>d[i];
  sort(all(s));
  reverse(all(s));
  int ans=1;
  rep(i,n){
    if(d[i]!=d[i+1]) ans++;
  }
  cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 's' was not declared in this scope
   15 |   sort(all(s));
      |            ^
a.cc:8:17: note: in definition of macro 'all'
    8 | #define all(a) (a).begin(),(a).end()
      |                 ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> D(N);
  
  for (int i = o; i < N; i++) {
    int d;
    cin >> d;
    D.at(d - 1) = 1;
  }
  
  int l = 0;
  for (int i = 0; i < N; i++) l += D(i);
  cout << l << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: 'o' was not declared in this scope
    9 |   for (int i = o; i < N; i++) {
      |                ^
a.cc:16:37: error: no match for call to '(std::vector<int>) (int&)'
   16 |   for (int i = 0; i < N; i++) l += D(i);
      |                                    ~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |       D.push_back(d)
      |                     ^
      |                     ;
   16 |   }
      |   ~
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);
  }
  
  int sum = 0;
  
  for (int i = 0; i < n; i ++) {
    if (s.at(i) != 0) {
      sum++;
      for (int j = i + 1;; j < n; j++) {
        if (s.at(i) == s.at(j))
          s.at(j) = 0;
      }
    }
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:33: error: expected ')' before ';' token
   17 |       for (int j = i + 1;; j < n; j++) {
      |           ~                     ^
      |                                 )
a.cc:17:35: error: 'j' was not declared in this scope
   17 |       for (int j = i + 1;; j < n; j++) {
      |                                   ^
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;
	cin >> n;
	vector<int> mochi(n);
	rep(i, n) cin >> mochi(i);

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

	int ans = 1;
	rep(i, n-1){
		if(mochi.at(i) != mochi.at(i+1))
			ans++;
	}
	cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: no match for call to '(std::vector<int>) (int&)'
    9 |         rep(i, n) cin >> mochi(i);
      |                          ~~~~~^~~
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;
  cin >> N;
  vector<int> vec(101,0);
  rep(i,N){
   int tmp;
   cin >> tmp;
   vec.at(tmp) = 1; 
  }
  int ans =0;
  rep(i,N){
    ans += v.at(i);
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'v' was not declared in this scope
   16 |     ans += v.at(i);
      |            ^
Language: Java

import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
import java.util.stream.Collectors;
public class Main39 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int givenNumber = scanner.nextInt();
        scanner.nextLine();
        List<Integer> array = new ArrayList<>();
        for(int i=0; i<givenNumber; i++) {
            array.add(scanner.nextInt());
        }
        long size = array.stream().distinct().count();
        System.out.println(size);
    }
}


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

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

int main(){
  int N;
  cin >> N;
  
  vector<int> d(N);
  
  int sum = 1;
  
  for(int i=0;i<N;i++){
    cin >> d.at[i];
  }
  
  sort(d.begin(),d.end());
  
  for(int j=0;j<N;j++){
    if(d.at(j)!=d.at(j+1)){
      sum++;
    }
  }

  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     cin >> d.at[i];
      |                ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  vector<int> d(N);
  
  int sum = 1;
  
  for(int i=0;i<N;i++){
    cin >> d(N);
  }
  
  for(int j=0;j<N;j++){
    if(d(j)=d(j+1)){
      continue;
    }
    else if(d(j)!=d(j+1)){
      sum++;
    }
  }

  cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: no match for call to '(std::vector<int>) (int&)'
   13 |     cin >> d(N);
      |            ~^~~
a.cc:17:9: error: no match for call to '(std::vector<int>) (int&)'
   17 |     if(d(j)=d(j+1)){
      |        ~^~~
a.cc:17:14: error: no match for call to '(std::vector<int>) (int)'
   17 |     if(d(j)=d(j+1)){
      |             ~^~~~~
a.cc:20:14: error: no match for call to '(std::vector<int>) (int&)'
   20 |     else if(d(j)!=d(j+1)){
      |             ~^~~
a.cc:20:20: error: no match for call to '(std::vector<int>) (int)'
   20 |     else if(d(j)!=d(j+1)){
      |                   ~^~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector<int> d(N);
  
  int sum = 1;
  
  for(int i=0;i<N;i++){
    cin >> d(N);
  }
  
  for(int j=0;j<N;j++){
    if(d(j)=d(j+1)){
      continue;
    }
    else if(d(j)!=d(j+1)){
      sum++;
    }
  }

  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: no match for call to '(std::vector<int>) (int&)'
   13 |     cin >> d(N);
      |            ~^~~
a.cc:17:9: error: no match for call to '(std::vector<int>) (int&)'
   17 |     if(d(j)=d(j+1)){
      |        ~^~~
a.cc:17:14: error: no match for call to '(std::vector<int>) (int)'
   17 |     if(d(j)=d(j+1)){
      |             ~^~~~~
a.cc:20:14: error: no match for call to '(std::vector<int>) (int&)'
   20 |     else if(d(j)!=d(j+1)){
      |             ~^~~
a.cc:20:20: error: no match for call to '(std::vector<int>) (int)'
   20 |     else if(d(j)!=d(j+1)){
      |                   ~^~~~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  
  vector(int) d(N);
  
  int sum = 1;
  
  for(int i=0;i<N;i++){
    cin >> d(N);
  }
  
  for(int j=0;j<N;j++){
    if(d(j)=d(j+1)){
      continue;
    }
    else if(d(j)!=d(j+1)){
      sum++;
    }
  }

  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: missing template arguments before '(' token
    8 |   vector(int) d(N);
      |         ^
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) d(N);
      |          ^~~
a.cc:13:12: error: 'd' was not declared in this scope
   13 |     cin >> d(N);
      |            ^
a.cc:17:8: error: 'd' was not declared in this scope
   17 |     if(d(j)=d(j+1)){
      |        ^
Language: C++

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

int main() {
  int N,;
  cin >> N;
  
  vector(int) d(N);
  
  int sum = 1;
  
  for(int i=0;i<N;i++){
    cin >> d(N);
  }
  
  for(int j=0;j<N;j++){
    if(d(j)=d(j+1)){
      continue;
    }
    else if(d(j)!=d(j+1)){
      sum++;
    }
  }

  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected unqualified-id before ';' token
    5 |   int N,;
      |         ^
a.cc:8:9: error: missing template arguments before '(' token
    8 |   vector(int) d(N);
      |         ^
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) d(N);
      |          ^~~
a.cc:13:12: error: 'd' was not declared in this scope
   13 |     cin >> d(N);
      |            ^
a.cc:17:8: error: 'd' was not declared in this scope
   17 |     if(d(j)=d(j+1)){
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected ')' before '{' token
   20 |       if(d.at(j)!=d.at(j+1){
      |         ~                  ^
      |                            )
a.cc:24:12: error: expected primary-expression before '}' token
   24 |            }
      |            ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:20:28: error: expected ')' before '{' token
   20 |       if(d.at(j)!=d.at(j+1){
      |         ~                  ^
      |                            )
a.cc:24:12: error: expected primary-expression before '}' token
   24 |            }
      |            ^
Language: C

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

int main() {
  int N;
  cin >> N;
  vector<int> mochi(N);
  for (int i = 0; i < N; i++) {
    cin >> mochi.at(i);
  }
  sort(mochi.begin(), mochi.end());
  reverse(mochi.begin(), mochi.end());
  int ans = 0;
  int prev = 101;
  for (int i = 0; i < N; i++) {
    int cur = mochi.at(i);
    if (cur < prev) ans++;
    prev = cur;
  }
  cout << ans << endl;
}


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

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

int main() {
  int N;
  cin >> N;
  vector<int> mochi(N);
  for (int i = 0; i < N; i++) {
    cin >> mochi.at(i);
  }
  sort(mochi.begin(), mochi.end());
  reverse(mochi.begin(), mochi.end());
  int ans = 0;
  int prev = 101;
  for (int i = 0; i < N; i++) {
    int cur = mochi.at(i);
    if (cur < prev) ans++;
    prev = cur;
  }
  cout << ans << endl;
}


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

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

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

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

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

int main(){
  int n,h[10000]=0,nu=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    int d;
    cin>>d;
    h[d]=1;
  }
  for(int i=1;i<=n;i++){
    nu+=h[i];
  }
  cout<<nu<<endl;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: array must be initialized with a brace-enclosed initializer
    5 |   int n,h[10000]=0,nu=0;
      |                  ^
Language: C++

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

int main(){
  int n,h[10000]=0,nu=0;
  cin>>n;
  for(int i=1;i<=n;i++){
    int d;
    cin>>d;
    h[d]=1;
  }
  for(int i=1;i<=n;i++){
    nu+=h[d];
  }
  cout<<nu<<endl;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: array must be initialized with a brace-enclosed initializer
    5 |   int n,h[10000]=0,nu=0;
      |                  ^
a.cc:13:11: error: 'd' was not declared in this scope
   13 |     nu+=h[d];
      |           ^
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());
    reverse(d.begin(), d.end());

    int count = 0;
    for (int i = 0; i < N; i++) {
        if (d.at(i) > d.at(i+1) {
            count++;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no match for call to '(std::vector<int>) (int&)'
   10 |         cin >> d(i);
      |                ~^~~
a.cc:17:32: error: expected ')' before '{' token
   17 |         if (d.at(i) > d.at(i+1) {
      |            ~                   ^~
      |                                )
a.cc:20:5: error: expected primary-expression before '}' token
   20 |     }
      |     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >>n;
  set<int> v;
  for(int i=0; i<n; i++){
    int t;
    cin >>t;
    set(t);
  }
  cout << set.size() <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: conflicting declaration 'set<...auto...> t'
   12 |     set(t);
      |         ^
a.cc:10:9: note: previous declaration as 'int t'
   10 |     int t;
      |         ^
a.cc:14:14: error: missing template arguments before '.' token
   14 |   cout << set.size() <<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.at(i);
  }
  sort(d.begin(), d.end());
  
  int count;
  for(int i=0; i<n-1; i++){
    if(d.at(i) < d.at(i+1)) count++;
    else continue;
  }
  
  cout << count << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
a.cc:11:10: error: request for member 'begin' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |                     ^~~
a.cc:15:10: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |          ^~
a.cc:15:20: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |                    ^~
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
a.cc:11:10: error: request for member 'begin' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |                     ^~~
a.cc:15:10: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |          ^~
a.cc:15:20: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |                    ^~
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
a.cc:11:10: error: request for member 'begin' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |                     ^~~
a.cc:15:10: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |          ^~
a.cc:15:20: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |                    ^~
a.cc:16:18: error: expected ';' before '}' token
   16 |     else continue
      |                  ^
      |                  ;
   17 |   }
      |   ~
Language: C++

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

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




Compiler output:
a.cc: In function 'int main()':
a.cc:5:13: error: expected ';' before 'n'
    5 |   int n; cin n;
      |             ^~
      |             ;
a.cc:11:10: error: request for member 'begin' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |          ^~~~~
a.cc:11:21: error: request for member 'end' in 'n', which is of non-class type 'int'
   11 |   sort(n.begin(), n.end());
      |                     ^~~
a.cc:15:10: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |          ^~
a.cc:15:20: error: request for member 'at' in 'n', which is of non-class type 'int'
   15 |     if(n.at(i) < n.at(i+1)) count++;
      |                    ^~
a.cc:16:18: error: expected ';' before '}' token
   16 |     else continue
      |                  ^
      |                  ;
   17 |   }
      |   ~
Language: C++

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

int main(){
  ll N,c;
  cin >> N;
  c = 1;
  vector<int> width(N);
  rep(i, N) {
    cin >> width.at(i);
  }
  sort(width.begin(), width.end());
  rep(i, N - 1) {
    if (width.at(i + 1) > width.at(i)) {
      s++;
    }
  }
}


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

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

int main() {
    int n; cin >> n;
    vint d(n);
    rep(i,n) cin >> d[i];
    sort(all(d));
    d.erase(unique(all(d),d.end());
    cout << d.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: expected ')' before ';' token
   25 |     d.erase(unique(all(d),d.end());
      |            ~                      ^
      |                                   )
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 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/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Iterator2 = __gnu_cxx::__normal_iterator<int*, std::vector<int> >; _Compare = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<int*, vector<int> > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:19:   required from here
   25 |     d.erase(unique(all(d),d.end());
      |             ~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<int*, std::vector<int> >) (int&, int&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#incluce<set>
#include<math.h>
using namespace std;

int main(){
    int N;
    int d[110];
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> d[i];
    }
    
    set<int> V;
    for(int i=0; i<N; i++){
        V.insert(d[i]);
    }
    
    
    cout << V.size() << endl;
    return 0;
}


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #incluce; did you mean #include?
    4 | #incluce<set>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:16:5: error: 'set' was not declared in this scope
   16 |     set<int> V;
      |     ^~~
a.cc:6:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    5 | #include<math.h>
  +++ |+#include <set>
    6 | using namespace std;
a.cc:16:9: error: expected primary-expression before 'int'
   16 |     set<int> V;
      |         ^~~
a.cc:18:9: error: 'V' was not declared in this scope
   18 |         V.insert(d[i]);
      |         ^
a.cc:22:13: error: 'V' was not declared in this scope
   22 |     cout << V.size() << endl;
      |             ^
Language: C++

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


int main() {
  cin >> n;
  vector<int> d(n);
  rep(i,n) cin >> d[i];
  set<int> values;
  rep(i,n){
    values.insert(d[i]);
  }
  cout << values.size() << endl;
  return 0;
}

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

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.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> n;
      |   ^~~
a.cc:9:3: error: 'set' was not declared in this scope
    9 |   set<int> values; // insert時に重複を取り除く
      |   ^~~
a.cc:9:7: error: expected primary-expression before 'int'
    9 |   set<int> values; // insert時に重複を取り除く
      |       ^~~
a.cc:12:5: error: 'values' was not declared in this scope
   12 |     values.insert(d[i]); // 挿入
      |     ^~~~~~
a.cc:16:3: error: 'cout' was not declared in this scope
   16 |   cout << values.size() << endl;
      |   ^~~~
a.cc:16:11: error: 'values' was not declared in this scope
   16 |   cout << values.size() << endl;
      |           ^~~~~~
a.cc:16:28: error: 'endl' was not declared in this scope
   16 |   cout << values.size() << endl;
      |                            ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: array must be initialized with a brace-enclosed initializer
   13 |   int num[100] = 0;
      |                  ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'aa' was not declared in this scope; did you mean 'a'?
    8 | aa
      | ^~
      | a
a.cc:9:19: error: 'i' was not declared in this scope
    9 |   for (int i = 0; i < n; i++)
      |                   ^
Language: C++

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

int main(){
    int n;
    cin >>n;
    vector<string> blue(n);
  for(int i=0;i<n;i++){
    cin >>blue[i];
     }
   
  int ans=n;
  for(int i=0;i<n;i++){
    if(i>0){ 
     for(int j=0;j<i;j++){
       if(blue[i]==blue[j]){stop=1; break;}
     }
   }
    if(stop==1){ans--;}
  
  }
  
  cout << ans<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: 'stop' was not declared in this scope
   16 |        if(blue[i]==blue[j]){stop=1; break;}
      |                             ^~~~
a.cc:19:8: error: 'stop' was not declared in this scope
   19 |     if(stop==1){ans--;}
      |        ^~~~
Language: C++

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

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

    int numbs[110];
    int bucket[N] = {0};
    int count = 0;

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

    }
    for(int i = 0;i < N;i++){
        
        bucket[numbs[i]]++;
        
    }
    for(int i = 0;i < 101;i++){
        if(bucket[i]] > 0){
        count++;
    }

    }
    
    cout << count << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected ')' before ']' token
   22 |         if(bucket[i]] > 0){
      |           ~         ^
      |                     )
a.cc:22:21: error: expected primary-expression before ']' token
Language: C++

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

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

    int numbs[110];
    int bucket[N];
    int count = 0;

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

    }
    for(int = 0; i < N ; i++){
        
        bucket[numbs[i]]++;
        
    }
   
    if(bucket[numbs[i]] > 0){
        count++
    }

    cout << count << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: expected unqualified-id before '=' token
   12 |     for(int = 0; i < N ; i++){
      |             ^
a.cc:12:12: error: expected ';' before '=' token
   12 |     for(int = 0; i < N ; i++){
      |            ^~
      |            ;
a.cc:12:13: error: expected primary-expression before '=' token
   12 |     for(int = 0; i < N ; i++){
      |             ^
a.cc:12:18: error: 'i' was not declared in this scope
   12 |     for(int = 0; i < N ; i++){
      |                  ^
a.cc:12:23: error: expected ')' before ';' token
   12 |     for(int = 0; i < N ; i++){
      |        ~              ^~
      |                       )
a.cc:12:26: error: 'i' was not declared in this scope
   12 |     for(int = 0; i < N ; i++){
      |                          ^
a.cc:16:13: error: expected unqualified-id before '=' token
   16 |     for(int = 0; i < N ; i++){
      |             ^
a.cc:16:12: error: expected ';' before '=' token
   16 |     for(int = 0; i < N ; i++){
      |            ^~
      |            ;
a.cc:16:13: error: expected primary-expression before '=' token
   16 |     for(int = 0; i < N ; i++){
      |             ^
a.cc:16:23: error: expected ')' before ';' token
   16 |     for(int = 0; i < N ; i++){
      |        ~              ^~
      |                       )
a.cc:23:16: error: expected ';' before '}' token
   23 |         count++
      |                ^
      |                ;
   24 |     }
      |     ~
Language: C++

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

int main(){
  int N; cin >> N;
  int d[N];
  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;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: invalid use of non-static member function 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::size() const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; size_type = long unsigned int]'
   12 |   cout << values.size << endl;
      |   ~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/set:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_set.h:421:7: note: declared here
  421 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:45: error: expected ';' before 'break'
    4 |     for(int j=0;j<i;j++){if(a.at(i)==a.at(j)break;if(j=i-1)x++;}}
      |                                             ^~~~~
      |                                             ;
a.cc:4:51: error: expected primary-expression before 'if'
    4 |     for(int j=0;j<i;j++){if(a.at(i)==a.at(j)break;if(j=i-1)x++;}}
      |                                                   ^~
a.cc:4:51: error: expected ')' before 'if'
    4 |     for(int j=0;j<i;j++){if(a.at(i)==a.at(j)break;if(j=i-1)x++;}}
      |                            ~                      ^~
      |                                                   )
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(N);
           sort(a.begin(),a.end());int x=1;for(int i=1;i<N;i++)if(a.at(i)-a.at(i-1))x++;
           cout<<x<<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>
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]]++;  // d[i] が 1 個増える
    }

    int res = 0;  // 答えを格納
    for (int i = 1; i <= 100; ++i) {  // 1 <= d[i] <= 100 なので 1 から 100 まで探索
        if (num[i]) {  // 0 より大きかったら
            ++res;
        }
    }
    cout << res << endl;
}

// std::set を用いた解
#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.size() << endl;
}

Compiler output:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

// バケット法による解
#include <iostream>
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]]++;  // d[i] が 1 個増える
    }

    int res = 0;  // 答えを格納
    for (int i = 1; i <= 100; ++i) {  // 1 <= d[i] <= 100 なので 1 から 100 まで探索
        if (num[i]) {  // 0 より大きかったら
            ++res;
        }
    }
    cout << res << endl;
}

// std::set を用いた解
#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.size() << endl;
}

Compiler output:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   18 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:18:20: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   18 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++

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

Compiler output:
a.cc:21:20: error: extended character 　 is not valid in an identifier
   21 |     if(a[j]<a[j+1])　　
      |                    ^
a.cc:21:20: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:11: error: expected unqualified-id before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:10: error: expected ';' before '=' token
   11 |   for(int =0;i<n;i++)
      |          ^~
      |          ;
a.cc:11:11: error: expected primary-expression before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |              ^
a.cc:11:17: error: expected ')' before ';' token
   11 |   for(int =0;i<n;i++)
      |      ~          ^
      |                 )
a.cc:11:18: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |                  ^
a.cc:17:10: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   17 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:17:20: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   17 |   sort(a.begin(),a.end());
      |                    ^~~
a.cc:21:20: error: '\U00003000\U00003000' was not declared in this scope
   21 |     if(a[j]<a[j+1])　　
      |                    ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
 
 int n;
  cin>>n;
  
  int a[n];
 
  for(int i=0;i<n;i++)
    cin>>a[i];
  
  int num=1;
  
  sort(a,a+n);
  
  for(int j=0;j<n-1;j++)
  {
   　if(a[j]<a[j+1])　　
    {
      num++;
    }
  }
  
  cout<<num<<endl;
  
}

Compiler output:
a.cc:20:4: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |    ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |                     ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:20:4: error: '\U00003000if' was not declared in this scope
   20 |    　if(a[j]<a[j+1])　　
      |    ^~~~
Language: C++

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

int main() {
 
 int n;
  cin>>n;
  
  int a[n];

  for(int =0;i<n;i++)
    cin>>a[i];
  
  int num=1;
  
  sort(a,a+n);
  
  for(int j=0;j<n-1;j++)
  {
   　if(a[j]<a[j+1])　　
    {
      num++;
    }
  }
  
  cout<<num<<endl;
  
}

Compiler output:
a.cc:20:4: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |    ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |                     ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:11:11: error: expected unqualified-id before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:10: error: expected ';' before '=' token
   11 |   for(int =0;i<n;i++)
      |          ^~
      |          ;
a.cc:11:11: error: expected primary-expression before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |              ^
a.cc:11:17: error: expected ')' before ';' token
   11 |   for(int =0;i<n;i++)
      |      ~          ^
      |                 )
a.cc:11:18: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |                  ^
a.cc:20:4: error: '\U00003000if' was not declared in this scope
   20 |    　if(a[j]<a[j+1])　　
      |    ^~~~
Language: C++

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

int main() {
 
 int n;
  cin>>n;
  
  int a[n+1];
  int a[n+1]=0;
  for(int =0;i<n;i++)
    cin>>a[i];
  
  int num=1;
  
  sort(a,a+n);
  
  for(int j=0;j<n;j++)
  {
   　if(a[j]<a[j+1])　　
      num++;
  }
  
  cout<<num<<endl;
  
}

Compiler output:
a.cc:20:4: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |    ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
   20 |    　if(a[j]<a[j+1])　　
      |                     ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a [(n + 1)]'
   10 |   int a[n+1]=0;
      |       ^
a.cc:9:7: note: 'int a [(n + 1)]' previously declared here
    9 |   int a[n+1];
      |       ^
a.cc:11:11: error: expected unqualified-id before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:10: error: expected ';' before '=' token
   11 |   for(int =0;i<n;i++)
      |          ^~
      |          ;
a.cc:11:11: error: expected primary-expression before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |              ^
a.cc:11:17: error: expected ')' before ';' token
   11 |   for(int =0;i<n;i++)
      |      ~          ^
      |                 )
a.cc:11:18: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |                  ^
a.cc:20:4: error: '\U00003000if' was not declared in this scope
   20 |    　if(a[j]<a[j+1])　　
      |    ^~~~
Language: C++

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

int main() {
 
 int n;
  cin>>n;
  
  int a[n+1];
  int a[n+1]=0;
  for(int =0;i<n;i++)
    cin>>a[i];
  
  int num=1;
  
  sort(a,a+n);
  
  for(int j=0;j<n;j++)
  {
   　if(a[i]<a[i+1])　　
      num++;
  }
  
  cout<<num<<endl;
  
}

Compiler output:
a.cc:20:4: error: extended character 　 is not valid in an identifier
   20 |    　if(a[i]<a[i+1])　　
      |    ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
   20 |    　if(a[i]<a[i+1])　　
      |                     ^
a.cc:20:21: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:10:7: error: redeclaration of 'int a [(n + 1)]'
   10 |   int a[n+1]=0;
      |       ^
a.cc:9:7: note: 'int a [(n + 1)]' previously declared here
    9 |   int a[n+1];
      |       ^
a.cc:11:11: error: expected unqualified-id before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:10: error: expected ';' before '=' token
   11 |   for(int =0;i<n;i++)
      |          ^~
      |          ;
a.cc:11:11: error: expected primary-expression before '=' token
   11 |   for(int =0;i<n;i++)
      |           ^
a.cc:11:14: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |              ^
a.cc:11:17: error: expected ')' before ';' token
   11 |   for(int =0;i<n;i++)
      |      ~          ^
      |                 )
a.cc:11:18: error: 'i' was not declared in this scope
   11 |   for(int =0;i<n;i++)
      |                  ^
a.cc:20:4: error: '\U00003000if' was not declared in this scope
   20 |    　if(a[i]<a[i+1])　　
      |    ^~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 's' was not declared in this scope
   14 |         if(s.at(i+1)-s.at(i)>0){
      |            ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: no matching function for call to 'end()'
   11 |   sort(vec.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:14:12: error: 's' was not declared in this scope
   14 |         if(s.at(i+1)-s.at(i)>0){
      |            ^