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

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

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

#include<iostream
using namespace std;
int a[101]={0};
int main()
{
	int n,x;
	cin>>n;
	fr(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:1:18: error: missing terminating > character
    1 | #include<iostream
      |                  ^
a.cc: In function 'int main()':
a.cc:8:12: error: expected primary-expression before 'int'
    8 |         fr(int i=1;i<=n;i++)
      |            ^~~
a.cc:8:20: error: 'i' was not declared in this scope
    8 |         fr(int i=1;i<=n;i++)
      |                    ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: invalid operands of types '__complex__ long int' and 'int' to binary 'operator<='
   14 |     for(int i=1li<=100;i++)
      |               ~~~^~~~~
      |               |    |
      |               |    int
      |               __complex__ long int
a.cc:14:27: error: expected ';' before ')' token
   14 |     for(int i=1li<=100;i++)
      |                           ^
      |                           ;
Language: C++

#include<iostream>
using namespace std;

int a[101]={0}
int main()
{
	int n,x;
	cin>>n;
	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<<endl;
	return 0;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main()
      | ^~~
Language: C++

#include<iostream>
using namespace std;

int a[101]={0}
int main()
{
	int n,x;
	cin>>n;
	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<<endl;
	return 0;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main()
      | ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int a[101];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: 's' was not declared in this scope
   19 |                 if(a[i]==1)  s++;
      |                              ^
a.cc:22:15: error: 's' was not declared in this scope
   22 |         cout<<s<<endl;
      |               ^
Language: C++

#include<iostream>
using namespace std;

int a[101]={0}
int main()
{
	int n,x;
	cin>>n;
	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)++;
	}
	cout<<s;
	return 0;
}

Compiler output:
a.cc:5:1: error: expected ',' or ';' before 'int'
    5 | int main()
      | ^~~
Language: C++

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

int a[101];

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: 's' was not declared in this scope
   24 |         cout<<s<<endl;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,ans,s[1000],b[1000];
int main()
{
cin>>n;
for(int i=1;i<=n;i++){
cin>>s[i];b[s[i]]=1;
for(int i=1;i<=100;i++)ans+=b[i];
cout<<ans;
return 0;
}


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

#include<iostreaam>
using namespace std;
int s[1000],b[1000];
int main()
{
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>s[i];
		b[s[i]]=1;
	}
	for(int i=1;i<=100;i++)
	{
		ans+=b[i];
	}
	cout<<ans;
	return 0;
}

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

import java.util.Scanner;

public class Q1 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int num=scn.nextInt();
		
		int [] arr=new int[num];
		for(int i=0;i<num;i++) {
			arr[i]=scn.nextInt();
		}
		int temp;
		for(int i=0;i<num;i++) {
			for(int j=i+1;j<num;j++) {
				if(arr[i]<arr[j]) {
					temp=arr[i];
					arr[i]=arr[j];
					arr[j]=temp;
				}
			}
		}
		int count=1;
		for(int i=0;i<num-1;i++) {
			if(arr[i]!=arr[i+1]) {
				count++;
			}
		}
		System.out.println(count);
		scn.close();
	}
}

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

import java.util.Scanner;

public class Q1 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn=new Scanner(System.in);
		int num=scn.nextInt();
		
		int [] arr=new int[num];
		for(int i=0;i<num;i++) {
			arr[i]=scn.nextInt();
		}
		int temp;
		for(int i=0;i<num;i++) {
			for(int j=i+1;j<num;j++) {
				if(arr[i]<arr[j]) {
					temp=arr[i];
					arr[i]=arr[j];
					arr[j]=temp;
				}
			}
		}
		int count=0;
		for(int i=0;i<num-1;i++) {
			if(arr[i]!=arr[i+1]) {
				count++;
			}
		}
		System.out.println(count+1);
	}
}

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

#include <iostream>
#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[i];
    sort(d.begin(), d.end(), greater<int>());

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

    cout << ans << endl;
    return 0;
}

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

#include <iostream>

using namespace std;

int main() {
    int N;
    scanf("%d", &N);

    int a[N];
    for (int i = 0; i < N; ++i) {
        scanf("%d", &a[i]);
    }

    sort(a, a + N, greater<int>());

    int tmp = 0, ans = 0;
    for (int i = 0; i < N; ++i) {
        if (tmp == a[i]) continue;
        tmp = a[i];
        ans++;
    }

    printf("%d\n", ans);

    return 0;
}


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

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

using namespace std;

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

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

	sort(begin(v), end(v), greater<int>());

	int prev = INT_MAX;
	int ans = 0;
	for (int x : v) {
		if (x < prev) {
			prev = x;
			++ans;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'INT_MAX' was not declared in this scope
   21 |         int prev = INT_MAX;
      |                    ^~~~~~~
a.cc:6:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    5 | #include <cmath>
  +++ |+#include <climits>
    6 | #include <string>
Language: C++

#include <iostream>
2 using namespace std;
3 int N, flag[101]; // Global variables are initially all 0.
4 // Also note that we need [101], not [100]!
5 int main(){
6 cin >> N;
7 for(int i = 0; i < N; ++i){
8 int d;
9 cin >> d;
10 flag[d] = 1;
11 }
12 int ans = 0;
13 for(int i = 0; i < N; ++i){
14 ans += flag[i];
15 }
16 cout << ans << endl;
17 }

Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 using namespace std;
      | ^
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 int N, flag[101]; // Global variables are initially all 0.
      | ^
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 4 // Also note that we need [101], not [100]!
      | ^
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>using namespace std;int main(){    string s;    cin>>s;    s[3]='8';    cout<<s;    system("pause");    return 0;}

Compiler output:
a.cc:1:17: warning: extra tokens at end of #include directive
    1 | #include<string>#include<string.h>#include<map>#include<set>#include<vector>#include<stdio.h>#include<math.h>#include<iostream>#include<algorithm>#include<queue>using namespace std;int main(){    string s;    cin>>s;    s[3]='8';    cout<<s;    system("pause");    return 0;}
      |                 ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
int a[100];
int main()
{int n;
 for(int i=0;i<n;i++)
 cin>>a[i];
 for(int i=0;i<n;i++)
   for(int j=i;j<n;j++)
   {
     if(a[i]==a[j];
        n--;
        cout<<n;
        }
        system("pause");
        return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:12: error: expected ')' before ';' token
   12 |         n--;
      |            ^
      |            )
a.cc:11:8: note: to match this '('
   11 |      if(a[i]==a[j];
      |        ^
Language: Java

 package main;
 
 import java.util.*;
 import java.math.*;
 public class A
 {
 	public static void main (String[] args)
 	{
 		Scanner in = new Scanner(System.in);
 		int n = in.nextInt();
 		boolean layers[] = new boolean[100];
 		int res = 0; 
 		Arrays.fill(layers, false);
 		for (int i = 0; i < n; ++i)
 		{
 			int a = in.nextInt();
 			if(layers[a] == false)
 			{
 				res += 1;
 				layers[a] = true;
 			}
 		}
 		System.out.println(res);
 	}
 }



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

 import java.util.*;
 import java.math.*;
 public class A
 {
 	public static void main (String[] args)
 	{
 		Scanner in = new Scanner(System.in);
 		int n = in.nextInt();
 		boolean layers[] = new boolean[100];
 		int res = 0; 
 		Arrays.fill(layers, false);
 		for (int i = 0; i < n; ++i)
 		{
 			int a = in.nextInt();
 			if(layers[a] == false)
 			{
 				res += 1;
 				layers[a] = true;
 			}
 		}
 		System.out.println(res);
 	}
 }



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

use std::io::*;
use std::str::FromStr;

struct Scanner<R: Read> {
    reader: R,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn safe_read<T: FromStr>(&mut self) -> Option<T> {
        let token = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            token.parse::<T>().ok()
        }
    }

    fn read<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.safe_read() {
            s
        } else {
            writeln!(stderr(), "Process terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(104_857_600)
        .spawn(solve)
        .unwrap()
        .join()
        .unwrap();
}

fn solve() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    loop {
        let n: usize = sc.read();
        let mut d: Vec<i32> = (0..n).map(|_| sc.read()).collect();
        d.sort();
        d.dedup();
        println!("{}", d.len());
    }
}


Compiler output:
a.cc:8:2: error: invalid preprocessing directive #[
    8 | #[allow(dead_code)]
      |  ^
a.cc:51:32: error: too many decimal points in number
   51 |         let mut d: Vec<i32> = (0..n).map(|_| sc.read()).collect();
      |                                ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::*;
      | ^~~
a.cc:2:1: error: 'use' does not name a type
    2 | use std::str::FromStr;
      | ^~~
a.cc:4:8: error: 'Scanner' is not a class template
    4 | struct Scanner<R: Read> {
      |        ^~~~~~~
a.cc:4:16: error: 'R' was not declared in this scope
    4 | struct Scanner<R: Read> {
      |                ^
a.cc:5:5: error: 'reader' does not name a type
    5 |     reader: R,
      |     ^~~~~~
a.cc:9:5: error: expected initializer before '<' token
    9 | impl<R: Read> Scanner<R> {
      |     ^
a.cc:36:1: error: 'fn' does not name a type
   36 | fn main() {
      | ^~
a.cc:45:1: error: 'fn' does not name a type
   45 | fn solve() {
      | ^~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
    vector<unsigned int> d;
    unsigned int N;
    
    cin >> N;
    
    for(unsigned int i = 0;i < N;i++){
        unsigned int di;
        cin >> di;
        vector<unsigned>::iterator cIter = find( d.begin(),d.end() , di );

        if( cIter == d.end() ){
            d.push_back(di);
        }
    }
    
    cout << d.size();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:48: error: no matching function for call to 'find(std::vector<unsigned int>::iterator, std::vector<unsigned int>::iterator, unsigned int&)'
   13 |         vector<unsigned>::iterator cIter = find( d.begin(),d.end() , di );
      |                                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:13:48: note:   '__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   13 |         vector<unsigned>::iterator cIter = find( d.begin(),d.end() , di );
      |                                            ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int N,X,cnt=0;
    cin >> N;
    vector<char>S(N);
    
    for(int i=0; i<N; i++){
        cin >> S[i];
    }
    
    sort(S.begin(),S.end());
    X = S[0];
    
    for(int i=1; i<N; i++){
        if(X != S[i]){
            cnt++;
            X = S[i];
        }
    }
    
    cout << cnt+1 << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<char>S(N);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | #include <string>
a.cc:9:12: error: expected primary-expression before 'char'
    9 |     vector<char>S(N);
      |            ^~~~
a.cc:12:16: error: 'S' was not declared in this scope
   12 |         cin >> S[i];
      |                ^
a.cc:15:10: error: 'S' was not declared in this scope
   15 |     sort(S.begin(),S.end());
      |          ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,a,b)	for(int i=a;i<=b;i++)
#define rrep(i,a,b)	for(int i=a;i>=b;i--)
using namespace std;
typedef long long ll;
const int N=1e6+5,inf=0x3f3f3f3f;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,x,res=0;
	rep(i,1,n)
		cin>>x,mp[x]++;
	rep(i,1,100)
		if(mp[i])
			res++;
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'mp' was not declared in this scope
   13 |                 cin>>x,mp[x]++;
      |                        ^~
a.cc:15:20: error: 'mp' was not declared in this scope
   15 |                 if(mp[i])
      |                    ^~
Language: C++

#include "stdafx.h"
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>

using namespace std;

int main()
{
	int mochi_num;
	cin >> mochi_num;
	vector<int> mochi_radius;
	int radius_input;
	for (int i = 0; i < mochi_num; i++) {
		cin >> radius_input;
		mochi_radius.push_back(radius_input);
	}
	sort(mochi_radius.begin(), mochi_radius.end());
	int kagami_level = 0;
	int temp_count=0;
	for (int i = 0; i < mochi_num; i++) {
		if (temp_count == mochi_radius[i]) {
		}
		else {
			kagami_level++;
			temp_count = mochi_radius[i];
		}
	
	}
	cout << kagami_level;


    return 0;
}


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

#include <iostream>

using namespace std;

int main() {
  int n, d[100], h = 1;

  cin >> 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]) h++;

  cout << h << endl;

  return 0;
}

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


#include <unordered_set>
#include <string>
#include <cmath>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <queue>
#include <tuple>
#include <functional>
#include <set>

void run() {
	int N;
	std::cin >> N;
	int cnt[200];
	memset(cnt, 0, sizeof(cnt));
	for (int i = 0; i < N; ++i) {
		int d;
		std::cin >> d;
		++cnt[d];
	}
	int ans = 0;
	for (int v : cnt){
		if (v > 0)
			++ans;
	}
	std::cout << ans << std::endl;
}
int main() {
	run();
	return 0;
}


Compiler output:
a.cc: In function 'void run()':
a.cc:18:9: error: 'memset' was not declared in this scope
   18 |         memset(cnt, 0, sizeof(cnt));
      |         ^~~~~~
a.cc:13:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   12 | #include <set>
  +++ |+#include <cstring>
   13 |
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int N,X,cnt=0;
    cin >> N;
    vector<int>S(N);
    
    for(int i=0; i<N; i++){
        cin >> S[i];
    }
    
    sort(S.begin(),S.end());
    X = S[0];
    
    for(int i=1; i<N; i++){
        if(X != S[i]){
            cnt++;
            X = S[i];
        }
    }
    
    cout << cnt+1 << endl;
    return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int>S(N);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | #include <string>
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int>S(N);
      |            ^~~
a.cc:12:16: error: 'S' was not declared in this scope
   12 |         cin >> S[i];
      |                ^
a.cc:15:10: error: 'S' was not declared in this scope
   15 |     sort(S.begin(),S.end());
      |          ^
Language: C++

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

int main() {
	int N;
	cin >> N;
	vector<int> d(N);
	for (int i = 0; i < N; i++) {
		cin >> d[i];
	}
	auto itr = uniq(d.begin(), d.end());
	d.erase(itr, d.end());
	d.resize(itr - d.begin());
	size_t size = d.size();
	cout << size << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: 'uniq' was not declared in this scope; did you mean 'unix'?
   13 |         auto itr = uniq(d.begin(), d.end());
      |                    ^~~~
      |                    unix
Language: C++

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

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

    // solve
    int ans = 0;
    sort(d.begin(), d.end());

    for (int i = 0; i < d.size(); ++i) {
        if (d[i] != d[i + 1]) ans++;
    }

    // output
    cout << ans << endl;

    return 0;
}


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

#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  int d[N];
  for(int i=0;i<N;i++)cin>>d[i];
  sort(d,d+N);
  int t=0;
  int res=0;
  for(int i=0;i<N;i++){
    if(t!=d[i])res++;
    t=d[i];
  }
  cout<<res;
  return 0;
}

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

int main() {

	int r[105] = { 0 };
	int num = 0;
	int a = 0;
	int ans = 0;

	cin >> num;

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

	for (int i = 104; i >= 1; i--) {
		if (r[i] != 0) {ans += 1; }
	}


	cout << ans << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'cin' was not declared in this scope
    8 |         cin >> num;
      |         ^~~
a.cc:20:9: error: 'cout' was not declared in this scope
   20 |         cout << ans << endl;
      |         ^~~~
a.cc:20:24: error: 'endl' was not declared in this scope
   20 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    int N, tempInt;
    vector<int> Mochi;
    cin  >> N;
    for(int i = 0; i < N; i++){
        cin >> tempInt;
        Mochi.push_back(tempInt);
    }
    sort(Mochi.begin(), Mochi.end());
    
    tempInt = -1;
    
    int count = 0;
    for(int i = 0; i < Mochi.size(); i++){
        if(tempInt != Mochi[i]){
            tempInt = Mochi[i];
            count++;
        }
    }
    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(Mochi.begin(), Mochi.end());
      |     ^~~~
      |     short
Language: C++

//競技プログラミング　テンプレ
//
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cstdlib> //abs() これは整数のみ

using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); ++i)

const int max_v = 300;
const int INF = 1000000;



int main() {
	int n, ans=0;
	cin >> n;
	vector <int> A(n);
	//string str;
	for (int i = 0; i < n; i++) {
		cin >> A[i];
	}
	map<int ,int> mp;
	REP(i,n){
		mp[A[i]] = 1;
	}

	ans = mp.size;
	//sort(A.begin(), A.end());

	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: cannot convert 'std::map<int, int>::size' from type 'std::map<int, int>::size_type (std::map<int, int>::)() const noexcept' {aka 'long unsigned int (std::map<int, int>::)() const noexcept'} to type 'int'
   32 |         ans = mp.size;
      |                  ^~~~
Language: C++

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

int main(){
  int N,tmp,c;
  vector<int> d;

  cin >> N;
  d = vector<int>(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> d[i];
  }
  sort(d.begin(), d.end());

  tmp = d[0];
  c = 1;
  for (int i = 1; i < N; i++)
  {
    if(tmp != d[i]){
      c++;
      tmp = d[i];
    }
  }
  cout << c;
}

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

#include <iostream>

using namespace std;

int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int mem[101];
  memset(mem, 0, sizeof(mem));
  int cnt = 0;
  int d;
  for (int i = 0; i < n; i++) {
    cin >> d;
    if (mem[d] == 0) {
      mem[d] = 1;
      cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:9:3: error: 'memset' was not declared in this scope
    9 |   memset(mem, 0, sizeof(mem));
      |   ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: Java

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;
class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);

        int N = scan.nextInt();
        int d = IntStream.range(0,N).map(i -> scan.nextInt()).toArray();
        Arrays.sort(d);
        int ans = 1;
        for(int i= 0;i<N-1;++i){
            if(d[i+1] > d[i])++ans;
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:9: error: incompatible types: int[] cannot be converted to int
        int d = IntStream.range(0,N).map(i -> scan.nextInt()).toArray();
                                                                     ^
Main.java:10: error: no suitable method found for sort(int)
        Arrays.sort(d);
              ^
    method Arrays.sort(int[]) is not applicable
      (argument mismatch; int cannot be converted to int[])
    method Arrays.sort(long[]) is not applicable
      (argument mismatch; int cannot be converted to long[])
    method Arrays.sort(short[]) is not applicable
      (argument mismatch; int cannot be converted to short[])
    method Arrays.sort(char[]) is not applicable
      (argument mismatch; int cannot be converted to char[])
    method Arrays.sort(byte[]) is not applicable
      (argument mismatch; int cannot be converted to byte[])
    method Arrays.sort(float[]) is not applicable
      (argument mismatch; int cannot be converted to float[])
    method Arrays.sort(double[]) is not applicable
      (argument mismatch; int cannot be converted to double[])
    method Arrays.sort(Object[]) is not applicable
      (argument mismatch; int cannot be converted to Object[])
    method Arrays.<T#1>sort(T#1[],Comparator<? super T#1>) is not applicable
      (cannot infer type-variable(s) T#1
        (actual and formal argument lists differ in length))
    method Arrays.<T#2>sort(T#2[],int,int,Comparator<? super T#2>) is not applicable
      (cannot infer type-variable(s) T#2
        (actual and formal argument lists differ in length))
  where T#1,T#2 are type-variables:
    T#1 extends Object declared in method <T#1>sort(T#1[],Comparator<? super T#1>)
    T#2 extends Object declared in method <T#2>sort(T#2[],int,int,Comparator<? super T#2>)
Main.java:13: error: array required, but int found
            if(d[i+1] > d[i])++ans;
                ^
Main.java:13: error: array required, but int found
            if(d[i+1] > d[i])++ans;
                         ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
4 errors
Language: C++

n = gets.to_i
d = []
n.times {
    d << gets.to_i
}
p d.uniq.size

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = gets.to_i
      | ^
a.cc:6:1: error: 'p' does not name a type
    6 | p d.uniq.size
      | ^
Language: C++

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

int main(){
 int n,Y,y;
 cin >> n >> Y;
 y = Y/1000;
 
 for(int i=0; i<=n; i++){
   for(int j=0; j<=n-i; j++){
       int k=n-i-j;
       if(10*i+5*j+k==y){
         cout << i << " " << j << " " << k << endl;
         return 0;
       }
     }
   }
 }
  
  cout << "-1 -1 -1" << endl;
  return 0;
}

Compiler output:
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout << "-1 -1 -1" << endl;
      |   ^~~~
a.cc:23:3: error: expected unqualified-id before 'return'
   23 |   return 0;
      |   ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

int main()
{
   int N,Y,z;
   cin >> N >> Y;
   for(int x=0;x<N;x++){
      for(int y = 0;y <N;y++){
         z = N-x-y;
         if(z >= 0 && Y == 10000*x+5000*y+1000*z)break;
      }
   }
   cout << x << " " << y << " " << z<< endl;

   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'x' was not declared in this scope
   14 |    cout << x << " " << y << " " << z<< endl;
      |            ^
a.cc:14:24: error: 'y' was not declared in this scope
   14 |    cout << x << " " << y << " " << z<< endl;
      |                        ^
Language: C++

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

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

  if(Y % 1000 != 0){
    cout << "-1 -1 -1" << endl;
  }

  int a, b, c;
  int sum;

  else{
    bool G = false

    for(int i = 0; i < N; i++){
      for(int j = 0; j < N; j++){
        sum = 10000 * i + 5000 * j + 1000 * (N - i - j);
        if(sum == Y){
          int N - i - j = k;
          cout << "i j k" << endl;
          G = true;
          break;
        }

      }
      while(G) break;
    }
  }
}

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

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int y = sc.nextInt();
        for(int i = 0 ; i < n ; i ++){
        	for(int j = 0 ; j < n-i ; j ++){
            	for(int k = 0 ; k < n-i-j ; k++){
                	if(n == 10000*i + 5000*j + 1000*k){
                    	System.out.println(i + " " + j + " " + k);
                      	return;
                    }
                }
            }
        }
      	System.out.println("-1 -1 -1");
      
    }
}


Compiler output:
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner sc = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  /////入力部/////
  int N; //総数
  int POINT=1; //POINT
  int sum_norm; //金額の合計
  
  cin >> N >> sum_norm; //総数と金額を代入
  
  for(int i=0;i<N+1;i++){ //一万円のところ
    //if(sum_norm<10000*i)break;
    int sum_ans=0;
    for(int j=0;j<N+1;j++){ //五千円のところ
      ///// 計算部 /////
      sum_ans = 10000*i + 5000*j + 1000*(N-i-j);
      
      //cout<< sum_ans <<endl;
      ///// 判定部と出力部 /////
      if(sum_ans == sum_norm and N>i+j){
        cout << i<<" " << j<<" " << (N-i-j) << endl;//正解のみ
        break;
      }
      //if(i+j>N)break;//間違っているときのみ
    }
  
  if(sum_ans == sum_norm and N>i+j){
    POINT =0;
    break;
  }
    
  }
  if(POINT) cout << -1<<" " << -1<<" " << -1 << endl;
}
      
      
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:28:34: error: 'j' was not declared in this scope
   28 |   if(sum_ans == sum_norm and N>i+j){
      |                                  ^
Language: C

import sys

def main():
    N, Y = [int(_) for _ in input().split()]

    for n_10k in range(N+1):
        for n_5k in range(N - n_10k + 1):
            n_1k = N - n_10k - n_5k

            if n_10k * 10000 + n_5k * 5000 + n_1k * 1000 == Y:
                print(n_10k, n_5k, n_1k)
                sys.exit()

    print(-1,-1,-1)

main()

Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import sys
      | ^~~~~~
main.c:3:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'def'
    3 | def main():
      | ^~~
main.c:3:1: error: unknown type name 'def'
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	int y = sc.nextInt();
        for(int i = 0 ; i < n ; i++){
          for(int j = 0 ; j < n ; j++){
          	 int k = n - i - j ;
            if (10000*i + 5000 * j + 1000 * K == y){
            	System.out.println(i + " " + j + " " + k );
            }
          }
        }
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
            if (10000*i + 5000 * j + 1000 * K == y){
                                            ^
  symbol:   variable K
  location: class Main
1 error
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	int y = sc.nextInt();
        for(int i = 0 ; i < n ; i++){
          for(int j = 0 ; j < n ; j++){
          	 int k = n - i - j ;
            if (10000*i + 5000 * j + 1000 * K == y){
            	System.out.println(i + " " + j + " " + K );
            }
          }
        }
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
            if (10000*i + 5000 * j + 1000 * K == y){
                                            ^
  symbol:   variable K
  location: class Main
Main.java:12: error: cannot find symbol
            	System.out.println(i + " " + j + " " + K );
            	                                       ^
  symbol:   variable K
  location: class Main
2 errors
Language: Java

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
      	int y = sc.nextInt();
        for(int i = 0 ; i < n ; i++){
          for(int j = 0 ; j < n ; j++){
          	 int k = n - i - j ;
            if (10000*i + 5000 * j + 1000 * K == y){
            	System.out.println(i && " " && j && " " && K );
            }
          }
        }
    }
}


Compiler output:
Main.java:11: error: cannot find symbol
            if (10000*i + 5000 * j + 1000 * K == y){
                                            ^
  symbol:   variable K
  location: class Main
Main.java:12: error: bad operand types for binary operator '&&'
            	System.out.println(i && " " && j && " " && K );
            	                     ^
  first type:  int
  second type: String
Main.java:12: error: cannot find symbol
            	System.out.println(i && " " && j && " " && K );
            	                                           ^
  symbol:   variable K
  location: class Main
3 errors
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
      Scanner sc = sc.nextInt();  
      int b = sc.nextInt(); 

      String output = "n";
      int count = 0;
        
        for(int i = 0; i <= a ; i++ ){
            if(output.equals("y")){
                break;
            }
            if(count>a){
                count = 0;
                continue;
            }
            for(int j = 0; j <= a ; j++){
            if(count>a){
                count = 0;
                break;
            }
                for(int k = 0; k <= a ; k++){
                    count = i + j + k;
                    if(10000 * i + 5000 * j + 1000 * k == b && i + j + k == a){
                        System.out.println(i+" "+j+" "+k);
                        output = "y";
                        break;
                    }
                }
            }
        }
    if(output.equals("n")){    
        System.out.println("-1 -1 -1");    
    }    
  }    
}

Compiler output:
Main.java:4: error: incompatible types: int cannot be converted to Scanner
      Scanner sc = sc.nextInt();  
                             ^
Main.java:10: error: cannot find symbol
        for(int i = 0; i <= a ; i++ ){
                            ^
  symbol:   variable a
  location: class Main
Main.java:14: error: cannot find symbol
            if(count>a){
                     ^
  symbol:   variable a
  location: class Main
Main.java:18: error: cannot find symbol
            for(int j = 0; j <= a ; j++){
                                ^
  symbol:   variable a
  location: class Main
Main.java:19: error: cannot find symbol
            if(count>a){
                     ^
  symbol:   variable a
  location: class Main
Main.java:23: error: cannot find symbol
                for(int k = 0; k <= a ; k++){
                                    ^
  symbol:   variable a
  location: class Main
Main.java:25: error: cannot find symbol
                    if(10000 * i + 5000 * j + 1000 * k == b && i + j + k == a){
                                                                            ^
  symbol:   variable a
  location: class Main
7 errors
Language: Java


public class Main{
	public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int a = sc.nextInt();  
      int b = sc.nextInt(); 
      String output = "n";
        
        for(int i = 0; i < a ; i++ ){
            if(output.equals("y")){
                break;
            }
            for(int j = 0; j < a ; j++){
                for(int k = 0; k < a ; k++){
                    if(10000 * i + 5000 * j + 1000 * k == b && i + j + k == a){
                        System.out.println(i+" "+j+" "+k);
                        output = "y";
                        break;
                    }
                }
            }
        }
    if(output.equals("n")){    
        System.out.println("-1 -1 -1" );    
    }    
  }    
}

Compiler output:
Main.java:4: error: cannot find symbol
      Scanner sc = new Scanner(System.in);
      ^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
      Scanner sc = new Scanner(System.in);
                       ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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

int main() {
  int N, Y;
  cin >> N >> Y;
  bool p = false;
  bool q = true;
  
  for (int i = 0; i <= N; i++) {
    for (int j = 0; j <= N; j++) {
      for (int k = 0; k <=N; k++) {
        if (10000 * i + 5000 * j + 1000 * k == Y && i + j + k <= N) {
          cout << i << " " << j << " " << k << endl;
          p = true;
          q = false;
        }
        if(p) break;
      }
    }
  }
  
  if (q) cout << "-1 -1 -1" << endl;

}


Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include <bits/stdc++.h>
      | ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> N >> Y;
      |   ^~~
a.cc:14:11: error: 'cout' was not declared in this scope
   14 |           cout << i << " " << j << " " << k << endl;
      |           ^~~~
a.cc:14:48: error: 'endl' was not declared in this scope
   14 |           cout << i << " " << j << " " << k << endl;
      |                                                ^~~~
a.cc:23:10: error: 'cout' was not declared in this scope
   23 |   if (q) cout << "-1 -1 -1" << endl;
      |          ^~~~
a.cc:23:32: error: 'endl' was not declared in this scope
   23 |   if (q) cout << "-1 -1 -1" << endl;
      |                                ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    int N, Y;
    cin >> N >> Y;
    int man = -1;
    int gosen = -1;
    int sen = -1;

    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            int k = N - i - j;
                if (i+j+k == N && 1000*k + 5000*j + 10000*i == Y) {
                    man = i;
                    gosen = j;
                    sen = k;
                }
            }
        }
    }

    cout << man << " " << gosen << " " << sen << endl;
}

Compiler output:
a.cc:22:5: error: 'cout' does not name a type
   22 |     cout << man << " " << gosen << " " << sen << endl;
      |     ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
int main() {
	int n; // nb
	int y; // yen
	cin >> n >> y;

	int a; // 10000
	int b; // 5000
	int c; // 1000

	for (a = 0; (10000 * a <= ) && (a <= n); a++) {
		for (b = 0; (10000 * a + 5000 * b <= y) && (a + b <= n); b++) {
			if (10000 * a + 5000 * b + 1000 * (n - a - b) == y) {
				cout << a << " " << b << " " << n - a - b;
				return 0;
			}
		}
	}

	cout << "-1 -1 -1" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:35: error: expected primary-expression before ')' token
   15 |         for (a = 0; (10000 * a <= ) && (a <= n); a++) {
      |                                   ^
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int n,y;
	int i,j,flg=0;
	scanf("%d %d",&n,&y);
	for(i=0;i<=n;i++){
		for(j=0;j<=n;j++){
			if(n-(i+j)<0) {
				break;
			}
			if(i+j+n-(i+j)==n&&y==i*10000+j*5000+(n-(i+j))*1000){
				flg=1;
				break;
			}
		}
		if(flg==1) break;
	}
	if(flg==1){
		printf("%d %d %d\n",i,j,n-(i+j));
	}
	else if(flg==0||flg==2){
		printf("-1 -1 -1\n");
	}
	return 0;
}

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

int main() {
    // n枚、Y円
    int n, Y;
    scanf("%d%d", &n, &Y);

    // 10000円札x枚、5000円札y枚、1000円札z枚
    // x + y + z = N
    // 10000x + 5000y + 1000z = Y
    // 3重ループだとTLEするので
    // z = N - x - y => 10000x + 5000y + 1000(N - x - y) = Y

    rep(x, n + 1) {
        rep(y, n + 1) {
            int z = n - (x + y);
            if(10000LL * x + 5000LL * y + 1000LL * z == Y && z >= 0) {
                printf("%d %d %d\n", x, y, z);
                return 0;
            }
        }
    }
    printf("-1 -1 -1\n");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'scanf' was not declared in this scope
    4 |     scanf("%d%d", &n, &Y);
      |     ^~~~~
a.cc:12:9: error: 'x' was not declared in this scope
   12 |     rep(x, n + 1) {
      |         ^
a.cc:12:5: error: 'rep' was not declared in this scope
   12 |     rep(x, n + 1) {
      |     ^~~
a.cc:21:5: error: 'printf' was not declared in this scope
   21 |     printf("-1 -1 -1\n");
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main() {
Language: C

#include <stdio.h>

 

int main()
{
    long cin[2];
    int a, b, c;

 

    for (int i = 0; i < 2; ++i) {
        scanf_s("%d", &cin[i]);
    }

 

    cin[1] = cin[1] / 1000;
    long yn = cin[1] - cin[0];

 

    for (c = 0; c <= cin[0]; c++) {
        b = (yn - 9 * c) / 4;
        if ((yn - 9 * c) % 4 == 0) {
            a = cin[0] - b - c;
            if ((a >= 0) && (yn == 9 * b + 4 * c)) {
                printf("%d %d %d", a, b, c);
                return 0;
            }
        }
    }
    printf("%d %d %d", -1, -1, -1);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   13 |         scanf_s("%d", &cin[i]);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <iostream>

using namespace std;

#define Nfori(N) for(int i=0;i<(N);i++)
#define Nforj(N) for(int j=0;j<(N);j++)

int main(){
  	int N;
  	long long Y;
  	cin >> N >> Y;
  	Nfor(N){
      	Nfor(N-i){
          	if(i*10000+j*5000+(N-i-j)*1000 == Y){
              	cout << i << " " << j << " " << N-i-j << endl;
              	return 0;
            }
        }
    }
  	cout << "-1 -1 -1" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'Nfor' was not declared in this scope; did you mean 'Nfori'?
   12 |         Nfor(N){
      |         ^~~~
      |         Nfori
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,Y; cin>>N>>Y;
  for(int i=0;i<=N;i++){
    for(int j=0;j<=N;j++){
      if(N-i-j<0)break;
      if(i*10000+j*5000+(N-i-j)*1000==Y){
        cout<<i<<" "<<j<<" "<<k<<endl;
        return 0;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: 'k' was not declared in this scope
    9 |         cout<<i<<" "<<j<<" "<<k<<endl;
      |                               ^
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[] a = new int[n];
		for(int i=0; i<n; i++){
			a[i] = scn.nextInt();
		}
      	int k = -1;
      	int k5 = -1;
      	int k10 = -1;
      	int num = 0;
      	for(int i=0; i<=n; i++){
          for(int j=0; j<=n-i; j++){
            num = 1000*i + 5000*j + 10000*(n-j-i);
            if(num==y){
              k=i;
              k5=j;
              k10=n-j-i;
            }
          }
        }
      	Sytem.out.println(k + " " + k5 + " " + k10);
	}
}


Compiler output:
Main.java:18: error: cannot find symbol
            if(num==y){
                    ^
  symbol:   variable y
  location: class Main
Main.java:25: error: package Sytem does not exist
      	Sytem.out.println(k + " " + k5 + " " + k10);
      	     ^
2 errors
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[] a = new int[n];
		for(int i=0; i<n; i++){
			a[i] = scn.nextInt();
		}
      	int k = -1;
      	int 5k = -1;
      	int 10k = -1;
      	int num = 0;
      	for(int i=0; i<=n; i++){
          for(int j=0; j<=n-i; j++){
            num = 1000*i + 5000*j + 10000*(n-j-i);
            if(num==y){
              k=i;
              5k=j;
              10k=n-j-i;
            }
          }
        }
      	Sytem.out.println(k + " " + 5k + " " + 10k);
	}
}

Compiler output:
Main.java:12: error: not a statement
      	int 5k = -1;
      	^
Main.java:12: error: ';' expected
      	int 5k = -1;
      	   ^
Main.java:13: error: not a statement
      	int 10k = -1;
      	^
Main.java:13: error: ';' expected
      	int 10k = -1;
      	   ^
Main.java:20: error: not a statement
              5k=j;
              ^
Main.java:20: error: ';' expected
              5k=j;
               ^
Main.java:21: error: not a statement
              10k=n-j-i;
              ^
Main.java:21: error: ';' expected
              10k=n-j-i;
                ^
Main.java:25: error: ')' or ',' expected
      	Sytem.out.println(k + " " + 5k + " " + 10k);
      	                             ^
Main.java:25: error: not a statement
      	Sytem.out.println(k + " " + 5k + " " + 10k);
      	                                     ^
Main.java:25: error: ';' expected
      	Sytem.out.println(k + " " + 5k + " " + 10k);
      	                                         ^
Main.java:25: error: ';' expected
      	Sytem.out.println(k + " " + 5k + " " + 10k);
      	                                          ^
12 errors