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

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

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

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

#include <stdio.h>
int desc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}

int main(void){
    int n,i,r=1,before;
    int arr[999]
    scanf("%d",&n);
    for(i=0;i<n;i++)scanf("%d",arr+i);
    printf(arr+i);
    qsort(arr,n,4,desc);
    before=arr[0];
    for(i=1;i<n;i++){
        if(before!=arr[i]){
            before=arr[i];
            r++;
        }
    }
    printf("%d\n",r);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'scanf'
    9 |     scanf("%d",&n);
      |     ^~~~~
main.c:10:32: error: 'arr' undeclared (first use in this function)
   10 |     for(i=0;i<n;i++)scanf("%d",arr+i);
      |                                ^~~
main.c:10:32: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   12 |     qsort(arr,n,4,desc);
      |     ^~~~~
Language: C++

#include<iostream>

using namespace std;

int main(){
  
  int n;cin>>n;
  int a[n];
  map<int,int> mp;
  
  for(int i=0;i<n;i++){
    cin>>a[i];
    mp[a[i]]=0;
  }
  int sum=0;
  
  for(pair<int,int> x:mp){
    sum++;
  }
 
  cout<<sum<<endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'map' was not declared in this scope
    9 |   map<int,int> mp;
      |   ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include<iostream>
  +++ |+#include <map>
    2 | 
a.cc:9:7: error: expected primary-expression before 'int'
    9 |   map<int,int> mp;
      |       ^~~
a.cc:13:5: error: 'mp' was not declared in this scope
   13 |     mp[a[i]]=0;
      |     ^~
a.cc:17:23: error: 'mp' was not declared in this scope
   17 |   for(pair<int,int> x:mp){
      |                       ^~
Language: C++

#include<iostream>
usinig namespace std;

 int main(){
   int N,a = 0;
   int sum = 0;
   int di[] = {};
   cin >> N;
   for(int i = 0;i < N;i++){
     cin >> di[i];
     if(a == di[i])sum += 1;
     a = di[i];
   }
   cout << sum << endl;
   return 0;
 }

Compiler output:
a.cc:2:1: error: 'usinig' does not name a type
    2 | usinig namespace std;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:8:4: 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:14:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 |    cout << sum << 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:14:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   14 |    cout << sum << 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,a = 0,sum = 0;
   vector<int> di(100,0);
   for(int i = 0;i < N;i++){
     cin >> di.at(i);
     if(a == di.at(i))sum += 1;
     a = di.at(i);
   }
   cout << sum << endl;
   return 0;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:4: error: 'vector' was not declared in this scope
    6 |    vector<int> di(100,0);
      |    ^~~~~~
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:6:11: error: expected primary-expression before 'int'
    6 |    vector<int> di(100,0);
      |           ^~~
a.cc:8:13: error: 'di' was not declared in this scope; did you mean 'i'?
    8 |      cin >> di.at(i);
      |             ^~
      |             i
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'j' was not declared in this scope
   16 |       if(i == j) {
      |               ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in);) {
            new Main().solve(sc);
        }
    }

    void solve(Scanner sc) {
        int n = sc.nextInt();
        int[] ds = new int[n];
        for (i = 0; i < n; i++) {
            ds[i] = sc.nextInt();
        }

        Arrays.sort(ds);
        int ans = 0;
        int tmp = 0;
        for (int d : ds) {
            if (d != tmp) {
                ans++;
                tmp = d;
            }
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
        for (i = 0; i < n; i++) {
             ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
        for (i = 0; i < n; i++) {
                    ^
  symbol:   variable i
  location: class Main
Main.java:14: error: cannot find symbol
        for (i = 0; i < n; i++) {
                           ^
  symbol:   variable i
  location: class Main
Main.java:15: error: cannot find symbol
            ds[i] = sc.nextInt();
               ^
  symbol:   variable i
  location: class Main
4 errors
Language: C++

#include<iostream>
#include<set>

using namespace std;

int main(){
    int N;
    cin>>N;
    set<int> mochi;

    for(int i=;i<N;++i){
        int tyn;
        cin>>tyn;
        mochi.insert(tyn);
    }

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



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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: expected ';' before '}' token
   18 |      d++
      |         ^
      |         ;
   19 |    }
      |    ~
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: expected initializer before '-' token
   11 |   int N -n;
      |         ^
a.cc:15:7: error: 'N' was not declared in this scope
   15 |       N--;
      |       ^
a.cc:18:11: error: 'N' was not declared in this scope
   18 |   cout << N <<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(), b.end());
  int mc=1, nm=d.at(0);
  for (int j=1; j<N; j++) {
    if (d.at(j) > nm) {
      mc++;
      nm = d.at(j);
    }
  }
  cout << mc << endl;
}
    

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

#include<iostream>
using namespace std;
#include<iostream>
using namespace std;
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX/2 + 2], R[MAX/2+2];
int cnt;

void merge(int A[], int n, int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  for( int i = 0; i < n1; i++ )L[i] = A[left + i];
  for( int i = 0; i < n2; i++ )R[i] = A[mid + i];
  L[n1] = R[n2] = SENTINEL;
  int i = 0, j = 0;
  for ( int k = left; k < right; k++ ){
    cnt++;
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }else{
      A[k] = R[j++];
    }
  }
}

void mergeSort(int A[], int n, int left, int right){
  if( left+1 < right){
    int mid = (left + right) / 2;
    mergeSort(A, n, left, mid);
    mergeSort(A, n, mid, right);
    merge(A, n, left, mid, right);
  }
}

int main(){
  int A[MAX], n, i;
  int m=0;
  cin >> n;
  for ( i = 0; i < n; i++) cin >> A[i];
  mergeSort(A, n, 0, n);
  for(int i=0;i<n;i++){
    cin>>A[i];
    if(A[i]<A[i+1))m++;
  }
  cout<<m<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: expected ']' before ')' token
   45 |     if(A[i]<A[i+1))m++;
      |                  ^
      |                  ]
a.cc:45:19: error: expected primary-expression before ')' token
   45 |     if(A[i]<A[i+1))m++;
      |                   ^
Language: C++

#include<iostream>
using namespace std;
#include<iostream>
using namespace std;
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX/2 + 2], R[MAX/2+2];
int cnt;

void merge(int A[], int n, int left, int mid, int right){
  int n1 = mid - left;
  int n2 = right - mid;
  for( int i = 0; i < n1; i++ )L[i] = A[left + i];
  for( int i = 0; i < n2; i++ )R[i] = A[mid + i];
  L[n1] = R[n2] = SENTINEL;
  int i = 0, j = 0;
  for ( int k = left; k < right; k++ ){
    cnt++;
    if(L[i] <= R[j]){
      A[k] = L[i++];
    }else{
      A[k] = R[j++];
    }
  }
}

void mergeSort(int A[], int n, int left, int right){
  if( left+1 < right){
    int mid = (left + right) / 2;
    mergeSort(A, n, left, mid);
    mergeSort(A, n, mid, right);
    merge(A, n, left, mid, right);
  }
}

int main(){
  int A[MAX], n, i;
  int m=0;
  cin >> n;
  for ( i = 0; i < n; i++) cin >> A[i];
  mergeSort(A, n, 0, n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(A[i]<a[i+1))m++;
  }
  cout<<m<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:10: error: 'a' was not declared in this scope
   44 |     cin>>a[i];
      |          ^
a.cc:45:18: error: expected ']' before ')' token
   45 |     if(A[i]<a[i+1))m++;
      |                  ^
      |                  ]
a.cc:45:19: error: expected primary-expression before ')' token
   45 |     if(A[i]<a[i+1))m++;
      |                   ^
Language: C++

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected ',' or ';' before 'int'
   14 |   int f=s.at(N);
      |   ^~~
a.cc:16:9: error: 'f' was not declared in this scope
   16 |     if (f > s.at(i)) {
      |         ^
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());
  
  int j = 0;
  int height = 0;
  while (j < N - 1) {
    if (mochi.at(j) < mochi.at(j + 1) {
      height ++;
    }
    j ++;
  }
  
  cout << height << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:38: error: expected ';' before '{' token
   17 |     if (mochi.at(j) < mochi.at(j + 1) {
      |                                      ^~
      |                                      ;
a.cc:20:9: error: expected ')' before ';' token
   20 |     j ++;
      |         ^
      |         )
a.cc:17:8: note: to match this '('
   17 |     if (mochi.at(j) < mochi.at(j + 1) {
      |        ^
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());
  
  int j = 0;
  int height = 0;
  while (j < N - 1) {
    if (mochi.at(j) < mochi(j + 1) {
      height ++;
    }
    j ++;
  }
  
  cout << height << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: no match for call to '(std::vector<int>) (int)'
   17 |     if (mochi.at(j) < mochi(j + 1) {
      |                       ~~~~~^~~~~~~
a.cc:20:9: error: expected ')' before ';' token
   20 |     j ++;
      |         ^
      |         )
a.cc:17:8: note: to match this '('
   17 |     if (mochi.at(j) < mochi(j + 1) {
      |        ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:30: error: expected ';' before ')' token
   10 |         for(int i=0< i<n; i++) num[d[i]]++;
      |                              ^
      |                              ;
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> a(105);
  for(int i=0;i<N;i++){
     int b;
     cin >> b ;
     a[b]++; 
  }  
  int res =0;
  for(int j=0;j<10５;j++){
    if (a.at(j)!=0)res++;
  }  
  cout << res<< endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: unable to find numeric literal operator 'operator""\U0000ff15'
   14 |   for(int j=0;j<10５;j++){
      |                 ^~~~
Language: Java

import java.util.*;
class Main
{
public static void main (String[] args)
{
Scanner sc =new Scanner(System.in);
int ans=0;
int n= sc.nextInt();
int[] a= new int[100];
Arrays.fill(a,0);
for(int i=0;i<n;i++)
a[sc.nextInt()-1]++;
for(int i=0;i<100;i++;)
if(a[i]>0)
ans++;
System.out.println(ans);
}
}

Compiler output:
Main.java:13: error: ')' expected
for(int i=0;i<100;i++;)
                     ^
Main.java:13: error: illegal start of expression
for(int i=0;i<100;i++;)
                      ^
2 errors
Language: C++

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

int main(void){
	ios::sync_with_stdio(false);
	int N,i,j,k;
	cin >> N;
	int d[N];
	for (i = 0; i < N; i++) cin >> d[i];
	sort(d, d + N, greater<int>());
	j = 0;
	k = 0;
	for (i = 0; i < N-1; i++) {
		if (d[i] != d[i + 1]) j++;
	}

	cout << j <<endl
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: expected ';' before 'return'
   20 |         cout << j <<endl
      |                         ^
      |                         ;
   21 |         return 0;
      |         ~~~~~~
Language: C++

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

int main(void){
	ios::sync_with_stdio(false);
	int N,i,j,k;
	cin >> N;
	int d[N];
	for (i = 0; i < N; i++) cin >> d[i] ;
	sort(d, d + N, greater<int>());
	j = 0;
	k = 0;
	for (i = 0; i < N-1; i++) {
		if(d[i]!=d[i+1]) j++
	}

	cout << j <<endl
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:37: error: expected ';' before '}' token
   17 |                 if(d[i]!=d[i+1]) j++
      |                                     ^
      |                                     ;
   18 |         }
      |         ~                            
a.cc:20:25: error: expected ';' before 'return'
   20 |         cout << j <<endl
      |                         ^
      |                         ;
   21 |         return 0;
      |         ~~~~~~
Language: C++

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

int N;
int d[110];

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

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

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

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

#include<iosyream>
#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;
	for (int i = 0; i < N; i++) {
		values.insert(d[i]);
	}
	cout << values.size() << endl;
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:23:12: error: 'j' was not declared in this scope
   23 |     if(num[j] < num[j-1]){
      |            ^
Language: C++

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

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

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

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

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

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
    cin.tie(0); ios::sync_with_stdio(false);

    int n, d, ans = 0;
    vector<int> flag(d + 1, false);

    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> d;
        if (!flag[d]) ++ans;
        flag[d] = true;
    }

    cout << sns << endl;

    return 0;
}


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

#include <iostream>
#include <set>

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

Compiler output:
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: 'set' was not declared in this scope
    7 |   set<int> st;
      |   ^~~
a.cc:7:3: note: suggested alternatives:
In file included from /usr/include/c++/14/set:63,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_set.h:96:11: note:   'std::set'
   96 |     class set
      |           ^~~
/usr/include/c++/14/set:87:13: note:   'std::pmr::set'
   87 |       using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>;
      |             ^~~
a.cc:7:7: error: expected primary-expression before 'int'
    7 |   set<int> st;
      |       ^~~
a.cc:11:5: error: 'st' was not declared in this scope; did you mean 'std'?
   11 |     st.insert(x);
      |     ^~
      |     std
a.cc:13:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |   cout << st.size() << 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:13:11: error: 'st' was not declared in this scope; did you mean 'std'?
   13 |   cout << st.size() << endl;
      |           ^~
      |           std
a.cc:13:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 |   cout << st.size() << 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++

int main() {
	vector<int> mochi(100);
	int n,count=0;
	cin >> n;
	for (int i = 0; i < n ; i++) {
		cin >> mochi.at(i);
	}

	sort(mochi.begin(), mochi .end());
	reverse(mochi.begin(), mochi.end());
	for (int i = 0; i < n; i++) {
		if (mochi.at(i) > mochi.at(i + 1)) {
			count++;
		}
	}
	cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'vector' was not declared in this scope
    2 |         vector<int> mochi(100);
      |         ^~~~~~
a.cc:2:16: error: expected primary-expression before 'int'
    2 |         vector<int> mochi(100);
      |                ^~~
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> n;
      |         ^~~
a.cc:6:24: error: 'mochi' was not declared in this scope
    6 |                 cin >> mochi.at(i);
      |                        ^~~~~
a.cc:9:14: error: 'mochi' was not declared in this scope
    9 |         sort(mochi.begin(), mochi .end());
      |              ^~~~~
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |         sort(mochi.begin(), mochi .end());
      |         ^~~~
      |         short
a.cc:10:9: error: 'reverse' was not declared in this scope
   10 |         reverse(mochi.begin(), mochi.end());
      |         ^~~~~~~
a.cc:16:9: error: 'cout' was not declared in this scope; did you mean 'count'?
   16 |         cout << count;
      |         ^~~~
      |         count
Language: C++

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

int mani() {
    int n;
    cin >> n;
    vector< int> v(n);
    for(int &e: v) cin >> e;
    sort(v.begin(), v.end());
    int k = unique(v.begin(), v.end()) - v.begin();
    cout << k << endl;
}

Compiler output:
a.cc: In function 'int mani()':
a.cc:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main() {
  int N, d[110];
  cin >> N;
  for (int i=0; i<N; i++) cin >> d[i];
  
  int count=0;
  bool t=true;
  for (int i=0; i<N-1; i++){
  	for (int j=i+1; j<N){
    	if (d[i]==d[j]) t=false;
    }
    if (t){
      t=true;	
      continue;
    }
    else cout++;
  }
  
  cut << count+1 <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: expected ';' before ')' token
   12 |         for (int j=i+1; j<N){
      |                            ^
      |                            ;
a.cc:19:14: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   19 |     else cout++;
      |          ~~~~^~
a.cc:22:3: error: 'cut' was not declared in this scope
   22 |   cut << count+1 <<endl;
      |   ^~~
Language: C++

#include <iostream>

using namespace std;

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

    std::sort(d, d + N, greater<int>());
    int ans = 1;
    int d_now = d[0];

    for (i = 1; i < N; i++) {
        if (d[i] < d_now) {
            ans++;
            d_now = d[i];
        }
    }

    cout << ans << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   12 |     std::sort(d, d + N, greater<int>());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>

using namespace std;

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

    sort(d, d + N, greater<int>());
    int ans = 1;
    int d_now = d[0];

    for (i = 1; i < N; i++) {
        if (d[i] < d_now) {
            ans++;
            d_now = d[i];
        }
    }

    cout << ans << endl;
    return 0;

}

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

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

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


#include<iostream>
#include<string>
#include<algorithm>
#include<functional>

#include<vector>

using namespace std;


int main()
{
	int N;
	int d[100];

	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 = 0; i < =100; i++) {

		if (num[i] > 0) {
			++ans;
		}
	}


	cout << ans << endl;

    return 0;
}



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

#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	int flag[101];
	cin>>n;
	for (int i = 0; i < n; ++i)
	{
		int d;
		cin>>d;
		flag[d]=1;
	}
	for (int i = 0; i < n; ++i)
	{
		int ans =0;
		ans+=flag[i];
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:19:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include<iostream>
#include<float.h>
#include<cfloat>
#include<string>
#include<ctype.h>
#include<algorithm>
#include<errno.h>
#include<cerrno>
#include<assert.h>
#include<cassert> 
#include<map>
#include<memory.h>
#include<cctype>
#include<ctype.h>
#include<math.h>
#include<vector> 
#include<cstdio> 
#include<set>
#include<string.h>
#include<stdio.h>
#include<new>
#include<memory>
#include<cmath>
#include<queue>
#include<cstring>
#define ll long long
#define fo(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define br break
#define ct continue
#define pb push_back
#define pi 3.141592653589793238462643383279502884197169
#define F first
#define S second
#define em empty()
#define vei vector<int>
#define ves vector<string>
#define qui queue<int> 
#define qu queue
using namespace std;
int a[150];
int main()
{int n;
 cin>>n;
 fo(i,0,n)
 cin>>a[i];
 sort(a,a+n);
 fo(i,0,n)
 ans
 if(a[i]==a[i-1])
 ans++;
 cout<<ans; 
 system("pause");
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:2: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |  ans
      |  ^~~
      |  abs
a.cc:51:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   51 |  cout<<ans;
      |        ^~~
      |        abs
Language: C++

#include<iostream>
#include<float.h>
#include<cfloat>
#include<string>
#include<ctype.h>
#include<algorithm>
#include<errno.h>
#include<cerrno>
#include<assert.h>
#include<cassert> 
#include<map>
#include<memory.h>
#include<cctype>
#include<ctype.h>
#include<math.h>
#include<vector> 
#include<cstdio> 
#include<set>
#include<string.h>
#include<stdio.h>
#include<new>
#include<memory>
#include<cmath>
#include<queue>
#include<cstring>
#define ll long long
#define fo(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define br break
#define ct continue
#define pb push_back
#define pi 3.141592653589793238462643383279502884197169
#define F first
#define S second
#define em empty()
#define vei vector<int>
#define ves vector<string>
#define qui queue<int> 
#define qu queue
using namespace std;
int a[150];
int main()
{int n;
 cin>>n;
 fo(i,0,n)
 cin>>a[i];
 sort(a,a+n);
 fo(i,0,n)
 if(a[i]==a[i-1])
 ans++;
 cout<<ans; 
 system("pause");
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:2: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |  ans++;
      |  ^~~
      |  abs
a.cc:50:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |  cout<<ans;
      |        ^~~
      |        abs
Language: C++

#include<iostream>
#include<float.h>
#include<cfloat>
#include<string>
#include<ctype.h>
#include<algorithm>
#include<errno.h>
#include<cerrno>
#include<assert.h>
#include<cassert> 
#include<map>
#include<memory.h>
#include<cctype>
#include<ctype.h>
#include<math.h>
#include<vector> 
#include<cstdio> 
#include<set>
#include<string.h>
#include<stdio.h>
#include<new>
#include<memory>
#include<cmath>
#include<queue>
#include<cstring>
#define ll long long
#define fo(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define br break
#define ct continue
#define pb push_back
#define pi 3.141592653589793238462643383279502884197169
#define F first
#define S second
#define em empty()
#define vei vector<int>
#define ves vector<string>
#define qui queue<int> 
#define qu queue
using namespace std;
int a[150];
int main()
{int n;
 cin>>n;
 fo(i,0,n)
 cin>>a[i];
 sort(a,a+n);
 fo(i,0,n)
 if(a[i+1]==a[i])
 ans++;
 cout<<ans; 
 system("pause");
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:2: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |  ans++;
      |  ^~~
      |  abs
a.cc:50:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |  cout<<ans;
      |        ^~~
      |        abs
Language: Java

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ

		//input
		//	N枚のモチ(i番目のモチはdiセンチメートル)
		//	◆条件
		//		1<= N <= 100
		//		1<= di <= 100
		//


		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		if(N<1 || N>100) {
			System.out.println("N is illegal");
			System.exit(1);
		}

		int d[] = new int[N];


		for(int i =0 ;i<N;i++) {
			int d_i = scan.nextInt();
			if(d_i < 1 || d_i > 100 ) {
				System.out.println("d[i] is illegal");
				System.exit(1);
			}
			d[i] = d_i;

		}

		//logic(組み合わせ問題)
		//①重複なしで、モチの直径をソートして、現時点で積み上げたモチの直径より小さいモチがあれば積み上げる
		//②

		int num_stage = 0;


		Arrays.sort(d);//昇順にソート
		int diameter = d[N-1];//直径が一番大きいモチの積み上げ
		num_stage = num_stage + 1;

		for(int i = 2;i < N +1 ;i++) {

			if(d[N-i] < diameter) {//一段積み上げ
				diameter = d[N-i];
				num_stage = num_stage + 1;

			}

		}


		//output
		//	最大で何段重ねのモチを作れるか
		System.out.println(num_stage);
	}

}


Compiler output:
Main.java:14: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:42: error: cannot find symbol
		Arrays.sort(d);//??????
		^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

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

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

    cin >> n;

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

    sort(d.begin(), d.end());
    for(int i=1,max=1,rmax=1; i<n; i++){
        if(d[i]>d[i-1]){
            max++;
        }else{
            if(max>rmax){
                rmax = max;
            }
            max=1;
        }
    }

    cout << rmax << 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
a.cc:27:13: error: 'rmax' was not declared in this scope
   27 |     cout << rmax << endl;
      |             ^~~~
Language: C++

#include <iostream>
using namespace std;

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

    cin >> n;

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

    sort(d.begin(), d.end());
    for(int i=1,max=1,rmax=1; i<n; i++){
        if(d[i]>d[i-1]){
            max++;
        }else{
            if(max>rmax){
                rmax = max;
            }
            max=1;
        }
    }

    cout << rmax << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<int> d;
      |     ^~~~~~
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:6:12: error: expected primary-expression before 'int'
    6 |     vector<int> d;
      |            ^~~
a.cc:11:16: error: 'd' was not declared in this scope
   11 |         cin >> d[i];
      |                ^
a.cc:14:10: error: 'd' was not declared in this scope
   14 |     sort(d.begin(), d.end());
      |          ^
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort(d.begin(), d.end());
      |     ^~~~
      |     short
a.cc:26:13: error: 'rmax' was not declared in this scope
   26 |     cout << rmax << endl;
      |             ^~~~
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  ll n;
  cin >> n;
  set<ll> st;
  REP(i,n){
    ll d;
    cin >> d;
    st.insert(d);
  }
  cout << st.size() << ebdl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:3: error: 'set' was not declared in this scope
   18 |   set<ll> st;
      |   ^~~
a.cc:7:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    6 | #include <queue>
  +++ |+#include <set>
    7 | #include <string>
a.cc:18:9: error: expected primary-expression before '>' token
   18 |   set<ll> st;
      |         ^
a.cc:18:11: error: 'st' was not declared in this scope; did you mean 'str'?
   18 |   set<ll> st;
      |           ^~
      |           str
a.cc:24:24: error: 'ebdl' was not declared in this scope
   24 |   cout << st.size() << ebdl;
      |                        ^~~~
Language: C++

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

int main() {
  int N;
  vector<int>Mochi(N);
  for(int i = 0; i < N; i++){
    cin >> Mochi.aat(i); //配列に代入
  }

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

  int number = 0; //鏡餅の段数の変数を定義
  for(int i = 0; i < N; i++){
    if(Mochi.at(i + 1) == max(Mochi(i), Mochi(i + 1))){
      number += 1;
    }
    else{
      continue;
    }
  }
  cout << number << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'class std::vector<int>' has no member named 'aat'; did you mean 'at'?
    8 |     cin >> Mochi.aat(i); //配列に代入
      |                  ^~~
      |                  at
a.cc:15:36: error: no match for call to '(std::vector<int>) (int&)'
   15 |     if(Mochi.at(i + 1) == max(Mochi(i), Mochi(i + 1))){
      |                               ~~~~~^~~
a.cc:15:46: error: no match for call to '(std::vector<int>) (int)'
   15 |     if(Mochi.at(i + 1) == max(Mochi(i), Mochi(i + 1))){
      |                                         ~~~~~^~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:26: error: expected ';' before '}' token
   15 |     if(num[i] > 0){ res++ };
      |                          ^~
      |                          ;
Language: C++


#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <list>
#include <sys/timeb.h>
#include <fstream>
#include <set>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	vi d(n);
	rep(i,n) cin>> d[i];
	sort(all(d));
	int ans = 1;
	int t = d[0]
	rep(i,n-1) {
		if(d[i] != d[i+1]) {
			t = d[i];
			ans++;
		}
	}
	cout << ans<<endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: expected ',' or ';' before 'for'
   20 | #define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
      |                     ^~~
a.cc:21:18: note: in expansion of macro 'repr'
   21 | #define rep(i,n) repr(i,0,n)
      |                  ^~~~
a.cc:92:9: note: in expansion of macro 'rep'
   92 |         rep(i,n-1) {
      |         ^~~
a.cc:92:13: error: 'i' was not declared in this scope
   92 |         rep(i,n-1) {
      |             ^
a.cc:20:40: note: in definition of macro 'repr'
   20 | #define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
      |                                        ^
a.cc:92:9: note: in expansion of macro 'rep'
   92 |         rep(i,n-1) {
      |         ^~~
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner();

		int n = scanner.nextInt();
		int[] diameters = new int[n];

		for (int i = 0; i < n; i++) {
			diameters[i] = scanner.nextInt();
		}

		diameters = Arrays.stream(diameters).distinct().toArray();

		System.out.println(diameters.length);

		scanner.close();
	}
}

Compiler output:
Main.java:6: error: no suitable constructor found for Scanner(no arguments)
		Scanner scanner = new Scanner();
		                  ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: C++

#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<iomanip>
using namespace std;
typedef long long lng;
typedef unsigned long long ulng;

#define pb push_back
#define SZ(a) int((a).size())
#define ALL(a) (a).begin(), (a).end()
#define FOR(i,a,b) for(int i=(a); i<=(b); ++i)
#define FORD(i,b,a) for(int i=(b); i>=(a); --i)
#define REP(i,n) FOR(i,0,n-1)
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) // <a> must be sorted in advance

lng power(lng b, lng e) {lng sol=1; while(e>0) {if(e&1) {sol=sol*b;} e>>=1; b*= b;} return sol;}

int N;
int d[100];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    REP(i, N) cin >> d[i];

    sort(d, d+N);
    UNIQUE(d);
    cout << SZ(d) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: request for member 'erase' in 'd', which is of non-class type 'int [100]'
   20 | #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) // <a> must be sorted in advance
      |                     ^~~~~
a.cc:34:5: note: in expansion of macro 'UNIQUE'
   34 |     UNIQUE(d);
      |     ^~~~~~
a.cc:16:20: error: request for member 'begin' in 'd', which is of non-class type 'int [100]'
   16 | #define ALL(a) (a).begin(), (a).end()
      |                    ^~~~~
a.cc:20:34: note: in expansion of macro 'ALL'
   20 | #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) // <a> must be sorted in advance
      |                                  ^~~
a.cc:34:5: note: in expansion of macro 'UNIQUE'
   34 |     UNIQUE(d);
      |     ^~~~~~
a.cc:16:33: error: request for member 'end' in 'd', which is of non-class type 'int [100]'
   16 | #define ALL(a) (a).begin(), (a).end()
      |                                 ^~~
a.cc:20:34: note: in expansion of macro 'ALL'
   20 | #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) // <a> must be sorted in advance
      |                                  ^~~
a.cc:34:5: note: in expansion of macro 'UNIQUE'
   34 |     UNIQUE(d);
      |     ^~~~~~
a.cc:20:45: error: request for member 'end' in 'd', which is of non-class type 'int [100]'
   20 | #define UNIQUE(a) a.erase(unique(ALL(a)), a.end()) // <a> must be sorted in advance
      |                                             ^~~
a.cc:34:5: note: in expansion of macro 'UNIQUE'
   34 |     UNIQUE(d);
      |     ^~~~~~
a.cc:15:23: error: request for member 'size' in 'd', which is of non-class type 'int [100]'
   15 | #define SZ(a) int((a).size())
      |                       ^~~~
a.cc:35:13: note: in expansion of macro 'SZ'
   35 |     cout << SZ(d) << endl;
      |             ^~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
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());
    int count =1;
    for(int i =0; i<N; i++){
       if(d[i] != d[i-1]){
           count++;
       }
   }
   cout << count << endl;
}

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

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
   int N,x=0;
   cin >> N;
   vector<int> d(N);

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: 'd' was not declared in this scope
    9 |        cin >> d[i];
      |               ^
a.cc:11:11: error: 'd' was not declared in this scope
   11 |      sort(d,d+N,greater<int>());
      |           ^
Language: C++

#include<iostream>
#include<algorithm>
int main(){
  int n,d[100],i=0,a=1;
  std::cin>>n;
  for(;i<n;i++)
    std::cin>>d[i];
  sort(d,d+n);
  for(i=n-2;i>=0;i--)
    if(d[i]!=d[i+1])a++;
  std::cout<<a;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    8 |   sort(d,d+n);
      |   ^~~~
      |   std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~