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

#include <iostream>
using namespace std;

int main() {
    int A, B, C, X, Y;
    cin >> A >> B >> C >> X >> Y;

    long ans = 100000000000;
    for (int i = 0; i <= 50000; ++i) {
        ans = min(ans, i * 2 * C + A * max(0, X - i) + B * max(0, Y - i));
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: no matching function for call to 'min(long int&, int)'
   10 |         ans = min(ans, i * 2 * C + A * max(0, X - i) + B * max(0, Y - i));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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: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:   template argument deduction/substitution failed:
a.cc:10:18: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   10 |         ans = min(ans, i * 2 * C + A * max(0, X - i) + B * max(0, Y - i));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, 2 provided
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string> 
#include <map>
#include <iomanip>
#include <list>
#include <stack>

using namespace std;


typedef int INT;
#define int long long

INT main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	int sum = 0;
	if (a + b > 2 * c)
	{
		int v = min(x, y);
		x -= v;
		y -= v;
		sum += v * 2 * c;
	}
	if (a > 2 * c)
	{
		int u = x * 2;
		y = max(0LL, y - x);
		x = 0;
		sum += u*c;
	}
	if (b > 2 * c)
	{
		int u = y * 2;
		x = max(0LL, x - y);
		y = 0;
		sum += u*c;
	}
	sum += x*a + y*b;
	cout << sum;
	return 0;
}#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string> 
#include <map>
#include <iomanip>
#include <list>
#include <stack>

using namespace std;


typedef int INT;
#define int long long

INT main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	int sum = 0;
	if (a + b > 2 * c)
	{
		int v = min(x, y);
		x -= v;
		y -= v;
		sum += v * 2 * c;
	}
	if (a > 2 * c)
	{
		int u = x * 2;
		y = max(0LL, y - x);
		x = 0;
		sum += u*c;
	}
	if (b > 2 * c)
	{
		int u = y * 2;
		x = max(0LL, x - y);
		y = 0;
		sum += u*c;
	}
	sum += x*a + y*b;
	cout << sum;
	return 0;
}

Compiler output:
a.cc:52:2: error: stray '#' in program
   52 | }#define _CRT_SECURE_NO_WARNINGS
      |  ^
a.cc:52:3: error: 'define' does not name a type
   52 | }#define _CRT_SECURE_NO_WARNINGS
      |   ^~~~~~
a.cc:68:13: error: conflicting declaration 'typedef long long int INT'
   68 | typedef int INT;
      |             ^~~
a.cc:17:13: note: previous declaration as 'typedef int INT'
   17 | typedef int INT;
      |             ^~~
a.cc:71:5: error: redefinition of 'INT main()'
   71 | INT main()
      |     ^~~~
a.cc:20:5: note: 'INT main()' previously defined here
   20 | INT main()
      |     ^~~~
Language: C++

A,B,C,X,Y=list(map(int, input().split()))

extra_pizza=max(X,Y)
surplus=max(X,Y)-min(X,Y)

number_of_pair=(X+Y-surplus)/2
money_sum=0

if number_of_pair*(A+B) > number_of_pair*2*C:
    money_sum+=number_of_pair*2*C
else:
    money_sum+=number_of_pair*(A+B)

if extra_pizza==X:
    if surplus*A > surplus*2*C:
        money_sum+=surplus*2*C
    else:
        money_sum+=surplus*A
else:
    if surplus*B > surplus*2*C:
        money_sum+=surplus*2*C
    else:
        money_sum+=surplus*B

print(int(money_sum))


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

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

using namespace std;

int main(){


	int N = 100000;

	int A,B,C,X,Y;
	cin >> A >>B >>C >> X >> Y;

	int ans = INT_MAX;
	for(int i = 0;i <=N;i++){
		int a = 0;
        a = i*2*C + max(0,X-i)*A + max(0,Y-i)*B;
        ans = min(ans,a);
	}

	cout << ans << endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: 'INT_MAX' was not declared in this scope
   26 |         int ans = INT_MAX;
      |                   ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include<cstring>
  +++ |+#include <climits>
   15 |
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdlib>
#include<cstdio>
#include<utility>
#include<list>
using namespace std;
int main(){
	int a,b,c,x,y;
	cin>>a>>b>>c>>x>>y;
	int val=0;
	for(int i=0;i<10000;i++){
		tmp = i*2*c + max(0, x-i)*a + max(0, y-i)*b;
		val = min(tmp, val);
	}

	cout<< val <<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   18 |                 tmp = i*2*c + max(0, x-i)*a + max(0, y-i)*b;
      |                 ^~~
      |                 tm
Language: C++

#include <iostream>
#include <utility>

using namespace std;

int a,b,c,x,y;

inline int calc(int s) {
    return (c * s) + (a * max(0,x - s)) + (b * max(0,y - s));
}

int main(void) {
    cin >> a >> b >> c >> x >> y;
    c = c + c;
    int min_cost = INT_MAX;
    for(int i = 0;i < max(x,y);i++)
        min_cost = min(min_cost,calc(i));
    cout << min_cost << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: 'INT_MAX' was not declared in this scope
   15 |     int min_cost = INT_MAX;
      |                    ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <utility>
  +++ |+#include <climits>
    3 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,x,y,ans;
    cin>>a>>b>>c>>x>>y;
    ans=a*x+b*y;
    for(int i=0;2*i<=max(x,y);i++){
    int m;
    m=a*x+b*y+2*i(c-b-a);
    if(ans>m)ans=m;
    }
    cout<<ans<<endl;
      
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: 'i' cannot be used as a function
   10 |     m=a*x+b*y+2*i(c-b-a);
      |                 ~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,x,y,ans;
    cin>>a>>b>>c>>x>>y;
    ans=a*x+b*y;
    for(int i=0;i<=min(x,y);i++){
    int m;
    m=a*x+b*y-(a+b-2c)*i;
    if(ans<m)ans=m;
    }
    cout<<ans<<endl;
      
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: unable to find numeric literal operator 'operator""c'
   10 |     m=a*x+b*y-(a+b-2c)*i;
      |                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
 
int a, b, c, x, y;
 
int main()
{
    cin >> a >> b >> c >> x >> y;
 
    // abピザの枚数でループ
    int mincost = -1;
    for (int i=0; i<=max(x, y); i++)
    {
        // abピザを2i枚買うとき
        int ia = max(0, x - i);
        int ib = max(0, y - i);
        int cost = 2 * i * c + ia * a + ib * b;
        if (cost < mincost || mincost < 0) mincost = cost;
    }
 
    cout << mincost << "\n";
 
    return 0;
}
#include <bits/stdc++.h>
using namespace std;


int a, b, c, x, y;

int main()
{
    cin >> a >> b >> c >> x >> y;

    // abピザの枚数でループ
    int mincost = -1;
    for (int i=0; i<=max(x, y); i++)
    {
        // abピザを2i枚買うとき
        int ia = max(0, x - i);
        int ib = max(0, y - i);
        int cost = 2 * i * c + ia * a + ib * b;
        if (cost < mincost || mincost < 0) mincost = cost;
    }

    cout << mincost << "\n";

    return 0;
}

Compiler output:
a.cc:30:5: error: redefinition of 'int a'
   30 | int a, b, c, x, y;
      |     ^
a.cc:5:5: note: 'int a' previously declared here
    5 | int a, b, c, x, y;
      |     ^
a.cc:30:8: error: redefinition of 'int b'
   30 | int a, b, c, x, y;
      |        ^
a.cc:5:8: note: 'int b' previously declared here
    5 | int a, b, c, x, y;
      |        ^
a.cc:30:11: error: redefinition of 'int c'
   30 | int a, b, c, x, y;
      |           ^
a.cc:5:11: note: 'int c' previously declared here
    5 | int a, b, c, x, y;
      |           ^
a.cc:30:14: error: redefinition of 'int x'
   30 | int a, b, c, x, y;
      |              ^
a.cc:5:14: note: 'int x' previously declared here
    5 | int a, b, c, x, y;
      |              ^
a.cc:30:17: error: redefinition of 'int y'
   30 | int a, b, c, x, y;
      |                 ^
a.cc:5:17: note: 'int y' previously declared here
    5 | int a, b, c, x, y;
      |                 ^
a.cc:32:5: error: redefinition of 'int main()'
   32 | int main()
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#define re          return
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)  for (__typeof(b) i=(a)-((a)>(b));i!=(b)-((a)>(b));i+=1-2*((a)>(b)))
#define PI            3.141592653589793l
#define fill(c,val) memset(c,val,sizeof(c))
#define sz(x)       (int)x.size()
#define LB lower_bound
#define UB upper_bound
using namespace std;
typedef long long ll;
ll const NMAX=1e5+20;
const ll INF=(1LL<<60)-1;
const ll inf=1e9;
max(int a,int b){
	if(a>b)
	 return a;
	 return b;
}
min(int a,int b){
	if(a>b)
	 return b;
	 return a;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
		   ll a,b,c,x,y;
		   cin>>a>>b>>c>>x>>y;
		   ll ans=inf;
		   for(int i=0;i<100000;i++){
		   	  ans=min(ans,i*2*c+max(0,x-i)*a+max(0,y-i)*b);
		   }
		    cout<<ans;
		   cout<<endl;
   }
    return 0;
}

Compiler output:
a.cc:23:1: error: ISO C++ forbids declaration of 'max' with no type [-fpermissive]
   23 | max(int a,int b){
      | ^~~
a.cc:28:1: error: ISO C++ forbids declaration of 'min' with no type [-fpermissive]
   28 | min(int a,int b){
      | ^~~
Language: C++

    #include <iostream>
    #include <string>
    #include <set>  
    #include <algorithm>
    #include <vector>
    #include <cmath>
    #include <queue>
    #include <deque>
    #include <cstring>
    #include <cstdio>
    #include <map>
    #include <numeric>
    #include <cassert>
    #include <iomanip>
    #include <sstream>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(int)(b);++i)
#define REP(i,N) FOR(i,0,N)
#define FORD(i,b,a) for(int i=(int)(b)-1;i>=a;--i)
typedef long long LL;
typedef pair<int,int> PII;
const int INF=1e9+7;
#define st first
#define nd second
#define pb push_back
#define eb emplace_back
#define dprintf(...) printf(__VA_ARGS__)
int a,b,c,x,y;
int main()
{
	scanf("%d %d %d %d %d",&a,&b,%c,&x,&y);
	if(2*c>a+b)
	{
		printf("%d\n",x*a+y*b);
	}
	else
	{
		int ans=0;
		if(x<y)
		{
			ans=2*c*x;
			ans+=min(2*c*(y-x),b*(y-x));
		}
		else
		{
			ans=2*c*y;
			ans+=min(2*c*(x-y),b*(x-y));
		}
		printf("%d\n",ans);
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:38: error: expected primary-expression before '%' token
   31 |         scanf("%d %d %d %d %d",&a,&b,%c,&x,&y);
      |                                      ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int A,B,C,X,Y;
  cin>>A>>B>>C>>X>>Y;

  if(A+B<=2*C){
    cout<<(A*X+B*Y)<<endl;
  }
  else if{
    if(X<Y){
      cout<<(2*C*X+B*(Y-X))<<endl;
    }else{
      cout<<(2*C*Y+A*(X-Y))<<endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: expected '(' before '{' token
   11 |   else if{
      |          ^
      |          (
Language: C++

#include <bits/stdc++.h>

int main(){
  int a, b, c, d, e;
  scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
  printf("%d\n",(d-min(d,e))*a+(e-min(d,e))*b+min(d,e)*min(a+b,c+c));
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:20: error: 'min' was not declared in this scope; did you mean 'std::min'?
    6 |   printf("%d\n",(d-min(d,e))*a+(e-min(d,e))*b+min(d,e)*min(a+b,c+c));
      |                    ^~~
      |                    std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: Java

import java.util.*;
public final class Solution{
	private static long solve(int a, int b, int c, int x, int y){
		long option1 = (a * x) + (b * y);
		long option2 = 0;
	if (x > y){
	   option2 = ((x - y) * a) + (Math.min(x, y) * c * 2);
	} else if (y > x){
	   option2 = ((y - x) * b) + (Math.min(x, y) * c * 2);
	} else {
	    option2 = (x * c * 2);
	}
	option2 = Math.min(option2, Math.max(x, y) * c * 2);
	return Math.min(option1, option2);
	}
	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 x = sc.nextInt();
	   int y = sc.nextInt();
	   System.out.println(solve(a, b, c, x, y));
	}
}

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

import java.util.*;
public final class Solution{
	private static long solve(int a, int b, int c, int x, int y){
		long option1 = (a * x) + (b * y);
		long option2 = 0;
	if (x > y){
	   option2 = ((x - y) * a) + (Math.min(x, y) * c * 2);
	} else if (y > x){
	   option2 = ((y - x) * b) + (Math.min(x, y) * c * 2);
	} else {
	    option2 = (x * c * 2);
	}
	option2 = Math.min(option2, Math.max(x, y) * c * 2)
	return Math.min(option1, option2)
	}
	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 x = sc.nextInt();
	   int y = sc.nextInt();
	   System.out.println(solve(a, b, c, x, y));
	}
}

Compiler output:
Main.java:13: error: ';' expected
	option2 = Math.min(option2, Math.max(x, y) * c * 2)
	                                                   ^
Main.java:14: error: ';' expected
	return Math.min(option1, option2)
	                                 ^
2 errors
Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>	// upper_bound(A, A+N, num):>, lower_bound(A, A+N, num):>=
#include <functional>
#include <string>
#include <sstream>
#include <complex>
#include <vector>	// V[i],  push_back(x), pop_back(), insert(index, x), erase(index), sort(v.begin(), v.end(), greater<int>())
#include <list>		// push_front(x), push_back(x), pop_front(), pop_back(), insert(index, x)
#include <queue>	// push(x), front(), pop()
#include <deque>
#include <stack>	// push(x), top(), pop()
#include <map>		// M[key],  insert(key, val), erase(key), find(key), 
#include <set>		// insert(key), erase(key), find(key)
using namespace std;
typedef long long ll;
// typedef pair<int, int> P;
#define pi 3.141592653589793)
#define mod 1000000007
void solve() {
	ll a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	ll d = a * x + b * y;
	ll e = c * 2 * max(x, y);
	ll f = c * 2 * min(x, y);
	if (x > y) f += (x - y)*a;
	else f += (y - x)*b;
	ll ans = min(min(d, e), f);
	cout << ans << endl;
}
int main() {
	solve();
	return 0;
}

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

void _main() {
    cin >> A >> B >> C >> X >> Y;
    
    ll ans = infl;
    rep(ab, 0, 201010) {
        ll sm = C * ab;
 
        ll x = X - ab / 2;
        ll y = Y - ab / 2;
 
        if (0 < x) sm += x * A;
        if (0 < y) sm += y * B;
 
        chmin(ans, sm);
    }
 
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'void _main()':
a.cc:2:5: error: 'cin' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |     ^~~
a.cc:2:12: error: 'A' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |            ^
a.cc:2:17: error: 'B' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |                 ^
a.cc:2:22: error: 'C' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |                      ^
a.cc:2:27: error: 'X' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |                           ^
a.cc:2:32: error: 'Y' was not declared in this scope
    2 |     cin >> A >> B >> C >> X >> Y;
      |                                ^
a.cc:4:5: error: 'll' was not declared in this scope
    4 |     ll ans = infl;
      |     ^~
a.cc:5:9: error: 'ab' was not declared in this scope
    5 |     rep(ab, 0, 201010) {
      |         ^~
a.cc:5:5: error: 'rep' was not declared in this scope
    5 |     rep(ab, 0, 201010) {
      |     ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << ans << endl;
      |     ^~~~
a.cc:17:13: error: 'ans' was not declared in this scope
   17 |     cout << ans << endl;
      |             ^~~
a.cc:17:20: error: 'endl' was not declared in this scope
   17 |     cout << ans << endl;
      |                    ^~~~
Language: Java

//.h file code:

public:
virtual void _main();

//.cpp file code:

void <missing_class_definition>::_main()
{
	cin >> A >> B >> C >> X >> Y;

	ll *ans = infl;
	rep(ab, 0, 201010)
	{
		ll *sm = C * ab;

		ll *x = X - ab / 2;
		ll *y = Y - ab / 2;

		if (0 < x)
		{
			sm += x * A;
		}
		if (0 < y)
		{
			sm += y * B;
		}

		chmin(ans, sm);
	}

	cout << ans << endl;
}


Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public:
      ^
Main.java:8: error: class, interface, enum, or record expected
void <missing_class_definition>::_main()
^
Main.java:12: error: class, interface, enum, or record expected
	ll *ans = infl;
	^
Main.java:13: error: class, interface, enum, or record expected
	rep(ab, 0, 201010)
	^
Main.java:17: error: class, interface, enum, or record expected
		ll *x = X - ab / 2;
		^
Main.java:18: error: class, interface, enum, or record expected
		ll *y = Y - ab / 2;
		^
Main.java:20: error: class, interface, enum, or record expected
		if (0 < x)
		^
Main.java:23: error: class, interface, enum, or record expected
		}
		^
Main.java:27: error: class, interface, enum, or record expected
		}
		^
Main.java:30: error: class, interface, enum, or record expected
	}
	^
Main.java:33: error: class, interface, enum, or record expected
}
^
11 errors
Language: C++

#include<bits/stdc++.h>

using namespace std;


struct node{
	long long l, r, val;
}a[1111111];

long long sum[1111111];
long long maxf[1111111];
long long maxp[1111111];
int cmp1(node x, node y){
	return x.l < y.l;
}

int cmp2(node x, node y){
	return x.r < y.r;
}

int main(){
	long long n, c;
	scanf("%lld%lld", &n, &c);
	for(int i = 1; i <= n; i++){
		scanf("%lld%lld",&a[i].l, &a[i].val);
		a[i].r = c - a[i].l;
	}
	sort(a + 1, a + n + 1, cmp1);
	for(int i = 1; i <= n; i++){
		maxf[i] = max(sum[i - 1] - a[i].l + a[i - 1].l + a[i].val, sum[i - 1]);
		sum[i] = sum[i - 1] - a[i].l + a[i - 1].l + a[i].val;
	}
	
	/*sort(sum + 1, sum + n + 1);
	long long maxv = sum[n - 1];
	sort(a + 1, a + n + 1, cmp2);
	for(int i = 1; i <= n; i++){
		sum[i] = sum[i - 1] - a[i].r + a[i - 1].r + a[i].val;
	}
	sort(sum + 1, sum + n + 1);
	maxv = max(maxv , sum[n - 1]);
	printf("%lld\n", maxv);
	*/
	long long maxv = -0x3f3f3f3f;
	sort(a + 1, a + n + 1, cmp2);
	for(int i = 1; i <= n; i ++ ){
		sum[i] = sum[i - 1] - a[i].r + a[i - 1].r + a[i].val;
		maxp[i] = max(sum[i], sum[i - 1]);
	}
	for(int i = 1; i <= n; i++){
		maxv = max(maxv, max(maxf[i] + maxp[n - i] - a[n - i + 1].l, maxf[i]));
		maxv = max(maxv, max(maxp[i] + maxf[n - i] - a[i].r, maxp[i]));
		//printf("%lld+++\n", maxv);
	}
	printf("%lld\n", maxv);


Compiler output:
a.cc: In function 'int main()':
a.cc:55:32: error: expected '}' at end of input
   55 |         printf("%lld\n", maxv);
      |                                ^
a.cc:21:11: note: to match this '{'
   21 | int main(){
      |           ^
Language: C++

#include<bits/stdc++.h>

using namespace std;


struct node{
	long long l, r, val;
}a[1111111];

long long sum[1111111];
long long maxf[1111111];
long long maxp[1111111];
int cmp1(node x, node y){
	return x.l < y.l;
}

int cmp2(node x, node y){
	return x.r < y.r;
}

int main(){
	long long n, c;
	scanf("%lld%lld", &n, &c);
	for(int i = 1; i <= n; i++){
		scanf("%lld%lld",&a[i].l, &a[i].val);
		a[i].r = c - a[i].l;
	}
	sort(a + 1, a + n + 1, cmp1);
	for(int i = 1; i <= n; i++){
		maxf[i] = max(sum[i - 1] - a[i].l + a[i - 1].l + a[i].val, sum[i - 1]);
		sum[i] = sum[i - 1] - a[i].l + a[i - 1].l + a[i].val;
	}
	
	/*sort(sum + 1, sum + n + 1);
	long long maxv = sum[n - 1];
	sort(a + 1, a + n + 1, cmp2);
	for(int i = 1; i <= n; i++){
		sum[i] = sum[i - 1] - a[i].r + a[i - 1].r + a[i].val;
	}
	sort(sum + 1, sum + n + 1);
	maxv = max(maxv , sum[n - 1]);
	printf("%lld\n", maxv);
	*/
	long long maxv = -0x3f3f3f3f;
	sort(a + 1, a + n + 1, cmp2);
	for(int i = 1; i <= n; i ++ ){
		sum[i] = sum[i - 1] - a[i].r + a[i - 1].r + a[i].val;
		maxp[i] = max(sum[i], sum[i - 1]);
	}
	for(int i = 1; i <= n; i++){
		printf("%lld %lld \n", maxf[i], maxp[i]);
	}
	for(int i = 1; i <= n; i++){
		maxv = max(maxv, max(maxf[i] + maxp[n - i] - a[n - i + 1].l, maxf[i]));
		maxv = max(maxv, max(maxp[i] + maxf[n - i] - a[i].r, maxp[i]));
		//printf("%lld+++\n", maxv);
	}
	printf("%lld\n", maxv);


Compiler output:
a.cc: In function 'int main()':
a.cc:58:32: error: expected '}' at end of input
   58 |         printf("%lld\n", maxv);
      |                                ^
a.cc:21:11: note: to match this '{'
   21 | int main(){
      |           ^
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int A,B,C,X,Y;
	cin >> A >> B >> C >> X >> Y;

	int answer = INT_MAX;

	for(int i = 0; i <= 100000; i++)
    {
		int now = i * 2 * C + max(0, (X - i)) * A + max(0, Y - i) * B;
        cout << now << endl;
		answer = min(answer,now);
	}

	cout << answer << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'INT_MAX' was not declared in this scope
    8 |         int answer = INT_MAX;
      |                      ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

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

  int ans=0,ove;
  if(x>=y){
    ove=y;
    if(a<c*2) ans+=(x-y)*a;
    else ans+=(x-y)*c*2;
  }
  else{

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

include<iostream>
using namespace std;

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

  int ans=0,ove;
  if(x>=y){
    ove=y;
    if(a<c*2) ans+=(x-y)*a;
    else ans+=(x-y)*c*2;
  }
  else{

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> a >> b >> c >> x >> y;
      |   ^~~
a.cc:14:8: error: expected '}' at end of input
   14 |   else{
      |       ~^
a.cc:14:8: error: expected '}' at end of input
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<iostream>
using namespace std;

int main(){
    unsigned long int N,C;
    //max1 = 0,max2=0,max3=0,max4=0,res1=0,res2=0,res3=0,res4=0;
    long int maxr=-1,maxl=-1,maxl1[N+1],maxr1[N+1];
    cin >> N >> C;
    unsigned long int x[N+2],v[N],sumr[N+1],suml[N+1];
    //3=N 20=C
    x[0]=0;
    x[N+1]=C;
    for (int i =0; i < N; i++){
        cin >>x[i+1]>>v[i];
    } 
    //sum of right rotation
    sumr[0] = 0;
    for(int i = 1;i<=N;i++){
        sumr[i]=sumr[i-1]+v[i-1];
    }
    
    //sum of left rotation
    suml[0] = 0;
     for(int i = 1;i<=N;i++){
        suml[i]=suml[i-1]+v[N-i];
    }   
 
    maxl1[0]=0;
    for(int J = 1;J<=N;J++){
       //long int maxl0 = suml[J] - C + x[N+1-J]; 
        maxl1[J] = max(maxl1[J-1],suml[J] - C + x[N+1-J]);
    }
    
/*
    for(int I= 0;I<=N;I++){
        //J=0
        long int res=sumr[I]+suml[0];
        res -= x[I];
        if(maxr<res) maxr =res;
        res = sumr[I]-x[I]*2;
        res += maxl1[N-I];
        if(maxr<res)             maxr =res;
//        cout << "maxr: "<< res <<endl;
        
    }
    
    maxr1[0]=0;
    for(int I = 1;I<=N;I++){
       //
        long int maxr0 = sumr[I] - x[I]; 
        maxr1[I] = max(maxr1[I-1],maxr0);
    }
    

    for(int J = 0;J<=N;J++){
        //I=0
        long int res=sumr[J]+suml[0];
        res -= C - x[N+1-J];
        if(maxl<res) maxl = res;
        res = suml[J]-2*C+2*x[N+1-J];
        res += maxr1[N-J];
        if(maxl<res) maxl =res;
//        cout << "maxl: " << res << endl;
    }
 
    cout << max(maxr,maxl) << endl;
*/
    cout << "0" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:23: error: no matching function for call to 'max(long int&, long unsigned int)'
   31 |         maxl1[J] = max(maxl1[J-1],suml[J] - C + x[N+1-J]);
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:   template argument deduction/substitution failed:
a.cc:31:23: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long unsigned int')
   31 |         maxl1[J] = max(maxl1[J-1],suml[J] - C + x[N+1-J]);
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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, 2 provided
Language: C++

#include<iostream>
using namespace std;

int main(){
    unsigned long int N,C;
    //max1 = 0,max2=0,max3=0,max4=0,res1=0,res2=0,res3=0,res4=0;
    long int maxr=-1,maxl=-1,maxl1[N+1],maxr1[N+1];
    cin >> N >> C;
    unsigned long int x[N+2],v[N],sumr[N+1],suml[N+1];
    //3=N 20=C
    x[0]=0;
    x[N+1]=C;
    for (int i =0; i < N; i++){
        cin >>x[i+1]>>v[i];
    } 
    //sum of right rotation
    sumr[0] = 0;
    for(int i = 1;i<=N;i++){
        sumr[i]=sumr[i-1]+v[i-1];
    }
    
    //sum of left rotation
    suml[0] = 0;
     for(int i = 1;i<=N;i++){
        suml[i]=suml[i-1]+v[N-i];
    }   
 
    maxl1[0]=0;
    for(int J = 1;J<=N;J++){
       //long int maxl0 = suml[J] - C + x[N+1-J]; 
        maxl1[J] = max(maxl1[J-1],suml[J] - C + x[N+1-J];
    }
    
/*
    for(int I= 0;I<=N;I++){
        //J=0
        long int res=sumr[I]+suml[0];
        res -= x[I];
        if(maxr<res) maxr =res;
        res = sumr[I]-x[I]*2;
        res += maxl1[N-I];
        if(maxr<res)             maxr =res;
//        cout << "maxr: "<< res <<endl;
        
    }
    
    maxr1[0]=0;
    for(int I = 1;I<=N;I++){
       //
        long int maxr0 = sumr[I] - x[I]; 
        maxr1[I] = max(maxr1[I-1],maxr0);
    }
    

    for(int J = 0;J<=N;J++){
        //I=0
        long int res=sumr[J]+suml[0];
        res -= C - x[N+1-J];
        if(maxl<res) maxl = res;
        res = suml[J]-2*C+2*x[N+1-J];
        res += maxr1[N-J];
        if(maxl<res) maxl =res;
//        cout << "maxl: " << res << endl;
    }
 
    cout << max(maxr,maxl) << endl;
*/
    cout << "0" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:57: error: expected ')' before ';' token
   31 |         maxl1[J] = max(maxl1[J-1],suml[J] - C + x[N+1-J];
      |                       ~                                 ^
      |                                                         )
Language: C++

#include<iostream>
using namespace std;

int main(){
    unsigned long int N,C;
    //max1 = 0,max2=0,max3=0,max4=0,res1=0,res2=0,res3=0,res4=0;
    long int maxr=-1,maxl=-1,maxl1[N+1],maxr1[N+1];
    cin >> N >> C;
    unsigned long int x[N+2],v[N],sumr[N+1],suml[N+1];
    //3=N 20=C
    x[0]=0;
    x[N+1]=C;
    for (int i =0; i < N; i++){
        cin >>x[i+1]>>v[i];
    } 
    //sum of right rotation
    sumr[0] = 0;
    for(int i = 1;i<=N;i++){
        sumr[i]=sumr[i-1]+v[i-1];
    }
    
    //sum of left rotation
    suml[0] = 0;
     for(int i = 1;i<=N;i++){
        suml[i]=suml[i-1]+v[N-i];
    }   
 
    maxl1[0]=0;
    for(int J = 1;J<=N;J++){
       //long int maxl0 = suml[J] - C + x[N+1-J]; 
        maxl1[J] = max(maxl1[J-1],maxl0);
    }
    
/*
    for(int I= 0;I<=N;I++){
        //J=0
        long int res=sumr[I]+suml[0];
        res -= x[I];
        if(maxr<res) maxr =res;
        res = sumr[I]-x[I]*2;
        res += maxl1[N-I];
        if(maxr<res)             maxr =res;
//        cout << "maxr: "<< res <<endl;
        
    }
    
    maxr1[0]=0;
    for(int I = 1;I<=N;I++){
       //
        long int maxr0 = sumr[I] - x[I]; 
        maxr1[I] = max(maxr1[I-1],maxr0);
    }
    

    for(int J = 0;J<=N;J++){
        //I=0
        long int res=sumr[J]+suml[0];
        res -= C - x[N+1-J];
        if(maxl<res) maxl = res;
        res = suml[J]-2*C+2*x[N+1-J];
        res += maxr1[N-J];
        if(maxl<res) maxl =res;
//        cout << "maxl: " << res << endl;
    }
 
    cout << max(maxr,maxl) << endl;
*/
    cout << "0" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:35: error: 'maxl0' was not declared in this scope; did you mean 'maxl1'?
   31 |         maxl1[J] = max(maxl1[J-1],maxl0);
      |                                   ^~~~~
      |                                   maxl1
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<cmath>
#include<queue>
#include<limits>
#include<cassert>
#include<set>
#include<tuple>
#include<map>
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define None cout<<"None"<<endl
typedef long long ll;
using namespace std;

int main(){
    int A,B,C,X,Y; R(A,B,C,X,Y);
    if(B>C*2)B=C*2;
    if(A>C*2)A=C*2;
    if(C*2<=A+B) cout <<(C*2*min(X,Y)+(X-min(X,Y))*A+(Y-min(X,Y))*B);
    else cout << (A*X+B*Y);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: 'R' was not declared in this scope
   25 |     int A,B,C,X,Y; R(A,B,C,X,Y);
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define fi first
#define se second
P dp[100009][2];
int n,c,w[100009],v[100009],ans=0;
int A[100009],B[100009];
int W[1000009];
main(){
  cin>>n>>c;
  r(i,n)cin>>w[i]>>v[i];
 
  r(i,n)W[i]=w[i];
 
  r(i,n)A[i]=v[i];
  r(i,n-1)A[i+1]+=A[i];
 
  r(i,n)B[i]=v[i];
  for(int i=n-1;i>0;i--)B[i-1]+=B[i];
  for(int i=n-1;i>=0;i--){
    if(i!=n-1)B[i]-=abs(c-w[i]);
    else B[i]-=abs(c-w[i]);
  }
  for(int i=n-1;i>0;i--){
    if(B[i-1]<B[i]){
      B[i-1]=max(B[i-1],B[i]);
      W[i-1]=W[i];
    }
  }
 
 
  for(int i=0;i<n;i++){
    int sum=0;
    sum=A[i]-w[i];
    //cout<<sum<<' ';
    ans=max(ans,sum);
    if(i!=n-1)sum+=B[i+1];
    if(i!=n-1)sum-=min(abs(W[i+1]-w[i],)min(abs(c-W[i+1]),w[i]));
    //cout<<B[i+1]<<endl;
    ans=max(ans,sum);
  }
  ans=max(ans,B[0]);
  cout<<ans<<endl;
}

Compiler output:
a.cc:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:41:40: error: expected primary-expression before ')' token
   41 |     if(i!=n-1)sum-=min(abs(W[i+1]-w[i],)min(abs(c-W[i+1]),w[i]));
      |                                        ^
Language: C++

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll dp[5005][5005];

int main()
{
    ll A,B,C,X,Y;
    cin>>A>>B>>C>>X>>Y;
    ll ans = 1000000000000000;
    for(ll i=0; i<X+1; i++){
        int k = (X-i);
        if(k<=Y)
        {
            ans = min(ans,min(A*i+2*C*k+(Y-k)*B,A*i+2*C*k+(Y-k)*2*C ));
            ans = min(ans,min(2*C*i+2*C*k+(Y-k)*B,2*C*i+2*C*k+(Y-k)*2*C))
        }

    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:74: error: expected ';' before '}' token
   17 |             ans = min(ans,min(2*C*i+2*C*k+(Y-k)*B,2*C*i+2*C*k+(Y-k)*2*C))
      |                                                                          ^
      |                                                                          ;
   18 |         }
      |         ~
Language: C++

#include <iostream>

using namespace std;

typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(0);
    ll a, b, ab, x, y;
    cin >> a >> b >> ab >> x >> y;
    ll odp = 1000000000000;
    for (ll i = 0; i <= 1000000; i += 2)
    {
        ll ra = max(x - i / 2, 0);
        ll rb = max(y - i / 2, 0);
        odp = min(odp, ab * i + ra * a + rb * b);
    }
    cout << odp;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:20: error: no matching function for call to 'max(ll, int)'
   15 |         ll ra = max(x - i / 2, 0);
      |                 ~~~^~~~~~~~~~~~~~
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:   template argument deduction/substitution failed:
a.cc:15:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   15 |         ll ra = max(x - i / 2, 0);
      |                 ~~~^~~~~~~~~~~~~~
/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, 2 provided
a.cc:16:20: error: no matching function for call to 'max(ll, int)'
   16 |         ll rb = max(y - i / 2, 0);
      |                 ~~~^~~~~~~~~~~~~~
/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:   template argument deduction/substitution failed:
a.cc:16:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   16 |         ll rb = max(y - i / 2, 0);
      |                 ~~~^~~~~~~~~~~~~~
/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, 2 provided
Language: C++

#include <iostream>
#include <algorithm>

#define int long long

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)

#define INF (3e9)

using namespace std;

int dp[100003][100003];
int A, B, C, X, Y;

int solve(int x, int y)
{
    if (A+B >= 2*C)
    {
        if (X > Y)
        {
            int ans = Y*2*C;
            ans += (X-Y) * min(A, 2*C);
            return ans;
        }
        else
        {
            int ans = X*2*C;
            ans += (Y-X) * min(B, 2*C);
            return ans;
        }
    }

    return X*A + Y*B;
}

signed main()
{
    cin >> A >> B >> C >> X >> Y;

    int ans = solve(X, Y);
    cout << ans << endl;

    return 0;
}

Compiler output:
/tmp/ccCWhq8k.o: in function `solve(long long, long long)':
a.cc:(.text+0x14): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x38): relocation truncated to fit: R_X86_64_PC32 against symbol `X' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x3f): relocation truncated to fit: R_X86_64_PC32 against symbol `Y' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `Y' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x52): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x64): relocation truncated to fit: R_X86_64_PC32 against symbol `X' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x6b): relocation truncated to fit: R_X86_64_PC32 against symbol `Y' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x78): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/ccCWhq8k.o
a.cc:(.text+0x8d): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++


#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#define MOD 1000000007

using namespace std;

int main(void) {
    long long a = 0;
    long long b = 0;
    long long c = 0;
    long long x = 0;
    long long y = 0;
    cin >> a >> b >> c >> x >> y;
    long long minxy = min(x,y);
    long long buya = 0;
    long long buyb = 0;
    long long buyc = 0;
    if(a+b < 2*c){
        buya += x;
        buyb += y;
//        if(x<y){
//            buya += x;
//        }else{
//            buyb += y;
//        }
    }else if(a+b >= 2*c){
        buyc += 2 * minxy;
        if(a>2*c && b>2:c){
            buyc = 2 * max(x,y);
        }else{
            if(x<y){
                buyb += y - x;
            }else{
                buya += x - y;
            }
        }
    }
    cout << buya*a + buyb*b + buyc*c << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:24: error: expected ')' before ':' token
   33 |         if(a>2*c && b>2:c){
      |           ~            ^
      |                        )
Language: C

#include <stdio.h>

int main(void) {
	int a, b, c, x, y, total = 0, total2 = 0, total3 = 0;
	scanf("%d %d %d %d %d", &a, &b, &c, &x, &y);
	total = a * x + b * y;
	total2 = c * 2 * (x > y ? x : y);
	total3 = c * 2 * (x < y ? x : y) + a * (x - (x < y ? x : y)) + b * (y - (x < y ? x : y));
	printf("%d %d %d\n", total, total2, total3);
	Sub(total, total2, total3);
	return 0;
}

void Sub(int total, int total2, int total3)
{
	int min = total;
	
	if(min>total2) min = total2;
	if(min>total3) min = total3;
	printf("%d\n", min);
}

Compiler output:
main.c: In function 'main':
main.c:10:9: error: implicit declaration of function 'Sub' [-Wimplicit-function-declaration]
   10 |         Sub(total, total2, total3);
      |         ^~~
main.c: At top level:
main.c:14:6: warning: conflicting types for 'Sub'; have 'void(int,  int,  int)'
   14 | void Sub(int total, int total2, int total3)
      |      ^~~
main.c:10:9: note: previous implicit declaration of 'Sub' with type 'void(int,  int,  int)'
   10 |         Sub(total, total2, total3);
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
int main(){
int A, B, C, X, Y,d,e;
cin >> A >> B >> C >> X >> Y;
if(X=>Y){
d = 2*C*Y+(X-Y)*A;
}else{
d = 2*C*X+(Y-X)*B;
}
e = A*X+B*Y;
f = 2*C*max(X,Y);
cout << min(d,e,f) << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected primary-expression before '>' token
    6 | if(X=>Y){
      |      ^
a.cc:12:1: error: 'f' was not declared in this scope
   12 | f = 2*C*max(X,Y);
      | ^
a.cc:13:28: error: expected '}' at end of input
   13 | cout << min(d,e,f) << endl;
      |                            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include<iostream>
#include<math.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
bool asingle,bsingle,csingle;
if(a<c*2){asingle=falce;}else{asingle=true;}
if(b<c*2){bsingle=falce;}else{bsingle=true;}
if(a+b<c*2){csingle=falce;}else{csingle=true;}
int x,y;
cin>>x>>y;
int au=0;
int bu=0;
int cu=0;
if(asingle==true){cu+=(x+1)/2;y-=((x+1)/2)*2;x=0;}
if(bsingle==true and y>
0){cu+=(y+1)/2;x-=((y+1)/2)*2;y=0;}
if(csingle==true and x>0 and y>0){
int k=min(x+1,y+1)/2;
cu+=k;x-=k*2;y-=k*2;
}
if(x>0){au+=x;}
if(y>0){bu+=y;}
cout<<au*a+bu*b+cu*c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: 'falce' was not declared in this scope
    8 | if(a<c*2){asingle=falce;}else{asingle=true;}
      |                   ^~~~~
a.cc:9:19: error: 'falce' was not declared in this scope
    9 | if(b<c*2){bsingle=falce;}else{bsingle=true;}
      |                   ^~~~~
a.cc:10:21: error: 'falce' was not declared in this scope
   10 | if(a+b<c*2){csingle=falce;}else{csingle=true;}
      |                     ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
int main() {
    int A,B,C,X,Y;
    std::cin >> A >> B >> C >> X >> Y;
    /*
    int A_num,B_num,AB_num;
    int mon;
    mon = A*X + B*Y;
    A_num = X;
    B_num = Y;
    AB_num = 0;
    */
    int max_num = X>Y ? X : Y;
    std::vector<int> mon_ary(max_num);
    for (int i=0; i < max_num; i++) {
        int temp_A_num = X-i > 0 ? X-i : 0;
        int temp_B_num = Y-i > 0 ? Y-i : 0;
        mon_ary[i] = temp_A_num*A + temp_B_num*B + 2*i*C;
    }
    std::cout << *std::min_element(mon_ary.begin(),mon_ary.end()) << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   22 |     std::cout << *std::min_element(mon_ary.begin(),mon_ary.end()) << std::endl;
      |                        ^~~~~~~~~~~
      |                        tuple_element
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

#include <cmath>
#include <cstdlib>
#include <climits>

//#include <stdio.h>
//#include <stdlib.h>
#include "show_vector.hh"


using namespace std;

#define debug false

int main(int argc, char *argv[]){

  int A, B, C, X, Y;
  cin >> A >> B >> C >> X >> Y;
  int sum = 0;
  if ( A+B <= 2*C ){
    sum = A*X + B*Y;
  }else{
    int smaller = (X<Y? X:Y);
    X -= smaller;
    Y -= smaller;
    sum = 2*C*smaller;

    int tmp1 = A*X + B*Y;
    int tmp2 = 2*C*(X+Y);
    sum += (tmp1>tmp2?tmp2:tmp1);

  }
  printf("%d\n", sum);

  return 0;
}


Compiler output:
a.cc:12:10: fatal error: show_vector.hh: No such file or directory
   12 | #include "show_vector.hh"
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
int main(int argc, const char * argv[]) {
    int A,B,C,X,Y;
    std::cin >> A >> B >> C >> X >> Y;
    /*
    int A_num,B_num,AB_num;
    int mon;
    mon = A*X + B*Y;
    A_num = X;
    B_num = Y;
    AB_num = 0;
    */
    int max_num = X>Y ? X : Y;
    std::vector<int> mon_ary(max_num);
    for (int i=0; i < max_num; i++) {
        int temp_A_num = X-i > 0 ? X-i : 0;
        int temp_B_num = Y-i > 0 ? Y-i : 0;
        mon_ary[i] = temp_A_num*A + temp_B_num*B + 2*i*C;
    }
    std::cout << *std::min_element(mon_ary.begin(),mon_ary.end()) << std::endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:24: error: 'min_element' is not a member of 'std'; did you mean 'tuple_element'?
   22 |     std::cout << *std::min_element(mon_ary.begin(),mon_ary.end()) << std::endl;
      |                        ^~~~~~~~~~~
      |                        tuple_element
Language: C++

#include<cstdio>

#define Fast register
#define int long long
inline int Min(const int&x,const int&y){return x<y?x:y;}
inline int Min(const int&x,const int&y){return x>y?x:y;}
inline void chkMin(int&x,const int&y){x>y&&(x=y);}
#undef int

int main(){
	#define int long long
	Fast int A,B,C,X,Y;
	scanf(" %lld %lld %lld %lld %lld",&A,&B,&C,&X,&Y);
	C<<=1;
	Fast int Ans=A*X+B*Y;
	if(X<Y)chkMin(Ans,C*X+B*(Y-X));
	if(X>Y)chkMin(Ans,C*Y+A*(X-Y));
	return(printf("%lld",Min(Ans,C*Max(X,Y))),0);
}


Compiler output:
a.cc:6:12: error: redefinition of 'long long int Min(const long long int&, const long long int&)'
    6 | inline int Min(const int&x,const int&y){return x>y?x:y;}
      |            ^~~
a.cc:5:12: note: 'long long int Min(const long long int&, const long long int&)' previously defined here
    5 | inline int Min(const int&x,const int&y){return x<y?x:y;}
      |            ^~~
a.cc: In function 'int main()':
a.cc:12:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         Fast int A,B,C,X,Y;
      |                  ^
a.cc:12:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         Fast int A,B,C,X,Y;
      |                    ^
a.cc:12:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         Fast int A,B,C,X,Y;
      |                      ^
a.cc:12:24: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         Fast int A,B,C,X,Y;
      |                        ^
a.cc:12:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         Fast int A,B,C,X,Y;
      |                          ^
a.cc:15:18: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   15 |         Fast int Ans=A*X+B*Y;
      |                  ^~~
a.cc:18:40: error: 'Max' was not declared in this scope
   18 |         return(printf("%lld",Min(Ans,C*Max(X,Y))),0);
      |                                        ^~~