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

main :: IO ()                                                                                                              
main = do                                                                                                                  
  abc <- map read . words <$> getLine                                                                                      
  k <- readLn                                                                                                              
  print $ sum abc + (maximum abc)^k - maximum abc

Compiler output:
a.cc:1:1: error: 'main' does not name a type
    1 | main :: IO ()
      | ^~~~
Language: C++

nums = list(map(int,input().split()))
k=int(input())
a = max(nums)*(2**k)
print(sum(nums) + max(nums)*(2**k)-max(nums))



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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected ';' before ')' token
   13 |   for ( int i = 0; i < n ){
      |                         ^~
      |                         ;
Language: Java

public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String abc = sc.nextLine();
		int k = Integer.parseInt(sc.nextLine());

		int max = 0;
		int ans = 0;
		for (String s : abc.split(" ")) {
			int i = Integer.parseInt(s);
			if (i > max) {
				ans += max;
				max = i;
			} else {
				ans += i;
			}
		}

		System.out.println(ans + max * 2 * k);

		sc.close();
	}
}

Compiler output:
Main.java:1: 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:22: error: class, interface, enum, or record expected
}
^
2 errors
Language: C++

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

int main() {
  vector<int> num(3);
  int k;
  cin >> num.at(0) >> num.at(1) >> num.at(2) >> k;
  sort(num.begin(), num.end());

  int i = 0;
  while (i < k) {
    num.at(2) *= 2;
    i ++;
  }
  int ans = um.at(0) + um.at(1) + um.at(2);

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: 'um' was not declared in this scope; did you mean 'num'?
   15 |   int ans = um.at(0) + um.at(1) + um.at(2);
      |             ^~
      |             num
Language: C++

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

int main() {
  vecotr<int> num(3);
  int k;
  cin >> num.at(0) >> num.at(1) >> num.at(2) >> k;
  sort(num.begin(), num.end());

  int i = 0;
  while (i < k) {
    num.at(2) *= 2;
    i ++;
  }
  int ans = um.at(0) + um.at(1) + um.at(2);

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vecotr' was not declared in this scope
    5 |   vecotr<int> num(3);
      |   ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vecotr<int> num(3);
      |          ^~~
a.cc:7:10: error: 'num' was not declared in this scope; did you mean 'enum'?
    7 |   cin >> num.at(0) >> num.at(1) >> num.at(2) >> k;
      |          ^~~
      |          enum
a.cc:15:13: error: 'um' was not declared in this scope; did you mean 'tm'?
   15 |   int ans = um.at(0) + um.at(1) + um.at(2);
      |             ^~
      |             tm
Language: C++

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

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

  int max = max(a, max(b, c));
  int i = 0;
  while (i < k) {
    max *= 2;
    i ++;
  }

  cout << max << endl;
}


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

#include<bits/stdc++.h>
#include<algorithm>

using namespace std;
int a, b, c, k;

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

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

#include<bits/stdc++.h>
#include<algorithm>

using namespace std;
int a, b, c, k;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'int_max' was not declared in this scope
   10 |   int max = int_max(a, b, c);
      |             ^~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<algorithm>

using namespace std;
int a, b, c, k;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid type argument of unary '*' (have 'int')
   10 |   int max = *max_element(a, b, c);
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 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/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = int; _Iterator2 = int; _Compare = int]':
/usr/include/c++/14/bits/stl_algo.h:5626:12:   required from 'constexpr _ForwardIterator std::__max_element(_ForwardIterator, _ForwardIterator, _Compare) [with _ForwardIterator = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<int>]'
 5626 |         if (__comp(__result, __first))
      |             ~~~~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5677:43:   required from 'constexpr _FIter std::max_element(_FIter, _FIter, _Compare) [with _FIter = int; _Compare = int]'
 5677 |       return _GLIBCXX_STD_A::__max_element(__first, __last,
      |                                           ^
a.cc:10:25:   required from here
   10 |   int max = *max_element(a, b, c);
      |              ~~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:31: error: invalid type argument of unary '*' (have 'int')
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                               ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:39: error: invalid type argument of unary '*' (have 'int')
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                                       ^~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: expression cannot be used as a function
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
#include<string>
using namespace std;
int a, b, c, k;

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

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

#include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b, c, k;

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

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

#include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b, c, k;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected ',' or ';' before '{' token
    9 |   int max = max{a, b, c};
      |                ^
Language: C++

#include<bits/stdc++.h>
#include<string>
using namespace std;
int a, b, c, k;

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

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

#include <iostream>
using namespace std;
 //Compiler version g++ 6.3.0

 int main()
 {
 	int a,b,c,d;
 	cin >> a>>b>>c>>d;
 	if(a>=b&&a>=c){
 		for (int i = 0; i < d; i++) {
 			a=a*a;
 		}
 		cout << a+b+c << endl;
 		return 0;
 	}else if{
 		b>=c&&b>=a{
 			for (int i = 0; i < d; i++) {
 			b=b*b;
 		}
 		cout << a+b+c << endl;
 		return 0;
 		}
 	}else{
 		for (int i = 0; i < d; i++) {
 			c=c*c;
 		}
 		cout << a+b+c << endl;
 		return 0;
 	}
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected '(' before '{' token
   15 |         }else if{
      |                 ^
      |                 (
a.cc:23:10: error: 'else' without a previous 'if'
   23 |         }else{
      |          ^~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int a,b,c,n,ans;
cin >> a >> b >> c >> n;
if(n==1){
    cout << a+b+c+max({a,b,c})*2 -max({a,b,c); << endl;
}else if(n==2){
    cout << a+b+c+ max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
}else{
    a+b+c+ max({a,b,c})*2+max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
}
   
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:45: error: expected '}' before ')' token
    8 |     cout << a+b+c+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                       ~     ^
a.cc:8:48: error: expected primary-expression before '<<' token
    8 |     cout << a+b+c+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                                ^~
a.cc:10:61: error: expected '}' before ')' token
   10 |     cout << a+b+c+ max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                                       ~     ^
a.cc:10:64: error: expected primary-expression before '<<' token
   10 |     cout << a+b+c+ max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                                                ^~
a.cc:12:68: error: expected '}' before ')' token
   12 |     a+b+c+ max({a,b,c})*2+max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                                              ~     ^
a.cc:12:71: error: expected primary-expression before '<<' token
   12 |     a+b+c+ max({a,b,c})*2+max({a,b,c})*2+max({a,b,c})*2 -max({a,b,c); << endl;
      |                                                                       ^~
Language: C++

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

int main(){
  int a[3],K;
  cin >> a[0] >> a[1] >> a[2] >> K;
  sort(a.begin(),a.end());
  for (int i = 0; i < K; i++) {
    a[2]*=2;
  }
  cout << a[0] + a[1] + a[2] << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: request for member 'begin' in 'a', which is of non-class type 'int [3]'
    8 |   sort(a.begin(),a.end());
      |          ^~~~~
a.cc:8:20: error: request for member 'end' in 'a', which is of non-class type 'int [3]'
    8 |   sort(a.begin(),a.end());
      |                    ^~~
Language: C++



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

using namespace std;

int main()
{
	int A, B, C, K;

	cin >> A >> B >> C >> K;

	int max_n = max(A, B);
	max_n = max(max_n, C);

	long long ans = A + B + C + max_n * pow(2,K) - max_n;

	cout << ans;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:45: error: 'pow' was not declared in this scope
   19 |         long long ans = A + B + C + max_n * pow(2,K) - max_n;
      |                                             ^~~
Language: C++

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

int main() {
  int A,B,C,K;
  cin >> A >> B >> C;
  cin >>K;
  int x = max(A,max(B,C));
  cout << x*pow(2,K) + A+B+C-x << endl;
}
		  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: 'pow' was not declared in this scope
   10 |   cout << x*pow(2,K) + A+B+C-x << endl;
      |             ^~~
Language: C++

#include <stdio.h>
#include <cstdio>
#include <vector>
#include <iostream>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
	int k;
	vector<int> m(3);
	REP(i, 3){
		cin >> m[i];
	}
	cin >> k;
	sort(m.begin(), m.end());
	REP(i, k){
		m[2] *= 2
	}
	cout << m[0] + m[1] + m[2] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |         sort(m.begin(), m.end());
      |         ^~~~
      |         short
a.cc:28:26: error: expected ';' before '}' token
   28 |                 m[2] *= 2
      |                          ^
      |                          ;
   29 |         }
      |         ~
Language: C++

#include <stdio.h>
#include <cstdio>
#include <vector>
#include <iostream>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
	int k;
	vector<int> m(3);
	REP(i, 3){
		cin >> m[i];
	}
	cin >> k;
	sort(m.begin(), m.end());
	cout << m[0] + m[1] + m[2]*2*k << "\n";

}


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

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

int main(){
  	int a,b,c,n;
  	cin >> a >> b >> c;
  	cin >> n;
  	switch(max(a,max(b,c))){
      case a:
        	cout << a*(pow(2,n)) + b + c << endl;
        break;
      case b:
        	cout << b*(pow(2,n)) + a + c << endl;
        break;
      case c:
        	cout << c*(pow(2,n)) + b + a << endl;
        break;
    }
 	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: the value of 'a' is not usable in a constant expression
   11 |       case a:
      |            ^
a.cc:7:13: note: 'int a' is not const
    7 |         int a,b,c,n;
      |             ^
a.cc:11:12: error: the value of 'a' is not usable in a constant expression
   11 |       case a:
      |            ^
a.cc:7:13: note: 'int a' is not const
    7 |         int a,b,c,n;
      |             ^
a.cc:14:12: error: the value of 'b' is not usable in a constant expression
   14 |       case b:
      |            ^
a.cc:7:15: note: 'int b' is not const
    7 |         int a,b,c,n;
      |               ^
a.cc:14:12: error: the value of 'b' is not usable in a constant expression
   14 |       case b:
      |            ^
a.cc:7:15: note: 'int b' is not const
    7 |         int a,b,c,n;
      |               ^
a.cc:17:12: error: the value of 'c' is not usable in a constant expression
   17 |       case c:
      |            ^
a.cc:7:17: note: 'int c' is not const
    7 |         int a,b,c,n;
      |                 ^
a.cc:17:12: error: the value of 'c' is not usable in a constant expression
   17 |       case c:
      |            ^
a.cc:7:17: note: 'int c' is not const
    7 |         int a,b,c,n;
      |                 ^
Language: C++

#include <iostream>

int a, b, c, k;
int main() {
  cin >> a >> b >> c >> k;
  int m = max({a, b, c});
  cout << a + b + c + m * (1 << k) - m << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >> a >> b >> c >> k;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:11: error: 'max' was not declared in this scope; did you mean 'std::max'?
    6 |   int m = max({a, b, c});
      |           ^~~
      |           std::max
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:
/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)
      |     ^~~
a.cc:7:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   cout << a + b + c + m * (1 << k) - m << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:43: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   cout << a + b + c + m * (1 << k) - m << endl;
      |                                           ^~~~
      |                                           std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main () {
  int A, B, C, K;
  cin >> A >> B >> C >> K;
  int d = max(A, B, C);
  for ( int i = 0; i < N; i++) d *= 2;
  cout << d << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: 'N' was not declared in this scope
    8 |   for ( int i = 0; i < N; i++) d *= 2;
      |                        ^
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:14:   required from here
    7 |   int d = 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>
#include<algorithm>

using namespace std;

int main(void) {
	int a, b, c, k;

	cin >> a >> b >> c >> k;

	cout << pow(2, k)*max(a, max(b, c)) + (a + b + c) - max(a, max(b, c)) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'pow' was not declared in this scope
   11 |         cout << pow(2, k)*max(a, max(b, c)) + (a + b + c) - max(a, max(b, c)) << endl;
      |                 ^~~
Language: C++

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

int main() {
        int A,B,C,K;

        cin >> A >> B >> C;
        cin >>K;

        cout <<  A+B+C+max({A,B,C})*((1<<K)-1) << endl;

        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:27: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
   12 |         cout <<  A+B+C+max({A,B,C})*((1<<K)-1) << endl;
      |                        ~~~^~~~~~~~~
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<cstdio>
#include<algorithm>
#include<string>
using namespace std;

int main(){
  int a, b, c, max, ans, k;
  scanf("%d%d%d%d", &a, &b, &c, &k);
  max = max(max(a,b),c);
  ans = a + b + c - max;
  for(int i = 0; i < k; i++) max *= 2;
  printf("%d",ans + max);
}


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

#include "bits/stdc++.h"
using namespace std;
#define r(i,a,n) for(int i=a;i<(int)(n);i++)
typedef long long ll;
int main(){
    int a,b,c,ans,n,K;
    cin>>a>>b>>c>>K;
    n=max(a,max(b,c));
    ans=a+b+c;
    ans-=n;
    r(i,0,K)max*=2;
    cout<<ans+n<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: overloaded function with no contextual type information
   11 |     r(i,0,K)max*=2;
      |                  ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define r(i,a,n) for(int i=a;i<(int)(n);i++)
typedef long long ll;
int main(){
    int a,b,c,ans,max,K;
    cin>>a>>b>>c>>K;
    max=max(a,max(b,c));
    ans=a+b+c;
    ans-=max;
    r(i,0,K)max*=2;
    cout<<ans+max<<endl;
    return 0;
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:5:19: error: invalid declarator before 'a'
    5 |   int vector<int> a(3);
      |                   ^
a.cc:6:8: error: 'a' was not declared in this scope
    6 |   cin>>a[0]>>a[1]>>a[2];
      |        ^
Language: C

#include <stdio.h>
 
int max(int A, int B, int C){
  if(A > B){
    if(A > C){
      return A;
    }
  }else{
    if(B > C){
      return B;
    }
  }
  return C;
}
 
int main(){
  int A;
  int B;
  int C;

Compiler output:
main.c: In function 'main':
main.c:19:3: error: expected declaration or statement at end of input
   19 |   int C;
      |   ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
 
int main(void)
{
    int a[3], k;
    int tmp;
    scanf("%d%d%d", &a[0], &a[1], &a[2]);
    scanf("%d", &k);
 
    for (int i = 1; i < 3; i++) {
        if (a[0] < a[i]) {
            tmp = a[0];
            a[0] = a[i];
            a[i] = tmp;
        }
    }
 

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

// Maximum Sum

#include <iostream>
#include <cmath>

using namespace std;

int main(){
	int num[3], K;
	cin >> num[0] >> num[1] >> num[2] >> K;

	sort(num, num+3);

	cout << num[0] + num[1] + (int)pow(2, K) * num[2] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   12 |         sort(num, num+3);
      |         ^~~~
      |         sqrt
Language: C++

#include <cstdint>
#include <iostream>

void shift(uint64_t k, uint64_t &v)
{
    v = v << k;
}

int main(void)

    uint64_t a, b, c, k;

    std::cin >> a >> b >> c;
    std::cin >> k;

    if (a > b && a > c) shift(k, a);
    if (b > a && b > c) shift(k, b);
    if (c > b && c > a) shift(k, c);

    std::cout << a+b+c << std::endl;

    return 0;
}

Compiler output:
a.cc:11:5: error: expected initializer before 'uint64_t'
   11 |     uint64_t a, b, c, k;
      |     ^~~~~~~~
a.cc:13:10: error: 'cin' in namespace 'std' does not name a type
   13 |     std::cin >> a >> b >> c;
      |          ^~~
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:14:10: error: 'cin' in namespace 'std' does not name a type
   14 |     std::cin >> k;
      |          ^~~
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:5: error: expected unqualified-id before 'if'
   16 |     if (a > b && a > c) shift(k, a);
      |     ^~
a.cc:17:5: error: expected unqualified-id before 'if'
   17 |     if (b > a && b > c) shift(k, b);
      |     ^~
a.cc:18:5: error: expected unqualified-id before 'if'
   18 |     if (c > b && c > a) shift(k, c);
      |     ^~
a.cc:20:10: error: 'cout' in namespace 'std' does not name a type
   20 |     std::cout << a+b+c << std::endl;
      |          ^~~~
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:22:5: error: expected unqualified-id before 'return'
   22 |     return 0;
      |     ^~~~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++


#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    std::ios::sync_with_stdio(false);

    int a; int b; int c; int k;
    cin >> a >> b >> c >> k;
    int n = 2;
    FOR(i,1,k)
        n *= n;
    if (a > b && a > c)
        cout << a * n + b + c << endl;
    else if (b > a && b > c)
        cout << a + b * n + c << endl;
    else if (c > b && c > a)
        cout << a + b + c * n] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:81:30: error: expected ';' before ']' token
   81 |         cout << a + b + c * n] << endl;
      |                              ^
      |                              ;
Language: C++

#include<iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;
int main(){
	int a[3],d;
	cin>>a[0]>>a[1]>>a[2]>>d;
	sort(a,a+3);
	for(int i=0;i<d;i++){
		a[2]=a[2]*2;
	}
	cout<<a[0]+a[1]+a[2]<<endl;ac
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: 'ac' was not declared in this scope; did you mean 'a'?
   13 |         cout<<a[0]+a[1]+a[2]<<endl;ac
      |                                    ^~
      |                                    a
Language: C++

#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> p;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<p> vp;
const int mx = 100005, inf = 1001001001;
const ll linf = 1e18;
const double eps = 1e-10;
const int div = 1e9+7;

int a, b, c, k;

int main()
{
    cin >> a >> b >> c >> k;

    set<int> st;
    for(int k1 = 0; k1 <= k; k1++){
        for(int k2 = 0; k2 <= k - k1; k2++){
            int k3 = k - (k1 + k2);
            ll val = a * pow(2, k1) + b * pow(2, k2) + c * pow(2, k3);
            st.insert(val);
        }
    }
    vi vec(all(st));
    sort(all(vec), greater<int>());
    cout << vec[0] << endl;
    return 0;

}

Compiler output:
a.cc:20:11: error: 'const int div' redeclared as different kind of entity
   20 | const int div = 1e9+7;
      |           ^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: previous declaration 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
Language: C++

  int A, B, C, sum = 0, ma, K, a[5];
  cin>>a[0]>>a[1]>>a[2]>>K;

  sum += a[0] + a[1] + a[2];

  for(int i = 0; i < K; i++){
    ma = 0;
    for(int j = 0; j < 3; j++){
      if(a[i] >= a[ma]) ma = j;
    }
    sum += a[ma];
    a[ma] *= 2;
    
  }

  cout<<sum<<endl;
  
  return 0 ;
}

Compiler output:
a.cc:2:3: error: 'cin' does not name a type
    2 |   cin>>a[0]>>a[1]>>a[2]>>K;
      |   ^~~
a.cc:4:3: error: 'sum' does not name a type
    4 |   sum += a[0] + a[1] + a[2];
      |   ^~~
a.cc:6:3: error: expected unqualified-id before 'for'
    6 |   for(int i = 0; i < K; i++){
      |   ^~~
a.cc:6:18: error: 'i' does not name a type
    6 |   for(int i = 0; i < K; i++){
      |                  ^
a.cc:6:25: error: 'i' does not name a type
    6 |   for(int i = 0; i < K; i++){
      |                         ^
a.cc:16:3: error: 'cout' does not name a type
   16 |   cout<<sum<<endl;
      |   ^~~~
a.cc:18:3: error: expected unqualified-id before 'return'
   18 |   return 0 ;
      |   ^~~~~~
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,k;
  int n[3];
  cin>>a>>b>>c;
  n[0]=a;
  n[1]=b;
  n[2]=c;
  sort(n,n+2);
  cin>>k;
  for(int i=0;i<k;i++){
    n[2]*=2;
  }
  cout<<n[0]+n[1]+n[2]<<endl;
  return 0;
}#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,k;
  int n[3];
  cin>>a>>b>>c;
  n[0]=a;
  n[1]=b;
  n[2]=c;
  sort(n,n+2);
  cin>>k;
  for(int i=0;i<k;i++){
    n[2]*=2;
  }
  cout<<n[0]+n[1]+n[2]<<endl;
  return 0;
}

Compiler output:
a.cc:17:2: error: stray '#' in program
   17 | }#include<bits/stdc++.h>
      |  ^
a.cc:17:3: error: 'include' does not name a type
   17 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:19:5: error: redefinition of 'int main()'
   19 | int main(){
      |     ^~~~
a.cc:3:5: note: 'int main()' previously defined here
    3 | int main(){
      |     ^~~~
Language: C++

#include<iostream>
using namespace std;
 int main(){
   int a[3];for(int i=0;i<3;i++)cin>>a[i];int k;cin>>k;
   for(int i=0;i<k;i++){sort(a,a+3);a[2]*=2;}
   int sum=0;
   for(int i=0;i<3;i++)sum+=a[i];
   cout<<sum<<endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: 'sort' was not declared in this scope; did you mean 'short'?
    5 |    for(int i=0;i<k;i++){sort(a,a+3);a[2]*=2;}
      |                         ^~~~
      |                         short
Language: C++

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



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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected '}' at end of input
   15 |     return 0;
      |              ^
a.cc:6:12: note: to match this '{'
    6 | int main() {
      |            ^
Language: Java

import java.util.*;
public class Main {
    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 cd =0;
if(max<=b){
max =b;
cd =1;
}
if(max<=c){
max =c;
cd =2;
}
for(int i=0;i<k;i++){
 max = max *2;
}
if(cd =0){
max =max +b+c;
}else if(cd =1){
max =max +a+c;
}else{
max = max+b+c;
}

 System.out.println(max);
 }
}


Compiler output:
Main.java:22: error: incompatible types: int cannot be converted to boolean
if(cd =0){
      ^
Main.java:24: error: incompatible types: int cannot be converted to boolean
}else if(cd =1){
            ^
2 errors
Language: Java

import java.util.*;
public class Main {
    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 cd =0;
if(max<=b){
max =b;
cd =1;
}
if(max<=c){
max =c;
cd =2;
}
for(int i=0;i<k;i++){
 max = max *2;
}
if(cd =0){
max =max +b+c;
}else if(cd =1){
max =max +a+c;
}else
max = max+b+c;
}

 System.out.println(max);
 }
}


Compiler output:
Main.java:30: error: <identifier> expected
 System.out.println(max);
                   ^
Main.java:30: error: <identifier> expected
 System.out.println(max);
                       ^
Main.java:32: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.*;
public class Main {
    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 cd =0;
if(max<=b){
max =b
cd =1;
}
if(max<=c){
max =c
cd =2;
}
for(int i=0;i<k;i++){
 max = max *2;
}
if(cd =0){
max =max +b+c;
}else if(cd =1){
max =max +a+c;
}else
max = max+b+c;
}

 System.out.println(max);
 }
}


Compiler output:
Main.java:12: error: ';' expected
max =b
      ^
Main.java:16: error: ';' expected
max =c
      ^
Main.java:30: error: <identifier> expected
 System.out.println(max);
                   ^
Main.java:30: error: <identifier> expected
 System.out.println(max);
                       ^
Main.java:32: error: class, interface, enum, or record expected
}
^
5 errors
Language: C++

#include<stdio.h>
int main(){
int A[3],K,i,max;
scanf("%d%d%d%d",A[0],A[1],A[2],K);
max=0
if(A[max]<A[1]){max=1;}
if(A[max]<A[2]){max=2;}
for(i=0;i<K;i++){
A[max]=A[max]*2;
}
printf("%d",A[0]+A[1]+A[2]);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:6: error: expected ';' before 'if'
    5 | max=0
      |      ^
      |      ;
    6 | if(A[max]<A[1]){max=1;}
      | ~~
Language: C++

#include <stdio.h>

int main(void){
int a,b,c,d,K;
scanf("%d %d %d/n%d",&a,&b,&c,&K);
if(a>=b){
  if(a>=c){
  for(i=0;i!=K;i++){
  a=a*2;
    }
  }
  else{
    for(i=0;i!=K;i++){
    c=c*2;
    }
  }
}
else(a<=b){
  if(b>=c){
  for(i=0;i!=K;i++){
  b=b*2;
    }
  }
  else{
  for(i=0;i!=K;i++){
  c=c*2;
  }
  }
  }
  d=a+b+c;
  printf("%d/n",d);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   for(i=0;i!=K;i++){
      |       ^
a.cc:13:9: error: 'i' was not declared in this scope
   13 |     for(i=0;i!=K;i++){
      |         ^
a.cc:18:11: error: expected ';' before '{' token
   18 | else(a<=b){
      |           ^
      |           ;
Language: C

#include<Stdio.h>
int main()
{
  int i,arr[3],temp=0,j,k;
  for(i=0;i<3;i++){
  scanf("%d",&arr[i]);
  }
  scanf("%d",&k);
  for(i=0;i<3;i++){
  if(arr[i]>temp){
   temp=arr[i];
    j=i;
  }
  }
  for(i=0;i<k;i++){
   temp=temp*2;
  }
  arr[j]=temp;
  k=arr[0]+arr[1]+arr[2];
  printf("%d",k);
  return 0;
}


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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		int k = scan.nextInt();
		if (a >= b && a >= c) {
			for (int i = 0; i < k; i++) {
				a *= 2;
			}
		} else if (b >= a && b >= c) {
			for (int i = 0; i < k; i++) {
				b *= 2;
			}
		} else {
			for (int i = 0; i < k; i++) {
				c *= 2;
			}
		}
		System.out.println(a + b + c);
	}
}


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

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

int main() {
  int A, B, C, K;
  cin >> A >> B >> C >> K;
  vector<int> V = {A, B, C};
  int k = max_element(V.begin(), V.end()) - V.begin();
  V[k] *= (1 << K);
  int sum = 0;
  for(int i = 0; i < 3; i++) {
  	sum += V[i];
  }
  cout << sum << endl;
  return 0;
}

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

#include "iostream"
#include "algorithm"

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'pow' was not declared in this scope
   12 |         cout << maxN*pow(2,K) + sum - maxN << endl;
      |                      ^~~
Language: C++

#include<iostream>
#include<stdio.h>
#include <cstdlib>  // abs() for integer
#include <cmath>    // abs() for float, and fabs()

int main(void){
    int a, b, c, k;
    int i;
    int max;

    std::cin >> a >> b >> c;
    std::cin >> k;

    for(i=0; i<k; i++){
        if(a <=c && b <= c) c = 2c;
        else if(a <= b && c <= b) b = 2b;
        else if(b <= a && c <= a) a = 2a;
    }

    max = a + b + c;
    std::cout << max << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:33: error: unable to find numeric literal operator 'operator""c'
   15 |         if(a <=c && b <= c) c = 2c;
      |                                 ^~
a.cc:16:39: error: unable to find numeric literal operator 'operator""b'
   16 |         else if(a <= b && c <= b) b = 2b;
      |                                       ^~
a.cc:17:39: error: unable to find numeric literal operator 'operator""a'
   17 |         else if(b <= a && c <= a) a = 2a;
      |                                       ^~
Language: C++

#include<iostream>
using namespace std;
int main() {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	int sum = a + b + c;
	int max = a>b ? a : b;
	max = max>c ? max : c;
	sum = sum-max+max*pow(2,k);
	cout << sum << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:27: error: 'pow' was not declared in this scope
    9 |         sum = sum-max+max*pow(2,k);
      |                           ^~~
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
main(){
  long long a,b,c,k,ans;
  cin >> a>>b>>c>>k;
  if(a==max({a,b,c})ans=a*pow(2,k) +b+c;
     else if(b==max(b,c))ans=b*pow(2,k) +a+c;
     else ans=c*pow(2,k)+a+b;
     
     cout<<ans<<endl;
     return 0;
     }
  

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:12: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    7 |   if(a==max({a,b,c})ans=a*pow(2,k) +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:8:6: error: expected primary-expression before 'else'
    8 |      else if(b==max(b,c))ans=b*pow(2,k) +a+c;
      |      ^~~~
a.cc:7:41: error: expected ')' before 'else'
    7 |   if(a==max({a,b,c})ans=a*pow(2,k) +b+c;
      |     ~                                   ^
      |                                         )
    8 |      else if(b==max(b,c))ans=b*pow(2,k) +a+c;
      |      ~~~~
Language: C++

#include <iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
int A,B,C,K;
cin>>A>>B>>C>>K;
if(A>=B&&A>=C)
cout<<A*pow(2,K)+B+C<<endl;
else if(B>=A&&B>=C)
cout<<A+B*pow(2,K)+C<<endl;
else
cout<<A+B+C*pow(2,k)<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'k' was not declared in this scope
   13 | cout<<A+B+C*pow(2,k)<<endl;
      |                   ^
Language: Java

import java.util.*;

public class Main{
	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 d = sc.nextInt();
		int k = sc.nextInt();
		
		d=a;
		if(a<b){
			d=b;
		}
		if(b<c){
			d=c;
		}
		System.out.println((a+b+c-d)+k*d;)
	}
}

Compiler output:
Main.java:19: error: ')' or ',' expected
		System.out.println((a+b+c-d)+k*d;)
		                                ^
Main.java:19: error: illegal start of expression
		System.out.println((a+b+c-d)+k*d;)
		                                 ^
2 errors
Language: C++

#include<iostream>
using namespace std;

int main()
{
  int a[3];
  cin >> a[0] >> a[1] >> a[2];
  int k;
  cin >> k;
  int ma = a[0]
  for (int i = 0; i < 3; ++i) {
    if (ma < a[i])
      ma = a[i];
  }
  int sum = a[0] + a[1] +a [2] - ma;
  int kma = ma;
  for (int i = 0; i < k; ++k)
    kma *= 2;
  sum += kma;
  cout << sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'for'
   11 |   for (int i = 0; i < 3; ++i) {
      |   ^~~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   for (int i = 0; i < 3; ++i) {
      |                   ^
Language: C++

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

int main() {
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    int k;
    cin >> k;

    sort(begin(a), end(a));

    int ans = a[0] + a[1] + a[2] * pow(2, k);
    cout << ans << endl;

    return 0;
}

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

#include <iostream>
#include <cmath>
using namespace std;
int main(){
  int a,b,c;
  int k;
  cin >> a >> b >> c >> k;
  long long m = max({a,b,c});
  long long ans = (m << k) + (a+b+c-m);
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: no matching function for call to 'max(<brace-enclosed initializer list>)'
    8 |   long long m = 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