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

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
    int a,b,c,k,max,n=1;
    cin >> a >> b >> c >> k;
    max = max(a,max(b,c));
    FOR(int i,0,k)n *= 2;
    cout << a + b + c + max * (n-1);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: 'max' cannot be used as a function
   41 |     max = max(a,max(b,c));
      |                 ~~~^~~~~
a.cc:41:25: error: 'max' cannot be used as a function
   41 |     max = max(a,max(b,c));
      |                         ^
a.cc:22:24: error: two or more data types in declaration of 'i'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                        ^~~
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected initializer before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected ';' before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected primary-expression before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:39: error: expected ')' before ';' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                       ~               ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:42:9: error: expected primary-expression before 'int'
   42 |     FOR(int i,0,k)n *= 2;
      |         ^~~
a.cc:22:42: note: in definition of macro 'FOR'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                          ^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
    int a,b,c,k,max,n=1;
    cin >> a >> b >> c >> k;
    max = max(a,max(b,c));
    FOR(int i,0,k)n *= 2;
    cout << a + b + c + max * (n-1);
    else if(k == 2)cout << (a+b+c)*2 - min(a,min(b,c));
    else if(k >= 3)cout << (a+b+c)*2;
    else cout << a + b + c;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:20: error: 'max' cannot be used as a function
   41 |     max = max(a,max(b,c));
      |                 ~~~^~~~~
a.cc:41:25: error: 'max' cannot be used as a function
   41 |     max = max(a,max(b,c));
      |                         ^
a.cc:22:24: error: two or more data types in declaration of 'i'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                        ^~~
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected initializer before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected ';' before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:35: error: expected primary-expression before '<' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                   ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:22:39: error: expected ')' before ';' token
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                       ~               ^
a.cc:42:5: note: in expansion of macro 'FOR'
   42 |     FOR(int i,0,k)n *= 2;
      |     ^~~
a.cc:42:9: error: expected primary-expression before 'int'
   42 |     FOR(int i,0,k)n *= 2;
      |         ^~~
a.cc:22:42: note: in definition of macro 'FOR'
   22 | #define FOR(i,b,e) for(int i=(b);i<(e);++i)
      |                                          ^
a.cc:44:5: error: 'else' without a previous 'if'
   44 |     else if(k == 2)cout << (a+b+c)*2 - min(a,min(b,c));
      |     ^~~~
Language: C

#include<stdio.h>

int main(void){
int a, b, c;
int n;
if(a>b){
if(a>c){
for(n;n>0;n--){
a＊=2;
}
}else{
for(n;n>0;n--){
c＊=2;
}
}
}else{
if(b>c){
for(n;n>0;n--){
b＊=2;
}
}else{
for(n;n>0;n--){
c＊=2;
}
}
}
printf("%d",a+b+c);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:1: error: 'a\U0000ff0a' undeclared (first use in this function)
    9 | a＊=2;
      | ^~~
main.c:9:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:1: error: 'c\U0000ff0a' undeclared (first use in this function)
   13 | c＊=2;
      | ^~~
main.c:19:1: error: 'b\U0000ff0a' undeclared (first use in this function)
   19 | b＊=2;
      | ^~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int arr[5];
int main()
{
	int k,sum=0,temp;
	for(int i=0;i<3;i++){
		cin>>arr[i];
		sum+=arr[i];
	}
	cin>>k;
	sort(arr,arr+3);
	sum-=arr[2];
	temp=arr[2];
	for(int i=1;i<=n;i++){
		temp*=2;
		sum+=temp;
	}
	cout<<sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'n' was not declared in this scope
   16 |         for(int i=1;i<=n;i++){
      |                        ^
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int A,B,C,K;
    cin>>A>>B>>C;
    cin>>K;
    int sum=A+B+C;

    int MAX;
    MAX=std::max({A,B,C});
    sum-=MAX;
    cout<<sum+MAX*pow(2,K)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   13 |     MAX=std::max({A,B,C});
      |         ~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int arr[5];
int main()
{
	int k,sum=0,temp;
	for(int i=0;i<3;i++){
		cin>>arr[i];
		sum+=arr[i];
	}
	cin>>k;
	sort(arr,arr+3);
	sum-=temp=arr[2];
	for(int i=1;i<=n;i++){
		temp*=2;
		sum+=temp;
	}
	cout<<sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:24: error: 'n' was not declared in this scope
   15 |         for(int i=1;i<=n;i++){
      |                        ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    vector<int> abc(3);
    int k;
    for (vector<int>::size_type i = 0; i < 3; ++i) cin >> abc.at(i);
    cin >> k;
    int sum = *max_element(abc.begin(), abc.end());
    for (int i = 0; i < k; ++i) sum *= 2;
    for (vector<int>::size_type i = 0; i < 3; ++i) sum += abc.at(i);
    cout << (sum - *max_element(abc.begin(), abc.end())) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:16: error: 'max_element' was not declared in this scope
   11 |     int sum = *max_element(abc.begin(), abc.end());
      |                ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int A,B,C,K;
    cin>>A>>B>>C;
    cin>>K;
    int sum=A+B+C;

    int MAX=max({A,B,C});
    sum-=MAX;
    cout<<sum+MAX*pow(2,K)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   12 |     int MAX=max({A,B,C});
      |             ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0;
                int maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        }
}



Compiler output:
Main.java:29: error: variable maxN might not have been initialized
                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                                          ^
1 error
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<cstring>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REV(i,a,b) for(int i=(a)-1;i>=(b);i--)

using namespace std;

typedef long long ll;

int main(){
  int a,b,c;
  int max_v,min_v,mid_v;
  int K;
  cin >> a >> b >> c;;
  cin >> K;
  max_v = max({a,b,c});
  min_v = min({a,b,c});
  mid_v = a+b+c-max_v-min_v;
  REP(i,K) max_v *= 2;
  cout << max_v+min_v+mid_v << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   20 |   max_v = max({a,b,c});
      |           ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
a.cc:21:14: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   21 |   min_v = min({a,b,c});
      |           ~~~^~~~~~~~~
/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, 1 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, 1 provided
Language: Java

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
}


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

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0,maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }

                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                System.out.println(num[0]+num[1]+num[2]);
        }
}



Compiler output:
Main.java:28: error: variable maxN might not have been initialized
                for(int i=0; i<K; i++)num[maxN] = num[maxN] * 2;
                                          ^
1 error
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int A,B,C,K;
    cin>>A>>B>>C;
    cin>>K;
    int sum=A+B+C;

    int max=max({A,B,C});
    sum-=max;
    cout<<sum*pow(2,K)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'max' cannot be used as a function
   12 |     int max=max({A,B,C});
      |             ~~~^~~~~~~~~
Language: C++

#include <stdio.h>
#include <cmath>
int main(void){
  int a,b,c,k,mx,total;
  scanf("%d %d %d",&a,&b,&c);
  scanf("%d",&k);
  max = fmax(a,fmax(b,c));
  total = a+b+c+mx*pow(2,k)-mx;
  printf("%d",total);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'max' was not declared in this scope; did you mean 'std::max'?
    7 |   max = fmax(a,fmax(b,c));
      |   ^~~
      |   std::max
In file included from /usr/include/c++/14/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0,maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }
                num[maxN] = num[maxN] * Math.pow(2,K);
                System.out.println(num[0]+num[1]+num[2]);
        }
}



Compiler output:
Main.java:27: error: incompatible types: possible lossy conversion from double to int
                num[maxN] = num[maxN] * Math.pow(2,K);
                                      ^
1 error
Language: C++

#include<iostream>
using namespace std;
int main()
{
int a[3];
int k;
cin>>a[0]>>a[1]>>a[2]>>k;
sort(a,a+3);
cout<<a[0]+a[1]+a[2]*pow(2,k);
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 | sort(a,a+3);
      | ^~~~
      | short
a.cc:9:22: error: 'pow' was not declared in this scope
    9 | cout<<a[0]+a[1]+a[2]*pow(2,k);
      |                      ^~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0,maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }
                num[maxN] = num[maxN] * Math.pow(2,K);
                Syste.out.println(num[0]+num[1]+num[2]);
        }
}



Compiler output:
Main.java:27: error: incompatible types: possible lossy conversion from double to int
                num[maxN] = num[maxN] * Math.pow(2,K);
                                      ^
Main.java:28: error: package Syste does not exist
                Syste.out.println(num[0]+num[1]+num[2]);
                     ^
2 errors
Language: C++

#include <iostream>
using namespace std;

int main() {
	int a,b,c,n;
	cin >> a >> b >> c >> n;
	if (a >= b) {
		if (a <= c) {
			for (int i = 0;i < n;i++) {
				c *= 2;
			}
		} else {
			for (int i = 0;i < n;i++) {
				a *= 2;
			}
		} 
	} else if (b >= c) {
		for (int i = 0;i < n;i++) {
			b *= 2;
		} else {
			for (int i = 0;i < n;i++) {
				c *= 2;
			}
		}
	}
	cout << a + b + c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: expected '}' before 'else'
   20 |                 } else {
      |                   ^~~~
a.cc:17:28: note: to match this '{'
   17 |         } else if (b >= c) {
      |                            ^
a.cc: At global scope:
a.cc:26:9: error: 'cout' does not name a type
   26 |         cout << a + b + c;
      |         ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: Java

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int ans = Math.max(A, Math.max(C, B));
        int ch = Math.max(A, Math.max(C, B));
        for (int i = 0; i < K; i++) {
            ans = ans * 2;
        }
        if (ch == A) {
            System.out.println(ans + B + C);
        } else if (ch == B) {
            System.out.println(ans + A + C);
        } else {
            System.out.println(ans + A + B);
        }
    }
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c,k,num[6],temp,q;
  cin >> a >> b >> c >> k;
  for(int p = 0; p < 2; p++){
		for(q = p + 1; q < 3; q++){
			if(num[p] < num[q]){
				temp = num[p];
				num[p] = num[q];
				num[q] = temp;
			}
		}
	}
  for(int m = 0,m<k,m++) num[0] = num[0]*2;
  cout << num[0]+num[1]+num[2] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:18: error: expected ';' before '<' token
   16 |   for(int m = 0,m<k,m++) num[0] = num[0]*2;
      |                  ^
      |                  ;
a.cc:16:18: error: expected primary-expression before '<' token
a.cc:16:24: error: expected ';' before ')' token
   16 |   for(int m = 0,m<k,m++) num[0] = num[0]*2;
      |                        ^
      |                        ;
Language: C++

#include <stdio.h>
#include <cmath>
int main(void){
  int a,b,c,k,max,total;
  scanf("%d %d %d",&a,&b,&c);
  scanf("%d",&k);
  max = fmax(a,max(b,c));
  total = a+b+c+max*pow(2,k)-max;
  printf("%d",total);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'max' cannot be used as a function
    7 |   max = fmax(a,max(b,c));
      |                ~~~^~~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
int a[3];
int k;
cin>>a[0]>>a[1]>>a[2]>>k;
sort(a,a+3)
cout<<a[0]+a[1]+a[2]*pow(2,k);
return 0;
}

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

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                num[0] = sc.nextInt();
                num[1] = sc.nextInt();
                num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0,maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }
                num[maxN] = num[maxN] * Math.pow(2,K)
                Syste.out.println(num[0]+num[1]+num[2]);
        }
}



Compiler output:
Main.java:27: error: ';' expected
                num[maxN] = num[maxN] * Math.pow(2,K)
                                                     ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

int main() {
    int i, n, K;
    vector<int> ABC;
    for (i=0;i<3;i++) {
        int tmp;
        cin >> tmp;
        ABC.push_back(tmp);
    }
    cin >> K;
    sort(ABC.begin(), ABC.end());
    for (n=0;n<K;n++) {
        ABC[2] = ABC[2]*2;
    }
    cout << accumulate(ABC.begin(), ABC.end(),0) << endl;
    return 0;
}

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

#include <iostream>
using namespace std;

int main() {
    int a[3];
    int k;
    cin >> a[0] >> a[1] >> a[2] >> k;
    sort(a, a+3);
    cout << a[0] + a[1] + a[2] * (1 << k) << endl;
    return 0;
}

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

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Iterator;
import java.util.Collections;
import java.util.Comparator;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

class Main{
        public static void main(String args[]){
                Scanner sc = new Scanner(System.in);
                int[] num = new int[3];
                int num[0] = sc.nextInt();
                int num[1] = sc.nextInt();
                int num[2] = sc.nextInt();
                int K = sc.nextInt();
                int max=0,maxN;
                for(int i=0; i<3; i++){
                        if(max<num[i]){
                                max = num[i];
                                maxN = i;
                        }
                }
                num[maxN] = num[maxN] * Math.pow(2,K)
                Syste.out.println(num[0]+num[1]+num[2]);
        }
}

Compiler output:
Main.java:16: error: ']' expected
                int num[0] = sc.nextInt();
                        ^
Main.java:17: error: ']' expected
                int num[1] = sc.nextInt();
                        ^
Main.java:18: error: ']' expected
                int num[2] = sc.nextInt();
                        ^
Main.java:27: error: ';' expected
                num[maxN] = num[maxN] * Math.pow(2,K)
                                                     ^
4 errors
Language: C++

#include <stdio.h>
#include <cmath.h>
int main(void){
  int a,b,c,k,max,total;
  scanf("%d %d %d",&a,&b,&c);
  scanf("%d",&k);
  max = fmax(a,max(b,c));
  total = a+b+c+max*pow(2,k)-max;
  printf("%d",total);
  return 0;
}

Compiler output:
a.cc:2:10: fatal error: cmath.h: No such file or directory
    2 | #include <cmath.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include "iostream"
#include "vector"
#include "array"
#include "string"
#include "algorithm"
#include "functional"

using namespace std;
#define rep(p,q) for(int i = p;i < q;i++)

//2
int main(void) {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	vector<int> num = vector<int>();
	num.push_back(a);
	num.push_back(b);
	num.push_back(c);
	sort(num.begin(), num.end());
	cout << num[0] + num[1] + pow(num[2], k) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: 'pow' was not declared in this scope
   20 |         cout << num[0] + num[1] + pow(num[2], k) << endl;
      |                                   ^~~
Language: C++

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

main () {
 int a, b, c, k, n, ans;
 cin >> a >> b >> c >> k;
 n = max(a,b,c);
 ans = n;
 for (int i=0;i<k;i++) ans *= 2;
 ans += a+b+c;
 ans -= n;
 cout << ans << endl;
}


Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main () {
      | ^~~~
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: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:7:9:   required from here
    7 |  n = max(a,b,c);
      |      ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 110 , mz = 1e9+7;
int a[5];

int main(){

    for(int i = 0 ; i < 3 ; i++)    cin>>a[i];
    sort(a,a+3);
    int k;
    cin>>k;
    while( k-- )    a[2]*=2;
    cout<<sum+a[1]+a[0]<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: 'sum' was not declared in this scope
   13 |     cout<<sum+a[1]+a[0]<<endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c,k,num[6],temp,q;
  cin >> a >> b >> c >> k;
  for(int p = 0; p < 2; p++){
		for(q = p + 1; q < 3; q++){
			if(num[p] < num[q]){
				tmp = num[p];
				num[p] = num[q];
				num[q] = tmp;
			}
		}
	}
  for(int m = 0,m<k,m++) num[0] = num[0]*2;
  cout << num[0]+num[1]+num[2] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: 'tmp' was not declared in this scope; did you mean 'temp'?
   10 |                                 tmp = num[p];
      |                                 ^~~
      |                                 temp
a.cc:16:18: error: expected ';' before '<' token
   16 |   for(int m = 0,m<k,m++) num[0] = num[0]*2;
      |                  ^
      |                  ;
a.cc:16:18: error: expected primary-expression before '<' token
a.cc:16:24: error: expected ';' before ')' token
   16 |   for(int m = 0,m<k,m++) num[0] = num[0]*2;
      |                        ^
      |                        ;
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int sum = max({a, b, c});
    for (int i = 0; i < k; i++) sum *= 2;
    cout << (a + b + c - max({a, b, c}) + sum) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    9 |     int sum = max({a, b, c});
      |               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
a.cc:11:29: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   11 |     cout << (a + b + c - max({a, b, c}) + sum) << endl;
      |                          ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
        int a,b,c,k;
        cin>>a>>b>>c;
        cin>>k;
        int N,M;
        N=max(a,b,c);
        M=max(a,b,c);
        for(int i=0;i<k;i++){
                N=N*2;
        }
        cout<<a+b+c-M+N<<endl;
        return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:14:   required from here
    9 |         N=max(a,b,c);
      |           ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    int sum = max({a, b, c});
    for (int i = 0; i < k; i++) sum *= 2;
    cout << (a + b + c - max({a, b, c}) + sum) << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    8 |     int sum = max({a, b, c});
      |               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
a.cc:10:29: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   10 |     cout << (a + b + c - max({a, b, c}) + sum) << endl;
      |                          ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include <algorithm>
#include <iostream>
#include <string>

int main() {
  int a, b, c;
  std::cin >> a >> b >> c;

  int k;
  std::cin >> k;

  int sum = a + b + c + std::max({a, b, c}) * (std::pow(2, k) - 1);
  std::cout << sum << std::endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:53: error: 'pow' is not a member of 'std'
   12 |   int sum = a + b + c + std::max({a, b, c}) * (std::pow(2, k) - 1);
      |                                                     ^~~
Language: C++

#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define Fast ios_base::sync_with_stdio(0), cin.tie(0)
#define ll long long



int main(){
	int a,b,c,k;
	cin>>a>>b>>c;
	cin>>k;
	int ans = 0;
	int tmp = max(a,max(b,c));
	ans = a + b + c - tmp + tmp * pow(2,k);
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:39: error: 'pow' was not declared in this scope
   16 |         ans = a + b + c - tmp + tmp * pow(2,k);
      |                                       ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
	vector<int> vec (3);
	int K;
	cin >> vec.at(0) >> vec.at(1) >> vec.at(2) >> K;
	sort(vec.begin(),vec.end());
	for(int i = 0;i < K,i++){
		vec.at(2) *= 2;
	}
	cout << vec.at(0) + vec.at(1) + vec.at (2) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: expected ';' before ')' token
    9 |         for(int i = 0;i < K,i++){
      |                                ^
      |                                ;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <queue>
#include <stack>
#include <functional>
using ll = long long;
using namespace std;
int main() {
	ll n, m, l, k;
	cin >> n >> m >> l >> k;
	for (int i = 0; i < k; i++)
		if (max(n, m, l) == n)
			n *= 2;
		else if (max(n, m, l) == m)
			m *= 2;
		else
			l *= 2;
	cout << n + m + l << endl;
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:17:10:   required from here
   17 |                 if (max(n, m, l) == n)
      |                     ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: Java

import java.util.*;

public class Q2{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		int k=sc.nextInt();
		int max=a;
		int ans=0;

		if(a<b && b>c) max=b;
		else if(a<c && b<c) max=c;

		for(int i=0;i<k;i++){
			ans+=2*max;
		}

		ans=ans+(a+b+c-max);

		System.out.println(ans);
	}
}

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

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


long long ans;

long long pow(int x,int n){
	long long val=1;
	for(int i=0;i<n;i++){
		val*=x;
	}
	return val;
}

int main(){
	
	long long a,b,c;cin>>a>>b>>c;
	int k;cin>>k;
	long long key=max(a,b,max(b,c));
	ans+=a+b+c-key;
	ans+=pow(key,k);
	
	cout<<ans<<endl;
	//system("pause");
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:22:19:   required from here
   22 |         long long key=max(a,b,max(b,c));
      |                       ~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

int pow2(int, int);

int main() {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	if(a>=b && a>=c){
		cout << pow(a,k)+b+c;
		return 0;
	}
	else if(b>=c){
		cout << pow(b,k)+a+c;
		return 0;
	}
	cout << pow(c,k)+a+b;
	return 0;
}

int pow2(int a, int k){
	if(k==0)return 1;
	return 2*pow2(a,k-1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'pow' was not declared in this scope; did you mean 'pow2'?
   10 |                 cout << pow(a,k)+b+c;
      |                         ^~~
      |                         pow2
a.cc:14:25: error: 'pow' was not declared in this scope; did you mean 'pow2'?
   14 |                 cout << pow(b,k)+a+c;
      |                         ^~~
      |                         pow2
a.cc:17:17: error: 'pow' was not declared in this scope; did you mean 'pow2'?
   17 |         cout << pow(c,k)+a+b;
      |                 ^~~
      |                 pow2
Language: C++

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


long long ans;

long long pow(int x,int n){
	long long val=1;
	for(int i=0;i<n;i++){
		val*=x;
	}
	return val;
}

int main(){
	
	long long a,b,c;cin>>a>>b>>c;
	int k;cin>>k;
	long long key=max(a,b,c);
	ans+=a+b+c-key;
	ans+=pow(key,k);
	
	cout<<ans<<endl;
	//system("pause");
	return 0;
}

Compiler output:
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:22:19:   required from here
   22 |         long long key=max(a,b,c);
      |                       ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:306:17: error: '__comp' cannot be used as a function
  306 |       if (__comp(__a, __b))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	cin >> k;
	cout << max(a,max(b,c))*k << endl;


	return 0;
}

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

#include <iostream>
#include <string>
#include <algorithm>

int main()
{
    long long int a[5];
    std::cin >> a[0] >> a[1] >> a[2] >> k;

    std::sort(a, a + 3);
    std::cout << a[2] * (1 << k) * a[1] * a[0];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:41: error: 'k' was not declared in this scope
    8 |     std::cin >> a[0] >> a[1] >> a[2] >> k;
      |                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

signed main(){
	int a[3]k;
	cin >> a[0] >> a[1] >> a[2] >> k;
	sort(a,a + 3);
	for(int i = 0;i < k;i++) a[2] *= 2;
	cout << a[0] + a[1] + a[2] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: expected initializer before 'k'
   30 |         int a[3]k;
      |                 ^
a.cc:31:16: error: 'a' was not declared in this scope
   31 |         cin >> a[0] >> a[1] >> a[2] >> k;
      |                ^
a.cc:31:40: error: 'k' was not declared in this scope
   31 |         cin >> a[0] >> a[1] >> a[2] >> k;
      |                                        ^
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
static const int INF = 1000010000;
static const int MOD = 1000000007;
 
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define SORT(v) sort(v.begin(), v.end());
#define pb push_back
#define mp make_pair
#define np next_permutation
#define pq priority_queue

//int dx4[4] = {0,1,0,-1}, dy4[4] = {-1,0,1,0};
//int dx5[5] = {-1,0,0,0,1}, dy5[5] = {0,-1,0,1,0};
//int dx8[8] = {-1,0,1,1,1,0,-1,-1}, dy8[8] = {1,1,1,0,-1,-1,-1,0};
//int dx9[9] = {-1,0,1,1,1,0,-1,-1,0}, dy9[9] = {1,1,1,0,-1,-1,-1,0,0};

int main(){
	int a, b, c, k;
    cin >> a >> b >> c >> k;
    if(a > b && a > c){
        a *= pow(2, k);
    }else if(b > c){
        b *= pow(2, k);
    }else{
        c *= pow(2, k);
    }
    cout << a + b + c << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: 'pow' was not declared in this scope
   38 |         a *= pow(2, k);
      |              ^~~
a.cc:40:14: error: 'pow' was not declared in this scope
   40 |         b *= pow(2, k);
      |              ^~~
a.cc:42:14: error: 'pow' was not declared in this scope
   42 |         c *= pow(2, k);
      |              ^~~