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

import java.util.*;
 
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int num = Integer.parseInt(sc.nextLine());
   long jap = Integer.parseInt(sc.nextLine());
   long btc = Integer.parseInt(sc.nextLine());
   long sum = (long)jap +(long) btc *380000.0;
   System.out.println(sum);
	}
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to long
   long sum = (long)jap +(long) btc *380000.0;
                        ^
1 error
Language: C++

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <cstdio>

#define BTC1 380000.0

int main(){
  int N;
  double btc_sum;
  double yen;
  double total;
  char unit[4];
  double tmp;
  scanf("%d\n", &N);
  
  yen = 0;
  btc_sum = 0;
  total = 0;
  for(int l1 = 0; l1 < N; l1++){
    scanf("%lf %s\n", &tmp, unit);
    if(strcmp(unit, "YEN") == 0){
      yen += tmp;
    }else if(strcmp(unit, "BTC") == 0){
      btc_sum += tmp;
  }
  printf("%.1f", btc_sum*BTC1 + yen);
  
  return 0;
}


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

#include <iostream>
#include <cstdlib>

int main()
{
    int N;
    scanf("%d\n", &N);
    double x;
    char u[5];
    
    double sum = 0;
    for(int i = 0; i < N; i++){
        scanf("%lf %s\n", &x, u);
        if(u[0] == 'J' && u[1] == 'P' && u[2] == 'Y'){
            sum += x;
        }
        else if(u[0] == 'B' && u[1] == 'T' && u[2] == 'C'){
            sum += x * 380000.0;
        }
        else{
           (void)0; //NO STATEMENT
        }
    }
    printf("%.8f",sum);
    return 0;
}


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

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

int main(){
    int n;
    double y[11], cnt;
    string u[11];
    cin >> n;
    cnt = 0.0;
    for(int i = 0; i < n; i++){
        cin >> y[i] >> u[i];
        if(u[i] = 'JPY') cnt += y[i];
        else cnt += y[i] * 380000.0;
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc:12:19: warning: multi-character character constant [-Wmultichar]
   12 |         if(u[i] = 'JPY') cnt += y[i];
      |                   ^~~~~
a.cc: In function 'int main()':
a.cc:12:19: warning: overflow in conversion from 'int' to 'char' changes value from '4870233' to '89' [-Woverflow]
a.cc:12:17: error: could not convert 'u[i].std::__cxx11::basic_string<char>::operator=(89)' from 'std::__cxx11::basic_string<char>' to 'bool'
   12 |         if(u[i] = 'JPY') cnt += y[i];
      |            ~~~~~^~~~~~~
      |                 |
      |                 std::__cxx11::basic_string<char>
Language: Java

import java.util.*;
 
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int num = Integer.parseInt(sc.nextLine());
   long jap = Integer.parseInt(sc.nextLine());
   long btc = Integer.parseInt(sc.nextLine());
   long sum = jap +(long) btc *380000.0;
   System.out.println(sum);
	}
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to long
   long sum = jap +(long) btc *380000.0;
                  ^
1 error
Language: Java

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        double c = 0;
        for (int i = 0;i < N; i++){
            double a = sc.nextDouble();
            String st = sc.next();
            if (st.equals("JPY")) {
                c += a;
            }
            else if (st.equals("BTC")) {
                c += a * 380000;
            }
        }
        System.out.println(c);
    }
}

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

import java.util.*;

public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int num = Integer.parseInt(sc.nextLine());
   float jap = Integer.parseInt(sc.nextLine());
   float btc = Integer.parseInt(sc.nextLine());
   float sum = jap + btc *380000.0;
   System.out.println(sum);
	}
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to float
   float sum = jap + btc *380000.0;
                   ^
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int i,ans,n = sc.nextInt();
    
    ans = 0;
    for(i=0;i<n;i++){
      double x = sc.nextDouble();
      String u = sc.nextString();
      if(u=="BTC"){
        x *= 380000;
      }
      ans += x;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:11: error: cannot find symbol
      String u = sc.nextString();
                   ^
  symbol:   method nextString()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;

public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int num = Integer.parseInt(sc.nextLine());
	int jap = Integer.parseInt(sc.nextLine());
   long btc = Integer.parseInt(sc.nextLine());
   long sum =(long)jap + btc *380000.0;
   System.out.println(sum);
	}
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to long
   long sum =(long)jap + btc *380000.0;
                       ^
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int i,ans,n = sc.nextInt();
    
    ans = 0;
    for(i=0;i<n;i++){
      double x = sc.nextInt();
      String u = sc.nextInt();
      if(u=="BTC"){
        x *= 380000;
      }
      ans += x;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:11: error: incompatible types: int cannot be converted to String
      String u = sc.nextInt();
                           ^
1 error
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int i,ans,n = sc.nextInt();
    ans = 0;
    for(i=0;i<n;i++){
      double x = sc.nextInt();
      string u = sc.nextInt();
      if(u==BTC){
        x *= 380000;
      }
      ans += x;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:10: error: cannot find symbol
      string u = sc.nextInt();
      ^
  symbol:   class string
  location: class Main
Main.java:11: error: cannot find symbol
      if(u==BTC){
            ^
  symbol:   variable BTC
  location: class Main
2 errors
Language: C++

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

#define rate 380000
int main(void){
    int N,sum=0;
    cin>>N;

    double x[N];
    string u[i];

    for(int i=0;i<N;i++){
        cin>>x[i]>>u[i];
        int yen;
        if(u[i]=="BTC")
             yen=x[i]*x[i];
        else
            yen=x[i];
        sum+=yen;
    }
    cout<<sum<<endl;

    return 0;
}


Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++>h>
      |                       ^
a.cc:1:9: fatal error: bits/stdc++>: No such file or directory
    1 | #include<bits/stdc++>h>
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
using namespace std;
int main(){
  double x[10];
  double y[10];
  int z[10];
  string u[10];
  int N;
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> x[i] >> u[i];
    if(u[i]=="BTC"){
      y[i] = x[i]*380000;
    }else{
      z[i] = x[i]
    }
  }
  cout << y[0]+y[1]+y[2]+y[3]+y[4]+y[5]+y[6]+y[7]+y[8]+y[9]+z[0]+z[1]+z[2]+z[3]+z[4]+z[5]+z[6]+z[7]+z[8]+z[9] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before '}' token
   15 |       z[i] = x[i]
      |                  ^
      |                  ;
   16 |     }
      |     ~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int i,ans,n = nextInt();
    ans = 0;
    for(i=0;i<n;i++){
      double x = nextInt();
      string u = nextInt();
      if(u==BTC){
        x *= 380000;
      }
      ans += x;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:6: error: cannot find symbol
    int i,ans,n = nextInt();
                  ^
  symbol:   method nextInt()
  location: class Main
Main.java:9: error: cannot find symbol
      double x = nextInt();
                 ^
  symbol:   method nextInt()
  location: class Main
Main.java:10: error: cannot find symbol
      string u = nextInt();
      ^
  symbol:   class string
  location: class Main
Main.java:10: error: cannot find symbol
      string u = nextInt();
                 ^
  symbol:   method nextInt()
  location: class Main
Main.java:11: error: cannot find symbol
      if(u==BTC){
            ^
  symbol:   variable BTC
  location: class Main
5 errors
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args){
    Scannr sc = new Scanner(System.in);
    int i,ans,n = nextInt();
    ans = 0;
    for(i=0;i<n;i++){
      double x = nextInt();
      string u = nextInt();
      if(u==BTC){
        x *= 380000;
      }
      ans += x;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:5: error: cannot find symbol
    Scannr sc = new Scanner(System.in);
    ^
  symbol:   class Scannr
  location: class Main
Main.java:6: error: cannot find symbol
    int i,ans,n = nextInt();
                  ^
  symbol:   method nextInt()
  location: class Main
Main.java:9: error: cannot find symbol
      double x = nextInt();
                 ^
  symbol:   method nextInt()
  location: class Main
Main.java:10: error: cannot find symbol
      string u = nextInt();
      ^
  symbol:   class string
  location: class Main
Main.java:10: error: cannot find symbol
      string u = nextInt();
                 ^
  symbol:   method nextInt()
  location: class Main
Main.java:11: error: cannot find symbol
      if(u==BTC){
            ^
  symbol:   variable BTC
  location: class Main
6 errors
Language: C++


#include "pch.h"
#include <iostream>
#include <string>

using namespace std;

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

	double x[10];
	int u[10];
	string v;
	double sum = 0;

	for (int i = 0; i < n; i++) {
		cin >> x[i] >> v;
		if (v == "JPY") u[i] = 1;
		else u[i] = 380000;
		sum += x[i] * u[i];
	}

	cout << sum << endl;

	return 0;
}

Compiler output:
a.cc:2:10: fatal error: pch.h: No such file or directory
    2 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int num = Integer.parseInt(sc.nextLine());
	int jap = Integer.parseInt(sc.nextLine());
   long btc = Integer.parseInt(sc.nextLine());
   long sum = jap + btc *380000.0;
   System.out.println(sum);
	}
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from double to long
   long sum = jap + btc *380000.0;
                  ^
1 error
Language: C++

#include <string>

using namespace std;

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

	double x[10];
	int u[10];
	string v;
	double sum = 0;

	for (int i = 0; i < n; i++) {
		cin >> x[i] >> v;
		if (v == "JPY") u[i] = 1;
		else u[i] = 380000;
		sum += x[i] * u[i];
	}

	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <string>
  +++ |+#include <iostream>
    2 | 
a.cc:21:9: error: 'cout' was not declared in this scope
   21 |         cout << sum << endl;
      |         ^~~~
a.cc:21:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:24: error: 'endl' was not declared in this scope
   21 |         cout << sum << endl;
      |                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <string>
  +++ |+#include <ostream>
    2 |
Language: C++

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


int main(){
  int i, N ;
  cin >> N;
  float x[N];
  string u[N];
  for(i = 0 ; i < N ; i++) cin >> x[i]; cin >> u[i];
  
  // BTCをJPYに
  for(i = 0 ; i < N ; i++){
    if (u[i] == "BTC"){
      x[i] = x[i] * 380000.0;
      u[i] = "JPY";
    }
  }
  
  //sum
  float sum = 0.0;
  for(i = 0 ; i < N ; i++){
    sum += x[i]
  }
  
  cout << sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before '}' token
   25 |     sum += x[i]
      |                ^
      |                ;
   26 |   }
      |   ~
Language: Java

public class Main{
  public static void main(String args[]) {
    int n = args[0];
    int b = 380000;
    double d=0;
    for(int i=1;i<n;i++) {
      String[] s=args[i].split(" ");
      if(s[1].equals("JPY")) {
        d+=Integer.parseInt(s[0]);
      }
      else{
        d+=Double.parseDouble(s[0])*b;
      }
    }
    System.out.println(d);
  }
}

Compiler output:
Main.java:3: error: incompatible types: String cannot be converted to int
    int n = args[0];
                ^
1 error
Language: C++

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <cstdio>

#define BTC1 380000.0

int main(){
  int N;
  double btc_sum;
  double yen;
  double total;
  char unit[4];
  double tmp;
  scanf("%d\n", &N);
  
  yen = 0;
  btc_sum = 0;
  total = 0;
  for(int l1 = 0; l1 < N; l1++){
    scanf("%lf %s\n", tmp, unit);
    if(strcmp(unit, "YEN") == 0){
      yen += tmp;
    }else if(strcmp(unit, "BTC") == 0){
      btc_sum += tmp;
  }
  printf("%.1f", btc_sum*BTC1 + yen);
  
  return 0;
}


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

using namespace std;

int main() {
  int N;
  cin>>N;
  vector<double> vec1(N);
  vector<string> vec2(N);
  for(int i=0;i<N;i++){
  	cin>>vec1.at(i)>>vec2.at(i);}
  	double ans=0;
  	for(int i=0;i<N;i++){
  		if(vec2.at(i)=="JPY"){ans+=vec1.at(i);}
  		else{ans+=vec1.at(i)*380000.0;}
  	}
  	cout<<ans<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>N;
      |   ^~~
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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<double> vec1(N);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'double'
    6 |   vector<double> vec1(N);
      |          ^~~~~~
a.cc:7:10: error: 'string' was not declared in this scope
    7 |   vector<string> vec2(N);
      |          ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:7:18: error: 'vec2' was not declared in this scope
    7 |   vector<string> vec2(N);
      |                  ^~~~
a.cc:9:14: error: 'vec1' was not declared in this scope
    9 |         cin>>vec1.at(i)>>vec2.at(i);}
      |              ^~~~
a.cc:12:44: error: 'vec1' was not declared in this scope
   12 |                 if(vec2.at(i)=="JPY"){ans+=vec1.at(i);}
      |                                            ^~~~
a.cc:13:27: error: 'vec1' was not declared in this scope
   13 |                 else{ans+=vec1.at(i)*380000.0;}
      |                           ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope
   15 |         cout<<ans<<endl;
      |         ^~~~
a.cc:15:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:20: error: 'endl' was not declared in this scope
   15 |         cout<<ans<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

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

using ll = int64_t;
#define int ll

#define FOR(i, a, b) for (int i = int(a); i < int(b); i++)
#define REP(i, b) FOR(i, 0, b)
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define ALL(x) x.begin(), x.end()
auto &errStream = cerr;
#ifdef LOCAL
#define cerr (cerr << "-- line " << __LINE__ << " -- ")
#else
class CerrDummy {
} cerrDummy;
template <class T> CerrDummy &operator<<(CerrDummy &cd, const T &) {
  return cd;
}
using charTDummy = char;
using traitsDummy = char_traits<charTDummy>;
CerrDummy &operator<<(CerrDummy &cd,
    basic_ostream<charTDummy, traitsDummy> &(
      basic_ostream<charTDummy, traitsDummy> &)) {
  return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr << "reached" << endl
#define DMP(x) cerr << #x << ":" << x << endl
#define ZERO(x) memset(x, 0, sizeof(x))
#define ONE(x) memset(x, -1, sizeof(x))

using pi = pair<int, int>;
using vi = vector<int>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  REP(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

ll read() {
  ll i;
  scanf("%" SCNd64, &i);
  return i;
}

void printSpace() { printf(" "); }

void printEoln() { printf("\n"); }

void print(ll x, int suc = 1) {
  printf("%" PRId64, x);
  if (suc == 1)
    printEoln();
  if (suc == 2)
    printSpace();
}

string readString() {
  static char buf[3341000];
  scanf("%s", buf);
  return string(buf);
}

char *readCharArray() {
  static char buf[3341000];
  static int bufUsed = 0;
  char *ret = buf + bufUsed;
  scanf("%s", ret);
  bufUsed += strlen(ret) + 1;
  return ret;
}

template <class T, class U> void chmax(T &a, U b) {
  if (a < b)
    a = b;
}

template <class T, class U> void chmin(T &a, U b) {
  if (b < a)
    a = b;
}

template <class T> T Sq(const T &t) { return t * t; }

#define CAPITAL
void Yes(bool ex = true) {
#ifdef CAPITAL
  cout << "YES" << endl;
#else
  cout << "Yes" << endl;
#endif
  if (ex)
    exit(0);
}
void No(bool ex = true) {
#ifdef CAPITAL
  cout << "NO" << endl;
#else
  cout << "No" << endl;
#endif
  if (ex)
    exit(0);
}

const ll infLL = LLONG_MAX / 3;

#ifdef int
const int inf = infLL;
#else
const int inf = INT_MAX / 2 - 100;
#endif

signed main() {
  int N = read();

  unsigned double ans = 0.0, value;
  string currency;
  REP(i, N) {
    cin >> value >> currency;
    if ( currency == "JPY" ) {
      ans += value;
    } else {
      ans += value * 380000;
    }
  }

  cout << ans << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:134:3: error: 'unsigned' specified with 'double'
  134 |   unsigned double ans = 0.0, value;
      |   ^~~~~~~~
a.cc:134:3: error: 'unsigned' specified with 'double'
Language: C++

#include <stdio.h>
#include <string.h>
#include <time.h>
#include <cstdio>

#define BTC1 380000.0

int main(){
  int N;
  double btc_sum;
  double yen;
  double total;
  char unit[4];
  double tmp;
  scanf("%d\n", &N);
  
  yen = 0;
  btc_sum = 0;
  total = 0;
  for(int l1 = 0; l1 < N; l1++){
    scanf("%f %s\n", tmp, unit);
    if(strcmp(unit, "YEN") == 0){
      yen += tmp;
    }else if(strcmp(unit, "BTC") == 0){
      btc_sum += tmp;
  }
  printf("%.1f", btc_sum*BTC1 + yen);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:8:11: note: to match this '{'
    8 | int main(){
      |           ^
Language: Java

public Class Main{
  public static void main(String args[]) {
    int n = args[0];
    int b = 380000;
    double d=0;
    for(int i=1;i<n;i++) {
      String[] s=args[i].split(" ");
      if(s[1].equals("JPY")) {
        d+=Integer.parseInt(s[0]);
      }
      else{
        d+=Double.parseDouble(s[0])*b;
      }
    }
    System.out.println(d);
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
public Class Main{
       ^
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)
Main.java:17: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		//ArrayList<Integer> JPY = new ArrayList<Integer>();
		ArrayList<Double> BTC = new ArrayList<Double>();
		Double x;
		String u;
		Double sum = 0.0;
		for(int i = 0;i < n;i ++) {
			x = sc.nextDouble();
			u = sc.next();
			if(u.equals("JPY")) sum += x;/*JPY.add(x);*/ 
			else BTC.add(x);
		}
		
		for(int i = 0;i < BTC.size();i ++) {
			sum += BTC.get(i) * 380000;
		}
		System.out.println(sum);
	}

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

#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <utility>
#include <string>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>

using namespace std;

enum currency {
	kJPY = 0,
	kBTC = 1,
};

struct present {
	uint32_t yen;
	double   btc;
	currency currency;
};

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

	vector<present> presents(n);
	for (auto& present : presents) {
		string amount;
		cin >> amount;
		string currency_str;
		cin >> currency_str;

		if (currency_str.compare("JPY") == 0) {
			present.currency = kJPY;
		}
		else if (currency_str.compare("BTC") == 0) {
			present.currency = kBTC;
		}
		else {
			assert(!"bug in currency_str");
		}

		if (present.currency == kJPY) {
			present.yen = stoi(amount);
		}
		else {
			present.btc = stod(amount);
		}
	}

	double sum = 0.0;
	for (const auto&present : presents) {
		if (present.currency == kJPY) {
			sum += present.yen;
		}
		else {
			sum += present.btc * 380000.0;
		}
	}

	cout << sum << endl;

	return 0;
}


Compiler output:
a.cc:26:18: error: declaration of 'currency present::currency' changes meaning of 'currency' [-Wchanges-meaning]
   26 |         currency currency;
      |                  ^~~~~~~~
a.cc:26:9: note: used here to mean 'enum currency'
   26 |         currency currency;
      |         ^~~~~~~~
a.cc:18:6: note: declared here
   18 | enum currency {
      |      ^~~~~~~~
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class MainB {
	public static void main(String[] args) {
		final int VALUE = 0;
		final int TYPE = 1;

		Map<String, Double> rateMap = new HashMap<>();
		rateMap.put("JPY", 1.0);
		rateMap.put("BTC", 380000.0);

		Scanner sc = new Scanner(System.in);
		sc.nextLine();

		double sum = 0;
		while (sc.hasNext()) {
			String[] input = sc.nextLine().split(" ");
			double value = Double.valueOf(input[VALUE]);
			double rate = rateMap.get(input[TYPE]);
			sum = sum + value * rate;
		}
		System.out.println(sum);
		sc.close();
	}
}


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

#include<iostream>
#include<algorithm>
#include<vector>
#include <numeric>
using namespace std;
int main(int argc, char const *argv[]) {
    int N,tmp;
    double x;
    string u;
    
    std::cin >> N;


    double ans=0;
    for (size_t i = 0; i < N; i++) {
        std::cin >> x >>u;
        if(u=="JPY")ans = ans+x;
        else and = and + x*380000.0;
    }
    std::cout << ans << '\n';

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:18:18: error: expected identifier before '=' token
   18 |         else and = and + x*380000.0;
      |                  ^
a.cc:18:24: error: expected identifier before '+' token
   18 |         else and = and + x*380000.0;
      |                        ^
Language: C++

#include <cstdio>
#include <climits>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int main() {
    int N;
    cin >> N;
    double total = 0;
    string val, unit;
    for (int i = 0; i < N; i++) {
        cin >> val >> unit;
        if (unit == "BTC") {
            total += ::atof(val.c_str()) * 380000.0;
        } else {
            total += ::atof(val.c_str());
        }
    }
    cout << total << endl;
}


Compiler output:
a.cc:5:9: error: 'pair' does not name a type
    5 | typedef pair<int, int> pii;
      |         ^~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> N;
      |     ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <climits>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:11:5: error: 'string' was not declared in this scope
   11 |     string val, unit;
      |     ^~~~~~
a.cc:3:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    2 | #include <climits>
  +++ |+#include <string>
    3 | using namespace std;
a.cc:13:16: error: 'val' was not declared in this scope
   13 |         cin >> val >> unit;
      |                ^~~
a.cc:13:23: error: 'unit' was not declared in this scope; did you mean 'unix'?
   13 |         cin >> val >> unit;
      |                       ^~~~
      |                       unix
a.cc:15:24: error: '::atof' has not been declared
   15 |             total += ::atof(val.c_str()) * 380000.0;
      |                        ^~~~
a.cc:17:24: error: '::atof' has not been declared
   17 |             total += ::atof(val.c_str());
      |                        ^~~~
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << total << endl;
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:22: error: 'endl' was not declared in this scope
   20 |     cout << total << endl;
      |                      ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include <climits>
  +++ |+#include <ostream>
    3 | using namespace std;
Language: C++

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

void solveA(){
  string s;
  cin >> s;

  int m=10*(s[5]-48) + s[6] -48;
  int d=10*(s[8]-48) + s[9] -48;

  if(m<=4 && d<=30){
    cout << "Heisei" << endl;
  }
  else{
    cout << "TBD" << endl;
  }
}
void solveB(){
  int n;
  cin >> n;
  double ans = 0.0;

  double x;
  string u;
  for(it i=0;i<n;i++){
    cin >> x >> u;
    if(u=="JPY"){
      ans += x;
    }
    else{
      ans += x*380000;
    }
  }
  cout << ans << endl;

}
void solveC(){

  
}

void solveD(){
}

int main(){
  solveB();
}


Compiler output:
a.cc: In function 'void solveB()':
a.cc:25:7: error: 'it' was not declared in this scope; did you mean 'int'?
   25 |   for(it i=0;i<n;i++){
      |       ^~
      |       int
a.cc:25:14: error: 'i' was not declared in this scope
   25 |   for(it i=0;i<n;i++){
      |              ^
Language: C++

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

using namespace std;
//int moreGcd

int main(){
    int N = 0;
    cin >> N;
    string x;
    string u;
    double total = 0;
    for(int i = 0; i < N; i++){
        cin >> x;
        cin >> u;
        
        if(u == "JPY"){
            total += wtoi(x.c_str());
        }else{
            total += wtoi(x.c_str()) * 380000;
        }


    }

    cout << total << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: 'wtoi' was not declared in this scope; did you mean 'atoi'?
   21 |             total += wtoi(x.c_str());
      |                      ^~~~
      |                      atoi
a.cc:23:22: error: 'wtoi' was not declared in this scope; did you mean 'atoi'?
   23 |             total += wtoi(x.c_str()) * 380000;
      |                      ^~~~
      |                      atoi
Language: C++

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

int main(){
	int n;
	cin >> n;
	long y,sum=0;
	string c;

	for (int i=0;i<n; i++){
	cin >> y>>c;
	if (c==“JPY”){
	sum+=y;
}
else{sum+=380000.0*y;}
}
cout<<sum<<endl;
}

Compiler output:
a.cc:12:16: error: extended character “ is not valid in an identifier
   12 |         if (c==“JPY”){
      |                ^
a.cc:12:16: error: extended character ” is not valid in an identifier
a.cc: In function 'int main()':
a.cc:12:16: error: '\U0000201cJPY\U0000201d' was not declared in this scope
   12 |         if (c==“JPY”){
      |                ^~~~~
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class A {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        double sum = 0;
        for (int i = 0; i < N; i++) {
            double x = scan.nextDouble();
            String y = scan.next();
            double t = "JPY".equals(y) ? 1 : 380000;
            sum += x * t;
        }
        System.out.println(sum);
    }
}


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

import java.io.*;
import java.util.*;

public class C{


	public static void main(String[] args) throws IOException {
		Scanner sc=new Scanner();
		PrintWriter out=new PrintWriter(System.out);
		int n=sc.nextInt();
		double ans=0;
		while(n-->0) {
			double x=sc.nextDouble();
			ans+=sc.next().equals("BTC")?x*380000.0:x;
			
		}
		out.println(ans);
		out.close();
	}
	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;
		Scanner(){
			br=new BufferedReader(new InputStreamReader(System.in));
		}
		Scanner(String fileName) throws FileNotFoundException{
			br=new BufferedReader(new FileReader(fileName));
		}
		String next() throws IOException {
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		String nextLine() throws IOException {
			return br.readLine();
		}
		int nextInt() throws IOException{
			return Integer.parseInt(next());
		}
		long nextLong()  throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		double nextDouble() throws NumberFormatException, IOException {
			return Double.parseDouble(next());
		}
	}
}


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

#include <bits/stdc++.h>
using namespace std;
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);cout.precision(20);}} fast;

/* define */
#define FOR(I,X,Y) for(long long (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(long long (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define pb push_back
#define COUNT(V,X) (upper_bound((V).begin(),(V).end(),X)-lower_bound((V).begin(),(V).end(),X))
#define debug(x) cerr<<#x<<':'<<x<<endl;
#define DEBUG(v) cerr<<#v<<':';for(auto xXx:v)cerr<<xXx<<' ';cerr<<endl;
#define Yes(X) if(X){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define YES(X) if(X){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define ctoi(C) (C-'0')
#define pow2(x) ((long long)((long long)1<<x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int,int>;
using pl = pair<long long,long long>;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1,0,-1,0};
const long long dy[] = {0,1,0,-1};
const long long dx8[] = {1,1,0,-1,-1,-1,0,1};
const long long dy8[] = {0,1,1,1,0,-1,-1,-1};
const long long dx9[] = {1,1,0,-1,-1,-1,0,1,0};
const long long dy9[] = {0,1,1,1,0,-1,-1,-1,0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
long long max(long long x,int y){return max(x,(long long)y);}
long long max(int x,long long y){return max((long long)x,y);}
long long min(long long x,int y){return min(x,(long long)y);}
long long min(int x,long long y){return min((long long)x,y);}

/* liblary */



/* main */

signed main(){
	int N;
	ld x;
	string u;
	ld ans = 0;
	FOR(i,0,N){
		cin >> x >> u;
		if(u == "JPY")ans += x;
		else ans += 380000*x;
	}
	cout << ans << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:64:29: error: expected '}' at end of input
   64 |         cout << ans << endl;
      |                             ^
a.cc:54:14: note: to match this '{'
   54 | signed main(){
      |              ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
void chmin(int &a, int b)
{
    if (a > b)
    {
        a = b;
    }
}

vector<int> l;
int n, A, B, C;
int dfs(int i, int a, int b, int c)
{
    if (i == n)
    {
        if (a * b * c == 0)
        {
            return;
        }
        else
        {
            return abs(a - A) + abs(b - B) + abs(c - C);
        }
    }
    //今ある竹を採用しない場合
    int res = dfs(i + 1, a, b, c);
    //A,B,Cのいずれかを使う場合
    chmin(res,dfs(i+1,a+l[i],b,c)+(a?10:0));
    chmin(res,dfs(i+1,a,b+l[i],c)+(b?10:0));
    chmin(res,dfs(i+1,a,b,c+l[i])+(c?10:0));

    return res;
}

int main()
{
    
    cin >> n >> A >> B >> C;
    l.resize(n);
    rep(i, n)
    {
        cin >> l[i];
    }
    cout<<dfs(0,0,0,0)<<endl;
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:23:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   23 |             return;
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
void chmin(int &a, int b)
{
    if (a > b)
    {
        a = b;
    }
}

vector<int> l;
int n, A, B, C;
int dfs(int i, int a, int b, int c)
{
    if (i == n)
    {
        if (a * b * c == 0)
        {
            return;
        }
        else
        {
            return abs(a - A) + abs(b - B) + abs(c - C);
        }
    }
    //今ある竹を採用しない場合
    int res = dfs(i + 1, a, b, c);
    //A,B,Cのいずれかを使う場合
    chmin(res,dfs(i+1,a+l[i],b,c)+(a?10:0));
    chmin(res,dfs(i+1,a,b+l[i],c)+(b?10:0));
    chmin(res,dfs(i+1,a,b,c+l[i])+(c?10:0));

    return res;
}

int main()
{
    int a, b, c, i;
    cin >> n >> a >> b >> c;
    l.resize(n);
    rep(i, n)
    {
        cin >> l[i];
    }
    cout<<dfs(0,0,0,0)<<endl;
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:21:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
   21 |             return;
      |             ^~~~~~
Language: C++


#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007; //998244353;

template<class _T> static void get(_T& a) {
	std::cin >> a;
}
template<class _T> static void get(_T& a, _T& b) {
	std::cin >> a >> b;
}
template<class _T> static void get(_T& a, _T& b, _T& c) {
	std::cin >> a >> b >> c;
}

static void exec();

int main()
{
	exec();
	fflush(stdout);
	return 0;
}

static int dfs(std::vector<int>& len, int now, std::vector<std::vector<int>> sel, int A, int B, int C)
{
	int ans = MOD_NUM;
	if (now >= len.size()) {
		if (sel[0].size() == 0 || sel[1].size() == 0 || sel[2].size() == 0) {
			return MOD_NUM;
		}
		ans = 0;
		int a = 0;
		for (int i = 0; i < sel[0].size(); i++) {
			a += sel[0][i];
		}
		ans += (sel[0].size() - 1) * 10;
		ans += tp_abs(A - a);
		int b = 0;
		for (int i = 0; i < sel[1].size(); i++) {
			b += sel[1][i];
		}
		ans += (sel[1].size() - 1) * 10;
		ans += tp_abs(B - b);
		int c = 0;
		for (int i = 0; i < sel[2].size(); i++) {
			c += sel[2][i];
		}
		ans += (sel[2].size() - 1) * 10;
		ans += tp_abs(C - c);
	}
	else {
		for (int i = 0; i < 4; i++) {
			if (i < 3) {
				sel[i].push_back(len[now]);
			}
			ans = std::min(ans, dfs(len, now + 1, sel, A, B, C));
			if (i < 3) {
				sel[i].erase(sel[i].end() - 1);
			}
		}
	}
	return ans;
}

static void exec()
{
	int N, A, B, C;
	get(N);
	get(A, B, C);

	std::vector<int> len(N);
	for (int i = 0; i < N; i++) {
		get(len[i]);
	}
	std::vector<std::vector<int>> sel(3);
	printf("%d\n", dfs(len, 0, sel, A, B, C));
}


Compiler output:
a.cc: In function 'int dfs(std::vector<int>&, int, std::vector<std::vector<int> >, int, int, int)':
a.cc:53:24: error: 'tp_abs' was not declared in this scope
   53 |                 ans += tp_abs(A - a);
      |                        ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
#define rep(i, j, n) for(int i = (j); i < (n); ++i)

int main() {
	int n, a, b, c; cin >> n >> a >> b >> c;
	int l[8]; rep(i, 0, n) cin >> l[i];

	int ans = 10000;
	rep(i, 0, pow(4, n)) {
		int four = i;
		int alen = 0, blen = 0, clen = 0;
		int cost = 0;
		rep(j, 0, n) {
			int k = four % 4;
			if (k == 0) {
				cost += 10 * (alen != 0);
				alen += l[j];
			}
			if (k == 1) {
				cost += 10 * (blen != 0);
				blen += l[j];
			}
			if (k == 2) {
				cost += 10 * (clen != 0);
				clen += l[j];
			}
			four /= 4;
		}
		if (alen != 0 && blen != 0 && clen != 0) 
			ans = min(ans, cost + abs(a - alen) + abs(b - blen) + abs(c - clen));
	}
	cout << ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'pow' was not declared in this scope
   11 |         rep(i, 0, pow(4, n)) {
      |                   ^~~
a.cc:4:44: note: in definition of macro 'rep'
    4 | #define rep(i, j, n) for(int i = (j); i < (n); ++i)
      |                                            ^
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
string s;
int m,n,t;
void pd(int i,int j)
{
 if(i==m&&j==n)  {
  cout<<s<<endl;t++;
 }
 else{
  if(i<m)  s=s+'A', pd(i+1,j),s.erase(s.size()-1,1);
  if(j<n&&j<i)s=s+'B', pd(i,j+1),s.erase(s.size()-1,1);//回溯 
 }
}
int main()
{
  t=0;s="";
  cin>>m>>n;
  s=s+'A';
  pd(1,0);
  cout<<t;


return 0;
}

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

#include<stdio.h>
#include<string.h>

int main() {
   int N,A,B,C;
   int MP = 0;
   scanf("%d %d %d %d", &N, &A, &B, &C);
   int l[N];
   for(int i = 0; i < N; i++) {
      scanf("%d", &l[i]);
   }
   for(int i = 0; i < N; i++) {
      if(l[i] == A) {
         A = 0;
      } else if(l[i] == B) {
         B = 0;
      } else if(l[i] == C) {
         C = 0;
      }
   }
   if(A == 0 && B == 0; C == 0) {
      printf("%d", 0);
   }
}


Compiler output:
main.c: In function 'main':
main.c:21:23: error: expected ')' before ';' token
   21 |    if(A == 0 && B == 0; C == 0) {
      |      ~                ^
      |                       )
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void chmin(int &a, int b) { if (a > b) a = b; }

int N, A, B, C;
vector<int> L;

int rec(int i, int a, int b, int c) {
    if (i == N) {
        if (!a || !b || !c) return INF; 
        return abs(a - A) + abs(b - B) + abs(c - C); 
    }

    int res = rec(i+1, a, b, c);
    


    chmin(res, rec(i+1, a + L[i], b, c) + (a ? 10 : 0));
    chmin(res, rec(i+1, a, b + L[i], c) + (b ? 10 : 0));
    chmin(res, rec(i+1, a, b, c + L[i]) + (c ? 10 : 0));
    
    return res;
}

int main() {

    cin >> N >> A >> B >> C;
    L.resize(N);
    for (int i = 0; i< N; ++i) cin >> L[i];
    

    cout << rec(0, 0, 0, 0) << endl;
}

Compiler output:
a.cc: In function 'int rec(int, int, int, int)':
a.cc:12:36: error: 'INF' was not declared in this scope
   12 |         if (!a || !b || !c) return INF;
      |                                    ^~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void chmin(int &a, int b) { if (a > b) a = b; }

int N, A, B, C;
vector<int> L;
int rec(int i, int a, int b, int c) {
    if (i == N) {
        if (!a || !b || !c) return INF; 
        return abs(a - A) + abs(b - B) + abs(c - C); 
    }

    
    int res = rec(i+1, a, b, c);
    chmin(res, rec(i+1, a + L[i], b, c) + (a ? 10 : 0));
    chmin(res, rec(i+1, a, b + L[i], c) + (b ? 10 : 0));
    chmin(res, rec(i+1, a, b, c + L[i]) + (c ? 10 : 0));
    
    return res;
}

int main() {
    cin >> N >> A >> B >> C;
    L.resize(N);
    for (int i = 0; i< N; ++i) cin >> L[i];
    cout << rec(0, 0, 0, 0) << endl;
}

Compiler output:
a.cc: In function 'int rec(int, int, int, int)':
a.cc:11:36: error: 'INF' was not declared in this scope
   11 |         if (!a || !b || !c) return INF;
      |                                    ^~~
Language: C++

N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10**9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a,b,c)>0 else INF

    ans = INF
    ans = min(ans, dfs(cur+1, a, b, c))
    ans = min(ans, dfs(cur+1, a + l[cur], b, c)+10)
    ans = min(ans, dfs(cur+1, a, b+l[cur], c)+10)
    ans = min(ans, dfs(cur+1, a, b, c+l[cur])+10)
    return ans

print(dfs(0, 0, 0, 0))

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

include <bits/stdc++.h>
using namespace std;
int l[9];
int n,a,b,c;
int ans;
int dfs(int number,int A,int B,int C){
    if(number==n){
        if(A>0 && B>0 && C>0)ans=abs(A-a)+abs(B-b)+abs(C-c)-30;
        else ans=1e9;
        return ans;
    }
    else{
        if(number==0)ans=1e9;
        int ans1=dfs(number+1,A+l[number],B,C)+10;
        int ans2=dfs(number+1,A,B+l[number],C)+10;
        int ans3=dfs(number+1,A,B,C+l[number])+10;
        int ans4=dfs(number+1,A,B,C);
        return min(min(min(ans1,ans2),ans3),ans4);
    }
}

int main(){
    cin >> n >> a >> b >> c;
    for(int i=0;i<n;i++)cin >> l[i];
    cout << dfs(0,0,0,0) << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:8:34: error: 'abs' was not declared in this scope; did you mean 'ans'?
    8 |         if(A>0 && B>0 && C>0)ans=abs(A-a)+abs(B-b)+abs(C-c)-30;
      |                                  ^~~
      |                                  ans
a.cc:18:24: error: 'min' was not declared in this scope
   18 |         return min(min(min(ans1,ans2),ans3),ans4);
      |                        ^~~
a.cc:18:20: error: 'min' was not declared in this scope
   18 |         return min(min(min(ans1,ans2),ans3),ans4);
      |                    ^~~
a.cc:18:16: error: 'min' was not declared in this scope
   18 |         return min(min(min(ans1,ans2),ans3),ans4);
      |                ^~~
a.cc: In function 'int main()':
a.cc:23:5: error: 'cin' was not declared in this scope
   23 |     cin >> n >> a >> b >> c;
      |     ^~~
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << dfs(0,0,0,0) << endl;
      |     ^~~~
a.cc:25:29: error: 'endl' was not declared in this scope
   25 |     cout << dfs(0,0,0,0) << endl;
      |                             ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int l[9];
int n,a,b,c;
int ans;
int dfs(int number,int A,int B,int C){
    if(number==n){
        if(A>0 && B>0 && C>0)ans=abs(A-a)+abs(B-b)+abs(C-c)-30;
        return ans;
    }
    else{
        if(number==0)ans=1e9;
        int ans1=dfs(number+1,A+l[number],B,C)+10;
        int ans2=dfs(number+1,A,B+l[number],C)+10;
        int ans3=dfs(number+1,A,B,C+l[number])+10;
        int ans4=dfs(number+1,A,B,C);
        return min(ans1,ans2,ans3,ans4);
    }
}

int main(){
    cin >> n >> a >> b >> c;
    for(int i=0;i<n;i++)cin >> l[i];
    cout << dfs(0,0,0,0) << endl;
}

Compiler output:
a.cc: In function 'int dfs(int, int, int, int)':
a.cc:17:19: error: no matching function for call to 'min(int&, int&, int&, int&)'
   17 |         return min(ans1,ans2,ans3,ans4);
      |                ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 4 provided