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

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



int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

unsigned long  gcd(unsigned long x, unsigned long y)
{
        if (y == 0) {
                return x;
        } else {
                return gcd(y, x % y);
        }
}

long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}




int main(void){
    int price[4];
    int n;
    unsigned long long min = price[0]*(int)pow(2, 3-i);
    int mini;
    unsigned long long ans = 0;
    for (int i = 0; i < 4; i++){
        scanf("%d", &price[i]);
    }
    scanf("%d", &n);
    n *= 4;
    for (int i = 0; i < 3; i++){
        if (min > price[i]*(int)pow(2, 3-i)){
            min = price[i]*(int)pow(2, 3-i);
            mini = i;
        }
    }
    if (min > price[3]){
        ans = (unsigned long long)n/8*price[3]+(n%8)/(int)pow(2, mini)*price[mini];
    }else{
        ans = (unsigned long long)n/(int)pow(2, mini)*price[mini];
    }

    printf("%llu\n", ans);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:71:53: error: 'i' undeclared (first use in this function)
   71 |     unsigned long long min = price[0]*(int)pow(2, 3-i);
      |                                                     ^
main.c:71:53: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<iostream>
using namespace std;
int main(){
  long long a,b,c,d,n;
  cin >>a>>b>>c>>d;
  cin>>n;
  long long p,q;
  p=min(min(4*a,2*b),c);
  q=min(2*p,d);
  long long r=n%2;
  n/=2;
  long long ans=p*r+q*n;
  
  cout<<ans<<endl;
  return 0;
  }

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

#include<set>
#include<cstdio> 
#include<cstring> 
#include<cmath> 
#include<windows.h>
#include<algorithm> 
#include<ctime> 
#include<bits/stdc++.h>
using namespace std; 
#define pi  acos(-1)
#define ll int
#define For(i,x,y)  for(ll i=x;i<=y;++i) 
#define FOr(i,x,y)  for(ll i=x;i>=y;--i) 
#define rep(i,x,y)	for(ll i=x;i<y;++i)
ll read(){  ll x=0,f=1; char ch=getchar();  for(;ch<'0'||ch>'9';ch=getchar()) if (ch=='-')    f=-1;   for(;ch>='0'&&ch<='9';ch=getchar())   x=x*10+ch-'0';  return x*f; } 
void write(ll x){   if (x<0) putchar('-'),x=-x;  if (x>=10)   write(x/10);    putchar(x%10+'0');  } 
void writeln(ll x){ write(x);   puts("");   }
const ll N=500010;
struct data{	ll x,y;	}p[N];
ll c[N],x1,ya,x2,y2,ans,n,b[N];
void add(ll x,ll v){	for(;x<=n;x+=x&-x)	c[x]=max(c[x],v);	}
ll ask(ll x){	ll ans=0;	for(;x;x-=x&-x)	ans=max(ans,c[x]);	return ans;	}
bool cmp(data a,data b){	return a.x==b.x?a.y<b.y:a.x<b.x;	}
int main(){
	memset(c,-60,sizeof c);
	x1=read();	ya=read();	x2=read();	y2=read();
	n=read();	For(i,1,n)	p[i].x=read(),p[i].y=read();
	if (x1>x2){	x1=-x1;	x2=-x2;	For(i,1,n)	p[i].x=-p[i].x;	}
	if (ya>y2){	ya=-ya;	y2=-y2;	For(i,1,n)	p[i].y=-p[i].y;	}
	p[++n]=(data){x1,ya};	p[++n]=(data){x2,y2};
	For(i,1,n)	b[i]=p[i].y;	sort(b+1,b+n+1);
	ll Y1=lower_bound(b+1,b+n+1,ya)-b,Y2=lower_bound(b+1,b+n+1,y2)-b;
	For(i,1,n)	p[i].y=lower_bound(b+1,b+n+1,p[i].y)-b;
	ll ans=0;
	sort(p+1,p+n+1,cmp);
	For(i,1,n){
		ll lis=ask(p[i].y)+1;
		if (p[i].x==x1&&p[i].y==Y1)	lis=0;
		else if (p[i].x==x2&&p[i].y==Y2)	ans=lis-1;
		add(p[i].y,lis);
	}
	printf("%.20lf",(x2-x1+y2-ya)*100.0+(pi-4)*5*(ans-(ans==min(y2-ya+1,x2-x1+1)&&ans)));
}

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

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include<algorithm>
#include<complex>
#include<cstdlib>
#include<cctype>
 
#define DBG cout << '!' << endl;
#define REP(i,n) for(int i = 0;i < (n);i++)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cout << v[i] << ' ';cout << endl << endl;}
#define SHOW2d(v,i,j) {for(int a = 0;a < i;a++){for(int b = 0;b < j;b++)cout << v[a][b] << ' ';cout << endl;}cout << endl;}
#define ALL(v) v.begin(),v.end()
 
using namespace std;
 
typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;
 
ll mozi[26];
 
int main()
{
	string str;
	
	cin >> str;
	REP(i,str.size())
	{
		mozi[str[i] - 'a']++;
	}
	
	
	//SHOW1d(mozi,26);
	ll tmp = str.size();
	ll ans = tmp * (tmp - 1) / 2 + 1;
	
	REP(i,26)
	{
		if(mozi[i] > 1)
		{
			ans -= mozi[i] * (mozi[i] - 1) / 2;
		}
	}	
	
	
	
	cout << ans << endl;
	
	return

Compiler output:
a.cc: In function 'int main()':
a.cc:58:15: error: expected primary-expression at end of input
   58 |         return
      |               ^
a.cc:58:15: error: expected ';' at end of input
   58 |         return
      |               ^
      |               ;
a.cc:58:15: error: expected '}' at end of input
a.cc:32:1: note: to match this '{'
   32 | {
      | ^
Language: Java

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class IceTea {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<List<Integer>> teas = new ArrayList<>();
        teas.add(Arrays.asList(1, sc.nextInt()));
        teas.add(Arrays.asList(2, sc.nextInt()));
        teas.add(Arrays.asList(4, sc.nextInt()));
        teas.add(Arrays.asList(8, sc.nextInt()));

        int N = sc.nextInt();

        long[] dp = new long[N*4 + 1];

        for (int i = 1; i < dp.length; i++) {
            long min = Integer.MAX_VALUE;
            for (List<Integer> tea : teas) {
                int deno = tea.get(0);
                int price = tea.get(1);
                if (i >= deno && dp[i - deno] != -1) {
                    min = Math.min(min, dp[i - deno] + price);
                }

                if (min != Integer.MAX_VALUE)
                    dp[i] = min;
                else
                    dp[i] = -1;
            }
        }

        System.out.println(dp[dp.length - 1]);
    }
}


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

q, h, s, d = gets.split.map(&:to_i)
n = gets.to_i
one_liter_min = [q * 4, h * 2, s].min
p n / 2 * [one_liter_min * 2, d].min + n % 2 * one_liter_min


Compiler output:
a.cc:1:1: error: 'q' does not name a type
    1 | q, h, s, d = gets.split.map(&:to_i)
      | ^
Language: C++

#include <bits/stdc++.h>
#define LL long long 
using namespace std;
int A[5], N;
int main()
{
#ifndef ONLINE_JUGDE
	freopen("A.in", "r", stdin);
	freopen("A.out", "w", stdout);
#endif
	for (int i = 1; i <= 4; ++i)
		scanf("%d", &A[i]);
	scanf("%d", &N);
	for (int i = 2; i <= 3; ++i)
		A[i] = min(A[i], A[i-1] * 2);
	LL Ans1 =(LL)N * A[3];
	LL Ans2 =(LL)((LL)N / 2 * A[4] + (N % 2) * A[3]);
	if (A[3] * 2< A[4])t
		printf("%lld\n",Ans1);
	else
		printf("%lld\n",Ans2);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: 't' was not declared in this scope; did you mean 'tm'?
   18 |         if (A[3] * 2< A[4])t
      |                            ^
      |                            tm
Language: C

#include<stdio.h>

int v[4];

int main() {
  int a, b, c, d, ab, bb, cb, u, p, max, i, x, y;
  float xl, yl, n;
  unsigned long long s;
  scanf( "%d%d%d%d%f", &a, &b, &c , &d, &n );
  cb = b * 2;
  bb = c * 4;
  ab = d * 8;
  v[0] = ab;
  v[1] = bb;
  v[2] = cb;
  v[3] = db;
  for ( u = 3; u > 0; u-- ) { 
    max = v[0];
    p = 0;                        
    for ( i = 1; i <= u; i++ )
      if ( v[i] > max ) {        
        max = v[i];
        p = i;
      }
    v[p] = v[u];
    v[u] = max;
  }
  x = v[3];
  y = v[2];
  if( x == ab ) {
    x = a;
    xl = 0.25;
  }
  else if( x == bb ) {
    x = b;
    xl = 0.50;
  }
  else if( x == cb ) {
    x = c;
    xl = 1;
  }
  else if( x == db ) {
    x = d;
    xl = 2;
  }
  if( y == ab && y != v[3] ) {
    y = a;
    yl = 0.25;
  }
  else if( x == bb && y != v[3] ) {
    y = b;
    yl = 0.50;
  }
  else if( x == cb && y != v[3] ) {
    y = c;
    yl = 1;
  }
  else if( x == db && y != v[3] ) {
    y = d;
    yl = 2;
  }
  s = (n / xl) * x;
  s += (n / yl) * y;
  printf( "%ulld", s ); 
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:10: error: 'db' undeclared (first use in this function); did you mean 'cb'?
   16 |   v[3] = db;
      |          ^~
      |          cb
main.c:16:10: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <limits.h>
using namespace std;

int main()
{
    int n, q, h, s, d;
    int minp, pay(0);
    cin>>q>>h>>s>>d>>n;
    while (n!=0)
    {
        minp=min(q, min(h/2, min(s/4, d/8)));
        if (minp=h/2)
        {
            if (0.5<=n)
            {
                pay+=n/0.5*h;
                n=n%0.5;
                h=INT_MAX;
            }
        }
        if (minp=q)
        {
            if (0.25<=n)
            {
                pay+=n/0.25*q
                n=n%0.25;
                q=INT_MAX;
            }

        }
        if (minp=s/4)
        {
            if (1<=n)
            {
                pay+=n/1*s;
                n=n%1;
                s=INT_MAX;
            }

        }
        if (minp=d/8)
        {
            if (2<=n)
            {
                pay+=n/2*d;
                n=n%2;
                d=INT_MAX;
            }

        }
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: invalid operands of types 'int' and 'double' to binary 'operator%'
   18 |                 n=n%0.5;
      |                   ~^~~~
      |                   | |
      |                   | double
      |                   int
a.cc:26:30: error: expected ';' before 'n'
   26 |                 pay+=n/0.25*q
      |                              ^
      |                              ;
   27 |                 n=n%0.25;
      |                 ~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int q, h, s, d, n, mini, mini2, mini1;
    cin >> q >> h >> s >> d >> n;
    q = q*8;
    h = h*4;
    s = s*2;
    mini = min(q, h);
    mini = min(mini, s);
    mini1 = mini
    mini = min(mini, d);
    mini2 = mini
    if(n % 2 == 0) cout << n/2 * mini2;
    else cout << n/2 * mini2 + mini1/2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ';' before 'mini'
   14 |     mini1 = mini
      |                 ^
      |                 ;
   15 |     mini = min(mini, d);
      |     ~~~~         
a.cc:16:17: error: expected ';' before 'if'
   16 |     mini2 = mini
      |                 ^
      |                 ;
   17 |     if(n % 2 == 0) cout << n/2 * mini2;
      |     ~~           
a.cc:18:5: error: 'else' without a previous 'if'
   18 |     else cout << n/2 * mini2 + mini1/2;
      |     ^~~~
Language: C++

#include <iostream>

using namespace std;

int main()
{
    int q, h, s, d, n, mini, mini2, min1;
    cin >> q >> h >> s >> d >> n;
    q = q*8;
    h = h*4;
    s = s*2;
    mini = min(q, h);
    mini = min(mini, s);
    mini1 = mini
    mini = min(mini, d);
    mini2 = mini
    if(n % 2 == 0) cout << n/2 * mini2;
    else cout << n/2 * mini2 + mini1/2;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'mini1' was not declared in this scope; did you mean 'min1'?
   14 |     mini1 = mini
      |     ^~~~~
      |     min1
a.cc:16:17: error: expected ';' before 'if'
   16 |     mini2 = mini
      |                 ^
      |                 ;
   17 |     if(n % 2 == 0) cout << n/2 * mini2;
      |     ~~           
a.cc:18:5: error: 'else' without a previous 'if'
   18 |     else cout << n/2 * mini2 + mini1/2;
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;
int main()
{
    int q,h,s,d,sum,mini,mini2,n,mini1;
    cin>>q>>h>>s>>d>>n;
    q=8*q;h=4*h-;s=2*s;
    mini=min(q,h);
    mini=min(mini,s);
    mini1=mini;
    mini2=min(mini,d);
    if (n%2==0)
        cout<<mini2*(n/2);
    else
        cout<<mini2*(n/2)+(mini1/2);
        return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before ';' token
    7 |     q=8*q;h=4*h-;s=2*s;
      |                 ^
Language: C++

#include <iosstream>
using namespace std;
int main()
{
    int q,h,s,d,sum,mini,mini2,n,mini1;
    cin>>q>>h>>s>>d>>n;
    q=8*q;h=4*h-;s=2*s;
    mini=min(q,h);
    mini=min(mini,s);
    mini1=mini;
    mini2=min(mini,d);
    if (n%2==0)
        cout<<mini2*(n/2);
    else
        cout<<mini2*(n/2)+(mini1/2);
        return 0;}


Compiler output:
a.cc:1:10: fatal error: iosstream: No such file or directory
    1 | #include <iosstream>
      |          ^~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main8 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int Q = sc.nextInt();
        int H = sc.nextInt();
        int S = sc.nextInt();
        int D = sc.nextInt();
        int N = sc.nextInt();

        int Hmin = Q*2 < H ? Q*2 : H;
        int Smin = Hmin*2 < S ? Hmin*2 : S;
        int Dmin = Smin*2 < D ? Smin*2 : D;
        
        long price = (long) N/2 * Dmin + N%2 * Smin;
        System.out.println(price);
    }
}


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

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr double DINF =100000000000000000.0;
constexpr long long INF = 100000000000000000;
const double PI = acos(-1);

sfsfint main() {

feffffefefe
fefewfwfefwe}
sfsfsfsfffsss

Compiler output:
a.cc:24:1: error: 'sfsfint' does not name a type
   24 | sfsfint main() {
      | ^~~~~~~
a.cc:28:1: error: 'sfsfsfsfffsss' does not name a type
   28 | sfsfsfsfffsss
      | ^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
const ll maxn=100005;
vector <ll> adj[maxn];
bool mark[maxn];
void dfs(ll x)
{
	mark[x]=true;
	for (ll y:adj[x])
	{
		if (!mark[y])
		{
			dfs(y);
		}
	}
}
int main()
{
	ios_base::sync_with_stdio(false);
	ll q,h,s,d,n; cin>>q>>h>>s>>d; cin>>n;
	s=min(4*q,min(h*2,min(2*q+h,s)));
	cout<< min(n*s,(n/2)*d+(n%2)s);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:24:37: error: expected ')' before 's'
   24 |         cout<< min(n*s,(n/2)*d+(n%2)s);
      |                   ~                 ^
      |                                     )
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

ll a, b, c, d, n;

int main(int argc, char **argv) {
	cin >> a >> b >> c >> d >> n;
	a *= 8; b *= 4; c *= 2;
	int x = min(a, min(b, c)), y = min(x, d);
	cout << (n / 2 * y + n % 2 * x / 2) << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:30:43: error: no matching function for call to 'min(int&, ll&)'
   30 |         int x = min(a, min(b, c)), y = min(x, d);
      |                                        ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:30:43: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   30 |         int x = min(a, min(b, c)), y = min(x, d);
      |                                        ~~~^~~~~~
/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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:30:43: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |         int x = min(a, min(b, c)), y = min(x, d);
      |                                        ~~~^~~~~~
Language: C++

#include <stdio.h>
#include <cstdio>
#include <string>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#define scanf scanf_s


int main()
{

	long long int Q, H, S, D, N;

	scanf("%lld%lld%lld%lld%lld", &Q, &H, &S, &D, &N);

	long long int OneMin;

	OneMin = std::min(Q * 4, std::min(H * 2, S));

	printf("%lld\n", N / 2 * std::min(OneMin * 2, D) + (N % 2) * OneMin);



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
    8 | #define scanf scanf_s
      |               ^~~~~~~
a.cc:16:9: note: in expansion of macro 'scanf'
   16 |         scanf("%lld%lld%lld%lld%lld", &Q, &H, &S, &D, &N);
      |         ^~~~~
Language: C++

/*input
20 30 70 90
3
*/
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string>
#include <string.h>
#include <vector>
#include <algorithm>
using namespace std;

int findMin(int q, int h, int s, double d){
	double min = INT_MAX;
	vector<double> someVector;
	someVector.push_back(q);
	someVector.push_back(h);
	someVector.push_back(s);
	someVector.push_back(d);
	for(size_t i = 0; i < someVector.size(); i++){
		if(someVector[i] <= min){
			min = someVector[i];
		}
	}
	return min;
}
int findMin(int q, int h, int s){
	double min = INT_MAX;
	vector<double> someVector;
	someVector.push_back(q);
	someVector.push_back(h);
	someVector.push_back(s);
	for(size_t i = 0; i < someVector.size(); i++){
		if(someVector[i] <= min){
			min = someVector[i];
		}
	}
	return min;
}

int main (){
	int q,h,s,d,n;
	cin >> q >> h >> s >> d;
	cin >> n;
	int qp = q * 4;
	int hp = h*2;
	int sp = s;
	double dp = d/2;
	int cost = 0;
	if(findMin(qp,hp,sp,dp) == dp){
		cost += (n/2) * d;
		if(findMin(qp, hp,sp) == qp){
			cost += q*4;
		}
		if(findMin(qp, hp,sp) == hp){
			cost += h*2;
		}
		else{
			cost += s;
		}
		cout << cost << endl;
		return 0;
	}
	if(findMin(qp, hp,sp) == qp){
			cost += q*4*n;
		}
		if(findMin(qp, hp,sp) == hp){
			cost += h*2*n;
		}
		else{
			cost += s*n;
		}	
	cout << cost << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int findMin(int, int, int, double)':
a.cc:16:22: error: 'INT_MAX' was not declared in this scope
   16 |         double min = INT_MAX;
      |                      ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   12 | #include <algorithm>
  +++ |+#include <climits>
   13 | using namespace std;
a.cc: In function 'int findMin(int, int, int)':
a.cc:30:22: error: 'INT_MAX' was not declared in this scope
   30 |         double min = INT_MAX;
      |                      ^~~~~~~
a.cc:30:22: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

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

int main() {
  long long int Q,H,S,D;
  long long int N;
  cin >> Q >> H >> S >> D;
  cin >> N;
  Q = 4 * Q;
  H = 2 * H;
  long long int min1;
  min1 = min(Q,H,S);
  if(min1 <= D / 2) {
    cout << N * min1;
  }else if(min1 > D / 2) {
    long long int sum = N / 2;
    cout << sum * D + (N % 2) * min1;
  }
}


Compiler output:
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::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:12:13:   required from here
   12 |   min1 = min(Q,H,S);
      |          ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

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

int main() {
  long long int Q,H,S,D;
  long long int N;
  cin >> Q >> H >> S >> D;
  cin >> N;
  Q = 4 * Q;
  H = 2 * H;
  long long int min1;
  min1 = min(Q,H,S);
  if(min1 <= D / 2) {
    cout << N * min1;
  }else if(min1 > D / 2) {]
    long long int sum = N / 2;
    cout << sum * D + (N % 2) * min1;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: expected primary-expression before ']' token
   15 |   }else if(min1 > D / 2) {]
      |                           ^
a.cc:17:13: error: 'sum' was not declared in this scope
   17 |     cout << sum * D + (N % 2) * min1;
      |             ^~~
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::min(const _Tp&, const _Tp&, _Compare) [with _Tp = long long int; _Compare = long long int]':
a.cc:12:13:   required from here
   12 |   min1 = min(Q,H,S);
      |          ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef pair<int, int> ii;


int main() {
	int q, h, s, d;
	cin >> q >> h >> s >> d;
	q *= 4;
	h *= 2;
	int dd = d;
	d += d % 2;
	d /= 2;

	vector<ii> v;
	v.push_back(ii(q, 1));
	v.push_back(ii(h, 2));
	v.push_back(ii(s, 3));
	v.push_back(ii(d, 4));

	sort(v.begin(), v.end());

	if (v[0].second == 4) {
		if (n % 2) {
			cout << n / 2 * dd + s << '\n';
		} else {
			cout << n / 2 * dd << '\n';
		}
	} else {
		cout << n * v[0].first << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'n' was not declared in this scope
   25 |                 if (n % 2) {
      |                     ^
a.cc:31:25: error: 'n' was not declared in this scope
   31 |                 cout << n * v[0].first << endl;
      |                         ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	int q, h, s, d;
	cin >> q >> h >> s >> d;
	q *= 4;
	h *= 2;
	int dd = d;
	d += d % 2;
	d /= 2;

	vector<ii> v;
	v.push_back(ii(q, 1));
	v.push_back(ii(h, 2));
	v.push_back(ii(s, 3));
	v.push_back(ii(d, 4));

	sort(v.begin(), v.end());

	if (v[0].second == 4) {
		if (n % 2) {
			cout << n / 2 * dd + s << '\n';
		} else {
			cout << n / 2 * dd << '\n';
		}
	} else {
		cout << n * v[0].first << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'ii' was not declared in this scope
   14 |         vector<ii> v;
      |                ^~
a.cc:14:18: error: template argument 1 is invalid
   14 |         vector<ii> v;
      |                  ^
a.cc:14:18: error: template argument 2 is invalid
a.cc:15:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   15 |         v.push_back(ii(q, 1));
      |           ^~~~~~~~~
a.cc:16:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   16 |         v.push_back(ii(h, 2));
      |           ^~~~~~~~~
a.cc:17:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   17 |         v.push_back(ii(s, 3));
      |           ^~~~~~~~~
a.cc:18:11: error: request for member 'push_back' in 'v', which is of non-class type 'int'
   18 |         v.push_back(ii(d, 4));
      |           ^~~~~~~~~
a.cc:20:16: error: request for member 'begin' in 'v', which is of non-class type 'int'
   20 |         sort(v.begin(), v.end());
      |                ^~~~~
a.cc:20:27: error: request for member 'end' in 'v', which is of non-class type 'int'
   20 |         sort(v.begin(), v.end());
      |                           ^~~
a.cc:22:14: error: invalid types 'int[int]' for array subscript
   22 |         if (v[0].second == 4) {
      |              ^
a.cc:23:21: error: 'n' was not declared in this scope
   23 |                 if (n % 2) {
      |                     ^
a.cc:29:25: error: 'n' was not declared in this scope
   29 |                 cout << n * v[0].first << endl;
      |                         ^
a.cc:29:30: error: invalid types 'int[int]' for array subscript
   29 |                 cout << n * v[0].first << endl;
      |                              ^
Language: C++

#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define PB push_back
using namespace std;
typedef pair<int, int> P1;
typedef pair<int, pair<int, int> > P2;
static const int INF = 1ll<<60;
static const int dx[] = { 1, -1, 0, 0, };
static const int dy[] = { 0, 0, 1, -1 };
static const int mod = 1000000007;
 
int a[4];
double b[4] = {0.25,0.5,1.0,2.0};
int N;
int ans=INF;
 
 
signed main(){
    for(int i=0;i<4;++i)cin>>a[i];
    cin>>N;
    int n = N;
    for(int i=0;i<4;++i){
        for(int j=0;j<4;++j){
            for(int k=0;k<4;++k){
                for(int l=0;l<4;++l){
                    int p = n/b[i];
                    n-=b[i]*p;
                    int q = n/b[j];
                    n-=b[j]*q;
                    int r = n/b[k];
                    n-=b[k]*r;
                    int s = n/b[l];
                    n-=b[l]*s;
                    if(n!=0)continue;
                    int res = a[i]*p+a[j]*q+a[k]*r+a[l]*s;
                    ans=min(ans,res);
                    n=N;
                }
            }
        }
    }
    cout<<ans<<endl;
    //cout<<Q*a+H*b+S*c+D*d<<endl;

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

#include<iostream>
using namespace std;
int main()
{
   char s[200001];
   scanf("%s",s);
   int count[26];
   for(int i=0;i<26;i++)
   {
   	count[i]=0;
   }
   for(int i=0;s[i]!='\0';i++)
   {
   	count[s[i]-'a']++;
   }
   long long int ans=0,l=0;
   for(int i=0;i<26;i++)
   {
   	l = l+((count[i]*(count[i]-1))/2);
   }
   ans = ((n*(n-1))/2);
   ans = ans - l;
   cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: 'n' was not declared in this scope
   21 |    ans = ((n*(n-1))/2);
      |            ^
Language: Java

import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
 
public class Es
{
	static class Pair
	{
		int first, second;
		public Pair(int f, int s)
		{
			first = f;
			second = s;
		}
		
		public String toString()
		{
			return first + " " + second;
		}
	}
	
	static class PairComparator implements Comparator <Pair>
	{
		public int compare(Pair p1, Pair p2)
		{
			if(p1.first < p2.first)
				return -1;
			if(p1.first > p2.first)
				return 1;
			return 0;
		}
	}
	
	final static int MAXN = (int)1E5;
	
	static int log2(int a)
	{
		return (int)(Math.log(a) / Math.log(2));
	}
	
	static long gcd(long a, long b)
	{
		long r;
		while((r = a % b) > 0)
		{
			a = b;
			b = r;
		}
		return b;
	}
	
	static void print(int[] v)
	{
		if(v == null)
		{
			sop("-\n");
			return;
		}
		for(int i = 0; i < v.length; i ++)
		{
			sop(v[i] + " ");
		}
		sop("\n");
	}
	
	static long[] linearCombination(long a, long b, long[] n1, long[] n2, long[] n3, long q)
	{
		long qq = a / b;
		long rr = a % b;
		if(rr == 0)
		{
			if(n2 == null)
			{
				return new long[] {0, 1};
			}
			return new long[] {n2[0] - q * n3[0], n2[1] - q * n3[1]};
		}
		if(n2 == null)
		{
			return linearCombination(b, rr, n2, n3, new long[] {0, 1}, qq);
		}
		return linearCombination(b, rr, n2, n3, new long[] {n2[0] - q * n3[0], n2[1] - q * n3[1]}, qq);
	}
	
	public static void main(String[] args) throws IOException
	{
		int a = in.nextInt();
		int b = in.nextInt();
		int c = in.nextInt();
		int d = in.nextInt();
		int n = in.nextInt();
		double[] v = {4 * a, 2 * b, c};
		Arrays.sort(v);
		sop(Math.min((long)(v[0] * n), (long)(d / 2.0 * (n - n % 2) + (n % 2 != 0 ? v[0] : 0))));
	}
    
	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
	
    static FastReader in = new FastReader();
  
    public static void sop(Object o)
    {
    	System.out.print(o);
    }
}

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


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

public class Grand_Contest_019 {

    /**
     * Question A
     * Ice Tea Store
     */
    private void QuestionA() {
        //price
        long cheap = Long.MAX_VALUE;
        long price = 0;

        long Q = in.nextLong()*8;
        if (Q < cheap) {
            cheap = Q;
            price = cheap/2;
        }
        long H = in.nextLong()*4;
        if (H < cheap) {
            cheap = H;
            price = cheap/2;
        }
        long S = in.nextLong()*2;
        if (S < cheap) {
            cheap = S;
            price = cheap/2;
        }
        long D = in.nextLong();
        //total
        long N = in.nextLong();
        if (N < 2 || cheap < D) {
            out.println(N*price);
        }else{
            long temp = N/2;
            long remain = N%2;
            out.println(temp * D + remain * price);
        }
    }


    public static void main(String[] args) {
        new Grand_Contest_019().run();
    }
    FastScanner in;
    PrintWriter out;
    void run() {
        in = new FastScanner();
        out = new PrintWriter(System.out);
        QuestionA();
        out.close();
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


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

#include<bits/stdc++.h>
using namespace std;
typedef long long int uli;
int main(){
  uli a,b,c,d,n;
  cin>>a>>b>>c>>d>>n;
  c=min(c,b+b);
  c=min(c,a+a+a+a);
  if(c+c<=d)cout<<c*n<<endl;
  else cout<<(n/2)*d+c<<endl;  
  return 0;



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

#include<bits/stdc++.h>
using namespace std;
int main()
{
int Q,H,S,D,n,ans=0;
cin>>Q>>H>>S>>D;
cin>>n;
ans=(n/2)*min(min(min(min(8*Q,4*H),2*S),D))+(n%2)*min(min(4*Q,2*H),S);
cout<<ans;
 
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: no matching function for call to 'min(const int&)'
    8 | ans=(n/2)*min(min(min(min(8*Q,4*H),2*S),D))+(n%2)*min(min(4*Q,2*H),S);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
a.cc:8:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    8 | ans=(n/2)*min(min(min(min(8*Q,4*H),2*S),D))+(n%2)*min(min(4*Q,2*H),S);
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int Q,H,S,D,n,ans=0;
cin>>Q>>H>>S>>D;
cin>>n;
ans=(n/2)*min(8*Q,4*H,2*S,D)+(n%2)*(4*Q,2*H,S);
cout<<ans;
 
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:14: error: no matching function for call to 'min(int, int, int, int&)'
    8 | ans=(n/2)*min(8*Q,4*H,2*S,D)+(n%2)*(4*Q,2*H,S);
      |           ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 4 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int Q,H,S,D,n;
cin>>Q>>H>>S>>D;
cin>>n;
ans=(n/2)*min(8*Q,4*H,2*S,D)+(n%2)*(4*Q,2*H,S);
cout<<ans;

return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 | ans=(n/2)*min(8*Q,4*H,2*S,D)+(n%2)*(4*Q,2*H,S);
      | ^~~
      | abs
a.cc:8:14: error: no matching function for call to 'min(int, int, int, int&)'
    8 | ans=(n/2)*min(8*Q,4*H,2*S,D)+(n%2)*(4*Q,2*H,S);
      |           ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 4 provided
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
import java.math.BigInteger;

public final class main
{
	static long min(long a,long b) {
		if(a<b) {
			return a;
		}
		else {
			return b;
		}
	}
	public static void main (String[] args) throws java.lang.Exception
	{
		
		Scanner cin = new Scanner(System.in);
		long q,h,f,s;
		q = cin.nextLong();
		h = cin.nextLong();
		f = cin.nextLong();
		s = cin.nextLong();
		long n = cin.nextLong();
		long v1 = min(min(q*4,h*2),f);
		if(n%2==0) {
			System.out.println(min(n*v1,s*(n/2)));
		}
		else {
			System.out.println(min(n*v1,(s*(n/2))+v1));
		}
	}
}

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

#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<functional>
#include<list>
#include<map>
#include<iomanip>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
#include<algorithm>
#include<memory.h>
using namespace std;
struct pig
{
    int x,y;
}info[200100];
int cnt,n,a[200100],c[200100],xo,xt,yo,yt,len,num;
long double ans;
bool cmp1(pig a,pig b)
{
    return a.y < b.y;
}
bool cmp(pig a,pig b)
{
    if(a.x == b.x)return a.y > b.y;
    return yo < yt ? a.x < b.x : a.x > b.x;
}
int find(int L,int R,int x)
{
    if(L == R) return L;
    int mid = (L + R) >> 1;
    if(c[mid] < x) return find(mid + 1,len,x);
    else return find(L,mid,x);
}
int main()
{
    scanf("%d%d%d%d",&xo,&yo,&xt,&yt);if(xt < xo)swap(xo,xt),swap(yo,yt);
    scanf("%d",&n);
    for(int i = 1;i <= n;i++)scanf("%d%d",&info[i].x,&info[i].y);
    sort(info + 1,info + 1 + n,cmp);
    len=0;  c[0]=-0x7fffffff;
    for(int i = 1;i <= n;i++)
    {
        if(info[i].x > max(xt,xo) || info[i].y > max(yt,yo) || info[i].y < min(yo,yt) || info[i].x < min(xo,xt))continue;
        int tmp;
        if(info[i].y>c[len]) tmp = ++len;
        else tmp = find(1,len,info[i].y);
        c[tmp]=info[i].y;
    }
    ans = (long double)(abs(xt - xo) + abs(yt - yo)) * 100 - (20 - 5 * pi) * len;
    if(len == min(abs(xt - xo),abs(yt - yo)) + 1)ans += 5 * pi;
    printf("%.15Lf\n",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:72: error: 'pi' was not declared in this scope; did you mean 'pig'?
   59 |     ans = (long double)(abs(xt - xo) + abs(yt - yo)) * 100 - (20 - 5 * pi) * len;
      |                                                                        ^~
      |                                                                        pig
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int q,h,s,d;
	cin>>q>>h>>s>>d;
	int n;
	cin>>n;

	int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
	cout<<a;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: no matching function for call to 'min(int, int, int, int&)'
   10 |         int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
      |                     ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:10:44:   required from here
   10 |         int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
      |                                                ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int q,h,s,d;
	cin>>q>>h>>s>>d;
	int n;
	cin>>n;
	int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
	cout<<a;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:24: error: no matching function for call to 'min(int, int, int, int&)'
    9 |         int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
      |                     ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 4 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 4 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 4 provided
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int]':
a.cc:9:44:   required from here
    9 |         int a=(n/2)*min(8*q,4*h,2*s,d) + (n%2)*min(4*q,2*h,s);
      |                                                ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:284:17: error: '__comp' cannot be used as a function
  284 |       if (__comp(__b, __a))
      |           ~~~~~~^~~~~~~~~~