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

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

int get_Max_size(int &money, int &base) {
  int count = 0;
  int tmp_money = money;
  for (;;) {
    if (tmp_money - base > 0) {
      tmp_money -= base;
      count += 1;
    } else {
      break;
    }
  }
  return count;
}

int main() {
  int N = 0;
  int Y = 0;
  std::cin >> N;
  std::cin >> Y;
  int x = 0;
  int y = 0;
  int z = 0;

  int x_counter = 0;
  int y_counter = 0;
  int z_counter = 0;

  int max_10000 = get_Max_size(Y, 10000);

  for (int i = 0; i < max_10000 + 1; i++) {
    int tmp_Y = Y - 10000 * i;
    x_counter = i;
    int max_5000 = get_Max_size(tmp_Y, 5000);
    for (int j = 0; j < max_5000 + 1; j++) {
      y_counter = j;
      z_counter = (tmp_Y - 5000 * j) / 1000;

      if (x_counter + y_counter + z_counter == N) {
        std::cout << x_counter << " " << y_counter << " " << z_counter
                  << std::endl;
        return 0;
      }
    }
  }

  std::cout << "-1"
            << " "
            << "-1"
            << " "
            << "-1" << std::endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:35: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   33 |   int max_10000 = get_Max_size(Y, 10000);
      |                                   ^~~~~
a.cc:6:35: note:   initializing argument 2 of 'int get_Max_size(int&, int&)'
    6 | int get_Max_size(int &money, int &base) {
      |                              ~~~~~^~~~
a.cc:38:40: error: cannot bind non-const lvalue reference of type 'int&' to an rvalue of type 'int'
   38 |     int max_5000 = get_Max_size(tmp_Y, 5000);
      |                                        ^~~~
a.cc:6:35: note:   initializing argument 2 of 'int get_Max_size(int&, int&)'
    6 | int get_Max_size(int &money, int &base) {
      |                              ~~~~~^~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class MainC2 {

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

		int N = sc.nextInt();
		int Y = sc.nextInt();

		int r10 = -1;
		int r5 = -1;
		int r1 = -1;

		for (int x = 0; x <= N; x++) {
			for (int y = 0; y + x <=N; y++) {
				int z = N - x - y;
				int total = 10000*x + 5000*y + 1000*z;
				if (total == Y) {
					r10 = x;
					r5 = y;
					r1 = z;
				}
			}
		}

		System.out.println(r10 + " " + r5 + " " + r1);

	}


	static class FastScanner {

		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;

	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }


	}

}


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

#include <iostream>
#include <cstdlib>
#include <stdlib.h>
using namespace std;
typedef long long int ll;
#define rep(i,N) for(ll i=0;i<N;i++)
 
ll N,Y;
ll end_flag=0;
 
ll dfs(ll a,ll b,ll c){
    if(a<0 || b<0 || c<0 || end_flag==1){
        return 0;}
    
    if(a+b+c==N){
        cout<<a<<" "<<b<<" "<<c<<endl;
        end_flag=1;
    	continue;}
    
    dfs(a+1,b,c-10);
    dfs(a,b+1,c-5);
  	return 0;
}
 
int main(){
    cin>>N>>Y;
    ll a=0;
    ll b=0;
    ll c=Y/1000;
    dfs(a,b,c);
    if(end_flag==0){
    	cout<<-1<<" "<<-1<<" "<<-1<<endl;}
    
    return 0;}

Compiler output:
a.cc: In function 'll dfs(ll, ll, ll)':
a.cc:18:9: error: continue statement not within a loop
   18 |         continue;}
      |         ^~~~~~~~
Language: C++

#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;
const int INF=1e9;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    int n, y;
    cin>>n>>y;
    int ans1=-1, ans5=-1, ans10=-1;
    for(int i=0; i+<=n; i++){
        for(int j=0; i+j<=n; j++){
            int k=n-i-j;
            if(i*1000+j*5000+k*10000==y){
                ans1=i;
                ans5=j;
                ans10=k;
                break;
            }
        }
    }
    cout<<ans10<<' '<<ans5<<' '<<ans1<<endl;
    
}



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

N, Y = map(int,input().split())
a_max = min(N, Y // 10000)
flg = False
for a in range(a_max+1):
    if flg: 
        break
    for b in range(N+1):
        if flg:
            break 
        c = N - a - b
        if a*10000+b*5000+c*1000 == Y and c >= 0:
            print(a,b,c)
            flg = True
if not flg:
    print(-1,-1,-1)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, Y = map(int,input().split())
      | ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: expected ';' before 'return'
   15 |     cout << "-1 -1 -1"
      |                       ^
      |                       ;
   16 |     return 0;
      |     ~~~~~~
Language: C++

public void Solve (Console Input cin)
{
var N = cin.ReadInt;
var Y = cin.ReadInt;
for(int i = 0; i<=N; ++I)
{
for(int j = 0; i<=N-i; ++j)
{
var k =N - i - j;
var sum = 10000*i + 5000*j + 1000*k;
if(sum ==Y)
{
WriteLine ($”{I}{j}{k}”);
retune;
}
}
}
WriteLine(“-1-1-1”);
}

Compiler output:
a.cc:13:12: error: extended character ” is not valid in an identifier
   13 | WriteLine ($”{I}{j}{k}”);
      |            ^
a.cc:13:23: error: extended character ” is not valid in an identifier
   13 | WriteLine ($”{I}{j}{k}”);
      |                       ^
a.cc:18:11: error: extended character “ is not valid in an identifier
   18 | WriteLine(“-1-1-1”);
      |           ^
a.cc:18:17: error: extended character ” is not valid in an identifier
   18 | WriteLine(“-1-1-1”);
      |                 ^
a.cc:1:1: error: expected unqualified-id before 'public'
    1 | public void Solve (Console Input cin)
      | ^~~~~~
Language: C

#include<stdio.h>
#include<math.h>
int main(){
int N,Y;
scanf("%d " ,&N);
scanf("%d" ,&Y);
double k = Y / 1000;
double b = k-N;
double round_x ,round_y ,round_z;
int answer_x ,answer_y ,answer_z ;
round_x = floor(b/4);
round_y = ceil(2*(b)/9);
round_z = floor(k/5);

if(round_y<=round_x && round_y <= round_z){
     answer_x = b - 4*round_y;
     answer_y = 9*round_y - 2 * b;
     answer_z = k - 5 * round_y;

}else {
    answer_x = N;
    answer_y = Y;
    answer_z = -1;
}
printf("%d %d %d ", answer_x ,answer_y ,answer_z );
retrun 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:1: error: 'retrun' undeclared (first use in this function)
   26 | retrun 0;
      | ^~~~~~
main.c:26:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:7: error: expected ';' before numeric constant
   26 | retrun 0;
      |       ^~
      |       ;
Language: Java

import java.util.Scanner;
public class Main {
	static int N;
	static int Y;
	static int A=-1,B=-1,C=-1;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N=sc.nextInt();
		Y=sc.nextInt();
		for(int i=0;i<=N;i++) {
			for(int j=0;j<=N-i;j++) {
				if(i*10000+j*5000+(N-i-j)*1000==Y) {
					A=i ;B=j;C=N-i-j;
				}
			}
		}
		System.out.println(A+" "+B+" "+C);
	}

Compiler output:
Main.java:18: error: reached end of file while parsing
	}
	 ^
1 error
Language: C++

#include <iostream>
using namespace std;

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

	int res10000 = -1, res5000 = -1, res1000 = -1;

	for (int i = 0; i <= n; i++) {
		for (int j = 0; j + i <= n; j++) {
			int k = n - i - j;
			int total = 10000 * i + 5000 * j + 1000 * k;
			if (total == y) res10000 = i; res5000 = j; res1000 = k;
		}
	}

	cout << i << " " << j << " " << k << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'i' was not declared in this scope
   18 |         cout << i << " " << j << " " << k << endl;
      |                 ^
a.cc:18:29: error: 'j' was not declared in this scope
   18 |         cout << i << " " << j << " " << k << endl;
      |                             ^
a.cc:18:41: error: 'k' was not declared in this scope
   18 |         cout << i << " " << j << " " << k << endl;
      |                                         ^
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(x*10000 + y*5000 + z*1000 == Y)
            {
                cout << x << '' << y << '' << endl;
            }
        }
    }
}

Compiler output:
a.cc:15:30: error: empty character constant
   15 |                 cout << x << '' << y << '' << endl;
      |                              ^~
a.cc:15:41: error: empty character constant
   15 |                 cout << x << '' << y << '' << endl;
      |                                         ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main () {
  int N, Y;
  cin >> N >> Y;
  Y /= 1000;
  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 (i * 10 + j * 5 + k == Y) {
          cout << i << ' ' << j << ' ' << k << endl;
          return 0;
        }
      }
    }
  }
  cout << -1 << ' ' << -1 << ' ' << -1 << endl
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:47: error: expected ';' before 'return'
   17 |   cout << -1 << ' ' << -1 << ' ' << -1 << endl
      |                                               ^
      |                                               ;
   18 |   return 0;
      |   ~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
    int N;
    int Y;
    cin >> N >> Y;
    int n_man = n_gosen = n_sen = 0;
    int total = 0;
    

    for (n_man = 0; n_man <= N; ++n_man) {
        for (n_gosen = 0; n_gosen <= N - n_man; ++n_gosen) {
            n_sen = N - n_man - n_gosen;
            total = 10000 * n_man + 5000 * n_gosen + 1000 * n_sen;
            if(total == Y) {
                cout << n_man << n_gosen << n_sen << endl;
                n_man = N+1;
                n_gosen = N+1;
            }
        }
    }
    if (n_man == N) {
        cout << -1 << -1 << -1 << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'n_gosen' was not declared in this scope
    8 |     int n_man = n_gosen = n_sen = 0;
      |                 ^~~~~~~
a.cc:8:27: error: 'n_sen' was not declared in this scope
    8 |     int n_man = n_gosen = n_sen = 0;
      |                           ^~~~~
Language: Java

import java.util.*;
public class Coins {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N =  sc.nextInt();
		int Y =  sc.nextInt();
		boolean bool = false;
			for(int a = 0;a <= N;a++){
				for(int b = 0;b <= N;b++){
					for(int c = 0;c <= N;c++){
						if(bool_func(a,b,c,Y,N)==true){
							System.out.println(a+" "+ b +" "+c);
							N = a = b = c;
							bool = true;
						}
					}
				}
			}
			if(bool == false)
			System.out.println("-1 -1 -1");
		}

	static boolean bool_func(int x,int y,int z,int Y,int N) {
		if(10000 * x + 5000 * y + 1000 * z == Y && (x + y + z) == N) {
			return true;
		}
		else {
			return false;
		}
	}
}

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

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Abc085c {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        String[] str = stdR.readLine().split(" ");
        int N = Integer.parseInt(str[0]);//1-2000 x + y + z = X
        int Y = Integer.parseInt(str[1])/1000;//1-20000 10 5 1　10x + 5y + z = Y
        boolean ok = false;
        for(int i = 0 ; i <= N ; i++) {
            int newX = N - i;
            int newY = Y - i;
            newY -= newX * 5;
            if(newY >= 0 && newY % 5 == 0) {
                if(newX - newY / 5 >= 0) {
                    ok = true;
                    System.out.println((newY / 5)+" "+(newX - newY / 5)+" "+i);
                    break;
                }
            }
        }
        if(!ok) {
            System.out.println("-1 -1 -1");
        }
    }
}


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

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


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

      }
    }
  }
  if(!flag) cout << "-1 -1 -1" << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'k' was not declared in this scope
   14 |                 k=N-i-j;
      |                 ^
Language: C++

#include <iostream>


struct Answer {
    int yen_10000;
    int yen_5000;
    int yen_1000;
    
    bool is_valid() { 
        return yen_10000 != -1;
    }
    
    void print() {
        std::printf(
            "%d %d %d\n",
            yen_10000, yen_5000, yen_1000
        );
    }
};


// n枚で1000*y円作る組み合わせを返す
Answer solve(
  	const int n, const int ky, bool use_10000=true, bool use_5000=true) 
{
    //
    if(n == 0 && ky == 0) {
        return {0, 0, 0};
    }
    if(ky == 0) {
        return {-1, -1, -1};
    }
    if(ky == n) {
        return {0, 0, n};
    }
    
    //
    if(cond.use_10000) {
        for(int num = ky / 10; num >= 0; --num) {
            auto ans = solve(
                n - num, ky - num*10, false
            );
            if(ans.is_valid()) {
                ans.yen_10000 += num;
                return ans;
            }
        }
    }
    if(cond.use_5000) {
        for(int num = ky / 5; num >= 0; --num) {
            auto ans = solve(
                n - num, ky - num*5, false, false
            );
            if(ans.is_valid()) {
                ans.yen_5000 += num;
                return ans;
            }
        }
    }
    
    return {-1, -1, -1};
}

int main(void) {
    int N, Y;
    std::cin >> N >> Y;

    solve(N, Y/1000).print();
}


Compiler output:
a.cc: In function 'Answer solve(int, int, bool, bool)':
a.cc:38:8: error: 'cond' was not declared in this scope
   38 |     if(cond.use_10000) {
      |        ^~~~
a.cc:49:8: error: 'cond' was not declared in this scope
   49 |     if(cond.use_5000) {
      |        ^~~~
Language: C++

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

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

#include <iostream>
using namespace std;
 
int main() {
    int N , Y;
    cin >> N >> Y;
  	int ans = 0;
  	int ans2 = 0;
  	int ans3 = 0;
    for (int i = 1; i <= N; ++i){
      for(int j = 1; j <= N; ++j){
        for(int k = 1; k <= N; ++k){
          if(10000 * i + 5000 * j + 1000 * k = Y){
            ans = i;
            ans2 = j;
            ans3 = k;
          }
        }
      }
    }
  	if(ans == 0 && ans2 == 0 && ans3 == 0){
      ans = -1;
      ans2 = -1;
      ans3 = -1;
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: lvalue required as left operand of assignment
   13 |           if(10000 * i + 5000 * j + 1000 * k = Y){
      |              ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
 
int main() {
    int N , Y;
  	int ans = 1;
    cin >> N >> Y;
  	int ans = 0;
  	int ans2 = 0;
  	int ans3 = 0;
    for (int i = 1; i <= N; ++i){
      for(int j = 1; j <= N; ++j){
        (int k = 1; k <= N; ++k){
          if(10000 * i + 5000 * j + 1000 * k = Y){
            ans = i;
            ans2 = j;
            ans3 = k;
          }
        }
      }
    }
  	if(ans == 0 && ans2 == 0 && ans3 == 0){
      ans = -1;
      ans2 = -1;
      ans3 = -1;
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: redeclaration of 'int ans'
    8 |         int ans = 0;
      |             ^~~
a.cc:6:13: note: 'int ans' previously declared here
    6 |         int ans = 1;
      |             ^~~
a.cc:13:10: error: expected primary-expression before 'int'
   13 |         (int k = 1; k <= N; ++k){
      |          ^~~
a.cc:13:10: error: expected ')' before 'int'
   13 |         (int k = 1; k <= N; ++k){
      |         ~^~~
      |          )
a.cc:13:21: error: 'k' was not declared in this scope
   13 |         (int k = 1; k <= N; ++k){
      |                     ^
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:5:9: error: expected initializer before 'Y'
    5 |   int N Y;
      |         ^
a.cc:6:10: error: 'N' was not declared in this scope
    6 |   cin >> N >> Y;
      |          ^
a.cc:6:15: error: 'Y' was not declared in this scope
    6 |   cin >> N >> Y;
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int m,n;
    scanf("%d%d",&m,&n);
    if(m*10000<n)
	{
        printf("-1 -1 -1");
        return 0;
    }
    if(m*1000>n)
	{
        printf("-1 -1 -1");
        return 0;
    }
    if(n%1000!=0)
	{
        printf("-1 -1 -1");
        return 0;
    }
    for(int i=0;i<=m;i++)
     	for(int j=0;j<=m;j++)
	       {	
	       		int k=m-i-j;
	            if(i+j+k==m && i*1000+j*5000+k*10000==n)
	            {
	                printf("%d %d %d",k,j,i);
	                return 0;   
	            }
	       }
    printf("-1 -1 -1");
    return 0;

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

#include <algorithm>
#include <string>
#include <queue>
#include <sstream>
#include <vector>
#include <stack>
#include <utility>
#include <math.h>
using namespace std;

int main()
{
	int N, Y;
	cin >> N >>Y;
//	int tmp;
	int x, y, z;
	for (int i = 0; i <= N; i++)
	{
//		tmp = 0;

		//i枚の一万円札使うとする
		for (int j = 0; j <= N - i; j++)
		{
			//j枚の5000円札使うとする
			//残りN - i - j枚のお札があるので足す
			
			if (10000 * i + 5000 * j + 1000 * (N - i - j) == Y)
			{
				x = i, y = j, z = N - i - j;
				printf("%d %d %d\n", x, y, z);
				return 0;
			}
		}
	}

	printf("%d %d %d\n", -1, -1, -1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |         cin >> N >>Y;
      |         ^~~
a.cc:9:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    8 | #include <math.h>
  +++ |+#include <iostream>
    9 | using namespace std;
Language: C++


N, Y = map(int, input().split())

for a in range(N + 1):
    for b in range(N + 1):
        if a + b > N:
            break
        else:
            c = N - a - b
            total = 10000 * a + 5000 * b + 1000 * c
            if total == Y:
                print('{0} {1} {2}'.format(a, b, c))
                exit()

print('-1 -1 -1')

Compiler output:
a.cc:12:23: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   12 |                 print('{0} {1} {2}'.format(a, b, c))
      |                       ^~~~~~~~~~~~~
a.cc:15:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   15 | print('-1 -1 -1')
      |       ^~~~~~~~~~
a.cc:2:1: error: 'N' does not name a type
    2 | N, Y = map(int, input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n,y;
int main()
{
    scanf("%d%d",&n,&y);
    if(10000*n<y)
    {
        cout<<"-1 -1 -1";
        return 0;
    }
    if(1000*n>y)
    {
        cout<<"-1 -1 -1";
        return 0;
    }
    if(y%1000!=0)
    {
        cout<<"-1 -1 -1";
        return 0;
    }
    for(int i=0;i<=y/10000;i++)
    {
        for(int j=0;j<=y/5000;j++)
        {
            for(int k=0;k<=y/1000,i+j+k<=m;k++)
            {
                if(i+j+k==n && (i*10000+j*5000+k*1000)==y)
                {
                    printf("%d %d %d",i,j,k);
                    return 0;
                }
            }
        }
    }
    printf("-1 -1 -1");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:42: error: 'm' was not declared in this scope
   26 |             for(int k=0;k<=y/1000,i+j+k<=m;k++)
      |                                          ^
Language: C++

n, y = map(int, input().split())

ans = [-1, -1, -1]
flag = 0
for i in range(n + 1):
    for j in range(n + 1 - i):
            if 10000 * i + 5000 * j + 1000 * (n - i - j) == y:
                ans = [i, j, n - i - j]
                break
print(' '.join(map(str, ans)))

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, y = map(int, input().split())
      | ^
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();
        int y10000 = -1;
        int y5000 = -1;
        int y1000 = -1;
        for(int i=0;i<=N;i++){
            for(int j=0;j<=N-i;j++){
                if(10000*i+5000*j+1000*(N-i-j) == Y){
                    y10000 = i;
                    y5000 = j;
                    y1000 = N-i-j;
                    break;
                }
            }
        }
        System.out.println(i+" "+j+" "+(N-i-j));
    }
}

Compiler output:
Main.java:21: error: cannot find symbol
        System.out.println(i+" "+j+" "+(N-i-j));
                           ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
        System.out.println(i+" "+j+" "+(N-i-j));
                                 ^
  symbol:   variable j
  location: class Main
Main.java:21: error: cannot find symbol
        System.out.println(i+" "+j+" "+(N-i-j));
                                          ^
  symbol:   variable i
  location: class Main
Main.java:21: error: cannot find symbol
        System.out.println(i+" "+j+" "+(N-i-j));
                                            ^
  symbol:   variable j
  location: class Main
4 errors
Language: Java

mport java.util.*;

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

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: Java

public class Main {
    public static void main(String[] args) {
        int n = scanner.nextInt();
        int y = scanner.nextInt();
        if (y >= n * 1000 && y <= n * 10000) {
            int m10000Max = y / 10000;
            for (int t10000 = m10000Max; t10000 >= 0; t10000--) {
                int temp = y - t10000 * 10000;
                for (int t1000 = temp % 5000 / 1000; t1000 <= temp / 1000; t1000 += 5)
                    if (t10000 + t1000 + (y - (t10000 * 10000 + t1000 * 1000)) / 5000 == n) {
                        System.out.println(t10000 + " " + ((y - (t10000 * 10000 + t1000 * 1000)) / 5000) + " " + t1000);
                        return;
                    }
            }
        }
        System.out.println("-1 -1 -1");
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        int n = scanner.nextInt();
                ^
  symbol:   variable scanner
  location: class Main
Main.java:4: error: cannot find symbol
        int y = scanner.nextInt();
                ^
  symbol:   variable scanner
  location: class Main
2 errors
Language: Java


    public static void main(String[] args) {
        int n = scanner.nextInt();
        int y = scanner.nextInt();
        if (y >= n * 1000 && y <= n * 10000) {
            int m10000Max = y / 10000;
            for (int t10000 = m10000Max; t10000 >= 0; t10000--) {
                int temp = y - t10000 * 10000;
                for (int t1000 = temp % 5000 / 1000; t1000 <= temp / 1000; t1000 += 5)
                    if (t10000 + t1000 + (y - (t10000 * 10000 + t1000 * 1000)) / 5000 == n) {
                        System.out.println(t10000 + " " + ((y - (t10000 * 10000 + t1000 * 1000)) / 5000) + " " + t1000);
                        return;
                    }
            }
        }
        System.out.println("-1 -1 -1");
    }

Compiler output:
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
    public static void main(String[] args) {
                  ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

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

int main() {
 int N,Y;
 cin >>  N,Y;
int i,j;
 int ta = -1; int tb = -1; int tc = -1; 
  
  for (int i = 0; i < N; i++){
    for (int j = 0; j < N; j++){
      int k = N - i - j;
     if(i *10000 + j*5000 + k*1000 == Y){
     ta = i;
     tb = j;
     tc = k;

     }
 }


 cout <<  ta  << tb << tc<< endl;
}


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

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

int main() {
 int N,Y;
 cin >>  N,Y;
int i,j
 int ta = -1; int tb = -1; int tc = -1; 
  
  for (int i = 0; i < N; i++){
    for (int j = 0; j < N; j++){
      int k = N - i - j;
     if(i *10000 + j*5000 + k*1000 == Y){
     ta = i;
     tb = j;
     tc = k;

     }
 }


 cout <<  ta  << tb << tc<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:2: error: expected initializer before 'int'
    8 |  int ta = -1; int tb = -1; int tc = -1;
      |  ^~~
a.cc:14:6: error: 'ta' was not declared in this scope; did you mean 'tc'?
   14 |      ta = i;
      |      ^~
      |      tc
a.cc:22:11: error: 'ta' was not declared in this scope; did you mean 'tc'?
   22 |  cout <<  ta  << tb << tc<< endl;
      |           ^~
      |           tc
a.cc:23:2: error: expected '}' at end of input
   23 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main() {
 int N,Y;
 cin >>  N,Y;
int i,j,k;
  
  for (int i = 0; i < N; i++){
    for (int j = 0; j < N; j++){
      for(int k = 0; k < N; k++){
        if (Y == i * 10000 + j * 5000 + k * 1000){
            
            break;}
         }
     }
 }
 if(i == N-1 && j == N-1 $$ k == N-1){
  i = -1;
  j=  -1;
  k = -1;}

 cout <<   i << j << k<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: expected ')' before '$$'
   18 |  if(i == N-1 && j == N-1 $$ k == N-1){
      |    ~                    ^~~
      |                         )
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++){
      for(int k = 0; k < N; k++){
        if (Y == i * 10000 + j * 5000 + k * 1000){
            
            break;}
         }
     }
 }
 if(i == N-1 && j == N-1 $$ k == N-1){
  i = -1;
  j=  -1;
  k = -1;}

 cout <<   i << j << k<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:5: error: 'i' was not declared in this scope
   17 |  if(i == N-1 && j == N-1 $$ k == N-1){
      |     ^
a.cc:17:17: error: 'j' was not declared in this scope
   17 |  if(i == N-1 && j == N-1 $$ k == N-1){
      |                 ^
a.cc:17:25: error: expected ')' before '$$'
   17 |  if(i == N-1 && j == N-1 $$ k == N-1){
      |    ~                    ^~~
      |                         )
a.cc:20:3: error: 'k' was not declared in this scope
   20 |   k = -1;}
      |   ^
a.cc:22:12: error: 'i' was not declared in this scope
   22 |  cout <<   i << j << k<< endl;
      |            ^
a.cc:22:17: error: 'j' was not declared in this scope
   22 |  cout <<   i << j << k<< endl;
      |                 ^
a.cc:22:22: error: 'k' was not declared in this scope
   22 |  cout <<   i << j << k<< endl;
      |                      ^
Language: C++

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<iomanip>
#include<queue>
#include<string>

typedef long long ll;
const int inf = 0x3f3f3f3f,maxn = 100 + 5;

using namespace std;

int main(){

	int n,y;

	while(cin >> n >> y)
	{
		int a,b,c;

		y = y / 1000;

		bool flag = false;

		for(a = n;a >= 0;a--)
		{
			for(b = n - a;b >= 0;b--)
			{
				for(c = n - a - b;c >= 0;c--)
				{
					if(a + b + c == n && a * 10 + b * 5 + c == y)
					{
						flag = true;
						printf("%d %d %d\n",a,b,c);
						break;
					}
				}

				if(flag) break;

			}

			if(flag) break;
	

Compiler output:
a.cc: In function 'int main()':
a.cc:48:40: error: expected '}' at end of input
   48 |                         if(flag) break;
      |                                        ^
a.cc:31:17: note: to match this '{'
   31 |                 {
      |                 ^
a.cc:48:40: error: expected '}' at end of input
   48 |                         if(flag) break;
      |                                        ^
a.cc:23:9: note: to match this '{'
   23 |         {
      |         ^
a.cc:48:40: error: expected '}' at end of input
   48 |                         if(flag) break;
      |                                        ^
a.cc:18:11: note: to match this '{'
   18 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int N,Y;
  cin>>N>>Y;
  Y/=1000;
  int t = Y-N;
  k=(2*t+8)/9-1;
  if(k<= t/4 && k <= (N+t)/5){
    int x=t-4*k;
    int y=9*k-2*t;
    int z=N-x-y;
    cout<<x<<" "<<y<<" "<<z<<endl;
  }else{
   cout<<'-1 -1 -1'<<endl; 
  }
}
/*
x+y+z=N; 10x+5y+z=Y
z=N-x-y; 9x+4y=Y-N

// もしも、マイナス枚の紙ももらえることとします。
t := Y-N
(x, y)=(t-4k,9k-2t) (kは整数)
// でも、実際は、マイナス枚の紙はもらえない
0 <= x, y; x+y <= N

4k <= t; 2t <= 9k; 5k-t <= N

4k <= t; 2t <= 9k; 5k <= N+t

k <= t/4; 2t/9 <= k; k <= (N+t)/5



*/

Compiler output:
a.cc:16:10: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   16 |    cout<<'-1 -1 -1'<<endl;
      |          ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:9:3: error: 'k' was not declared in this scope
    9 |   k=(2*t+8)/9-1;
      |   ^
Language: C++

N,Y=[int(a) for a in input().split()]
for x in range(N+1):
    for y in range(N+1-x):
        for z in range(N+1-x-y):
            if x+5*y+10*z==Y//1000:
                print(x,y,z)
                import sys
                sys.exit()
print(-1,-1,-1)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,Y=[int(a) for a in input().split()]
      | ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:4:4: error: 'cin' was not declared in this scope
    4 |    cin >> N >> Y;
      |    ^~~
a.cc:16:5: error: 'cout' was not declared in this scope
   16 |     cout << A << " " << B << " " << C << endl;
      |     ^~~~
a.cc:16:42: error: 'endl' was not declared in this scope
   16 |     cout << A << " " << B << " " << C << endl;
      |                                          ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
using namespace std;
using ll = long long;
using lli = long long int;
ll MM = 1000000000;
ll mod = MM + 7;
#define INF (ll)1e18
int main(){
    int n; cin >> n;
    ll y; cin >> y;
    for(int i = 0; i < 100; i++){
        for(int j = 0; j < 100; j++){
            if(10000*i + 5000*j + 1000*(n-i-j) == y){
                cout << i << " " << j << " " << k << endl;
                break;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
}

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

n, x = gets.chomp.split.map(&:to_i)
n.downto(0) do |i|
  (n-i).downto(0) do |j|
    if i * 10000 + j * 5000 + (n - i - j) * 1000 == x
      puts "#{i} #{j} #{n - i - j}"
      exit
    end
  end
end
puts "-1 -1 -1"

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n, x = gets.chomp.split.map(&:to_i)
      | ^
Language: C++

n,y=map(int,input().split())

def search():
    for b in range(0,n+1):
        for a in range(0,n+1):
            c=n-a-b
            total = 10000*a+5000*b+1000*c
            if(y==total and c>=0):
                return(a,b,c)
    return(-1,-1,-1)
print("%d %d %d" % search())

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

#include <iostream>

using namespace std;

int main(){
  int N, Y;
  int d, r;
  vector<int> values({10000, 5000, 1000});
  int ans[3] = {-1, -1, -1};
  
  for (int i=0; i<3; i++){
    d = Y / values[i];
    r = Y % values[i];
    if (N - d < 0) break;
    N -= d;
    ans[i] = d;
    Y = r;
  }
  
  if (r != 0){
    cout << "-1 -1 -1" << endl;
  }
  else{
    cout << ans[0] << " " << ans[1] << " " << ans[2] << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> values({10000, 5000, 1000});
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> values({10000, 5000, 1000});
      |          ^~~
a.cc:8:41: error: expected primary-expression before ')' token
    8 |   vector<int> values({10000, 5000, 1000});
      |                                         ^
a.cc:12:13: error: 'values' was not declared in this scope
   12 |     d = Y / values[i];
      |             ^~~~~~
Language: C++

#include <iostream>

int main(){
  int N, Y;
  int d, r;
  vector<int> values({10000, 5000, 1000});
  int ans = {-1, -1, -1};
  
  for (int i=0; i<3; i++){
    d = Y / values[i];
    r = Y % values[i];
    if (N - d < 0) break;
    N -= d;
    ans[i] = d;
    Y = r;
  }
  
  if (r != 0){
    cout << "-1 -1 -1" << endl;
  }
  else{
    cout << ans[0] << " " << ans[1] << " " << ans[2] << endl;
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> values({10000, 5000, 1000});
      |   ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> values({10000, 5000, 1000});
      |          ^~~
a.cc:6:41: error: expected primary-expression before ')' token
    6 |   vector<int> values({10000, 5000, 1000});
      |                                         ^
a.cc:7:7: error: scalar object 'ans' requires one element in initializer
    7 |   int ans = {-1, -1, -1};
      |       ^~~
a.cc:10:13: error: 'values' was not declared in this scope
   10 |     d = Y / values[i];
      |             ^~~~~~
a.cc:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout << "-1 -1 -1" << endl;
      |     ^~~~
      |     std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:27: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |     cout << "-1 -1 -1" << endl;
      |                           ^~~~
      |                           std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:22:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   22 |     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:22:57: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   22 |     cout << ans[0] << " " << ans[1] << " " << ans[2] << 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<stdio.h>
int main(void){
  int n,Y;
  int x=-1;
  int y=-1;
  int z=-1;
int i;
  
  scanf("%d %d",&n,&y);
  
for(x=0;x<=n;x++){
  i=x*10000;
  for(y=0;y<=n;y++){
    i=i+y*5000;
    for(z=0;z<=n;z++){
      i=i+z*1000;
      if((i==Y)&&((x+y+z)==n)){
        
        
  printf("%d %d %d",x,y,z);
      }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
   23 | }
      | ^
main.c:23:1: error: expected declaration or statement at end of input
main.c:23:1: error: expected declaration or statement at end of input
Language: C++

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:54: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   14 |                                         cout << i<" "<<j<<" "<<k<<endl;
      |                                                   ~~~^~~
      |                                                   |    |
      |                                                   |    int
      |                                                   const char [2]
Language: C++

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:54: error: invalid operands of types 'const char [2]' and 'int' to binary 'operator<<'
   14 |                                         cout << i<" "<<j<<" "<<k<<endl;
      |                                                   ~~~^~~
      |                                                   |    |
      |                                                   |    int
      |                                                   const char [2]
Language: C++

#include <iostream>
using namespace std;
int main(){
	int N,Y,f=0;
	cin>>N>>Y;
	for(int x=0;x<=N;x++){
		for(int y=0;y<=N;y++){
			int z=N-(x+y);
			if(x+y+z==N&&10000*x+y*5000+z*1000==Y){
				cout<<x<<" "<<y<<" "<<z<<endl;
				f=1;
				break;
			}
		}
		if(f==1){
			break;
		}
		if(){
			cout<<-1<<" "<<-1<<" "<<-1<<endl;
		}
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: expected primary-expression before ')' token
   18 |                 if(){
      |                    ^
Language: C++

#include <iostream>
#include <stdio.h>
#include <algorithm>
using namespace std;

int main()
{
  int n;
  long long y;
  bool ans = false;

  for(int a = 0; a <= n; a++){
    for(int b=0, c=0; b<= n; b++){
      if(a+ b <= n){
        c = n - (a+b);
        if(a*10000+b*5000+c*1000 == y){
          ans = true;
          cout << a << " " << b<< " " << c << endl;
          return 0
        }
      }
    }
  }

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

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: expected ';' before '}' token
   19 |           return 0
      |                   ^
      |                   ;
   20 |         }
      |         ~
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;
      }
    }
  }
  cout << res10000 << " " << res5000 << " " << res1000 << endl;
}

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

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        // programming
        int n = getInputInteger(sc);
        int y = getInputInteger(sc);
        int n1 = 0;
        int n2 = 0;
        int n3 = 0;
        int temp = 0;
        
        l1: for (int i = 0; i <= n; i++) {
            n1 = i;
            n2 = 0;
            n3 = 0;
            temp = total(n1,n2,n3);
            if (temp > y) {
                break l1;
            }
            if (temp == y && n1 + n2 + n3 == n) {
                output(String.valueOf(n1), String.valueOf(n2), String.valueOf(n3));
                return;
            }
            for (int j = 0; j <= n - n1; j++) {
                n2 = j;
                temp = total(n1,n2,n3);
                if (temp > y) {
                    break l1;
                }
                if (temp == y && n1 + n2 + n3 == n) {
                    output(String.valueOf(n1), String.valueOf(n2), String.valueOf(n3));
                    return;
                }
                for (int k = 0; k <= n - n1 - n2; k++) {
                    n3 = k;
                    temp = total(n1,n2,n3);
                    if (temp > y) {
                        break l1;
                    }
                    if (temp == y && n1 + n2 + n3 == n) {
                        output(String.valueOf(n1), String.valueOf(n2), String.valueOf(n3));
                        return;
                    }
                }
            }
        }
        output("-1", "-1", "-1");
	}

    private static total(int n1, int n2, int n3) {
        return 10000*n1+5000*n2+1000*n3;
    }

	public static String getInputString(Scanner sc) {
		return sc.next();
	}

	public static int getInputInteger(Scanner sc) {
		return Integer.parseInt(sc.next());
	}

	public static void output(String... params) {
		boolean isInit = true;
		String str = "";
		for (String s : params) {
			if (!isInit) {
				str += " ";
			}
			str += s;
			isInit = false;
		}
		System.out.println(str);
	}

    public static int[] toIntegerList(String s) {
        int[] ret = new int[s.length()];
        for (int i = 0; i < s.length(); i++) {
            ret[i] = Integer.parseInt(String.valueOf(s.charAt(i)));
        }
        return ret;
    }

    public static int sum(int[] vals) {
        int sum = 0;
        for (int val : vals) {
            sum += val;
        }
        return sum;
    }

    public static int[] sort(int[] vals, boolean isAsc) {
        Arrays.sort(vals);
		if (isAsc) {
			return vals;
		}
        int[] ret = new int[vals.length];
        for (int i = 0; i < vals.length; i++) {
            ret[vals.length - i - 1] = vals[i];
        }
		return ret;
	}
}

Compiler output:
Main.java:51: error: invalid method declaration; return type required
    private static total(int n1, int n2, int n3) {
                   ^
1 error
Language: C++

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

int main(void){
	ios::sync_with_stdio(false);
	int N, Y, i, j, k, l[3];
	cin >> N >> Y;
	Y /= 1000;
	i = 0;
	j = 0;
	l[1] = -1;
	l[2] = -1;
	l[3] = -1;
	for (i = 0; i <=N; i++) {
		for (j = 0; j <= N-j; j++) {
			if (Y == j * 5 + i * 10 + N - i - j) {
				l[1] = i;
				l[2] = j;
				l[3] = k;
			}
			l++;
		}
	}
	cout << l[1] <<' ' << l[2] <<' ' << l[3];
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: lvalue required as increment operand
   24 |                         l++;
      |                         ^