criyle/codenet-compile-errors huggingface dataset:
Language: Java


public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int Y = sc.nextInt();
        boolean exist;
        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(Y==i*10000+j*1000+K*100){
                        System.out.println(i+" "+j+" "+k);
                        return;
                    }
                }
            }
        }
        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
Main.java:11: error: cannot find symbol
                    if(Y==i*10000+j*1000+K*100){
                                         ^
  symbol:   variable K
  location: class Main
3 errors
Language: C++

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

int main () {
    int N, Y; cin >> N >> Y;
    int x = -1, y = -1, z = -1, tmp, total;
    for (int i = 0; i <= N; i++) {
        for (int j = 0; j <= N; j++) {
            tmp = n - i - j;
            total = i*10000 + j*5000 + tmp*1000;
            if (total == Y) {
                x = i;
                y = j;
                z = tmp;
            }
        }
    }
    printf("%d %d %d\n", x, y, z);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'n' was not declared in this scope
   10 |             tmp = n - i - j;
      |                   ^
Language: C++

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

int main () {
    int n, y; cin >> n >> y;
    int x = -1, y = -1, z = -1, tmp, total;
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= n; j++) {
            tmp = n - i - j
            total = i*10000 + j*5000 + tmp*1000;
            if (total == y) {
                x = i;
                y = j;
                z = tmp;
            }
        }
    }
    printf("%d %d %d\n", x, y, z);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: redeclaration of 'int y'
    7 |     int x = -1, y = -1, z = -1, tmp, total;
      |                 ^
a.cc:6:12: note: 'int y' previously declared here
    6 |     int n, y; cin >> n >> y;
      |            ^
a.cc:10:28: error: expected ';' before 'total'
   10 |             tmp = n - i - j
      |                            ^
      |                            ;
   11 |             total = i*10000 + j*5000 + tmp*1000;
      |             ~~~~~
Language: C++

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

int main(){

    int n,y;
    scanf("%d", &n);
    scanf("%d", &y);
    int n1 = -1;
    int n2 = -1;
    int n3 = -1;
    bool flag = false;

    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= n - x; j++){
            if(10000 * i + 5000 * j + 1000 * (n-i-j) == y){
                falg = true;
                n1 = i;
                n2 = j;
                n3 = n - i - j;
                break;
            }
        }
        if(flag){
            break;
        }
    }
    ptinf("%d %d %d",n1,n2,n3);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:33: error: 'x' was not declared in this scope
   16 |         for(int j = 0; j <= n - x; j++){
      |                                 ^
a.cc:18:17: error: 'falg' was not declared in this scope; did you mean 'flag'?
   18 |                 falg = true;
      |                 ^~~~
      |                 flag
a.cc:29:5: error: 'ptinf' was not declared in this scope; did you mean 'printf'?
   29 |     ptinf("%d %d %d",n1,n2,n3);
      |     ^~~~~
      |     printf
Language: C++

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


int Len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}


int Sint(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}


int Svec(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}


int GCD(int a,int b){
  int r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return b;
}


int LCM(int a,int b){
  int c=a,d=b,r,tmp;
/*自然数 a > b を確認・入替*/
  if(a<b){
    tmp=a,a=b,b=tmp;
  }
/*ユークリッドの互除法*/
  r=a%b;
  while(r!=0){
    a=b,b=r,r=a%b;
  }
  return c/b*d;
}


int Factorial(int n){
  int m=1;
  while(n>=1) m*=n,n--;
  return m;
}


/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  int n,y;
  cin>>n>>y;
  for(int i=0;i<=n;i++){
    for(int j=0;j<=n-i;j++){
      if(y-10000*i-5000*j)/1000<=n-i-j){
        cout<<i<<' '<<j<<' '<<(10000*i+5000*j)/1000<<endl;
        return 0;
      }
    }
  }
  
  cout<<-1<<' '-1<<' '<<-1<<endl;
  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:73:27: error: expected primary-expression before '/' token
   73 |       if(y-10000*i-5000*j)/1000<=n-i-j){
      |                           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int N,M;
	cin>>N>>M;
	int n1,n2,n3;
	int a,b,c;
	a=10000;b=5000;c=1000;
	int s1=-1,s2=-1,s3=-1;
	if(N*a<M||c*N>M)
	{
		s1=s2=s3=-1;
	}
	else
	{
		
		n1 = M/a;
		for(n1;i>=0;i--)
		{
			int flag=0;
			n2 = (M-i*a)/b;
			for(n2;j>=0;j--)
			{
				n3=(M-i*a-j*b)/c;
				if(i+j+n3==N&&i*a+j*b+n3*c==M)
				{
					s1=i;
					s2=j;
					s3=n3;
					flag=1;
					break;
				}
			}
			if(flag==1) break;
		}
	}
	cout<<s1<<" "<<s2<<" "<<s3<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:24: error: 'i' was not declared in this scope
   20 |                 for(n1;i>=0;i--)
      |                        ^
a.cc:24:32: error: 'j' was not declared in this scope
   24 |                         for(n2;j>=0;j--)
      |                                ^
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	m=m/1000;
	for(int i=0;i<=2000;i++){
		for(int j=0;j<=4000;j++){
			if(i+j+k==n&&i*10+j*5+k*1==m){
					cout<<i<<' '<<j<<' '<<k<<endl;
					return 0;
				}
		}
	}
	cout<<-1<<' '<<-1<<' '<<-1<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: 'k' was not declared in this scope
   11 |                         if(i+j+k==n&&i*10+j*5+k*1==m){
      |                                ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    int n,s;cin>>n>>s;
    if(s % 1000 != 0) {
        printf("-1 -1 -1\n");
    } else {
        s /= 1000;
        for(int i = 0;i <= 20000;i++) {1000
            for(int j = 0;j <= 10000;j++) {2000
                if(i + j*5 > s) {
                    continue;
                }
                if( ((s - (i + j*5)) % 10 == 0 ) ) {
                    if(i + j + ((s - (i + j*5))/10) == n) {
                        printf("%d %d %d\n",((s - (i + j*5))/10),j,i);
                        return 0;
                    }
                }
            }
        }
        printf("-1 -1 -1\n");
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:44: error: expected ';' before 'for'
   11 |         for(int i = 0;i <= 20000;i++) {1000
      |                                            ^
      |                                            ;
   12 |             for(int j = 0;j <= 10000;j++) {2000
      |             ~~~                             
a.cc:12:27: error: 'j' was not declared in this scope
   12 |             for(int j = 0;j <= 10000;j++) {2000
      |                           ^
Language: C

#include <bits/stdc++.h>

using namespace std;

tuple<int, int, int> solve() {
  int N, Y;
  cin >> N >> Y;
  Y /= 1000;
  for (int i = 0; i <= N && i * 10 <= Y; ++i) {
    for (int j = 0; i + j <= N && i * 10 + j + 5 <= Y; ++j) {
      int k = N - i - j;
      if (10 * i + 5 * j + k == Y) {
        return {i, j, k};
      }
    }
  }
  return make_tuple(-1, -1, -1);
}

int main() {
  int i, j, k;
  tie(i, j, k) = solve();
  cout << i << " " << j << " " << k << 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++

int main() {
	int N, Y;
	cin >> N >> Y;
	int res10000 = -1, res5000 = -1, res1000 = -1;
	for (int a = 0; a <= N; ++a) {  
		for (int b = 0; b + a <= N; ++b) {  
			int c = N - a - b;  
			int total = 10000 * a + 5000 * b + 1000 * c;
			if (total == Y) {  
				res10000 = a;
				res5000 = b;
				res1000 = c;
				break;
			}
		}
	}

	cout << res10000 << " " << res5000 << " " << res1000 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N >> Y;
      |         ^~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << res10000 << " " << res5000 << " " << res1000 << endl;
      |         ^~~~
a.cc:18:65: error: 'endl' was not declared in this scope
   18 |         cout << res10000 << " " << res5000 << " " << res1000 << endl;
      |                                                                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int Y;
  cin >> N >> Y;
  int count=0;
  for(int x=0;x<=N;x++){
    for(int y=0;y<=N-x;y++){
      if(x*10000+y*5000+(N-x-y)*1000==Y){
        count++;
        cout << x << " " << y << " " << z << endl;
        break;
      }
    }
  }
  if(count ==0){
  cout << -1 << " " << -1 << " " << -1 << endl;
  }
}
        

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

int main()  {
// Nは札の枚数の合計、Yは金額の総和
  int N, Y;
  cin >> N >> Y;
  bool f = false;
  bool t = false;
  int x, y;
// xは10000円札の枚数、yは５０００円札の枚数,s/1000は１０００円札の枚数
  for (int x = 0; x <= N; x++) {
    for (int y = 0; y <= N; y++) {
      int s = Y - 10000*x - 5000*y;
        if (s >= 0 && s % 1000 == 0 && x + y + s/1000 == N)  {
           f = true;t = true; 
          cout << x << " " << y << " " << s/1000 << endl;    
           break;
        }
      
      }
    if (t) break;
  }
if (f == false) cout << -1 << " " << -1 << " " << -1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> N >> Y;
      |   ^~~
a.cc:14:11: error: 'cout' was not declared in this scope
   14 |           cout << x << " " << y << " " << s/1000 << endl;
      |           ^~~~
a.cc:14:53: error: 'endl' was not declared in this scope
   14 |           cout << x << " " << y << " " << s/1000 << endl;
      |                                                     ^~~~
a.cc:21:17: error: 'cout' was not declared in this scope
   21 | if (f == false) cout << -1 << " " << -1 << " " << -1 << endl;
      |                 ^~~~
a.cc:21:57: error: 'endl' was not declared in this scope
   21 | if (f == false) cout << -1 << " " << -1 << " " << -1 << endl;
      |                                                         ^~~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main() {
	int n,y;
	cin >> n >> y;
	int res1000 = -1;
	int res5000 = -1;
	int res10000 = -1;
	for (int a = 0;a <= n;++a) {
		for (int b = 0;b <= n - a;++b) {
			int c = n - a - b;
			int total = 10000 * a + 5000 * b + 1000 * c;
			if (total == y) {
				res10000 = a;
				res5000 = b;
				res1000 = c;
			}
		}
	}
	cout << a << "" << b << "" << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:17: error: 'a' was not declared in this scope
   26 |         cout << a << "" << b << "" << c << endl;
      |                 ^
a.cc:26:28: error: 'b' was not declared in this scope
   26 |         cout << a << "" << b << "" << c << endl;
      |                            ^
a.cc:26:39: error: 'c' was not declared in this scope
   26 |         cout << a << "" << b << "" << c << endl;
      |                                       ^
Language: C++

    int main() {
    int N,Y;
    cin >> N >> Y;
    int EN10000=-1,EN5000=-1,EN1000=-1;

    bool flag = false;
    for(int i=0; i<=N; i++){
        for(int j=0; j<=N; j++){
            int s = Y - i*10000 - j*5000;
            int sn = N - i - j;
            if ( s == sn*1000 && sn >= 0 ) {
                EN10000 = i;
                EN15000 = j;
                EN1000 = sn;
                flag = true;
                break;
                }
            }
            if(flag) break;
        }
        cout << EN10000 << " " << EN15000 << " " << EN1000 << endl;
        return 0;
        }

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> Y;
      |     ^~~
a.cc:13:17: error: 'EN15000' was not declared in this scope; did you mean 'EN1000'?
   13 |                 EN15000 = j;
      |                 ^~~~~~~
      |                 EN1000
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << EN10000 << " " << EN15000 << " " << EN1000 << endl;
      |         ^~~~
a.cc:21:35: error: 'EN15000' was not declared in this scope; did you mean 'EN1000'?
   21 |         cout << EN10000 << " " << EN15000 << " " << EN1000 << endl;
      |                                   ^~~~~~~
      |                                   EN1000
a.cc:21:63: error: 'endl' was not declared in this scope
   21 |         cout << EN10000 << " " << EN15000 << " " << EN1000 << endl;
      |                                                               ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N,Y;
    int ans[3]={-1,-1,-1};
    cin >> N >> Y;
    for(int i=0;i<=N;i++){
        for(int k=0;k<=N-i;k++){
                if(i*10000+k*5000+(N-i-k)*1000==Y){
                    ans[0]=i;
                    ans[1]=k;
                    ans[2]=j;
                    break;
                
            }
        }
    }
    cout << ans[0] << " "<< ans[1] << " "<< ans[2];
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: 'j' was not declared in this scope
   13 |                     ans[2]=j;
      |                            ^
Language: Java

public class Main {

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

		int num = scan.nextInt();
		int amountOfMoney = scan.nextInt();

		scan.close();

		for(int i = 0; i <= num; i++) {
			for(int j = 0; j <= num - i; j++) {
				for(int k = 0 ; k <= num - i - j; k++) {
					if(10000 * i + 5000 * j + 1000 * k == amountOfMoney) {
						System.out.println(i + " " + j + " " + k);
						return;
					}
				}
			}
		}
		System.out.println(-1 + " " + -1 + " " + -1);

	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scan = 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,Y;
  cin >> N >> Y; 
  for(int i = 0; i < N){
    for(int j = 0; j < N - i){
      int p = 10000* i + 5000*j + 1000*(N - i - j);
      
      if(p == Y){
        cout << i << ' ' << j <<' '<< N - i - j << endl;
        break;
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: expected ';' before ')' token
    7 |   for(int i = 0; i < N){
      |                       ^
      |                       ;
a.cc:8:29: error: expected ';' before ')' token
    8 |     for(int j = 0; j < N - i){
      |                             ^
      |                             ;
Language: C++

#include <iostream>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:63: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |                     std::cout << x << ' ' << y << ' ' << z << endl;
      |                                                               ^~~~
      |                                                               std::endl
In file included from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:32: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |     std::cout << "-1 -1 -1" << endl;
      |                                ^~~~
      |                                std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N, Y;
    cin >> N >> Y;
    int res10000 = -1, res5000 = -1, res1000 = -1;
    for (int a = 0; a <= N; ++a) {  // 10000円の枚数を 0 〜 N で調べる
        for (int b = 0; b + a <= N; ++b) {  // 5000円の枚数を 0 〜 N-a で調べる
            int c = N - a - b;  // 1000円の枚数は決まる
            int total = 10000*a + 5000*b + 1000*c;
            if (total == Y) {  // 答えが見つかったら
                res10000 = a;
                res5000 = b;
                res1000 = c;
            }
        }
    }

    // 答えを出力 (見つかっていなくても -1 -1 -1 になるので OK です)
    cout << res10000 << " " << res5000 << " " << res1000 << endl;
}
【コ

Compiler output:
a.cc:23:1: error: extended character 【 is not valid in an identifier
   23 | 【コ
      | ^
a.cc:23:1: error: '\U00003010\U000030b3' does not name a type
   23 | 【コ
      | ^~~~
Language: C++

#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, y;
    cin >> n >> y;
    y /= 1000;
    for (int a = 0; a <= n; ++a)
        for (int b = 0; b <= n - a; ++b)
            if (a + 5 * b + (n - a - b) * 10 == y)
                return cout << a << ' ' << b << ' ' << c, 0;
    cout << "-1 -1 -1";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:56: error: 'c' was not declared in this scope
   20 |                 return cout << a << ' ' << b << ' ' << c, 0;
      |                                                        ^
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 a=0;a<=N;a++){
            for(int b=0;b<=N-a;b++){
                int c = N-a-b;
                int total = a*10000 + b*5000 + c*1000;
                if(total == Y){
                    System.out.println(a+" "+b+" "+c);
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
}

Compiler output:
Main.java:4: error: cannot find symbol
    public static void main(string[] args){
                            ^
  symbol:   class string
  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 a=0;a<=N;a++){
            for(int b=0;b<=N-a,b++){
                int c = N-a-b;
                int total = a*10000 + b*5000 + c*1000;
                if(total == Y){
                    System.out.println(a+" "+b+" "+c);
                    return;
                }
            }
        }

        System.out.println("-1 -1 -1");
    }
}

Compiler output:
Main.java:10: error: ';' expected
            for(int b=0;b<=N-a,b++){
                              ^
1 error
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'k' was not declared in this scope
   11 |       k = N - (i + j);
      |       ^
a.cc:24:23: error: 'k' was not declared in this scope
   24 |     cout << i << j << k << endl;
      |                       ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'k' was not declared in this scope
   11 |       k = N - (i + j);
      |       ^
a.cc:24:13: error: 'i' was not declared in this scope
   24 |     cout << i << j << k << endl;
      |             ^
a.cc:24:18: error: 'j' was not declared in this scope
   24 |     cout << i << j << k << endl;
      |                  ^
a.cc:24:23: error: 'k' was not declared in this scope
   24 |     cout << i << j << k << endl;
      |                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  // お札数, 合計金額
  long long N, Y;
  cin >> N >> Y;
  // 1万円札の枚数
  for (long long lTenTh = 0; lTenTh <= N; lTenTh++)
  {
    // 5千円札の枚数
    for (long long lFifTh = 0; lFifTh <= (N - lTenTh); nFifTh++)
    {
      // 千円札は1万円札と5千円札の枚数を差っ引いた枚数で出す
      if (((10000 * lTenTh) + (5000 * lFifTh) + (1000 * (N - lTenTh - lFifTh))) == Y)
      {
        // 枚数に対する合計金額が一致したら終了
        cout << lTenTh << " " << lFifTh << " " << (N - lTenTh - lFifTh) << endl;
        return 0;
      }
    }
  }
  // 一致しない
  cout << "-1 -1 -1" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:56: error: 'nFifTh' was not declared in this scope; did you mean 'lFifTh'?
   12 |     for (long long lFifTh = 0; lFifTh <= (N - lTenTh); nFifTh++)
      |                                                        ^~~~~~
      |                                                        lFifTh
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:35:25: error: invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
   35 |     cout << I + " " + J + " " + K + " " << endl;
      |             ~~~~~~~~~~~ ^ ~~~
      |                     |     |
      |                     |     const char [2]
      |                     const char*
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:32:13: error: 'i' was not declared in this scope
   32 |     cout << i + " " + j + " " + k + " " << endl;
      |             ^
a.cc:32:23: error: 'j' was not declared in this scope
   32 |     cout << i + " " + j + " " + k + " " << endl;
      |                       ^
a.cc:32:33: error: 'k' was not declared in this scope
   32 |     cout << i + " " + j + " " + k + " " << endl;
      |                                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, y;cin>>n>>y;
  int res10000=-1, res5000=-1, res1000=-1;
  for(int a=0;a<=n;a++){
    for(int b=0; a+b<=n;b++){
      c=n-a-b; int total= 10000*a+5000*b+1000*c;
      if(total==y){
        res10000=a;
        res5000=b;
        res1000=c;
      }
    }
  }
  cout<<res10000<<" "<<res5000<<" "<<res1000<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'c' was not declared in this scope
    8 |       c=n-a-b; int total= 10000*a+5000*b+1000*c;
      |       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, y;cin>>n>>y;
  int res10000=-1, res5000=-1, res1000=-1;
  for(int a=0;a<=n;a++){
    for(int b=0; a+b<=n;b++){
      c=n-a-b; total= 10000*a+5000*b+1000*c;
      if(total==y){
        res10000=a;
        res5000=b;
        res1000=c;
      }
    }
  }
  cout<<res10000<<" "<<res5000<<" "<<res1000<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'c' was not declared in this scope
    8 |       c=n-a-b; total= 10000*a+5000*b+1000*c;
      |       ^
a.cc:8:16: error: 'total' was not declared in this scope
    8 |       c=n-a-b; total= 10000*a+5000*b+1000*c;
      |                ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, y;cin>>n>>y;
  int res10000=-1, res5000=-1, res1000=-1;
  for(int a=0;a<=N;a++){
    for(int b=0; a+b<=N;b++){
      c=N-a-b; total= 10000*a+5000*b+1000*c;
      if(total==y){
        res10000=a;
        res5000=b;
        res1000=c;
      }
    }
  }
  cout<<res10000<<" "<<res5000<<" "<<res1000<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 'N' was not declared in this scope
    6 |   for(int a=0;a<=N;a++){
      |                  ^
a.cc:8:7: error: 'c' was not declared in this scope
    8 |       c=N-a-b; total= 10000*a+5000*b+1000*c;
      |       ^
a.cc:8:16: error: 'total' was not declared in this scope
    8 |       c=N-a-b; total= 10000*a+5000*b+1000*c;
      |                ^~~~~
Language: C++

#include<bits/stdc++.h>
int main(){
  int n, y;cin>>n>>y;
  int res10000=-1, res5000=-1, res1000=-1;
  for(int a=0;a<=N;a++){
    for(int b=0; a+b<=N;b++){
      c=N-a-b; total= 10000*a+5000*b+1000*c;
      if(total==y){
        res10000=a;
        res5000=b;
        res1000=c;
      }
    }
  }
  cout<<res10000<<" "<<res5000<<" "<<res1000<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 |   int n, y;cin>>n>>y;
      |            ^~~
      |            std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:5:18: error: 'N' was not declared in this scope
    5 |   for(int a=0;a<=N;a++){
      |                  ^
a.cc:7:7: error: 'c' was not declared in this scope
    7 |       c=N-a-b; total= 10000*a+5000*b+1000*c;
      |       ^
a.cc:7:16: error: 'total' was not declared in this scope
    7 |       c=N-a-b; total= 10000*a+5000*b+1000*c;
      |                ^~~~~
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<res10000<<" "<<res5000<<" "<<res1000<<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:47: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<res10000<<" "<<res5000<<" "<<res1000<<endl;
      |                                               ^~~~
      |                                               std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/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 i,j,k,n,y;cin>>n>>y;
  int ans[3]={-1};
  for(i=0;i<n;i++){for(j=0;j<n;j++){if(10000*i+5000*j+1000*(n-i-j)==y){ans[0]=i;ans[1]=j;ans[2]=n-i-j;}}}
  cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<endl;
}


Compiler output:
a.cc:7:43: error: empty character constant
    7 |   cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<endl;
      |                                           ^~
Language: C++

#include<bits/stdc++.h>
int main(){
  int i,j,k,n,y;cin>>n>>y;
  int ans[3]={-1};
  for(i=0;i<n;i++){for(j=0;j<n;j++){if(10000*i+5000*j+1000*(n-i-j)==y){ans[0]=i;ans[1]=j;ans[2]=n-i-j;}}}
  cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<endl;
}

Compiler output:
a.cc:6:43: error: empty character constant
    6 |   cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<endl;
      |                                           ^~
a.cc: In function 'int main()':
a.cc:3:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    3 |   int i,j,k,n,y;cin>>n>>y;
      |                 ^~~
      |                 std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 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:6:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<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:6:47: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   cout<<ans[0]<<' '<<ans[1]<<' '<<ans[2]<<''<<endl;
      |                                               ^~~~
      |                                               std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: Java

import java.util.*;

public class Main {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long Y = sc.nextLong();
        sc.clone();

        long num_10000 = -1;
        long num_5000 = -1;
        long num_1000 = -1;

        long target = Y - 1000 * N;
        long tmp = -1;

        for (int i = 0; i <= N; i++) {
            if ((target - 9000 * i) % 4000 == 0) {
                tmp = (target - 9000 * i) / 4000;
                if ((tmp >= 0) && (N - tmp - i) >= 0) {
                    num_10000 = i;
                    num_5000 = tmp;
                    num_1000 = N - num_10000 - num_5000;
                    break;
                }
            }
        }

        System.out.println(num_10000 + " " + num_5000 + " " + num_1000);
    }
}

Compiler output:
Main.java:8: error: clone() has protected access in Object
        sc.clone();
          ^
1 error
Language: C++

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

#define sen 1000
#define gosen 5000
#define man 10000

int main() {
	int n,y;
	
	cin >> n >> y;
	
	for (int i=n;i>=0;i--){
		for (int j=n-i;j>=0;j--){
			for (int k=n-i-j;k>=0;k--){
				long long sum = i*sen + j*gosen + man*k;
				if (sum == y) {
					count << i << " " << j << " " << k << endl;
					return 0;
				} else if (sum > y) {
					break;
				}
			}
		}
	}
	count << -1 << " " << -1 << " " << -1 << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:47: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   18 |                                         count << i << " " << j << " " << k << endl;
      |                                         ~~~~~~^~~~
a.cc:26:15: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator<<'
   26 |         count << -1 << " " << -1 << " " << -1 << endl;
      |         ~~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N, Y;
    cin >> N >> Y;
    int res10000 = -1, res5000 = -1, res1000 = -1;
    for(int a = 0; a <= N; ++a) {
        for(int b = 0; b + a <= N; ++b) {
            int c = N - a - b;
            int total = 10000*a + 5000*b 1000*c;
            if(total == Y) {
                res10000 = a;
                res5000 = b;
                res1000 = c;
            }
        }
    }
    cout << res10000 << " " << res5000 << " " << res1000 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:42: error: expected ',' or ';' before numeric constant
   11 |             int total = 10000*a + 5000*b 1000*c;
      |                                          ^~~~
Language: Java

import java.util.*;

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


Compiler output:
Main.java:10: error: variable k might not have been initialized
                int k = n - j + k;
                                ^
1 error
Language: Java

import java.util.*;

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


Compiler output:
Main.java:17: error: unreachable statement
        System.out.println("-1 -1 -1");
        ^
1 error
Language: Java

import java.util.*;

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


Compiler output:
Main.java:16: error: unreachable statement
        System.out.println("-1 -1 -1");
        ^
1 error
Language: C++

#include <stdio.h>

int main{
	int N;
	long Y;
	int x=0, y=0, z=0;
	scanf("%d %d",N ,Y);
	
	while(1){
		if(Y>10000){
			x++:
			Y -= 10000;
		}else if(Y>5000){
			y++:
			Y -= 5000;
		}else if(Y>1000){
			z++:
			Y -= 1000;
		}else if(Y==0){
			break;
		}else{
			printf("-1 -1 -1");
			return 0;
		}
	}
	
	
	for(int i = 0; i<x; i++){
		for(int j = 0; j<x; j++){
			for(int k = 0; k<y; k++){
				i = 0;
				if(((x-i-j)+(y-k+2*j)+z+i*10+k*5) == N){
					printf("%d %d %d", (x-i-j), (y-k+2*j), z+i*10+k*5))
					return 0;
				}
			}
		}
	}
}

Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:9: error: expected primary-expression before 'int'
    4 |         int N;
      |         ^~~
a.cc:4:9: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:7:14: error: expected constructor, destructor, or type conversion before '(' token
    7 |         scanf("%d %d",N ,Y);
      |              ^
a.cc:9:9: error: expected unqualified-id before 'while'
    9 |         while(1){
      |         ^~~~~
a.cc:28:9: error: expected unqualified-id before 'for'
   28 |         for(int i = 0; i<x; i++){
      |         ^~~
a.cc:28:24: error: 'i' does not name a type
   28 |         for(int i = 0; i<x; i++){
      |                        ^
a.cc:28:29: error: 'i' does not name a type
   28 |         for(int i = 0; i<x; i++){
      |                             ^
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
 
int main() {
  int N;
  int Y;
  cin >> N >> Y;
  
  int res10000 = -1, res5000 = -1 , res1000 = -1;
  for(int a =0 ; a <= N ; ++a){
  	for(int b =0 ; b +a <= N  ; ++b){
      int c = N -a -b;
      int total = 10000*a + 5000*b + 1000*c;
      it(total == Y){
        res10000=a;
        res5000=b;
        res1000=c;
      }
    }
  }
  cout << res10000 << " " << res5000 << " " << res1000 << endl;
  cout << -1 << " " << -1 << " " << -1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'it' was not declared in this scope; did you mean 'int'?
   14 |       it(total == Y){
      |       ^~
      |       int
Language: C++

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


int main(){

int n,y;
cin >> n >> y;
int co=0;
int a,b,c;
a=y/10000;
b=y/5000;
c=y/1000;


    rep(j,b+1){
        rep(k,c+1){
            if(y==(n-j-k)*10000+j*5000+k*1000 and i+j+k==n){
                cout << i << " " << j << " " << k << endl;
                co++;
                break;
            }
        }
        if(co!=0)break;
    }

if(co==0)cout << -1 << " " << -1 << " " << -1 << endl;
return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:19:51: error: 'i' was not declared in this scope
   19 |             if(y==(n-j-k)*10000+j*5000+k*1000 and i+j+k==n){
      |                                                   ^
Language: C++

#include<iostream>
#include<string>
#include <vector>
#include<map>
#include<algorithm>
#include<iomanip>
#include<cmath>
using namespace std;
using vi = vector<int>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<int, int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define vsort(v) sort(v.begin(), v.end())
#define rv(v) reverse(v.begin(), v.end())
#define ll long long
const ll MOD = 1e9 + 7;

int main() {
	int n;
	ll y;
	cin >> n >> y;
	int a = 0, b = 0, c = 0;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n - i && flag; j++) {
			int k = n - i - j;
			if (y == 10000 * i + 5000 * j + 1000 * k) {
				a = i;
				b = j;
				c = k;
			}
		}
	}
	cout << a << " " << b << " " << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:47: error: 'flag' was not declared in this scope
   25 |                 for (int j = 0; j <= n - i && flag; j++) {
      |                                               ^~~~
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-i;j++){
            int k=n-i-j;
                if((i*10000+j*5000+k*1000==y) {
                    cout<<i<<' '<<j<<' '<<k<<endl;
                    return 0;
                }
        }
    }
        cout << "-1 -1 -1" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:46: error: expected ')' before '{' token
    9 |                 if((i*10000+j*5000+k*1000==y) {
      |                   ~                          ^~
      |                                              )
a.cc:13:9: error: expected primary-expression before '}' token
   13 |         }
      |         ^
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-x;j++){
            int k=n-i-j;
                if((i*10000+j*5000+k*1000==y) {
                    cout<<i<<' '<<j<<' '<<k<<endl;
                    return 0;
                }
        }
    }
        cout << "-1 -1 -1" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: 'x' was not declared in this scope
    7 |         for(int j=0;j<n-x;j++){
      |                         ^
a.cc:9:46: error: expected ')' before '{' token
    9 |                 if((i*10000+j*5000+k*1000==y) {
      |                   ~                          ^~
      |                                              )
a.cc:13:9: error: expected primary-expression before '}' token
   13 |         }
      |         ^
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<math.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;

int main() {
    int n,y; cin>>n>>y;
    bool finished=0
    
    rep(i,n){
        rep(j,n){
            rep(k,n){
                int count=i*10000+j*5000+k*1000;
                if((count==y && i+j+k==n) && finished==0) {
                    cout << i << j << k << endl;
                    break;
                }
            }
        }
    }
    if(finished==0) {
        cout << "-1 -1 -1" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: expected ',' or ';' before 'for'
    5 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                  ^~~
a.cc:12:5: note: in expansion of macro 'rep'
   12 |     rep(i,n){
      |     ^~~
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     rep(i,n){
      |         ^
a.cc:5:30: note: in definition of macro 'rep'
    5 | #define rep(i,n) for(int i=0;i<(int)(n);i++)
      |                              ^
Language: C++

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

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

    for(int x = 0; x <= N; x++){
        for(int y = 0; y <= N - x; y++){
            int z = N - x - y;
            if((10000*x + 5000*y + 1000*z) == sum)
                cout << x << ' ' << y << ' ' << z << endl;
            else
                cout << -1 << ' ' << -1 << ' ' << -1 << endl;
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:47: error: 'sum' was not declared in this scope
   12 |             if((10000*x + 5000*y + 1000*z) == sum)
      |                                               ^~~
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int n;  cin >> n;
  ll y;  cin >> y;
  rep(i,n){
    rep(j,n-i+1){
      if(y == 10000*i+5000*j+1000(n-i-j) ){
        cout << i << " " << j << " " << n-i-j;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:34: error: expression cannot be used as a function
   33 |       if(y == 10000*i+5000*j+1000(n-i-j) ){
      |                              ~~~~^~~~~~~
Language: C++

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<tuple>
#include<utility>
#define rep(i,n) for(ll i=0; i<n; i++)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
using ll = long long;
using namespace std;

int main(){
  int n;  cin >> n;
  ll y;  cin >> y;
  int ans = 0;
  rep(i,n){
    rep(j,n-i+1){
      if(y == 10000*i+5000*j+1000(n-i-j)){
        cout << i << " " << j << " " << n-i-j;
        return 0;
      }
    }
  }
  cout << "-1 -1 -1";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:34: error: expression cannot be used as a function
   34 |       if(y == 10000*i+5000*j+1000(n-i-j)){
      |                              ~~~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n); i >= 0; i--)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	int N;
	cin >> Y;
	Y /= 1000;
	bool JD = true;
	string ans = "-1 -1 -1";
	for(int i = 0; i <= N; i++){//10,000JPY
		for(int j = 0; j <= N; j++){//5,000JPY
			int k = N - i - j;//1,000JPY
			if(i * 10 + j * 5 + k == Y){
				cout << i << " " << j << " " << k << endl;
				JD = false;
			}
		}
	}
	if(JD)cout << ans << endl;
}

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'a' was not declared in this scope
   21 |   cout << a <<" "<< b << "  "<< c << endl;
      |           ^
a.cc:21:21: error: 'b' was not declared in this scope
   21 |   cout << a <<" "<< b << "  "<< c << endl;
      |                     ^
a.cc:21:33: error: 'c' was not declared in this scope
   21 |   cout << a <<" "<< b << "  "<< c << endl;
      |                                 ^