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

#include<iostream>
int main(){
  int n,d[100],i=0,a=1;
  std::cin >> n;
  for(;i<n;i++)
    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:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     cin >> d[i];
      |     ^~~
      |     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: 'sort' was not declared in this scope; did you mean 'short'?
    7 |   sort(d,d+n);
      |   ^~~~
      |   short
Language: C++

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

int main()
{
  int n ,c=0;
  cin >> n ;
  int b[101]= {};
  for(int i=0;i<n;i++)
    {
      cin >> c;
      b[c]++;
    }
  sort(b ,b+101,greater<int>());

  for(int i=0;b[i]>0;i++)
    {
      cnt++;
    }
  cout << cnt  << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   18 |       cnt++;
      |       ^~~
      |       int
a.cc:20:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |   cout << cnt  << endl;
      |           ^~~
      |           int
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]]++;
  }
  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:3: error: expected ',' or ';' before 'for'
   11 |   for (int i = 0; i<N; ++i){
      |   ^~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   for (int i = 0; i<N; ++i){
      |                   ^
a.cc:15:5: error: expected ',' or ';' before 'for'
   15 |     for (int i = 1; i <= 100; ++i){
      |     ^~~
Language: Java

import java.util.*;

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

    int N = sc.nextInt();
    int[] sumArray = new int[101];
    int d;
    int count = 0;

    for (int i=0; i < N; i++) {
      d = sc.nextInt();
      sumArray[d] += 1;
    }

    for (int i=0; i < 101; i++) {
      if (sumArray[i] != 0) {
        count += 1;
      }
    }

    System.out.println(count);
  }
}


Compiler output:
Main.java:3: error: class KagamiMochi is public, should be declared in a file named KagamiMochi.java
public class KagamiMochi {
       ^
1 error
Language: Java

import java.util.*;

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

    int N = sc.nextInt();
    int[] sumArray = new int[100];
    int d;
    int count;

    for (int i=0; i < N; i++) {
      d = sc.nextInt();
      sumArray[d] += 1;
    }

    for (int i=0; i < 100; i++) {
      if (sumArray[i] != 0) {
        count += 1;
      }
    }

    System.out.println(count);
  }
}


Compiler output:
Main.java:19: error: variable count might not have been initialized
        count += 1;
        ^
Main.java:23: error: variable count might not have been initialized
    System.out.println(count);
                       ^
2 errors
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N, d[120];
  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++){
    if(num[i]){
      res++;
    }
  }
}

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

#include <iostream>
using namespace std;

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

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

#include<iostream>
using namespace std;

int main() {
	int n;
	int d[101];

	scanf_s("%d", &n);
	for (int i = 0; i<n; i++)scanf_s("%d", d[i]);

	int num[101] = { 0 };
	for (int i = 0; i<n; i++) {
		num[d[i]]++;
	}
	int count = 0;
	for (int i = 0; i<100; i++) {
		if (num[i]>0)count++;
	}
	printf_s("%d", count);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
a.cc:19:9: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
   19 |         printf_s("%d", count);
      |         ^~~~~~~~
      |         printf
Language: C

#include<cstdio>
using namespace std;

int main() {
	int n;
	int d[101];

	scanf_s("%d", &n);
	for (int i = 0; i<n; i++)scanf_s("%d", d[i]);

	int num[101] = { 0 };
	for (int i = 0; i<n; i++) {
		num[d[i]]++;
	}
	int count = 0;
	for (int i = 0; i<100; i++) {
		if (num[i]>0)count++;
	}
	printf_s("%d", count);

	return 0;
}


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

#include<iostream>
using namespace std;

int main() {
	int n;
	int d[101];

	scanf_s("%d", &n);
	for (int i = 0; i<n; i++)scanf_s("%d", d[i]);

	int num[101] = { 0 };
	for (int i = 0; i<n; i++) {
		num[d[i]]++;
	}
	int count = 0;
	for (int i = 0; i<100; i++) {
		if (num[i]>0)count++;
	}
	printf_s("%d", count);

	return 0;
}

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

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;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << res << endl;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:20: error: 'endl' was not declared in this scope
   20 |     cout << res << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <iostream>
using namespace std;

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

  sort(d, d + n);
  int cnt = 1;
  for (int i = 1; i < n; i++) {
    if (d[i - 1] != d[i]) cnt++;
  }
  cout << cnt << endl;
}

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

# include <iostream>
# include <string>
# include <algorithm>
# include <vector>
# include <cstring>
# include <stdio.h>
# include <map>
# include <queue>

# define ll long long
# define pii pair<int,int>
# define FOR(a,b) for(int a=1; a<=b; a++)
# define REP(a,b) for(int a=0; a<b; a++)
# define FORU(a,b,c) for(int a=b; a<=c; a++)
# define FORD(a,b,c) for(int a=b; a>=c; a--)

using namespace std;

int main(){

    ios :: sync_with_stdio(false);
    int N;
    cin >> N;
    set<int> s;
    FOR(i,N){
        int x;
        cin >> x;
        s.insert(x);
    }

    cout << (int)s.size() << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'set' was not declared in this scope
   24 |     set<int> s;
      |     ^~~
a.cc:9:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    8 | # include <queue>
  +++ |+#include <set>
    9 | 
a.cc:24:9: error: expected primary-expression before 'int'
   24 |     set<int> s;
      |         ^~~
a.cc:28:9: error: 's' was not declared in this scope
   28 |         s.insert(x);
      |         ^
a.cc:31:18: error: 's' was not declared in this scope
   31 |     cout << (int)s.size() << endl;
      |                  ^
Language: C++

给定n个数
求去重后有多少个数.
如 1 2 2 3 答案是 3
水题
n<=100 每个数在一百之内

Compiler output:
a.cc:1:1: error: '\U00007ed9\U00005b9an\U00004e2a\U00006570' does not name a type
    1 | 给定n个数
      | ^~~~~~~~~
Language: C++

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

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

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

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

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

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

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'of' was not declared in this scope
   15 |                 of(num[i])res++;
      |                 ^~
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'of' was not declared in this scope
   15 |                 of(num[i])res++;
      |                 ^~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<cmath>
#include<queue>
#include<limits>
#include<cassert>
#include<set>
#include<tuple>
#include<map>
using namespace std;

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

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,d[100]={},syamu;
  
  for(int i=0;i<n;i++){
    int x;
    cin>>x;
    d[x-1]=1;
  }
  for(int i=0;i<100;i++){
    syamu+=d[i]
  }
  
  cout<<syamu<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected ';' before '}' token
   12 |     syamu+=d[i]
      |                ^
      |                ;
   13 |   }
      |   ~
Language: C++

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

a.sort()
z = 1
for j in range(n-1):
    if a[j] < a[j+1]:
        z += 1
    elif a[j] == a[j+1]:
        z += 0

print(z)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C

#include<stdio.h>

int main(){
	int N, i, a, count=0;
	scanf("%d", &N);
	int d[N];
	for(i=0; i<N; i++){
		scanf("%d", d[i]);
	}
	
	for(j=0; j<N; j++){
		for(i=0; i<N; i++){
			if(d[i]>d[i+1]){
				a = d[i];
				d[i] = d[i+1];
				d[i+1] = a;
			}
		}
	}
	
	for(i=0; i<N; i++){
		if(d[i]<d[i+1])	count++;
	}
	
	printf("%d\n", count);
	
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:13: error: 'j' undeclared (first use in this function)
   11 |         for(j=0; j<N; j++){
      |             ^
main.c:11:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
using namespace std;

//#define int ll

typedef int64_t ll;
//static const int MOD = 1000000007;
//static const int INF = 2147483647;
//static const long long INF = 9223372000000000000;
//static const long long INF = 9223372000000000000/2;
//static const int INF = 1000010000;
//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define FI first
#define SE second
#define NP next_permutation
#define PQ priority_queue
#define UB upper_bound
#define LB lower_bound
#define SZ(a) signed((a).size())
#define LEN(a) signed((a).length())
#define SORT(c) sort((c).begin(),(c).end())
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REP1(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREP1(i,x) for(int i=((int)(x));i>0;i--)
#define ALL(x) (x).begin(),(x).end()
#define YESNO(x) puts((x)?"YES":"NO")
#define YesNo(x) puts((x)?"Yes":"No")

int main(){
    set<int> S;
    int N;
    cin >> N;
    REP(i,N){
        int tmp;
        scanf("%d",&tmp);
        S.insert(tmp);
    }
    printf("%d\n",int(S.size));
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:25: error: invalid use of 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]' (did you forget the '()' ?)
   48 |     printf("%d\n",int(S.size));
      |                       ~~^~~~
      |                             ()
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]]　= 1;
  }
  
  int ans = 0;
  for(int i = 1; i <= 100; i++){
    ans = ans + num[i];
  }
  cout << ans << endl;
}
    
    
  


Compiler output:
a.cc:13:14: error: extended character 　 is not valid in an identifier
   13 |     num[d[i]]　= 1;
      |              ^
a.cc: In function 'int main()':
a.cc:13:14: error: expected ';' before '\U00003000'
   13 |     num[d[i]]　= 1;
      |              ^~
      |              ;
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]]　= 1;
  }
  
  int ans = 0;
  for(int i = 1; i <= 100; i++){
    ans = ans + num[i];
  }
  cout << ans << endl;
}
    
    
  

Compiler output:
a.cc:13:14: error: extended character 　 is not valid in an identifier
   13 |     num[d[i]]　= 1;
      |              ^
a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before ';' token
    7 |   for(int i = 0; i < N;; i++){
      |                        ^
a.cc:7:24: error: expected ')' before ';' token
    7 |   for(int i = 0; i < N;; i++){
      |      ~                 ^
      |                        )
a.cc:7:26: error: 'i' was not declared in this scope
    7 |   for(int i = 0; i < N;; i++){
      |                          ^
a.cc:12:24: error: expected primary-expression before ';' token
   12 |   for(int i = 0; i < N;; i++){
      |                        ^
a.cc:12:24: error: expected ')' before ';' token
   12 |   for(int i = 0; i < N;; i++){
      |      ~                 ^
      |                        )
Language: C++

#include<iostream>
#include<math.h>
#include<string>
#include<algorithm>
using namespace std;
 
#define rep0(n) for(int i=0;i<n;i++)
#define rep(n) for(int i=1;i<=n;i++)
 
double const pi = 3.1415926535;
int const mod = 1000000007;
int const inf = 2147483647;
 
int yesno(bool flag, string yes, string no) {
	if (flag)cout << yes << endl;
	else cout << no << endl;
	return 0;
}
 
int printint(int n) {
	cout << n << endl;
	return 0;
}
 
int prints(string s) {
	cout << s << endl;
	return 0;
}
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:33:31: error: extended character 　 is not valid in an identifier
   33 |   for int (i = 0; i < N; i++);　cin >> d[i]
      |                               ^
a.cc: In function 'int main()':
a.cc:33:7: error: expected '(' before 'int'
   33 |   for int (i = 0; i < N; i++);　cin >> d[i]
      |       ^~~
      |       (
a.cc:33:12: error: 'i' was not declared in this scope
   33 |   for int (i = 0; i < N; i++);　cin >> d[i]
      |            ^
a.cc:33:31: error: '\U00003000cin' was not declared in this scope
   33 |   for int (i = 0; i < N; i++);　cin >> d[i]
      |                               ^~~~~
a.cc:33:42: error: 'i' was not declared in this scope
   33 |   for int (i = 0; i < N; i++);　cin >> d[i]
      |                                          ^
a.cc:37:5: error: 'values' was not declared in this scope
   37 |     values.insert(d[i]);
      |     ^~~~~~
a.cc:39:11: error: 'values' was not declared in this scope
   39 |   cout << values.size() <<endl;
      |           ^~~~~~
Language: Java

import java.util.*;
public class Hagamimochi {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int mochi[] = new int[x];
		for(int i = 0;i < N;i++){
			mochi[i] = sc.nextInt();
		}
		Arrays.sort(mochi);
		int count = 1;
		for(int k = 0;k < x;k++){
			if(mochi[k] > mochi[k-1])count++;
		}
		System.out.println(count);
	}
}

Compiler output:
Main.java:2: error: class Hagamimochi is public, should be declared in a file named Hagamimochi.java
public class Hagamimochi {
       ^
Main.java:7: error: cannot find symbol
		int mochi[] = new int[x];
		                      ^
  symbol:   variable x
  location: class Hagamimochi
Main.java:13: error: cannot find symbol
		for(int k = 0;k < x;k++){
		                  ^
  symbol:   variable x
  location: class Hagamimochi
3 errors
Language: Java

import java.util.*;
public class Hagamimochi {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int mochi[] = new int[x];
		for(int i = 0;i < x;i++){
			mochi[i] = sc.nextInt();
		}
		Arrays.sort(mochi);
		int count = 1;
		for(int k = 0;k < x;k++){
			if(mochi[k] > mochi[k+1])count++;
		}
		System.out.println(count);
	}
}

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

#include <stdio.h>
#include <stdlib.h>
 
int d[100];
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
 
int main(){
    int N;
    scanf("%d", &N);
    
    for(int i = 0; i < N; i++){
        scanf("%d", d+i);
    }
    
    qsort(d,N,sizeof(int),compare_int);
    
    int cnt = 0;
    for(int i = 1; i < N ; i++){
        if(d[i] > d[i-1]) cnt++;
    }
    
    printf("%d\n",cnt+1);
}
#include <stdio.h>
#include <stdlib.h>

int d[100];
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
    int N;
    scanf("%d", &N);
    
    for(int i = 0; i < N; i++){
        scanf("%d", d+i);
    }
    
    qsort(d,N,sizeof(int),compare_int);
    
    int cnt = 0;
    for(int i = 1; i < N ; i++){
        if(d[i] > d[i-1]) cnt++;
    }
    
    printf("%d\n",cnt+1);
}


Compiler output:
a.cc:30:5: error: redefinition of 'int d [100]'
   30 | int d[100];
      |     ^
a.cc:4:5: note: 'int d [100]' previously declared here
    4 | int d[100];
      |     ^
a.cc:31:5: error: redefinition of 'int compare_int(const void*, const void*)'
   31 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:5:5: note: 'int compare_int(const void*, const void*)' previously defined here
    5 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main(){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main(){
      |     ^~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
 
int d[100];
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
 
int main(){
    int N;
    scanf("%d", &N);
    
    for(int i = 0; i < N; i++){
        scanf("%d", d+i);
    }
    
    qsort(d,N,sizeof(int),compare_int);
    
    int cnt = 0;
    for(int i = 1; i < N ; i++){
        if(d[i] > d[i-1]) cnt++;
    }
    
    printf("%d\n",cnt+1);
}
#include <stdio.h>
#include <stdlib.h>

int d[100];
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
    int N;
    scanf("%d", &N);
    
    for(int i = 0; i < N; i++){
        scanf("%d", d+i);
    }
    
    qsort(d,N,sizeof(int),compare_int);
    
    int cnt = 0;
    for(int i = 1; i < N ; i++){
        if(d[i] > d[i-1]) cnt++;
    }
    
    printf("%d\n",cnt+1);
}
Submission

Compiler output:
a.cc:30:5: error: redefinition of 'int d [100]'
   30 | int d[100];
      |     ^
a.cc:4:5: note: 'int d [100]' previously declared here
    4 | int d[100];
      |     ^
a.cc:31:5: error: redefinition of 'int compare_int(const void*, const void*)'
   31 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:5:5: note: 'int compare_int(const void*, const void*)' previously defined here
    5 | int compare_int(const void *a, const void *b)
      |     ^~~~~~~~~~~
a.cc:36:5: error: redefinition of 'int main()'
   36 | int main(){
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main(){
      |     ^~~~
a.cc:53:1: error: 'Submission' does not name a type
   53 | Submission
      | ^~~~~~~~~~
Language: Java


import java.util.*;
public class Main8 {
	public static void main(String[] arg) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i=0; i<n; i++) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int cnt=1;
		for(int i=0; i<n;i++) {
			if(a[i]<a[i+1]) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
	}

}


Compiler output:
Main.java:3: error: class Main8 is public, should be declared in a file named Main8.java
public class Main8 {
       ^
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int[] d = new int[N];
  int counter = 0;
  for(int i=0;i<N;i++){
    d[i] = sc.nextInt();
  }
  for(int i = 0;i<N;i++){
    boolean b = true;
    for(int j = 0;j<=i;j++){
      if(d[i] = d[j])b = false;
    }
    if(b)counter += 1;
  }
  System.out.println(counter);
}}


Compiler output:
Main.java:14: error: incompatible types: int cannot be converted to boolean
      if(d[i] = d[j])b = false;
              ^
1 error
Language: Java

import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  List<String> l = new ArrayList<>();
  for(int i=0;i<N;i++){
    l.add(sc.next());
  }
  List<String> m = l.stream().distinct().collect(Collectors.tolist());
  System.out.println(m.size());
}}


Compiler output:
Main.java:10: error: cannot find symbol
  List<String> m = l.stream().distinct().collect(Collectors.tolist());
                                                 ^
  symbol:   variable Collectors
  location: class Main
1 error
Language: C++

    scanf("%d",&n);
    vector<int>d(n);
    rep(i,0,n) cin >> d[i];

    set<int>value;
    rep(i,0,n) value.insert(d[i]);
    rep(i,1,101){
        if(num[i] != 0){
            ans++;
        }
    }
    cout << value.size() << endl;
    return 0;
}

Compiler output:
a.cc:1:10: error: expected constructor, destructor, or type conversion before '(' token
    1 |     scanf("%d",&n);
      |          ^
a.cc:2:5: error: 'vector' does not name a type
    2 |     vector<int>d(n);
      |     ^~~~~~
a.cc:3:8: error: expected constructor, destructor, or type conversion before '(' token
    3 |     rep(i,0,n) cin >> d[i];
      |        ^
a.cc:5:5: error: 'set' does not name a type
    5 |     set<int>value;
      |     ^~~
a.cc:6:8: error: expected constructor, destructor, or type conversion before '(' token
    6 |     rep(i,0,n) value.insert(d[i]);
      |        ^
a.cc:7:8: error: expected constructor, destructor, or type conversion before '(' token
    7 |     rep(i,1,101){
      |        ^
a.cc:12:5: error: 'cout' does not name a type
   12 |     cout << value.size() << endl;
      |     ^~~~
a.cc:13:5: error: expected unqualified-id before 'return'
   13 |     return 0;
      |     ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int b[100]={0};
  for(int i=0;i<n;i++){
    b[(a[i]-1)]++;
  }
  int cnt=0;
  for(int i=0;i<100;i++){
    if(b[i])cnt++;
  }
  cout<<cnt<<endl;
  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: expected '}' at end of input
   19 |   return 0;
      |            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int b[100]={0};
  for(int i=0;i<n;i++){
    b[a[i]-1]++;
  }
  int cnt=0;
  for(int i=0;i<n;i++){
    if(b[i])cnt++;
  }
  cout<<cnt<<endl;
  return 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: expected '}' at end of input
   19 |   return 0;
      |            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

    #include<iostream>
    using namespace std;
    int main(){
      int N;
      cin>>N;
      int a[N];
      for(int i=0;i<N;i++){
        cin>>a[i];}
      int b[100]={0}
      for(int j=0;j<N;j++){
        b[a[j]-1]++;
      }
      int cnt=0;
      for(int k=0;k<100;k++){
        if(b[k])cnt++;}
      cout<<cnt<<endl;
    }

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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[N],b[100]={0};
  for(int i=0;i<N;i++){
    cin>>a[i];}
  for(int j=0;j<N;j++){
    b[a[j]]++;
  }
  int cnt=0;
  for(int k=1;k<=100;k++){
    if(b[i])cnt++;}
  cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'i' was not declared in this scope
   14 |     if(b[i])cnt++;}
      |          ^
Language: Java

import java.util.Scanner;

public class B85 {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int mochi [] = new int [N];
		for(int m = 0; m<N; m++){
	        mochi[m]=scan.nextInt();
	    }

		//bubble sort
		int count = 0;
		for(int i =0; i<mochi.length-1; i++){
			for(int j = mochi.length-1; j>i; j--){
				if(mochi[j-1]>mochi[j]){
					int temp = mochi[j-1];
					mochi[j-1] = mochi[j];
					mochi[j] = temp;
					count++;
				}
			}

		}
		//System.out.println(Arrays.toString(mochi));

		int check = 0;
		for(int i = 0; i <mochi.length-1; i++){
			if(mochi[i]<mochi[i+1]){
				check++;
			}
		}
		System.out.println(check + 1);



	}

}


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

#include<iostream>
#include<string>
#include<map>
#include<string.h>
#include<vector>
#include<set>
#include<stdio.h>
#include<math.h>
//#include<algothm>
#include<queue>
int n,s[110],ans;
using namespace std;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	cin>>s[i];
	sort(s,s+n);
	ans++;
	for(int j=1;j<n;j++)
	{ 
  	if(s[j]!=s[j-1]) ans++;
  }
  cout<<ans;
 	system("pause");
  return 0;
}	

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

n=int(input())
a=[]

for i in range(n):
	b=0
	b=int(input())
	a.append(b)

a=sorted(a)
c=0
for j in range(n-1):
	if((a[j])<(a[j+1])):
		c+=1

print(c+1)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

n=int(input())
a=[]

for i in range(n):
	b=0
	b=int(input())
	a.append(b)

a=sorted(a)
c=0
for j in range(n-1):
	if((a[j])<(a[j+1])):
		c+=1

print(c+1

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

#include <iostream>

using namespace std;

int main()
{
 map<int,int > m;
 int n;
 cin >>n;
 for(int i=1;i<=n;i++)
 {
     int a;
     cin>>a;
     m[a]++;
 }
 cout <<m.size()<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:2: error: 'map' was not declared in this scope
    7 |  map<int,int > m;
      |  ^~~
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:7:6: error: expected primary-expression before 'int'
    7 |  map<int,int > m;
      |      ^~~
a.cc:14:6: error: 'm' was not declared in this scope
   14 |      m[a]++;
      |      ^
a.cc:16:9: error: 'm' was not declared in this scope
   16 |  cout <<m.size()<<endl;
      |         ^
Language: C++

#include<iostream>
#include<string>
#include<map>
#include<string.h>
#include<vector>
#include<set>
#include<stdio.h>
#include<math.h>
//#include<algothm>
#include<queue>
int n,s[110],ans;
using namespace std;
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	cin>>s[i];
	sort(s,s+n);
	ans++;
	for(int j=1;j<n;j++)
	{ 
  	if(s[j]!=s[j-1]) ans++;
  }
  cout<<ans;
  system("pause");
  return 0;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |         sort(s,s+n);
      |         ^~~~
      |         sqrt
Language: Java

import java.util.Scanner;
public class at{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int x=0;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]==b[k]){
                    l=l+1; 
                    for(int f=k+1;f<=N-1;f++){
                        if(b[j]==b[f]){
                            x=x+1;
                        }
                        }
                        l=l-x;
                }
                

            }
        if(j==N-1){
            System.out.println(N-l);
        }
        }

        


    }
}


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

import java.util.Scanner;
public class at{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]==b[k]){
                    l=l+1;
                }
                

            }
        if(j==N-1){
            System.out.println(N-l);
        }
        }

        


    }
}


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

import java.util.Scanner;
public class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]>b[k]){
                    l=l+1;
                }

            }
        if(j==N-1&&k==N-1){
            System.out.println(l);
        }
        }

        


    }
}


Compiler output:
Main.java:21: error: cannot find symbol
        if(j==N-1&&k==N-1){
                   ^
  symbol:   variable k
  location: class Main
1 error
Language: Java

import java.util.Scanner;
public class at{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]>b[k]){
                    l=l+1;
                }

            }
        if(j==N-1&&k==N-1){
            System.out.println(l);
        }
        }

        


    }
}


Compiler output:
Main.java:2: error: class at is public, should be declared in a file named at.java
public class at{
       ^
Main.java:21: error: cannot find symbol
        if(j==N-1&&k==N-1){
                   ^
  symbol:   variable k
  location: class at
2 errors
Language: Java

import java.util.Scanner;
public class at{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]>b[k]){
                    l++;
                    if(j==N-1&&k==N-2){
                        System.out.println(l);
                    }
                }
            }
        }
        


    }
}


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

import java.util.Scanner;
public class at{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        int a;
        int [] b=new int[N];
        //i番目の数の入力を行う
        for(int i=0;i<=N-1;i++){
             a=sc.nextInt();
             b[i]=a;  
        }
        int l=0;
        for(int j=0;j<=N-1;j++){
            for(int k=j+1;k<=N-1;k++){
                if(b[j]>b[k]){
                    l++;
                }
            }
        }
        System.out.println(l);


    }
}


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

#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>


int a[150];
using namespace std;


int main()
{
  	int n,ans=1;
    cin>>n;
    for(int i=0;i<=n;i++)
    cin>>a[i];
  	sort(a,a+n)
    for(int i=1;i<n;i++)
    if(a[i]!=a[i-1])
    ans++;
    cout<<ans;
     system("pause");
    return 0;
}     
          

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: expected ';' before 'for'
   23 |         sort(a,a+n)
      |                    ^
      |                    ;
   24 |     for(int i=1;i<n;i++)
      |     ~~~             
a.cc:24:17: error: 'i' was not declared in this scope
   24 |     for(int i=1;i<n;i++)
      |                 ^
Language: C++

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        
        HashSet<Integer> set = new HashSet<>();
        int ans = 0;
        for (int i=0; i<N; i++) {
            int d = sc.nextInt();
            if (!set.contains(d)) {
                set.add(d);
                ans++;
            }
        }
        System.out.println(ans);
    }
}


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

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

#define max(x, y)	(((x) > (y))? (x) : (y))
#define abs(x)		(((x) < 0)? (-1*(x)) : (x))

using namespace std;

int main() {
	int n,ans=0;
	int m[100];
	int i;

	memset(m,0);
	
	for ( i = 0; i < n; i++ ) {
		cin >> n;
		m[n] = 1;
	}
	
	for (i=0;i<100;i++) 
	if (m[i])ans++;

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset(m,0);
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <iodtream>
using namespace std;

int main()
{
	int x,n,i,a[100]={0},s=0;
	
	cin>>n;
	
	for(i=1;i<=n;i++){
		cin>>x;
		a[x]=1;
	}
	for(i=1;i<=n;i++){
		if(a[i]==1){
			s++;
		}
	}
	cout<<s<<endl;
	return 0;
}

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

#include <iodtream>
using namespace std;

int main()
{
	int x,n,i,a[100]={0},s=0;
	
	cin>>n;
	
	for(i=1;i<=n;i++){
		cin>>x;
		a[x]=1
	}
	for(i=1;i<=n;i++){
		if(a[i]==1){
			s++;
		}
	}
	cout<<s<<endl;
	return 0;
}

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

#include <iostream>
using namespace std;

int a[101]={0};

int main(){
	int n, x;
	cin >> n;  //4
	
	for (int i=1; i<=n; i++){
		cin >> x;
		a[x]=1;
	}
	
	int s=0;
	for(int i=1; i<=100; i++){
		if (a[i]==1) s++;
	}
	
	cout << s;
	return 0;
}#include <iostream>
using namespace std;

int a[101]={0};

int main(){
	int n, x;
	cin >> n;  //4
	
	for (int i=1; i<=n; i++){
		cin >> x;
		a[x]=1;
	}
	
	int s=0;
	for(int i=1; i<=100; i++){
		if (a[i]==1) s++;
	}
	
	cout << s;
	return 0;
}

Compiler output:
a.cc:22:2: error: stray '#' in program
   22 | }#include <iostream>
      |  ^
a.cc:22:3: error: 'include' does not name a type
   22 | }#include <iostream>
      |   ^~~~~~~
a.cc:25:5: error: redefinition of 'int a [101]'
   25 | int a[101]={0};
      |     ^
a.cc:4:5: note: 'int a [101]' previously defined here
    4 | int a[101]={0};
      |     ^
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
Language: C++

s  = input()
print ('2018'+s[4:])

Compiler output:
a.cc:2:8: warning: multi-character character constant [-Wmultichar]
    2 | print ('2018'+s[4:])
      |        ^~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s  = input()
      | ^
Language: C++

#include <iostream>
#include <list>
#include <chrono>

int main(int argc, char const *argv[]) {
    /* code */
    int n;
    std::cin >> n;
    int d;
    std::list<int> dList;
    while(std::cin >> d){
        dList.emplace_back(d);
    }
    //auto start = std::chrono::high_resolution_clock::now();
    dList.sort();
    dList.erase(std::unique(dList.begin(), dList.end()), dList.end());
    std::cout << dList.size() << " " << std::endl;
    //auto end = std::chrono::high_resolution_clock::now();
    //std::cout << "elapsed time in nanoseconds: " << std::chrono::duration_cast<std::chrono::nanoseconds>(end - start).count() << " nanoseconds." << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:16:22: error: 'unique' is not a member of 'std'
   16 |     dList.erase(std::unique(dList.begin(), dList.end()), dList.end());
      |                      ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[101];
int main()
{
	int n;
	cin>>n;
	int b;
	for(int i=1;i<=n;i++)
	{
		cin>>b;
		a[b]++;
	}
	int s=0;
	for(int i=1;i<=100;i++)
	{
		if(a[i]!=0)
		{
			s++:
		}
	}
	cout<<s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: expected ';' before ':' token
   19 |                         s++:
      |                            ^
      |                            ;
Language: C++

#include <iostream>

using namespace std;

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

  int input;
  int dh[101]={0};
  
  for(int i=0;i<N;i++){
    cin>>input;
    dh[input]=1;
  }

  int ans=0;
  for(int i=0;i<101;i++)
    if(dh[i]==1) ans++;

  cout<<ans<<endl;

  return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: expected '}' at end of input
   25 |   return 0;
      |            ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    //vector<int>d(101);
    vector<int>d(110);
    int N;
    cin>>N;
    if(N==0){
        cout<<1<<endl;
        return 0;
    }
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    sort(d.begin(),d.end());
    /*
    unique(d.begin(),d.end());
    int ans=0;
    for(int i=0;i<=100;i++){
        if(d[i]!=0){
            ans++;
        }
    }
     */
    d.erase(unique(d.begin(),d.end()),d.end());
    int ans=0;
    for(int i=0;i<d.size();i++){
        if(d[i]!=0)ans++;
    }
    cout<<ans<<endl;
    return 0;
}


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
a.cc:26:13: error: 'unique' was not declared in this scope
   26 |     d.erase(unique(d.begin(),d.end()),d.end());
      |             ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    //vector<int>d(101);
    vector<int>d(101);
    int N;
    cin>>N;
    if(N==0){
        cout<<1<<endl;
        return 0;
    }
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    sort(d.begin(),d.end());
    /*
    unique(d.begin(),d.end());
    int ans=0;
    for(int i=0;i<=100;i++){
        if(d[i]!=0){
            ans++;
        }
    }
     */
    d.erase(unique(d.begin(),d.end()),d.end());
    int ans=0;
    for(int i=0;i<d.size();i++){
        if(d[i]!=0)ans++;
    }
    cout<<ans<<endl;
    return 0;
}


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
a.cc:26:13: error: 'unique' was not declared in this scope
   26 |     d.erase(unique(d.begin(),d.end()),d.end());
      |             ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    //vector<int>d(101);
    vector<int>d(101);
    int N;
    cin>>N;
    if(N==0){
        cout<<1<<endl;
        return 0;
    }
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    sort(d.begin(),d.end());
    d.erase(unique(d.begin(),d.end()),d.end());
    cout<<d.size()-1<<endl;
    return 0;
}


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
a.cc:17:13: error: 'unique' was not declared in this scope
   17 |     d.erase(unique(d.begin(),d.end()),d.end());
      |             ^~~~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    vector<int>d(200);
    int N;
    cin>>N;
    if(N==0){
        cout<<1<<endl;
        return 0;
    }
    for(int i=0;i<N;i++){
        cin>>d[i];
    }
    sort(d.begin(),d.end());
    d.erase(unique(d.begin(),d.end()),d.end());
    cout<<d.size()-1<<endl;
    return 0;
}


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:16:13: error: 'unique' was not declared in this scope
   16 |     d.erase(unique(d.begin(),d.end()),d.end());
      |             ^~~~~~
Language: C

#include<stdio.h>

const int FALSE = 0;
const int TRUE = 1;
int main(){
    int N;
    klee_make_symbolic(&N, sizeof(N), "N");
    klee_assume(N >= 1);
    klee_assume(N <= 100);

    int d[100] = {-1};
    for(int i = 0; i < N; i++){
        d[i] = klee_int("d");
        klee_assume(d[i] >= 1);
        klee_assume(d[i] <= 100);
    }

    int cnt[110] = {-1};
    int pos = 0;
    int hit;
    for(int i = 0; i < 100; i++){
        if(i >= N){
            break;
        }
        hit = FALSE;
        for(int j = 0; j < pos; j++){
            if(d[i] == cnt[j]){
                hit = TRUE;
            }
        }
        if(!hit){
            cnt[pos++] = d[i];
        }

    }

    printf("%d\n", pos);
}


Compiler output:
main.c: In function 'main':
main.c:7:5: error: implicit declaration of function 'klee_make_symbolic' [-Wimplicit-function-declaration]
    7 |     klee_make_symbolic(&N, sizeof(N), "N");
      |     ^~~~~~~~~~~~~~~~~~
main.c:8:5: error: implicit declaration of function 'klee_assume' [-Wimplicit-function-declaration]
    8 |     klee_assume(N >= 1);
      |     ^~~~~~~~~~~
main.c:13:16: error: implicit declaration of function 'klee_int' [-Wimplicit-function-declaration]
   13 |         d[i] = klee_int("d");
      |                ^~~~~~~~
Language: C++

#include "stdafx.h"
#include<iostream>

int main()
{
	using namespace std;
	int n,a,temp,j = 0;
	int num[100];

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

	for (int i = 0; i < n - 1; i++)
	{
		for (int k = 0; k < n - i; k++)
		{
			if (num[i] > num[i + 1])
			{
				temp = num[i + 1];
				num[i] = num[i + 1];
				num[i + 1] = num[i];
			}
		}
	}

	for (int i = 0; i <= n; i++)
	{
		j++;
		if (num[i] == num[i + 1])
			j--;
	}
	cout << j;
    return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.