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

#include<iostream>
using namespace std;

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


Compiler output:
a.cc:21:3: error: expected unqualified-id before 'if'
   21 |   if(flag){
      |   ^~
a.cc:23:4: error: expected unqualified-id before 'else'
   23 |   }else{
      |    ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

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


Compiler output:
a.cc:21:3: error: expected unqualified-id before 'if'
   21 |   if(flag){
      |   ^~
a.cc:23:4: error: expected unqualified-id before 'else'
   23 |   }else{
      |    ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include<iostream>
using namespace std;

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


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

#include<iostream>
using namespace std;

int main(){
  int N,Y;
  cin>>N>>Y;
  
  int x,y,z;
  bool flag =false;
  
  for(x=0;x<=2000;x++){
    for(y=0;y<=2000;y++){
       z=N-x-y;
       if(10000x+5000y+1000z==Y){
         flag=true;
         break;
       }
    }
  }
  if(flag){
    cout<<x<<y<<z<<endl;
  }else{
    cout<<-1<<-1<<-1<<endl;
  }
  


Compiler output:
a.cc:14:24: warning: use of C++23 'make_signed_t<size_t>' integer constant
   14 |        if(10000x+5000y+1000z==Y){
      |                        ^~~~~
a.cc: In function 'int main()':
a.cc:14:11: error: unable to find numeric literal operator 'operator""x'
   14 |        if(10000x+5000y+1000z==Y){
      |           ^~~~~~
a.cc:14:18: error: unable to find numeric literal operator 'operator""y'
   14 |        if(10000x+5000y+1000z==Y){
      |                  ^~~~~
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using std;

int main(){
  int N,Y;
  cin>>N>>Y;
  
  int x,y,z;
  bool flag =false;
  
  for(x=0;x<=2000;x++){
    for(y=0;y<=2000;y++){
       z=N-x-y;
       if(10000x+5000y+1000z==Y){
         flag=true;
         break;
       }
    }
  }
  if(flag){
    cout<<x<<y<<z<<endl;
  }else{
    cout<<-1<<-1<<-1<<endl;
  }
  

Compiler output:
a.cc:14:24: warning: use of C++23 'make_signed_t<size_t>' integer constant
   14 |        if(10000x+5000y+1000z==Y){
      |                        ^~~~~
a.cc:2:7: error: expected nested-name-specifier before 'std'
    2 | using std;
      |       ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>N>>Y;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:11: error: unable to find numeric literal operator 'operator""x'
   14 |        if(10000x+5000y+1000z==Y){
      |           ^~~~~~
a.cc:14:18: error: unable to find numeric literal operator 'operator""y'
   14 |        if(10000x+5000y+1000z==Y){
      |                  ^~~~~
a.cc:21:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 |     cout<<x<<y<<z<<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:21:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 |     cout<<x<<y<<z<<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:23:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |     cout<<-1<<-1<<-1<<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:23:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |     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)
      |     ^~~~
a.cc:24:4: error: expected '}' at end of input
   24 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: lvalue required as left operand of assignment
   12 |       if(a * 10000 + b * 5000 + c * 1000 = Y){
      |          ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
Language: C++

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

int main() {
    int n, y; cin >> n >> y;
    
    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) {
                cout << i << " " << j << " " << n - i - j << endl;
                return 0;
            }
        }
        
    }
    
    cout << "-1 -1 -1" << endl;
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main() {
    int N,Y;
  	int cnt=0;
  	int sum=0;
  int q=-1;
  int s=-1;
  int z=-1;
    cin >> N >> Y;
    for (int a = 0; a <= N; ++a) {
　	for (int b = 0; b <= N; ++b) {
　　	for (int c = 0; c <= N; ++c) {
　　　	int total = 10000*a + 5000*b + 1000*c;
　　　	if (a + b + c == N && total == Y) {
     	q=a;
     	s=b;
     	z=c;
　　　	}
　　	}
　	}
	}
    cout <<q<<" "<<s<<" "<<z  << endl;
}

Compiler output:
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　      for (int b = 0; b <= N; ++b) {
      | ^
a.cc:13:1: error: extended character 　 is not valid in an identifier
   13 | 　　    for (int c = 0; c <= N; ++c) {
      | ^
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
   14 | 　　　  int total = 10000*a + 5000*b + 1000*c;
      | ^
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
   15 | 　　　  if (a + b + c == N && total == Y) {
      | ^
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
   19 | 　　　  }
      | ^
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:19:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
   20 | 　　    }
      | ^
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
   21 | 　      }
      | ^
a.cc: In function 'int main()':
a.cc:12:1: error: '\U00003000' was not declared in this scope
   12 | 　      for (int b = 0; b <= N; ++b) {
      | ^~
a.cc:12:25: error: 'b' was not declared in this scope
   12 | 　      for (int b = 0; b <= N; ++b) {
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
    int N,Y;
  	int cnt=0;
  	int sum=0;
  int q=-1;
  int s=-1;
  int z=-1;
    cin >> N >> Y;
    for (int a = 0; a <= N; ++a) {
　for (int b = 0; b <= N; ++b) {
　　for (int c = 0; c <= N; ++c) {
　　　int total = 10000*a + 5000*b + 1000*c;
　　　if (a + b + c == N && total == Y) {
　　　　// 見つかった！
     	q=a;
     	s=b;
     	z=c;
　　　}
　　}
　}
}
    cout <<q<<" "<<s<<" "<<z  << endl;
}




Compiler output:
a.cc:12:1: error: extended character 　 is not valid in an identifier
   12 | 　for (int b = 0; b <= N; ++b) {
      | ^
a.cc:13:1: error: extended character 　 is not valid in an identifier
   13 | 　　for (int c = 0; c <= N; ++c) {
      | ^
a.cc:13:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
   14 | 　　　int total = 10000*a + 5000*b + 1000*c;
      | ^
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:14:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
   15 | 　　　if (a + b + c == N && total == Y) {
      | ^
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:15:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
   16 | 　　　　// 見つかった！
      | ^
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:16:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
   20 | 　　　}
      | ^
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:20:1: error: extended character 　 is not valid in an identifier
a.cc:21:1: error: extended character 　 is not valid in an identifier
   21 | 　　}
      | ^
a.cc:21:1: error: extended character 　 is not valid in an identifier
a.cc:22:1: error: extended character 　 is not valid in an identifier
   22 | 　}
      | ^
a.cc: In function 'int main()':
a.cc:12:8: error: expected primary-expression before 'int'
   12 | 　for (int b = 0; b <= N; ++b) {
      |        ^~~
a.cc:12:19: error: 'b' was not declared in this scope
   12 | 　for (int b = 0; b <= N; ++b) {
      |                   ^
Language: Java

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

import com.sun.swing.internal.plaf.basic.resources.basic;

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 - i; j++) {
   			 int k = N - i - j;
   			 int total = i*10000 + j*5000 + k*1000;
   			 if(total == Y) {
   				 System.out.println(i + " " + j + " " + k + " ");
   				 return;
   			 }
   		 }
   	 }
   	 System.out.println("-1 -1 -1");
    }
}


Compiler output:
Main.java:6: error: package com.sun.swing.internal.plaf.basic.resources is not visible
import com.sun.swing.internal.plaf.basic.resources.basic;
                                        ^
  (package com.sun.swing.internal.plaf.basic.resources is declared in module java.desktop, which does not export it)
1 error
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n , y;
    cin >> n >> y;
    for( ll i = 0 ; i <= n ; i++ ) {
      for( ll  j = 0 ;  j <= n - i ; j++ ) {
        if ( i * 10000 + j * 5000 + ( n - i - j ) * 1000 == y ) {
          cout << i << " " << j << " " << n - i - j;
          return 0;
        }
      }
    }
  }
}


Compiler output:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n , y;
    cin >> n >> y;
    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 ) {
          cout << i << " " << j << " " << n - i - j;
          return 0;
        }
      }
    }
  }
}


Compiler output:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n , y;
    cin >> n >> y;
    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 ) {
          cout << i << " " << j << " " << n - i - j;
          return 0;
        }
      }
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:39: error: 'N' was not declared in this scope
   20 |         if ( i * 10000 + j * 5000 + ( N - i - j ) * 1000 == y ) {
      |                                       ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,M,X=0,Y=0;
  vector<int>vec(3);
  bool A = false;
  cin >> N >> M;
  for (X=0; X<=N; X++){
    for (Y=0; Y<=N; Y++){
      if (X+Y<=N){
        int Z = N-X-Y;
        if (X+Y+Z==N && X*10000+Y*5000+Z*1000==M){
          vec={X,Y,Z};
          F=true;
        }
      }
    }
  }
  if (F == true){
    cout << vec.at(0) << " " << vec.at(1) << " " << vec.at(2) << endl;
  }
  else{
    cout << -1 << " " << -1 << " " << -1 <<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: 'F' was not declared in this scope
   15 |           F=true;
      |           ^
a.cc:20:7: error: 'F' was not declared in this scope
   20 |   if (F == true){
      |       ^
Language: C++

N,Y = input().split()
N = int(N)
Y_k=int(Y)/1000

answer=[-1,-1,-1]
for i in range(N+1):
    for j in range(N+1 - i):
        for k in range(N+1-i-j):
            if 10*i + 5*j + 1*k == Y_k:
                answer = [i,j,k]

print(answer)



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

using namespace std;
#define rep(i,n) for(int i=0;i<=(n);i++)
using ll=long long;

int main(){
    int n,y;
    cin>>n>>y;
    int a=-1;
    int b=-1;
    int c=-1;

  
    rep(i,2000){
        rep(j,2000){
                a=i;
                b=j;
                c=n-a-b;
                if(10000*i+5000*j+1000*(n-a-b)==y){
                    break;
                }
            }
            if(a!=-1 && b!=-1 && c!=-1)break;
        }
    cout<<a<<' '<<b<<' '<<c;
    return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n>>y;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:24:5: error: 'cout' was not declared in this scope
   24 |     cout<<a<<' '<<b<<' '<<c;
      |     ^~~~
a.cc:24:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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


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

    for(ll i=0; i<=n; i++)
    {
        for(ll j=0; j<=n; j++)
        {

                if( i*10000 + j*5000 + (n-i-j)*1000 ==val && n-x-y>=0)
                {
                    cout << i << " " << j << " " << n  - i - j << endl;
             return 0;
                }
            }
        }

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



}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:64: error: 'x' was not declared in this scope
   18 |                 if( i*10000 + j*5000 + (n-i-j)*1000 ==val && n-x-y>=0)
      |                                                                ^
a.cc:18:66: error: 'y' was not declared in this scope
   18 |                 if( i*10000 + j*5000 + (n-i-j)*1000 ==val && n-x-y>=0)
      |                                                                  ^
Language: Java

import java.util.Scanner;
public class main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int Y = scan.nextInt();
		int c = 0;
		
		for(int x=0;x<N;x++) {
			for(int y=0;y<N;y++) {
				for(int z=0;z<N;z++) {
					if(x+y+z==N && 10000*x + 5000*y + 1000*z ==Y) {
						System.out.println(x+" "+y+" "+z);
						c++;
					}
				}
			}
		}
		if(c==0) {
			System.out.println("-1 -1 -1");
		}
	}
}

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

#include<stdio.h>
int main(){
  int a=0,b=0,c=0,n=0,x=0,y=0,z=0;
  scanf("%d %d",&n,&p);
  for(b=0;b<=n;b++){
    for(c=0;c<=n;c++){
      a=n-b-c;
      if(a+b+c<=n&&10000*a+5000*b+1000*c){
        x=a;
        y=b;
        z=c;
        D=1;
        break;
      }
    }
    if(D=1){
      printf("%d %d %d",x,y,z);
    }
    else{
      printf("-1 -1 -1");
    }
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:21: error: 'p' undeclared (first use in this function)
    4 |   scanf("%d %d",&n,&p);
      |                     ^
main.c:4:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:9: error: 'D' undeclared (first use in this function)
   12 |         D=1;
      |         ^
Language: C

#include<stdio.h>
int main(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {
    for(j=0;j<=N;j++)
    {
      k=N-(i+j);
      if(k>=&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      {
	   MAN=k;
	   GOSEN=j;
        SEN=i;
        BOOL=1;
     	break;
      }
    }    
   }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-1 -1 -1");
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:11: warning: comparison between pointer and integer
   10 |       if(k>=&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      |           ^~
main.c:10:7: error: label 'i' used but not defined
   10 |       if(k>=&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      |       ^~
Language: C

#include<stdio.h>
int main()
{
  int i;/*ループカウンター*/
  int j=0;/*お札の枚数*/
  int sum=0;
  int a=0,b=0,c=0;/*a=10000円　b=5000円　c=1000円*/
  int k=0,l=0,m=0;//変数//
  scanf("%d %d",&j,&sum);
  a=sum/10000;
  k=sum%10000;
  b=k/5000;
  l=k%5000;
  c=l/1000;
  m=c%1000;
  if(m!=0)
  {
    printf("-1 -1 -1");
  }
  else if(a+b+c<=j)
  {
    printf("%d %d %d",a,b,c);
  }
  else
  {
    printf("-1 -1 -1");
  }

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

#include<stdio.h>
int main(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {for(j=0;j<=N;j++)
   {k=N-(i+j);
   if(i+j+k==N&&10000*k+5000*j+1000*i==Y)
   {
   MAN=k;
   GOSEN=j;
   SEN=i;
   BOOL=1;
     break;
   }
    }    
   }
  }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-1 -1 -1");
return 0;
}

Compiler output:
main.c:20:3: error: expected identifier or '(' before 'if'
   20 |   if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
      |   ^~
main.c:21:3: error: expected identifier or '(' before 'else'
   21 |   else printf("-1 -1 -1");
      |   ^~~~
main.c:22:1: error: expected identifier or '(' before 'return'
   22 | return 0;
      | ^~~~~~
main.c:23:1: error: expected identifier or '(' before '}' token
   23 | }
      | ^
Language: C

#include<stdio.h>
int main(){
  int a=0,b=0,c=0,n=0,x=0,y=0,z=0;
  scanf("%d %d" &n,&y);
  for(a=n;a>=10000;a-10000){
    x++;
  }
  for(a=a;a>=5000;a-5000){
    y++;
  }
  for(a=a;a>=1000;a-1000){
    z++;
  }
  if(x+y+z==n){
    printf("%d %d %d" x,y,z);
  }
  else{
    printf("-1 -1 -1");
  }
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:17: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d %d" &n,&y);
      |         ~~~~~~~ ^
      |         |
      |         char *
main.c:15:22: error: expected ')' before 'x'
   15 |     printf("%d %d %d" x,y,z);
      |           ~          ^~
      |                      )
Language: C

#include<stdio.h>
int main(){
  int a=0,b=0,c=0,n=0,y=0;
  scanf("%d %d" &n,&y);
  for(a=n;a>=10000;a-10000){
    x++;
  }
  for(a=a;a>=5000;a-5000){
    y++;
  }
  for(a=a;a>=1000;a-1000){
    z++;
  }
  if(x+y+z==n){
    printf("%d %d %d" x,y,z);
  }
  else{
    printf("-1 -1 -1");
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:17: error: invalid operands to binary & (have 'char *' and 'int')
    4 |   scanf("%d %d" &n,&y);
      |         ~~~~~~~ ^
      |         |
      |         char *
main.c:6:5: error: 'x' undeclared (first use in this function)
    6 |     x++;
      |     ^
main.c:6:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: 'z' undeclared (first use in this function)
   12 |     z++;
      |     ^
main.c:15:22: error: expected ')' before 'x'
   15 |     printf("%d %d %d" x,y,z);
      |           ~          ^~
      |                      )
Language: C

#include<stdio.h>
int main(){
int N,Y,SEN=1000,GOSEN=5000,MAN=10000,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {for(j=0;j<=N;j++)
   {for(k=0;k<=N;k++)
    {
   if(i+j+k==N&&SEN*k+GOSEN*j+MAN*i==Y)
   {
   SEN=k;
   GOSEN=j;
   MAN=i;
   BOOL=1;
     break;
   }
    }    
   }
  }
  
  if(BOOL==1){printf("%d %d %d",SEN,GOSEN,MAN);}
  else printf("-1 -1 -1");
return 0;

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

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

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

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected ',' or ';' before 'b'
   14 |       int c = N - a b;
      |                     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int check(int money,int p){
  int a=p,b=0,c=0;
  bool bl=true:
  while(bl){
    y=10000*a+5000*b+1000*c;
    if(y==money){
    	cout<<a<<b<<c;
    	bl=false;
    }else if(b==0){
      a--;
      c=0;
      b=p-a;
    }else if(b!=0){
      b--;
      c++;
    }
    else if(a==0){
       cout<<-1<<-1<<-1;
       bl=false;
    }
  }
}
      
    
int main(){
  int n,y;//n：お札の枚数y:申告金額
  cin>>n>>y;
  if(y%1000!=0){//yは1000の倍数
    cout<<-1<<-1<<-1;
  }else{
    check(n,y);
  }
}
    
    
  

Compiler output:
a.cc: In function 'int check(int, int)':
a.cc:5:15: error: expected ',' or ';' before ':' token
    5 |   bool bl=true:
      |               ^
a.cc:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
   24 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  int ans10000 = -1;
  int ans5000 = -1;
  int ans1000 = -1;
  for(int i=0;i<a;i++){
   for(int j=0;i+j<a;j++){
    int k = a - i - j;
    int total = 10000*i + 5000*j + 1000*k;
    if(total==b){
     ans10000 = i;
     ans5000 = j;
     ans1000 = k;
    }
   }
  cout << ans10000 << ans5000 << ans1000 << endl;
}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
  int a,b;
  cin >> a >> b;
  int ans10000 = -1;
  int ans5000 = -1;
  int ans1000 = -1;
  for(int i=0;i<a;i++){
   for(int j=0;i+j<a;j++){
    int k = a - i - j;
    int total = 10000*i + 5000*j + 1000*k;
    if(total==b){
     ans10000 = i;
     ans5000 = j;
     ans1000 = k;
    }
  cout << ans10000 << ans5000 << ans1000 << endl;
     return0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:6: error: 'return0' was not declared in this scope
   19 |      return0;
      |      ^~~~~~~
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:9:23: note: to match this '{'
    9 |   for(int i=0;i<a;i++){
      |                       ^
a.cc:20:2: error: expected '}' at end of input
   20 | }
      |  ^
a.cc:3:12: note: to match this '{'
    3 | int main() {
      |            ^
Language: C++

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

int main(){
  int n,y;
  cin>>n>>y;
  int count=0;
  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){
          if(i*10000+j*5000+k*1000==y){
            cout<<i<<" "<<j<<" "<<k<<endl;
            break;
          }
        }
        else
          count++;
      }
    }
  }
  if(count==n*3)
    cout<<"-1"<<" "<<-"1"<<" "<<"-1"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: wrong type argument to unary minus
   23 |     cout<<"-1"<<" "<<-"1"<<" "<<"-1"<<endl;
      |                       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
/*
alias g='g++ -std=c++17 -O2 pra.cpp'
alias a='./a.out'
cd programming
cd cpp
cd practice

*/
/*
clock_t start = clock();
処理
cout<<"cpu時間: "<<(double)(end-start)/CLOCKS_PER_SEC<<"秒"<< endl;
clock_t end = clock();
*/
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
//if (i) cout << " "; で最初のみ空白文字を出力することができる
#define Sort(v) sort((v).begin(), (v).end())
#define pb push_back
using veci = vector<int>;
using vecs = vector<string>;
using vecd = vector<double>;
using vecl = vector<long long>;
using G = vector<vector<int>>;
using ll = long long;
using P = pair<int, int>;
double PI = acos(-1);
ll lINF = LLONG_MAX; ll lmINF = LLONG_MIN;
int INF = INT_MAX; int mINF = INT_MIN;
struct point{
    double x;
    double y;
};
int main(){
    int n, y; cin >> n >> y;
    int a, b, c;
    y /= 1000;
    for (a=0; a<=n;a++){
        for(b=0; b<=n;b++){
                /*if ((10 * a) + (5*b)+ (n-a-b) < y || b<0||c<0){
                    cout << -1 << " " << -1 << " " << -1 << endl;
                    return 0;
                }*/
                if ((10 * a) + (5*b)+ n-a-b == y){
                    cout << a << " " << b << " " << c << endl;
                    return 0;
                }
                /*`else if (y + 5 > (10 * a) + (5*b)+n-a-b && (10 * a) + (5*b)+c >= y + 1){
                    b--; c++;
                    continue;
                }
                else if (y + 9 > (10 * a) + (5*b)+n-a-b && (10 * a) + (5*b)+c >= y + 5){
                    a--; b++;
                    continue;
                }
                else if ((10 * a) + (5*b)+ n-a-b >= y + 9){
                    a--; c++;
                    continue;
                }*/
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    return 0;
}

Compiler output:
a.cc:66:5: error: 'cout' does not name a type
   66 |     cout << -1 << " " << -1 << " " << -1 << endl;
      |     ^~~~
a.cc:67:5: error: expected unqualified-id before 'return'
   67 |     return 0;
      |     ^~~~~~
a.cc:68:1: error: expected declaration before '}' token
   68 | }
      | ^
Language: C

#include <stdio.h>
int main()
{
	int N, a, b, c, total, S, ans0 = 0;
	scanf("%d", &N);
	scanf_s("%d", &S);
	for (a = 0; a <= N; a++) {
		for (b = 0; b <= N; b++) {
			c = N - a - b;
			total = a * 10000 + b * 5000 + c * 1000;
			if (a + b + c == N && total == S) {
				printf("%d %d %d", a, b, c);
				ans0++;
			}
          if(ans0 == 1){
          break;
          }
		}
	}
	if (ans0 == 0) {
		printf("-1 -1 -1");
	}
}

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

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

int main(){
  int n, y;
  cin >> n >> y;
  int ans10000 = -1, ans5000 = -1, ans1000 = -1;
  for(int i = 0; i <= n; i++){
    for(int j = 0; j + i <= n; j++){
      int k = n - i - j;
      int total = 10000 * a + 5000 * b + 1000 * c;
      if(total == y){
        ans10000 = a;
        ans5000 = b;
        ans1000 = c;
      }
    }
  }
  cout << ans10000 << " " << ans5000 << " " << ans1000 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: 'a' was not declared in this scope
   11 |       int total = 10000 * a + 5000 * b + 1000 * c;
      |                           ^
a.cc:11:38: error: 'b' was not declared in this scope
   11 |       int total = 10000 * a + 5000 * b + 1000 * c;
      |                                      ^
a.cc:11:49: error: 'c' was not declared in this scope
   11 |       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 a=-1,b=-1,c=-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){
              count++;
              a=i;
              b=j;
              c=n-i-j;
            }
    }
  }

  	cout << a << ' '<< b << ' ' << c;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: no post-increment operator for type
   12 |               count++;
      |                    ^~
Language: C++

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

int main() {
  int n,y;
  cin >> n >> y;
  int count=0;
  int a,b,c;
  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){
              count++;
              a=i;
              b=j;
              c=l;
            }
    }
  }
  if(count){
  	cout << a << ' '<< b << ' ' << c;
  }else{
  	cout << "-1 -1 -1" << endl;
  }
}



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

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

int main() {
  int n,y;
  cin >> n >> y;
  int count=0;
  int a,b,c;
  for(int i=0;i<n;i++){
  	for(int j=0;j<n-i;j++){
    	for(int l=0;i<n-i-j;l++){
        	if(10000*i+5000*j+1000*l==y){
              count++;
              a=i;
              b=j;
              c=l;
            }
        }
    }
  }
  if(count){
  	cout << a+" "+b+" "+c << endl;
  }else{
  	cout << "-1 -1 -1" << endl;
  }
}



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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N >> Y;
      |         ^~~
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << "-1 -1 -1" << endl;
      |         ^~~~
a.cc:14:31: error: 'endl' was not declared in this scope
   14 |         cout << "-1 -1 -1" << endl;
      |                               ^~~~
Language: C++

# https://atcoder.jp/contests/abs/tasks/abc085_c

val = [10000, 5000, 1000]

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

mx = [y // i for i in val]
nm = [0, 0, 0]
an = [-1, -1, -1]  # 回答入れ
is_find = False

for nm[0] in range(min(n, mx[0]) + 1):
    for nm[1] in range(min(n, mx[1]) + 1):
        nm[2] = n - nm[0] - nm[1]
        if nm[2] < 0:
            break
        elif nm[0] * val[0] + nm[1] * val[1] + nm[2] * val[2] == y and nm[2] >= 0:
            an = nm
            is_find = True
            break
    if is_find:
        break

print("{} {} {}".format(an[0], an[1], an[2]))
pass


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #https
    1 | # https://atcoder.jp/contests/abs/tasks/abc085_c
      |   ^~~~~
a.cc:9:20: error: stray '#' in program
    9 | an = [-1, -1, -1]  # 回答入れ
      |                    ^
a.cc:3:1: error: 'val' does not name a type
    3 | val = [10000, 5000, 1000]
      | ^~~
Language: C++

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

int main(){
  int N, Y, a, b, c;
  a = -1;
  b = -1;
  c = -1;
  bool finished = false;
  cin >> N >> Y;
  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){
          a = i;
          b = j;
          c = N - i - j;
          finished = true;
          break;
        }
      }
     
    }
    if(finished){
      break;
    }
  }
  cout << a << " " << b << " " << c << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:26:7: error: break statement not within loop or switch
   26 |       break;
      |       ^~~~~
a.cc: At global scope:
a.cc:29:3: error: 'cout' does not name a type
   29 |   cout << a << " " << b << " " << c << endl;
      |   ^~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main(){
  int N, Y, a, b, c;
  a = -1;
  b = -1;
  c = -1;
  bool finished = false;
  cin >> N >> Y;
  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){
          a = i;
          b = j;
          c = k;
          finished = true;
          break;
        }
      }
     
    }
    if(finished){
      break;
    }
  }
  cout << a << " " << b << " " << c << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'k' was not declared in this scope
   18 |           c = k;
      |               ^
a.cc:26:7: error: break statement not within loop or switch
   26 |       break;
      |       ^~~~~
a.cc: At global scope:
a.cc:29:3: error: 'cout' does not name a type
   29 |   cout << a << " " << b << " " << c << endl;
      |   ^~~~
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

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

int main(){
  int N, Y, a, b, c;
  a = -1;
  b = -1;
  c = -1;
  bool finished = false;
  cin >> N >> Y;
  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(10000 * i + 5000 * j + 1000 * k == Y){
          a = i;
          b = j;
          c = k;
          finished = true;
          break;
        }
      }
      if(finished){
        break:
      }
    }
    if(finished){
      break;
    }
  }
  cout << a << " " << b << " " << c << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: expected ';' before ':' token
   24 |         break:
      |              ^
      |              ;
a.cc:24:14: error: expected primary-expression before ':' token
Language: C++

#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  ll n,k; cin  >>n>>k;
   for(ll i=0;i<n+1;i++){
     rep(ll j=0;j<n+1;j++){
       if(i+j<=n&&i*100000+j*5000+(n-i-j)*1000==k){
         cout <<i<<" "<<j<<" "<<n-i-j<<endl;
         return 0;
       }
     }
   }
  cout <<-1<<" "<<-1<<" "<<-1<<endl;
}

Compiler output:
a.cc:23:26: error: macro "rep" requires 2 arguments, but only 1 given
   23 |      rep(ll j=0;j<n+1;j++){
      |                          ^
a.cc:15:9: note: macro "rep" defined here
   15 | #define rep(i, n) for(int i = 0; i < (int)n; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:23:6: error: 'rep' was not declared in this scope
   23 |      rep(ll j=0;j<n+1;j++){
      |      ^~~
Language: C++

#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  ll n,k; cin  >>n>>k;
   rep(i,n+1){
     rep(j,n+1){
       if(i+j<=n&&i*100000+j*5000+(n-i-j)*1000==k){
         cout <<i<<" "<<j<<" "<<n-i-j<<endl;
         return 0;
       }
     }
   }
  out <<-1<<" "<<-1<<" "<<-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:3: error: 'out' was not declared in this scope
   30 |   out <<-1<<" "<<-1<<" "<<-1<<endl;
      |   ^~~
Language: C++

#include<iostream>

using namespace std;

int main(){
    int N, Y;
    bool TF = false;
    cin >> N >> Y;
    for(int x = 0; x <= Y / 10000; x++){
        for(int y = 0; y <= (Y - 10000 * x) / 5000; y++){
            int z == N - x - y;
            if(x * 10000 + y * 5000 + z * 1000 == Y){
                cout << x << ' ' << y << ' ' << z << endl;
                TF = true;
                break;
                }
        }
        if(TF == true) break;
    }
    if(TF == false) cout << -1 << ' ' << -1 << ' ' << -1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected initializer before '==' token
   11 |             int z == N - x - y;
      |                   ^~
a.cc:12:39: error: 'z' was not declared in this scope
   12 |             if(x * 10000 + y * 5000 + z * 1000 == Y){
      |                                       ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '.' token
    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 n,y;
  cin>>n>>y;
  int u_a=y/10000;
  int u_b=y/5000;
  int l=-1;
  int m=-1;
  int n=-1;
  for(int a=0;a<=u_a;a++){
    for(int b=0;b<=u_b;b++){
      int c=n-10000*a-5000*b;
      c/=1000;
      if(a+b+c==n){
        l=a;
        m=b;
        n=c;
        break;
      }
    }
  }
  cout<<l<<" "<<m<<" "<<n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: redeclaration of 'int n'
   11 |   int n=-1;
      |       ^
a.cc:5:7: note: 'int n' previously declared here
    5 |   int n,y;
      |       ^
Language: C++

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

int main() {
  int n,y;
  cin>>n>>y;
  int u_a=y/10000;
  int u_b=y/5000;
  int l=-1;
  int m=-1;
  int n=-1;
  for(int a=0;x<=u_a;a++){
    for(int b=0;b<=u_b;b++){
      int c=n-10000*a-5000*b;
      c/=1000;
      if(a+b+c==n){
        l=a;
        m=b;
        n=c;
        break;
      }
    }
  }
  cout<<l<<" "<<m<<" "<<n<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: redeclaration of 'int n'
   11 |   int n=-1;
      |       ^
a.cc:5:7: note: 'int n' previously declared here
    5 |   int n,y;
      |       ^
a.cc:12:15: error: 'x' was not declared in this scope
   12 |   for(int a=0;x<=u_a;a++){
      |               ^
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 i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      int k=n-i-j;
      int total=10000*k+5000*i+1000*j;
      if(total==y){
        res10000=k;
        res5000=i;
        res1000=j;
      }
    }
  }
  cout << res10000 << " " << res5000 << " " << res1000 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: 'res5000' was not declared in this scope; did you mean 'res10000'?
    6 |   int res10000=-1;res5000=-1;res1000=-1;
      |                   ^~~~~~~
      |                   res10000
a.cc:6:30: error: 'res1000' was not declared in this scope; did you mean 'res10000'?
    6 |   int res10000=-1;res5000=-1;res1000=-1;
      |                              ^~~~~~~
      |                              res10000
Language: C++

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

int main() {
  int n, Y;
  cin >> n >> Y;
  int rx, ry, rz;
  rx = -1;
  ry = -1;
  rz = -1;
  for (int x = 0; x <= n; x++) {
    for (int y = 0; y <= n; y++) {
      if (n - x - y >= 0 && 10000 * x + 5000 * y + 1000 * (n - x - y) == Y) {
        rx = x;
        ry = y;
        rz = z;
      }
    }
  }
  cout << rx << ' ' << ry << ' ' << rz << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: 'z' was not declared in this scope
   16 |         rz = z;
      |              ^
Language: C++

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

int main() {
  int n, Y;
  cin >> n >> Y;
  int rx, ry, rz;
  rx = -1;
  ry = -1;
  rz = -1;
  for (int x = 0; x <= n; x++) {
    for (int y = 0; y <= n; y++) {
      if (n - x - y >= 0 && 10000 * x + 5000 * y + 1000 * z == Y) {
        rx = x;
        ry = y;
        rz = z;
      }
    }
  }
  cout << rx << ' ' << ry << ' ' << rz << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:59: error: 'z' was not declared in this scope
   13 |       if (n - x - y >= 0 && 10000 * x + 5000 * y + 1000 * z == Y) {
      |                                                           ^
Language: C++

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

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

    int a = -1;
    int b = -1;
    int c = -1;
    int total = 0;
    for(int i = 0; i <= n; i++){
        for(int j = 0; i + j <= n; j++){
            total = 10000*i + 5000*j + 1000*(n - i - j)
            if(total == y){
                a = i;
                b = j;
                c = n - i - j;
            }
        }
    }

    cout << a << b << c << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:56: error: expected ';' before 'if'
   14 |             total = 10000*i + 5000*j + 1000*(n - i - j)
      |                                                        ^
      |                                                        ;
   15 |             if(total == y){
      |             ~~
Language: C++

const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

const double PI = acos(-1);

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector<int> > G;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Yes[2] = {"No", "Yes"};
string YES[2] = {"NO", "YES"};
string Psb[2] = {"Impossible", "Possible"};
string psb[2] = {"impossible", "possible"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n, y;
    cin >> n >> y;
    y /= 10000;
    forn(a, n + 1)
    {
        forn(b, n + 1)
        {
            if (a + b <= n && y - 10 * a - 5 * b == n - a - b) cout << a << " " << b << " " << c, exit(0);
        }
    }
    cout << "-1 -1 -1";
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:99:96: error: 'c' was not declared in this scope
   99 |             if (a + b <= n && y - 10 * a - 5 * b == n - a - b) cout << a << " " << b << " " << c, exit(0);
      |                                                                                                ^