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

#include <iostream> 
using namespace std;
int N, flag[101];
int main(){
    cin >> N;
// Global variables are initially all 0.
// Also note that we need [101], not [100]!
  1
    for(int i = 0; i < N; ++i){
        int d;
cin >> d;
flag[d] = 1; }
    int ans = 0;
    for(int i = 0; i < N; ++i){
        ans += flag[i];
    }
    cout << ans << endl;
}

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

#include <iostream> using namespace std; int N, flag[101];
int main(){
    cin >> N;
// Global variables are initially all 0.
// Also note that we need [101], not [100]!
  1
    for(int i = 0; i < N; ++i){
        int d;
cin >> d;
flag[d] = 1; }
    int ans = 0;
    for(int i = 0; i < N; ++i){
        ans += flag[i];
    }
    cout << ans << endl;
}

Compiler output:
a.cc:1:21: warning: extra tokens at end of #include directive
    1 | #include <iostream> using namespace std; int N, flag[101];
      |                     ^~~~~
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 |     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:3:12: error: 'N' was not declared in this scope
    3 |     cin >> N;
      |            ^
a.cc:6:4: error: expected ';' before 'for'
    6 |   1
      |    ^
      |    ;
    7 |     for(int i = 0; i < N; ++i){
      |     ~~~
a.cc:7:20: error: 'i' was not declared in this scope
    7 |     for(int i = 0; i < N; ++i){
      |                    ^
a.cc:13:16: error: 'flag' was not declared in this scope
   13 |         ans += flag[i];
      |                ^~~~
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout << ans << 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:15:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |     cout << ans << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int N, tmp, cnt = 0;
  cin >> N;
  
  vector<int> d(N);
  
  for(int i = 0; i < N ; i++) {
     cin >> d.at(i);
  }
  
  for(int i = 0; i < N ; i++) {
    for(int j = 0; j < N-1; j++) {
      if(d.at(j)>d.at(j+1)) {
        tmp = d.at(j);
        d.at(j) = d.at(j+1);
        .at(j+1) = tmp;
      }
    }
  }
  for(int i = 0; i < N-1 ; i++) {
    if(d.at(i) != d.at(i+1)) {
      cnt++;
    }
  }
  cout << cnt+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected primary-expression before '.' token
   19 |         .at(j+1) = tmp;
      |         ^
Language: C++

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

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

int main() {
  int N, tmp, cnt = 0;
  cin >> N;
  
  vector<int> d(N);
  
  for(int i = 0; i < N ; i++) {
     cin >> d.at(i);
  }
  
  for(int i = 0; i < N ; i++) {
    for(int j = 0; j < N-1; j++) {
      if(d.at(j)>d.at(j+1)) {
        tmp = d.at(j);
        d.at(j) = d.at(j+1);
        d.at(j+1) = tmp;
      }
    }
  }
  for(int i = 0; i < N-1 ; i++) {
    if(d.at(i) != d.at(i+1)) {
      cnt++;
    }
  }
  cout << cnt+1 << endl;
}


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

import java.util.*;

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int[] d = new int[n];
		for(int i=0; i<n; i++){
			d[i] = scn.nextInt();
		}
      	Arrays.sort(d);
      	int count = 0;
      	for(int i=1; i<n; i++){
          if(a[i]==a[i-1]) count++;
        }
      	System.out.println(n-count);
	}
}

Compiler output:
Main.java:14: error: cannot find symbol
          if(a[i]==a[i-1]) count++;
             ^
  symbol:   variable a
  location: class Main
Main.java:14: error: cannot find symbol
          if(a[i]==a[i-1]) count++;
                   ^
  symbol:   variable a
  location: class Main
2 errors
Language: C++

// std::set を用いた解
#include <iostream>
#include <set>
using namespace std;

int main() {
  int N;
  int d[110];
  cin >> N;
  for (int i = 0; i < N; ++i) cin >> d[i];
  for (int i = 0; i < N; ++i){
    std::set<int> values; //setだから重複を許さず保存
    values.insert(d[i]);
  }
  // set のサイズを出力します
  cout << values.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: 'values' was not declared in this scope
   16 |   cout << values.size() << endl;
      |           ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int count = 0;
  int i;
  int d[100];
  int backet[100] = {0};
  cin >> N;
  for (i = 0; i < N; i++) {
    cin >> d[i];
    backet[d[i]] = backet[d[i]];
  }
  for (i = 0; i < N; i++) {
    if(backet[i]!=0){
      count++;
    }
  }
  cout << count;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   12 |   sort (a.bigin(), a.end());
      |           ^~~~~
      |           begin
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected '(' before 'mochi'
   14 |     if mochi[i] < mochi[i + 1] {
      |        ^~~~~
      |        (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: expected '(' before 'mochi'
   14 |     if mochi[i] < mochi[i + 1] {
      |        ^~~~~
      |        (
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '+=' token
    5 |   int x+=1;
      |        ^~
a.cc:13:7: error: 'x' was not declared in this scope
   13 |       x++;
      |       ^
a.cc:16:9: error: 'x' was not declared in this scope
   16 |   cout<<x<<endl;
      |         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}


   


int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);
    
   
    int n;
    vector<int>d(n);
    cin>>n;
    rep(i,n){
        cin>>d[i];
    }
    sort(ALL(d));

    int sum=1;
    rep(i,n){ 
       
         for(int i=0;i<n-1;i++){
  
    if(d.at(i)<d.at(i+1)){
      sum++;
 
  }
    }
    cout<<sum<<endl;
    


    
    
}


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

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

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


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

/*
      author  : nishi5451
      created : 14.08.2020 16:47:16
*/

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


int main(){
    set<int> li;
    int n;
    cin >> n;
    rep(i,n){
        int d;
        cin >> d;
        li.push_back(d);
    }
    cout << li.size() << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: 'class std::set<int>' has no member named 'push_back'
   19 |         li.push_back(d);
      |            ^~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: no matching function for call to 'sort(std::vector<int>::iterator, <unresolved overloaded function type>)'
   13 |   sort(vec.begin(), vec.end);
      |   ~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:63: note:   no known conversion for argument 2 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <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(i);
  
  //b:重ねた枚数, c:最上段の直径
  int b = 0, c = 0, d = 0;
  for (int i = 0; i < n; i++) {
    //cより小さい中で一番デカいのを調べる（最初はc関係なく一番デカいやつ）（ｄに直径を代入）
    if (i == 0) {
      for (int j = 0; j < n; j++) {
        if (a.at(j) > d) d = a.at(j);
      }
    }
    else {
      for (int j = 0; j < n; j++) {
        if (a.at(j) > d && a.at(j) < c) d = a.at(j);
      }
    }
    
    if (d > c) {
      b++;
      c = d;
    }
  }
  
  cout << b << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:39: error: no match for call to '(std::vector<int>) (int&)'
    9 |   for (int i = 0; i < n; i++) cin >> a(i);
      |                                      ~^~~
Language: C++

#include <iostream>
using namespace std;
typedef long long int LLI;

int solution(int arr[], int & n)
{
	int sum = 1;
	sort(arr,arr+n);
	for(int i = 0; i < n-1; i++)
		if( arr[i] != arr[i+1] )
			sum++;
	return sum;
}
int main()
{
	int n;
	cin >> n;
	int arr[n];
	for(int i = 0; i < n; i++)
		cin >> arr[i];
	cout << solution(arr,n);
}

Compiler output:
a.cc: In function 'int solution(int*, int&)':
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort(arr,arr+n);
      |         ^~~~
      |         short
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(),graeter<int>());
  
  int cnt=0;
  
  for (int i=0; i<N-1; i++)
    if (mochi.at(i)>mochi(i+1)) cnt++;
  
  cout << cnt << endl;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:35: error: 'graeter' was not declared in this scope
   10 |   sort (mochi.begin(),mochi.end(),graeter<int>());
      |                                   ^~~~~~~
a.cc:10:43: error: expected primary-expression before 'int'
   10 |   sort (mochi.begin(),mochi.end(),graeter<int>());
      |                                           ^~~
a.cc:15:26: error: no match for call to '(std::vector<int>) (int)'
   15 |     if (mochi.at(i)>mochi(i+1)) cnt++;
      |                     ~~~~~^~~~~
Language: C++

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

int main() {
    int N;
    cin >> N;
    set<int> d;
    for(int i = 0; i < N; i++){
        int in;
        cin >> in;
        set.insert(in);
    }
    cout << set.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected unqualified-id before '.' token
   11 |         set.insert(in);
      |            ^
a.cc:13:16: error: missing template arguments before '.' token
   13 |     cout << set.size() << endl;
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ;
  	cin >> N;
  int a[N];
	for (int i = 0; i < N; i++) cin >> a[i];
	sort(a, a + N, greater<int>());
	int count = 0;
	for (int i = 0; i < N; i++) {
      if (a[i]<a[i+1]){
      count ++;
      }
    }
  coun << count << endl ;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'coun' was not declared in this scope; did you mean 'count'?
   16 |   coun << count << endl ;
      |   ^~~~
      |   count
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N ;
  	cin >> N;
  int a[N];
	for (int i = 0; i < N; i++) cin >> a[i];
	sort(a, a + N, greater<int>());
	int count = 0;
	for (int i = 0; i < N; i++) {
      a[i]<a[i+1];
      count ++;
    }
  coun << count << endl ;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'coun' was not declared in this scope; did you mean 'count'?
   15 |   coun << count << endl ;
      |   ^~~~
      |   count
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  	int N;
  	int max = 101;
  	cin >> N;
  	vector<int> d(N),flag(max);
  	for(int i=0;i<N;i++){
      	cin >> d[i];
      	flag[d[i]] = 1;
    }
  	int res=0;
  	for(int i=0;i<max;i++){
      	if(flag) res++;
   	}
  	cout << res << endl;  	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: could not convert 'flag' from 'std::vector<int>' to 'bool'
   17 |         if(flag) res++;
      |            ^~~~
      |            |
      |            std::vector<int>
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define _GLIBCXX_DEBUG

int main(){
    int N;
    cin>>N;
    vector<int> vec(N);
    rep(i,N){
        cin>>vec[i];
    }
    sort(vec.begin(),vec.end());
    reverse(vec.begin(),vec.end());

    int count=1;
    if(N==1) cout<<count<<endl;
    else
    {
        rep(i,N-1){
            if(vec[i+1]-vec[i]!=0) count++;
            else continue;
        }
        cout<<count<<endl;
    }
    

}

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

#include <bits/stdc++.h>
using namespace std;
int N,i,aaray;
 
int main() {
  cin >>  N;
  set<int> mochi_array;
  
  for(i=0;i<N;i++){
    
  	cin >>  array;
    mochi_array.insert(array);
  }
  cout<<mochi_array.size()<<endl;
  return 0;
}
 


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: missing template arguments before ';' token
   11 |         cin >>  array;
      |                      ^
a.cc:12:29: error: missing template arguments before ')' token
   12 |     mochi_array.insert(array);
      |                             ^
Language: C++

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

 
int main() {
  cin>> int N;
  set<int> mochi_array;
  
  for(i=0;i<N;i++){
    
  	cin>> int array;
    mochi_array.insert(array);
  }
  cout<<mochi_array.size()<<endl;
  return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected primary-expression before 'int'
    6 |   cin>> int N;
      |         ^~~
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<N;i++){
      |       ^
a.cc:9:13: error: 'N' was not declared in this scope
    9 |   for(i=0;i<N;i++){
      |             ^
a.cc:11:15: error: expected primary-expression before 'int'
   11 |         cin>> int array;
      |               ^~~
a.cc:12:29: error: missing template arguments before ')' token
   12 |     mochi_array.insert(array);
      |                             ^
Language: C++

#include <iostream>

int main () {
    int n;
    std::cin >> n;
    int d[n];
    for(int i = 0; i < n; ++i) {
        std::cin >> d[i];
        for(int j = 0; j < i; ++j){
            if(d[j]==d[i]){
                c++;
                n -= 1;
                --i;
                break;
            }
        }
    }
    std::cout << n << std::endl;
}

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

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    set<int> a;
    for( int i = 0 ; i < n ; i++ ) {
        int d;
        cin >> d;
        a.insert(d);
    } 
    cout << a.size();
}


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:32: error: invalid types 'int[int]' for array subscript
    6 |   for(int i=0;i<n;i++)cin>>list[i];
      |                                ^
a.cc:10:13: error: invalid types 'int[int]' for array subscript
   10 |     num[list[i]]++;
      |             ^
a.cc:14:11: error: invalid types 'int[int]' for array subscript
   14 |     if(num[i]){
      |           ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |   sort(vec.begin(), vec.end());
      |   ^~~~
      |   short
a.cc:13:46: error: 'contenue' was not declared in this scope
   13 |     if(i != 0 && vec.at(i) == vec.at(i - 1)) contenue;
      |                                              ^~~~~~~~
Language: C++

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

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

    sort (d.begin(), d.end());
    int sum=0;

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

    

  
    


Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: expected ')' before '{' token
   16 |         if (d.at(i) {
      |            ~       ^~
      |                    )
a.cc:22:5: error: expected primary-expression before '}' token
   22 |     }
      |     ^
Language: C++

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

using namespace std;



int main() {
  int n;
  cin >>n;
  vector<int> d(n);
  for (int i = 0; i <n; i++) 
  {
    cin >> d.at(i);
  }
  sort(d.begin(),d.end());
  //reverse(a.begin(),a.end());
  int sum =0

  for(int i=0;i<n;i++){
  
    if(d.at(i)<d.at(i+1)){
      sum++;

  }

  
}
  cout<<sum<<endl;
}

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

#include <iostream>
#include <string>
#include <math.h>
#include <vector>

using namespace std;

int main()
{

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

}


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

#include <iostream>
#include <string>
#include <math.h>
#include <vector>

using namespace std;

int main()
{

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

}


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

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

int main(){
  int N;
  cin >> N;
  
  vector<int> size(N);
  for(int i=0; i < N; i++){
    cin >> size.at(i)
  }
  
  int tmp = size.at(0);
  int ans = 0;
  for(int i=1; i < N; i++){
    if(ans > size.at(i)){
      ans = size.at(i)
      ans++;
    }
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '}' token
   11 |     cin >> size.at(i)
      |                      ^
      |                      ;
   12 |   }
      |   ~                   
a.cc:18:23: error: expected ';' before 'ans'
   18 |       ans = size.at(i)
      |                       ^
      |                       ;
   19 |       ans++;
      |       ~~~
Language: C

#include<stdio.h>
int main(){
  int a[100]={0};
  int b[100]={0};
  int i=0,n=0,j=0,k=0,ans=0;
  scanf("%d",&n);
  for(i=0;i<=n;i++){
    scanf("%d",a[k]);
  }
  j=a[i];
  b[j]+=1;
    for(i=0;i<100;i++){
      if(b[i]!=0]){
        ans++;
      }
    }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:17: error: expected ')' before ']' token
   13 |       if(b[i]!=0]){
      |         ~       ^
      |                 )
main.c:13:17: error: expected statement before ']' token
main.c:13:18: error: expected statement before ')' token
   13 |       if(b[i]!=0]){
      |                  ^
Language: C++

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

int main() {
  int N, max=0, c=0, k;
  cin >> N;
  vector<int> moti(N);
  
  for(int i=0;i<N;i++){
    cin >> moti.at(i);
  }
  
  for(int i=0;i<N;i++){
    max=0;
    for(int j=0;j<N;j++){
      if(i==0){
        if(max < moti.at(j))
          max = mati.at(j);
      }else{
        if(max < moti.at(j) && moti.at(j) < k)
          max = moti.at(j);
      }
    }
    k=max;
    if(max > 0)
      c++;
  }
  cout << c << endl;
      
      
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'mati' was not declared in this scope; did you mean 'moti'?
   18 |           max = mati.at(j);
      |                 ^~~~
      |                 moti
Language: C++

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


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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    6 |   data[N];
      |       ^
a.cc:8:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     cin>>data[i];
      |              ^
a.cc:10:13: error: overloaded function with no contextual type information
   10 |   sort(data.begin(),data.end());
      |             ^~~~~
a.cc:10:26: error: overloaded function with no contextual type information
   10 |   sort(data.begin(),data.end());
      |                          ^~~
a.cc:13:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     if(data[i]<data[i+1]){
      |            ^
a.cc:13:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     if(data[i]<data[i+1]){
      |                    ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid types 'int[int]' for array subscript
    7 |   data[N];
      |       ^
a.cc:9:14: error: invalid types 'int[int]' for array subscript
    9 |     cin>>data[i];
      |              ^
a.cc:11:13: error: request for member 'begin' in 'data', which is of non-class type 'int'
   11 |   sort(data.begin(),data.end());
      |             ^~~~~
a.cc:11:26: error: request for member 'end' in 'data', which is of non-class type 'int'
   11 |   sort(data.begin(),data.end());
      |                          ^~~
a.cc:14:12: error: invalid types 'int[int]' for array subscript
   14 |     if(data[i]<data[i+1]){
      |            ^
a.cc:14:20: error: invalid types 'int[int]' for array subscript
   14 |     if(data[i]<data[i+1]){
      |                    ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: invalid types 'int[int]' for array subscript
    7 |   data[N];
      |       ^
a.cc:9:14: error: invalid types 'int[int]' for array subscript
    9 |     cin>>data[i];
      |              ^
a.cc:11:13: error: request for member 'begin' in 'data', which is of non-class type 'int'
   11 |   sort(data.begin(),data.end());
      |             ^~~~~
a.cc:11:26: error: request for member 'end' in 'data', which is of non-class type 'int'
   11 |   sort(data.begin(),data.end());
      |                          ^~~
a.cc:13:17: error: 'n' was not declared in this scope
   13 |   for(int i=0;i<n-1;i++){
      |                 ^
a.cc:14:12: error: invalid types 'int[int]' for array subscript
   14 |     if(data[i]<data[i+1]){
      |            ^
a.cc:14:20: error: invalid types 'int[int]' for array subscript
   14 |     if(data[i]<data[i+1]){
      |                    ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    6 |   data[N];
      |       ^
a.cc:8:14: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
    8 |     cin>>data[i];
      |              ^
a.cc:10:13: error: overloaded function with no contextual type information
   10 |   sort(data.begin(),data.end());
      |             ^~~~~
a.cc:10:26: error: overloaded function with no contextual type information
   10 |   sort(data.begin(),data.end());
      |                          ^~~
a.cc:12:17: error: 'n' was not declared in this scope
   12 |   for(int i=0;i<n-1;i++){
      |                 ^
a.cc:13:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     if(data[i]<data[i+1]){
      |            ^
a.cc:13:20: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   13 |     if(data[i]<data[i+1]){
      |                    ^
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());
  reverse(a.begin(),a.end());
  int b=0;
  for(i=0;i<N;i++){
    if(a.at(i)>a.at(i+1)){
     b++; 
    }
    break;
  }
  cout << b << endl;
}


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


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


int main(){
    int n; cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: expected ';' before ')' token
   15 |     sort(all(d),greater<int>()));
      |                                ^
      |                                ;
Language: C++

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

int main(){
 int N;
  cin >>N;
  int ans=0;
  vector<int> flag(101,0);
  
  for (int i=0;i<N;i++){
    int d;
   cin >> d; 
    flag.at(d) =1;
  }
  for (int i=0;i<flag.size();i++){
   ans += flag.at(i)
  }
  
  cout << ans << endl;
  return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: expected ';' before '}' token
   16 |    ans += flag.at(i)
      |                     ^
      |                     ;
   17 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n, a, j;
  cin >> n;
  vector<int> mochi(100);at
  for(i=0;i<n;i++) {
    cin >> mochi.at(i);
  }
  for(i=0;i<n;i++) {
    for(j=0;j<n;j++) {
      if(mochi.at(i) == mochi.at(j)) {
        mochi.at(j) = 0;
      }
    }
  }
  for(i=0;i<n;i++) {
    if(mochi.at(i) != 0) {
      a++;
    }
  }
  cout << a << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:26: error: 'at' was not declared in this scope; did you mean 'a'?
    6 |   vector<int> mochi(100);at
      |                          ^~
      |                          a
a.cc:7:18: error: expected ';' before ')' token
    7 |   for(i=0;i<n;i++) {
      |                  ^
      |                  ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    scanf("%d", &n);
    vector<int> d(n);
    rep(i, n) scanf("%d", &d[i]);
    sort(d.begin(), d.end());
    int count = 1;
    rep(i, n - 1)
    {
        if (d[i] != d[i + 1])
            count++;
    }
    printf("%d\n", count);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'i' was not declared in this scope
    8 |     rep(i, n) scanf("%d", &d[i]);
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i, n) scanf("%d", &d[i]);
      |     ^~~
Language: C++

/*
 * cpp_filepath
 */

// C++ 14
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring> // memset
#include <cassert>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
template <class T> ostream & operator << (ostream & out, vector<T> const & v) {
  for (auto &&a: v) out << a << " "; out << endl; return out;
}
template <class T> void dump(T &a) { cout << a << endl; }
void solve();
int main() { solve(); return 0; }


void solve() {
  int n;
  cin >> n;
  vector<int> A(n);
  loop(i,0,n) cin >> A[i];
  sort(A.begin(), A.end());
  erase(unique(A.begin(), A.end()), A.end());
  cout << A.size() << endl;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:29:3: error: 'erase' was not declared in this scope
   29 |   erase(unique(A.begin(), A.end()), A.end());
      |   ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define per(i,s,n) for(int i=n-1;i>=s;i--)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

int main(){
  set<int> s;
  int a;
  int n;
  cin>>n;
  rep(i,n){
    cin>>a;
    s.insert(a);
  }
  
  int ans=0;
  
  for(auto x:st){
    ans++;
  }
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: 'st' was not declared in this scope; did you mean 's'?
   29 |   for(auto x:st){
      |              ^~
      |              s
Language: Java


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

int main() { 
	int N,count = 1;
  cin >> N;
	vector<int> a(N);
  for (int i = 0; i < N; i++) {
          cin >> a.at(i);
  }

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

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

	  if (a[i] != a[i + 1]) {
      count++;
      }
   }
  cout << count << endl;
}

Compiler output:
Main.java:2: error: illegal character: '#'
#include <iostream>
^
Main.java:3: error: illegal character: '#'
#include <algorithm>
^
Main.java:4: error: illegal character: '#'
#include <vector>
^
Main.java:9: error: not a statement
  cin >> N;
      ^
Main.java:10: error: not a statement
	vector<int> a(N);
	              ^
Main.java:12: error: not a statement
          cin >> a.at(i);
              ^
Main.java:23: error: not a statement
  cout << count << endl;
                ^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
int main() { 
^
  (use --enable-preview to enable unnamed classes)
Main.java:10: error: ';' expected
	vector<int> a(N);
	             ^
Main.java:10: error: ';' expected
	vector<int> a(N);
	               ^
10 errors
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected ',' or ';' before 'cout'
   14 |   cout << n << endl;
      |   ^~~~
Language: C++

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

    int flag[110] = {0};  // バケット
    for (int i = 0; i < N; i++) {flag[d[i]]++;}  // d[i] が 1 個増える

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> N;
      |     ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << counter << endl;
      |     ^~~~
a.cc:17:24: error: 'endl' was not declared in this scope
   17 |     cout << counter << endl;
      |                        ^~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  
  int A[110];
  vector<bool> vec(N, true);
  
  rep(i,N){
    cin >> A[i];
  }
  
  int count = 0;
  rep(i,N){
    if(vec[i] == true){
      rep(j+i+1,N){
        if(A[j+i+1] == A[i]) vec[j+i+1] = false;
      }
      count++;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:12: error: expected ';' before '+' token
   19 |       rep(j+i+1,N){
      |            ^
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0; i<n; i++)
      |                          ^
a.cc:19:14: error: lvalue required as left operand of assignment
   19 |       rep(j+i+1,N){
      |            ~~^~
a.cc:3:26: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0; i<n; i++)
      |                          ^
a.cc:3:34: error: expected ')' before ';' token
    3 | #define rep(i,n) for(int i=0; i<n; i++)
      |                     ~            ^
a.cc:19:7: note: in expansion of macro 'rep'
   19 |       rep(j+i+1,N){
      |       ^~~
a.cc:19:11: error: 'j' was not declared in this scope
   19 |       rep(j+i+1,N){
      |           ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0; i<n; i++)
      |                                    ^
a.cc:19:15: error: lvalue required as increment operand
   19 |       rep(j+i+1,N){
      |               ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i=0; i<n; i++)
      |                                    ^
Language: C++

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

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

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

    int counter = 1;
    int comp = a[0];
    for(int i = 0; i < n; i++){
        if(comp != a[i]){
            ++counter;
            comp = a[i];
        }
    }

    cout << counter << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'a' was not declared in this scope
   15 |     int comp = a[0];
      |                ^
Language: C++

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

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

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

    int counter = 1;
    int comp = a[0];
    for(int i = 0; i < n; i++){
        if(comp != a[i]){
            ++counter;
            comp = a[i];
        }
    }

    cout << counter << endl;

    return 0;
}

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

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

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:21: error: overloaded function with no contextual type information
   27 |   int answer = size.veca();
      |                     ^~~~
Language: C++

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: expected primary-expression before ';' token
   12 |     for(int i=;i<N-1;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 count = 0;　
  for (int i = 0; i < N; i++){
    int count2 = 1;
    for (int j = 0; j < i; j++){
      if ( vec.at(i) == vec.at(j) ) count2 *= 0;
    }
    count += count2;
  }
  cout << count << endl;
}

Compiler output:
a.cc:8:17: error: extended character 　 is not valid in an identifier
    8 |   int count = 0;　
      |                 ^
a.cc: In function 'int main()':
a.cc:8:17: error: '\U00003000' was not declared in this scope
    8 |   int count = 0;　
      |                 ^~
a.cc:9:19: error: 'i' was not declared in this scope
    9 |   for (int i = 0; i < N; i++){
      |                   ^
Language: C++

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

int main(){
  int N; cin >> N;
  vector<int> vec(N);
  for (int i = 0; i < N; i++) cin >> vec.at(i);
  // 入力値の受け取り完了
  int count = 0;　
  // 出力変数の定義
  for (int i = 0; i < N; i++){
    int count2 = 1;
    for (int j = 0; j < i; j++){
      if ( vec.at(i) == vec.at(j) ) count2 *= 0;
    }
    count += count2;
  }
  cout << count << endl;
}

Compiler output:
a.cc:9:17: error: extended character 　 is not valid in an identifier
    9 |   int count = 0;　
      |                 ^
a.cc: In function 'int main()':
a.cc:9:17: error: '\U00003000' was not declared in this scope
    9 |   int count = 0;　
      |                 ^~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   for (int i = 0; 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 count = 0;
  for (int i = 0; i < N; i++){
    int count2 = 1;
    for (int j = 0; j < i; j++){
      if ( vec.at(i) == vec.at(j) ) count2 *= 0;
    }
    count += count2;
  }
  count << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   16 |   count << count << endl;
      |   ~~~~~~~~~~~~~~~^~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'vec' was not declared in this scope
    8 |     cin>>vec.at(i);}
      |          ^~~
a.cc:11:7: error: 'vec' was not declared in this scope
   11 |   if (vec.at(i)<vec.at(i+1)){
      |       ^~~
a.cc:12:8: error: expected ';' before '}' token
   12 |     x++}
      |        ^
      |        ;