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

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

int main(){
  int n,k,a,b,sum;
  cin >> n >> k >> a >> b;
  if(n<=k){
    cout << n*a << endl;
  }else{
    cout << n*a+(n-k)*b << endl;
  }
}

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

#include<stdio.h>
int main(void)
{
	int n,k,x,y,r;
	scanf("%d",&n);
	scanf("%d",&k);
	scanf("%d",&x);
	scanf("%d",&y);
	if(n>k)	{
		r=y*n;
	}
	else{
		r=x*n;
	}
	printf("%d\n",r);
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ';' before '}' token
   16 |         return 0
      |                 ^
      |                 ;
   17 | }
      | ~
Language: C++


#include<stdio.h>
int main(void)
{
	int n,k,x,y,r;
	scanf("%d",&n);
	scanf("%d",&k);
	scanf("%d",&x);
	scanf("%d",&y);
	if(n>k)	{
		r=y*n;
	}
	else{
		r=x*n;
	}
	printf("%d\n",r);
	return 0;


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


Copy
Copy
#include<stdio.h>
int main(void)
{
	int n,k,x,y,r;
	scanf("%d",&n);
	scanf("%d",&k);
	scanf("%d",&x);
	scanf("%d",&y);
	if(n>k)	{
		r=y*n;
	}
	else{
		r=x*n;
	}
	printf("%d\n",r);
	return 0;


Compiler output:
a.cc:2:1: error: 'Copy' does not name a type
    2 | Copy
      | ^~~~
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%d",&n);
      |         ^~~~~
a.cc:18:9: error: 'printf' was not declared in this scope
   18 |         printf("%d\n",r);
      |         ^~~~~~
a.cc:5:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    4 | #include<stdio.h>
  +++ |+#include <cstdio>
    5 | int main(void)
a.cc:19:18: error: expected '}' at end of input
   19 |         return 0;
      |                  ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^
Language: C++

#include<stdio.h>
int main(void)
{
	int X,Y,K,N,e;
	scanf("%d",X)；
	scanf("%d",Y);
	scanf("%d",N);
	e=(K*X)+(((k+1)*N*Y);
	printf("%d",e);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: expected ';' before '\U0000ff1b'
    5 |         scanf("%d",X)；
      |                      ^~
      |                      ;
a.cc:8:20: error: 'k' was not declared in this scope
    8 |         e=(K*X)+(((k+1)*N*Y);
      |                    ^
a.cc:8:29: error: expected ')' before ';' token
    8 |         e=(K*X)+(((k+1)*N*Y);
      |                 ~           ^
      |                             )
Language: C++

#include<stdio.h>
int main(void)
{
	int X,Y,K,e;
	scanf("%d",X)；
	scanf("%d",Y);
	e=(K*X)+((k+1)*Y);
	printf("%d",e);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:22: error: expected ';' before '\U0000ff1b'
    5 |         scanf("%d",X)；
      |                      ^~
      |                      ;
a.cc:7:19: error: 'k' was not declared in this scope
    7 |         e=(K*X)+((k+1)*Y);
      |                   ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N,K,X,Y;
  cin>>N>>K>>X>>Y
  int sum=0;
  for(int i=0;i<N;i++){
    if(i<K) sum+=X;
    else sum+=Y;
  }
cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected ';' before 'int'
    6 |   cin>>N>>K>>X>>Y
      |                  ^
      |                  ;
    7 |   int sum=0;
      |   ~~~             
a.cc:9:13: error: 'sum' was not declared in this scope
    9 |     if(i<K) sum+=X;
      |             ^~~
a.cc:10:10: error: 'sum' was not declared in this scope
   10 |     else sum+=Y;
      |          ^~~
a.cc:12:7: error: 'sum' was not declared in this scope
   12 | cout<<sum;
      |       ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,x,y;
  cin>>n>>k>>x>>y;
  cout<<n*x+miax(0,n-k)*(y-x);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: 'miax' was not declared in this scope
    6 |   cout<<n*x+miax(0,n-k)*(y-x);
      |             ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,k,x,y;
  cin >> n >> k >> x >> y;
  int sum = 0;
  if(n > k){
    cout << k * x + (n-k) * y;
  else{
    cout << n * x;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected '}' before 'else'
   10 |   else{
      |   ^~~~
a.cc:8:12: note: to match this '{'
    8 |   if(n > k){
      |            ^
Language: C++

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

int main(void)
{
  int n,k,c,y;
  int sum=0;
  cin>>n>>k>>x>>y;
  for(int i=0;i<k;i++){
    if(i<k)
      sum+=x;
    else
      sum+=y;
  }
  cout<<sum<<endl;

}

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

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

int main(){

  int N,K,X,Y;
  cin>>N>>K>>X>>Y;
  int summ=0;
  for(int i=0;i<N;i++){
    if(i>K)
      sum+=Y;
    else
      sum+=X;
    }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'sum' was not declared in this scope; did you mean 'summ'?
   11 |       sum+=Y;
      |       ^~~
      |       summ
a.cc:13:7: error: 'sum' was not declared in this scope; did you mean 'summ'?
   13 |       sum+=X;
      |       ^~~
      |       summ
Language: C++

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

int  main(){
  int K,N,X,Y;
  cin>>K>>N>>X>>Y;
  int sum=0;
  for(int i=K;i>0;i++){
    sum+=X;
  }
  for(int j=N-K;j>0;j++){
    sum+=Y
  }
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: expected ';' before '}' token
   12 |     sum+=Y
      |           ^
      |           ;
   13 |   }
      |   ~
Language: C++

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

int  main(){
  int K,N,X,Y;
  cin>>K N X Y;
  int sum=0;
  for(int i=K;i>0;i++){
    sum+=X;
  }
  for(int j=N-K;j>0;j++){
    sum+=Y
  }
  cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: expected ';' before 'N'
    6 |   cin>>K N X Y;
      |         ^~
      |         ;
a.cc:12:11: error: expected ';' before '}' token
   12 |     sum+=Y
      |           ^
      |           ;
   13 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
  int N, K, X, Y, ans;
  cin >> N >> K >> X >> Y;
  if (N>=K) {
    ans = X * K + Y * (N - K);
  }
  else {
    ans = X * N
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before '}' token
   10 |     ans = X * N
      |                ^
      |                ;
   11 |   }
      |   ~
Language: C++

n=int(input())
k=int(input())
x=int(input())
y=int(input())

s=0

for i in range(n):
    if k-1>=i:
        s=s+x
    else:
        s=s+y

print(s)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C

#include <stdio.h>

int main(void) {
  int a,b,c,d;
  double sum;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  sum=b*c+(a-b)*d
  printf("%.0f\n",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:18: error: expected ';' before 'printf'
   10 |   sum=b*c+(a-b)*d
      |                  ^
      |                  ;
   11 |   printf("%.0f\n",sum);
      |   ~~~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int N, K, X, Y;
	
	cin N >> K >> X >> Y;
	
	if(N <= K) cout << X*K;
	else if(N > K) {
		N = N - K;
		int sum = K*X + N*Y;
		cout << sum;
	}
	
	cout << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected ';' before 'N'
    7 |         cin N >> K >> X >> Y;
      |            ^~
      |            ;
Language: C++

#include <iostream>
using nampspace std;

int main(){
  	int n,k,x,y;
  	cin >> n >> k >> x >> y;
  	cout << min(n,k)*x+max(0,n-k)*y << endl;
  	return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'nampspace'
    2 | using nampspace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n >> k >> x >> y;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |         cout << min(n,k)*x+max(0,n-k)*y << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:17: error: 'min' was not declared in this scope; did you mean 'std::min'?
    7 |         cout << min(n,k)*x+max(0,n-k)*y << endl;
      |                 ^~~
      |                 std::min
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: 'std::min' declared here
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:7:28: error: 'max' was not declared in this scope; did you mean 'std::max'?
    7 |         cout << min(n,k)*x+max(0,n-k)*y << endl;
      |                            ^~~
      |                            std::max
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
a.cc:7:44: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |         cout << min(n,k)*x+max(0,n-k)*y << endl;
      |                                            ^~~~
      |                                            std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

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

int main() {
  int N,K,X,Y;
  cin >> N >> K >> X >> Y ;
  int aaa;
  if(N<=K){
   aaa=N*X  
  }
  else{
   aaa=K*X+(N-X)*Y;
    
  }
  
  
  
  
  
 cout <<aaa << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: expected ';' before '}' token
    9 |    aaa=N*X
      |           ^
      |           ;
   10 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  string w;
  cin >> w;
  int a[26];
  for (int i;i<w.size();i++){
   a[s[i]-'a']=1-a[s[i]-'a']; 
  }
  a.sort();
  if (a[25]=0){
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: 's' was not declared in this scope
    9 |    a[s[i]-'a']=1-a[s[i]-'a'];
      |      ^
a.cc:11:5: error: request for member 'sort' in 'a', which is of non-class type 'int [26]'
   11 |   a.sort();
      |     ^~~~
Language: C++

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

int main() {
  int n,k,c,y;
  cin>>n>>k>>x>>y;
  if (n<=k) {
    cout<<k*x<<endl;
  }
  else {
    cout<<k*x+(n-k)*y<<endl;
  }
  
}


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

#include <iostream>
using namespace std;
typedef long long unsigned int ll;
 
int main() {
 
  int N、K,X,Y;
  cin >> N;
  cin >> K;
  cin >> X;
  cin >> Y;
  cout << K*X+(N-K)*Y<<endl;
  
    return 0;
}


Compiler output:
a.cc:7:7: error: extended character 、 is not valid in an identifier
    7 |   int N、K,X,Y;
      |       ^
a.cc: In function 'int main()':
a.cc:8:10: error: 'N' was not declared in this scope
    8 |   cin >> N;
      |          ^
a.cc:9:10: error: 'K' was not declared in this scope
    9 |   cin >> K;
      |          ^
Language: C++

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

int main(){
int N, K, X, Y;
  cin >> N >> K >> X >> Y;
  if(N - K <= 0) cout << N * X;
  else cout << N * X + (K - N) * Y;
}

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

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

int main() {
  int N,K,X,Y ;
  cin >>N>>K>>X>>Y ;
  if (N <= K ){
  cout << N*X << endl;
  }
  ifelse {
    cout << K*X+(N-K)*Y <<endl ;
  }
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'ifelse' was not declared in this scope; did you mean 'sigrelse'?
   10 |   ifelse {
      |   ^~~~~~
      |   sigrelse
Language: C++

#include<iostream>
using namespace std;
int main(){
	int N,K,X,Y;
	cin >> N >> K >> X >> Y;
	cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:43: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    6 |         cout << (N<K)?(N*X):(K*X+(N-K)*Y) << endl;
      |                             ~~~~~~~~~~~~~~^~~~~~~
Language: Java

import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextint();
        if(n<=k) {
            System.out.println(x*n);
        }else {
            System.out.println(x*k+y*(n-k));
        }
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
        int y = sc.nextint();
                  ^
  symbol:   method nextint()
  location: variable sc of type Scanner
1 error
Language: C++

#include <iostream>
using namespace std;

int main (){
        int N, K, X, Y, cost;
        cin >> N >> K >> X >> Y;

        cost = X*K + (N-K)*Y;
        cout << cost << endl;

}       
~

Compiler output:
a.cc:12:2: error: expected class-name at end of input
   12 | ~
      |  ^
Language: C++

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

int main(){
  int N, K, X, Y, price = 0;
  cin >> N >> K >> X >> Y;
  if(K < N){
    price = X * K + Y * (N - K);
  }
  else{
    price = X * N
  }
  cout << price << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before '}' token
   11 |     price = X * N
      |                  ^
      |                  ;
   12 |   }
      |   ~
Language: C++

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


int N,K,X,Y,res;

int main(){
  cin>>N>>>K>>X>>Y;
  for(int i=1; i<=N; ++i){
    if(i<=K)
      res+=X;
    else res+=Y;
  }
  cout<<res<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected primary-expression before '>' token
    8 |   cin>>N>>>K>>X>>Y;
      |           ^
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
signed main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<max(a,b)*c+max(a-b,0)*d<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: no matching function for call to 'max(long long int, int)'
    8 |         cout<<max(a,b)*c+max(a-b,0)*d<<endl;
      |                          ~~~^~~~~~~
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: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:8:29: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
    8 |         cout<<max(a,b)*c+max(a-b,0)*d<<endl;
      |                          ~~~^~~~~~~
/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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:8:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
    8 |         cout<<max(a,b)*c+max(a-b,0)*d<<endl;
      |                          ~~~^~~~~~~
Language: C++

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

int main(){
  int N, K, X, Y;
  cin >> N >> K >> X >> Y;
  cout << min(N,K)*X +(N>K)(N-K)*Y << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: expression cannot be used as a function
    7 |   cout << min(N,K)*X +(N>K)(N-K)*Y << endl;
      |                       ~~~~~^~~~~
Language: C

#include <stdio.h>
int main(void){
  int a,b,c,d;
  scanf("%d",&a);
  scanf("%d",&b);
  scanf("%d",&c);
  scanf("%d",&d);
  if(a<b){printf("%d",(c*a);}
                 if(a>b){printf("%d",b*c+(a-b)*d);}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:28: error: expected ')' before ';' token
    8 |   if(a<b){printf("%d",(c*a);}
      |                 ~          ^
      |                            )
main.c:8:29: error: expected ';' before '}' token
    8 |   if(a<b){printf("%d",(c*a);}
      |                             ^
      |                             ;
Language: C++

int main(){
  int n,k,x,y;
  cin>>n>>k>>x>>y;
  int ans;
  if(n>k){
    ans = (k)*x + (n-k)*y;
  }
  else{
    ans = n*x;
  }
  cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>n>>k>>x>>y;
      |   ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout <<ans<<endl;
      |   ^~~~
a.cc:11:15: error: 'endl' was not declared in this scope
   11 |   cout <<ans<<endl;
      |               ^~~~
Language: C++

#inclde<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde<bits/stdc++.h>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclde<bits/stdc++.h>
a.cc:4:39: error: 'cout' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |                                       ^~~~
a.cc:4:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:4:54: error: 'cout' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |                                                      ^~~~
a.cc:4:54: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#incldue<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
    1 | #incldue<bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldue<bits/stdc++.h>
a.cc:4:39: error: 'cout' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |                                       ^~~~
a.cc:4:39: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:4:54: error: 'cout' was not declared in this scope
    4 |   int n,k,x,y;cin>>n>>k>>x>>y;if(n<=k)cout<<n*x;else cout<<x*k+(n-k)*y;}
      |                                                      ^~~~
a.cc:4:54: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
using namespace std;

int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
 if(b>a){cout<<N*c<<endl;}
  else cout<<b*C+(a-b)*d<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'N' was not declared in this scope
    7 |  if(b>a){cout<<N*c<<endl;}
      |                ^
a.cc:8:16: error: 'C' was not declared in this scope
    8 |   else cout<<b*C+(a-b)*d<<endl;
      |                ^
Language: C++

#include<iostream>

int main(void)
{
  int n,k,x,y,ans;
  n = k = x = y = ans = 0;
  
  cin >> n >> k >> x >> y;
  
  for(int i = 0;i < n;i++)
  {
    if(k < i){ans += y;}
    else{ans += x;}
  }
  
  cout << ans;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> n >> k >> x >> y;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |   cout << ans;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: Java

import java.util.*;
public class Main{
  public static void main(string[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    int x = Integer.parseInt(sc.next());
    int y = Integer.parseInt(sc.next());
    System.out.println(k * x + (n-k) * y);
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
  public static void main(string[] args){
                          ^
  symbol:   class string
  location: class Main
1 error
Language: Java

import java.util.*;
public class Main{
  public static void main(string[] args){
    int n = Integer.parseInt(sc.next());
    int k = Integer.parseInt(sc.next());
    int x = Integer.parseInt(sc.next());
    int y = Integer.parseInt(sc.next());
    System.out.println(k * x + (n-k) * y);
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
  public static void main(string[] args){
                          ^
  symbol:   class string
  location: class Main
Main.java:4: error: cannot find symbol
    int n = Integer.parseInt(sc.next());
                             ^
  symbol:   variable sc
  location: class Main
Main.java:5: error: cannot find symbol
    int k = Integer.parseInt(sc.next());
                             ^
  symbol:   variable sc
  location: class Main
Main.java:6: error: cannot find symbol
    int x = Integer.parseInt(sc.next());
                             ^
  symbol:   variable sc
  location: class Main
Main.java:7: error: cannot find symbol
    int y = Integer.parseInt(sc.next());
                             ^
  symbol:   variable sc
  location: class Main
5 errors
Language: C

#include <stdio.h>

int main(int argc, char const *argv[])
{
	int n,k,x,y;
	scanf("%d %d %d %d",&n,&k,&x,&y);
	printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:24: error: 'a' undeclared (first use in this function)
    7 |         printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
      |                        ^
main.c:7:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:28: error: 'b' undeclared (first use in this function)
    7 |         printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
      |                            ^
main.c:7:38: error: 'c' undeclared (first use in this function)
    7 |         printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
      |                                      ^
main.c:7:46: error: 'd' undeclared (first use in this function)
    7 |         printf("%d\n",(a > b) ? (b * c + a * d - b * d) : (a * c));
      |                                              ^
Language: C

#include <stdio.h>

int main(int argc, char const *argv[])
{
	scanf("%d %d %d %d",&n,&k,&x,&y);
	printf("%d\n",(n > k) ? (k * x + n * y - k * y) : (n * x));
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:30: error: 'n' undeclared (first use in this function)
    5 |         scanf("%d %d %d %d",&n,&k,&x,&y);
      |                              ^
main.c:5:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:33: error: 'k' undeclared (first use in this function)
    5 |         scanf("%d %d %d %d",&n,&k,&x,&y);
      |                                 ^
main.c:5:36: error: 'x' undeclared (first use in this function)
    5 |         scanf("%d %d %d %d",&n,&k,&x,&y);
      |                                    ^
main.c:5:39: error: 'y' undeclared (first use in this function)
    5 |         scanf("%d %d %d %d",&n,&k,&x,&y);
      |                                       ^
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int x,y,z,w;
  cin >> x >> y >> z >> w;
  if(x < y){
    cout << x*z << endl;
  }else{
    cout << y*z + (x-y)*k << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'k' was not declared in this scope
   10 |     cout << y*z + (x-y)*k << endl;
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int,n,k,x,y;
	cin>>n>>k>>x>>y;
	cout<<k*x+(n-k)*y<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected unqualified-id before ',' token
    4 |         int,n,k,x,y;
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int N, K, X, Y;
  cin >> N >> K >> X >>Y;
  if(N>k)
    cout << K*X + (N - K)*Y;
  else
    cout << N*X;
  
}

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

#include <iostream>
using namespace std;

int main()
{
  if(N>k)
    cout << K*X + (N - K)*Y;
  else
    cout << N*X;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: 'N' was not declared in this scope
    6 |   if(N>k)
      |      ^
a.cc:6:8: error: 'k' was not declared in this scope
    6 |   if(N>k)
      |        ^
a.cc:7:13: error: 'K' was not declared in this scope
    7 |     cout << K*X + (N - K)*Y;
      |             ^
a.cc:7:15: error: 'X' was not declared in this scope
    7 |     cout << K*X + (N - K)*Y;
      |               ^
a.cc:7:27: error: 'Y' was not declared in this scope
    7 |     cout << K*X + (N - K)*Y;
      |                           ^
a.cc:9:15: error: 'X' was not declared in this scope
    9 |     cout << N*X;
      |               ^
Language: C++

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

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    ll N, K, X, Y;
    cin >> N >> K >> X >> Y;
    cout << N * X - std::max(0, N - K) * (X - Y) << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:29: error: no matching function for call to 'max(int, ll)'
   18 |     cout << N * X - std::max(0, N - K) * (X - Y) << endl;
      |                     ~~~~~~~~^~~~~~~~~~
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: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:18:29: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   18 |     cout << N * X - std::max(0, N - K) * (X - Y) << endl;
      |                     ~~~~~~~~^~~~~~~~~~
/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
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:18:29: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   18 |     cout << N * X - std::max(0, N - K) * (X - Y) << endl;
      |                     ~~~~~~~~^~~~~~~~~~
Language: C++

n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n > k:
	print(k * x + (n - k) * y)
else:
	print(n * x)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
	if (a < 0) { return -a; }
	if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
	if (a >= b) {
		return a;
	}
	else {
		return b;
	}
}

//大小比較(小)
long long int small(long long int a, long long int b) {
	if (a >= b) {
		return b;
	}
	else {
		return a;
	}
}

int main() {
	long long int n, m, k,p,q;
	char str[30],str2[15],str3[15];
	scanf("%lld%lld%lld%lld",&n,&m,&k,&p);
	if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
	
	
}


Compiler output:
main.c: In function 'main':
main.c:33:76: error: expected ';' before '}' token
   33 |         if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
      |                                                                            ^~
      |                                                                            ;
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//絶対値
long long int change_plus(long long int a) {
	if (a < 0) { return -a; }
	if (a >= 0) { return a; }
}
//大小比較(大)
long long int big(long long int a, long long int b) {
	if (a >= b) {
		return a;
	}
	else {
		return b;
	}
}

//大小比較(小)
long long int small(long long int a, long long int b) {
	if (a >= b) {
		return b;
	}
	else {
		return a;
	}
}

int main() {
	long long int n, m, k,p,q;
	char str[30],str2[15],str3[15];
	scanf("%lld%lld%lld%lld",&n,&m,&k,&p);
	if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
	
		printf("%lld",p);
	
}

Compiler output:
main.c: In function 'main':
main.c:33:76: error: expected ';' before '}' token
   33 |         if (n <= k) { printf("%lld", n*k); }else{printf("%lld",(n-m)*p+k*m) }
      |                                                                            ^~
      |                                                                            ;
Language: C

#include<stdio.h>
int main(){
  int n,k,x,y;
  scanf("%d%d%d%d",&n,&k,&x,&y);
  if(n<=k)printf("%d",n*x);
  else printf("%d",k*x+(n-k)*y);
  reurn 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:3: error: 'reurn' undeclared (first use in this function)
    7 |   reurn 0;
      |   ^~~~~
main.c:7:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:8: error: expected ';' before numeric constant
    7 |   reurn 0;
      |        ^~
      |        ;
Language: C++

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

int main(){
		int n, k, x, y;
		cint >> n >> k >> x >> y;
		cout << k * x + (n - k) * y << endl;
		return 0;	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'cint' was not declared in this scope; did you mean 'uint'?
    6 |                 cint >> n >> k >> x >> y;
      |                 ^~~~
      |                 uint
Language: C

#incliude <stdio.h>
int main(){
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);

printf("%d",a*c+(b-a)*d);


return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
    1 | #incliude <stdio.h>
      |  ^~~~~~~~
      |  include
main.c: In function 'main':
main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 | scanf("%d%d%d%d",&a,&b,&c,&d);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #incliude <stdio.h>
main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 | scanf("%d%d%d%d",&a,&b,&c,&d);
      | ^~~~~
main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    6 | printf("%d",a*c+(b-a)*d);
      | ^~~~~~
main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#incliude <stdio.h>
int main(){
int a,b,c,d;

printf("%d",a*c+(b-a)*d);


return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #incliude; did you mean #include?
    1 | #incliude <stdio.h>
      |  ^~~~~~~~
      |  include
main.c: In function 'main':
main.c:5:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    5 | printf("%d",a*c+(b-a)*d);
      | ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #incliude <stdio.h>
main.c:5:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
    5 | printf("%d",a*c+(b-a)*d);
      | ^~~~~~
main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
 
int main(){
  int N, K, X, Y, accommodation;
  
  scanf("%d %d %d %d", &N, &K, &X, &Y);
  
  if(N <= K){
    accommodtion = N * X;
  } else {
    accommodation = N*X + (K - N)*Y; 
  }
  
  printf("%d\n", accommodation);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:5: error: 'accommodtion' undeclared (first use in this function); did you mean 'accommodation'?
    9 |     accommodtion = N * X;
      |     ^~~~~~~~~~~~
      |     accommodation
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <bits/stdc++.h>

int main()
{
	int n, k, x, y, fee;
	scanf("%d %d %d %d", &n, &k, &x, &y);
	if(n<=k)
		fee = n*x;
	else{
		fee = k*x;
		fee+=((n-k)*y);
	}

	printf("%d\n", fee);
	
	return 0;	
}

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

#include<stdio.h>

int main(){
int n,k,x,y,ans=0;i;
scanf("%d%d%d%d",&n,&k,&x,&y);
for(i=1;i<=n;i++){
if(i<=k)ans+=x;
else ans+=y;
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:19: error: 'i' undeclared (first use in this function)
    4 | int n,k,x,y,ans=0;i;
      |                   ^
main.c:4:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;

bool check(const string& s,const string& t){
	int n = s.size();
	int m = t.size();
	for(int i=0;i<=n-m;i++){
		bool ok = true;
		REP(j,m){
			if(s[i+j]!='?' && s[i+j]!=t[j])ok=false;
		}
		if(ok)return true;
	}
	return false;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n,a,x[51],y[51],maxX;
	ll dp[51][5001];
	scanf("%d %d",&n,&a);
	maxX = a;
	REP(i,n){
		scanf("%d",&x[i+1]);
		maxX = max(x[i+1],maxX);
	}
	memset(dp,0,sizeof(dp));

	REP(j,n){
		y[j+1] = x[j+1] - a;
	}
	dp[0][n*maxX]=1;
	for(int j = 1;j<=n;j++){
		REP(t,2*n*maxX + 1){
			dp[j][t] = dp[j-1][t];
			if(t>=y[j] && t-y[j]<=2*n*maxX){
				dp[j][t] += dp[j-1][t-y[j]];
//if(dp[j][t]>0)cout << "if dp[" << j-1 << "][" << t << "]+dp[" << j-1 << "][" << t-y[j] << "]=dp[" << j << "][" << t << "]=" << dp[j][t] << endl;
			}else{
//if(dp[j][t]>0)cout << "else dp[" << j-1 << "][" << t << "]=dp[" << j << "][" << t << "]=" << dp[j][t] << endl;
			}
		}
	}
	cout << dp[n][n*maxX]-1 << endl;

	return 0;
}
/*int A[100100];
long long dp[100][3000];
 
int main3(){
	int n,x,a;
	cin >> n >> x;
 
	for(int i=0;i<n;i++){
		cin >> A[i];
		A[i]-=x;
	}
	
	dp[0][n*x]=1;
	for(int i=0;i<n;i++){
		for(int j=0;j<=50*50;j++){
			dp[i+1][j]=dp[i][j];
			
			if(j-A[i]>=0)
				dp[i+1][j]+=dp[i][j-A[i]];
	cout << "dp[" << i+1 << "][" << j << "]=" << dp[i+1][j] << endl;
		}
	}
	
	cout << dp[n][n*x]-1 << endl;
	return 0;
}*/

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'memset' was not declared in this scope
   37 |         memset(dp,0,sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <functional>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C

#include<stdio.h>
#include<iostream>
#include<malloc.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
int main()
{
	int N,K,X,Y;
	int i;
	int sum=0;
	cin >> N>>K>>X>>Y;
	if(N<=K)
	{
		for(i=0;i<N;i++)
		{
			sum+=X;
		}
	} 
	else
	{
		for(i=0;i<K;i++)
		{
			sum+=X;
		}
		for(i=0;i<N-K;i++)
		{
			sum+=Y;
		}
	}
	cout << sum<<endl;
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <vector>
#include <iostream>
using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
typedef vector<long long> vll, vLL;

bool check(const string& s,const string& t){
	int n = s.size();
	int m = t.size();
	for(int i=0;i<=n-m;i++){
		bool ok = true;
		REP(j,m){
			if(s[i+j]!='?' && s[i+j]!=t[j])ok=false;
		}
		if(ok)return true;
	}
	return false;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n,a,x[60],y[60];
	scanf("%d %d",&n,&a);
	REP(i,n){
		scanf("%d",&x[i]);
	}
	ll dp[50][2500];
	memset(dp,0,sizeof(dp));

	REP(j,n){
		y[j] = x[j] - a;
	}
	dp[0][n*a]=1;
	REP(i,n){
		for(int k=0;k<=n*a;k++){
			dp[i+1][k] = dp[i][k];
			if(k>=y[i]&&k-y[i]<=2*n*a)dp[i+1][k] += dp[i][k-y[i]];
		}
	}
	cout << dp[n][n*a]-1 << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'memset' was not declared in this scope
   35 |         memset(dp,0,sizeof(dp));
      |         ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <functional>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

#include<iostream>
using namespace std;
int main(){
  int a,b,c,b;
  cin>>a>>b>>c>>d;
  if(a>b){
    cout<<b*c+(a-b)*d<<endl;
  }
  else{
    cout<<b*c<<endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:13: error: redeclaration of 'int b'
    4 |   int a,b,c,b;
      |             ^
a.cc:4:9: note: 'int b' previously declared here
    4 |   int a,b,c,b;
      |         ^
a.cc:5:17: error: 'd' was not declared in this scope
    5 |   cin>>a>>b>>c>>d;
      |                 ^
Language: C++

n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n < k:
    print (n*x)
else:
    print (k*x + (n-k)*y)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
int main()
{
	int N,K,X,Y;
	int total=0;
	cin>>N>>K>>X>>Y;
	for(int i=1;i<=N;i++){
		if(i<=X)	total+=X;
		else	total+=Y;
	}
	cout<<total<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>N>>K>>X>>Y;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         cout<<total<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |         cout<<total<<endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<stdio.h>

int main(void){
    int n, ,k, x, y;
    scanf("%d%d%d%d",&n, &k, &x, &y);
    int cost;
    if(n<=k) cost = n*x;
    else cost = k*x+(n-k)*y;
    printf("%d\n",cost);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:12: error: expected identifier or '(' before ',' token
    4 |     int n, ,k, x, y;
      |            ^
main.c:5:27: error: 'k' undeclared (first use in this function)
    5 |     scanf("%d%d%d%d",&n, &k, &x, &y);
      |                           ^
main.c:5:27: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:31: error: 'x' undeclared (first use in this function)
    5 |     scanf("%d%d%d%d",&n, &k, &x, &y);
      |                               ^
main.c:5:35: error: 'y' undeclared (first use in this function)
    5 |     scanf("%d%d%d%d",&n, &k, &x, &y);
      |                                   ^
Language: C++

#include<iostream>
using namespce std;
int main(){
  int n,k,x,y;
  cin>>n>>k>>x>>y;
  if(n>k)cout<<k*x+(n-k)*y<<endl;
  else cout<<k*x<<endl;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n>>k>>x>>y;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:10: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    6 |   if(n>k)cout<<k*x+(n-k)*y<<endl;
      |          ^~~~
      |          std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:6:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    6 |   if(n>k)cout<<k*x+(n-k)*y<<endl;
      |                             ^~~~
      |                             std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:7:8: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    7 |   else cout<<k*x<<endl;
      |        ^~~~
      |        std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:7:19: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    7 |   else cout<<k*x<<endl;
      |                   ^~~~
      |                   std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

include<iostream>
using namespce std;
int main(){
  int n,k,x,y;
  cin>>n>>k>>x>>y;
  if(n>k)cout<<k*x+(n-k)*y<<endl;
  else cout<<k*x<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>n>>k>>x>>y;
      |   ^~~
a.cc:6:10: error: 'cout' was not declared in this scope
    6 |   if(n>k)cout<<k*x+(n-k)*y<<endl;
      |          ^~~~
a.cc:6:29: error: 'endl' was not declared in this scope
    6 |   if(n>k)cout<<k*x+(n-k)*y<<endl;
      |                             ^~~~
a.cc:7:8: error: 'cout' was not declared in this scope
    7 |   else cout<<k*x<<endl;
      |        ^~~~
a.cc:7:19: error: 'endl' was not declared in this scope
    7 |   else cout<<k*x<<endl;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  	int n,k,x,y;
  cin>>n>>k>>x>>y
	if(k<=n) cout<<(n*x)<<endl;
  else cout<<(k*x)+y*(n-k)<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:18: error: expected ';' before 'if'
    5 |   cin>>n>>k>>x>>y
      |                  ^
      |                  ;
    6 |         if(k<=n) cout<<(n*x)<<endl;
      |         ~~        
a.cc:7:3: error: 'else' without a previous 'if'
    7 |   else cout<<(k*x)+y*(n-k)<<endl;
      |   ^~~~