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

#include <bits/stdc++.h>
using namespace std;
const int Maxn=1e5+10;
struct EDGE{int x,y,next;}edge[Maxn*2]; int len,first[Maxn];
void ins(int x,int y){len++; edge[len].x=x; edge[len].y=y; edge[len].next=first[x]; first[x]=len;}
int N,M; int C[Maxn];

int u,v,opt; bool vis[Maxn];
void Find_Cir(int x,int fa,int col)
{
  C[x]=col; vis[x]=1;
  for(int k=first[x];k!=-1;k=edge[k].next)
  {
    int y=edge[k].y;
    if(x==u&&y==v) continue;
    if(y!=fa)
    {
      if(vis[y]){u=x; v=y; if(C[u]==C[v]) opt=1; else opt=0;}
      else Find_Cir(y,x,-col);
    }
  }
}

int G[Maxn],F[Maxn];
void Dfs(int x,int fa)
{
  F[x]=C[x];
  for(int k=first[x];k!=-1;k=edge[k].next)
  {
    int y=edge[k].y;
    if(x==u&&y==v) continue;
    if(x==v&&y==u) continue;
    if(y!=fa)
    {
      Dfs(y,x);
      F[x]+=F[y]; G[x]+=G[y];
    }
  }
}

int A[Maxn]; int Alen;

int main()
{
  int Tcase=1
  while(Tcase--)
  {
    scanf("%d%d",&N,&M); len=0; memset(first,-1,sizeof(first));
    for(int i=1;i<=M;i++){int x,y; scanf("%d%d",&x,&y); ins(x,y); ins(y,x);}
    memset(vis,0,sizeof(vis)); memset(C,0,sizeof(C));
    u=v=0; Find_Cir(1,0,1);
    if(M==N-1)
    {
      Dfs(1,0);
      if(F[1]) printf("-1\n");
      else{int ans=0; for(int i=1;i<=N;i++) ans+=abs(F[i]); printf("%d\n",ans);}
    }
    else if(opt==1)
    {
      Dfs(1,0);
      int t=F[1],ans=0;
      if(t&1) printf("-1\n");
      else
      {
        C[u]-=t/2; C[v]-=t/2; ans+=abs(t/2); memset(F,0,sizeof F);
        Dfs(1,0); for(int i=1;i<=N;i++) ans+=abs(F[i]); printf("%d\n",ans);
      }
    }
    else if(opt==0)
    {
      Dfs(1,0);
      if(F[1]) printf("-1\n");
      else
      {
        memset(G,0,sizeof(G));
        G[u]--; G[v]++; memset(F,0,sizeof F);
        Dfs(1,0); int ans=0; Alen=0; memset(A,0,sizeof(A));
        for(int i=1;i<=N;i++)
        {
          if(G[i]==-1) A[++Alen]=F[i];
          if(G[i]==0) ans+=abs(F[i]);
          if(G[i]==1) A[++Alen]=-F[i];
        }
        sort(A+1,A+Alen+1);
        for(int i=1;i<=Alen;i++) ans+=abs(A[i]-A[(Alen+1)>>1]);
        ans+=abs(A[(Alen+1)>>1]);
        printf("%d\n",ans);
      }
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:3: error: expected ',' or ';' before 'while'
   46 |   while(Tcase--)
      |   ^~~~~
Language: C++

#define DEB
#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;


#ifdef DEB
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
#define dumpR(x) cerr<<"\x1b[31m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpY(x) cerr<<"\x1b[33m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
#define dumpG(x) cerr<<"\x1b[32m"<<#x<<" = " <<(x)<<"\x1b[39m"<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define dumpR(x) ;
#define dumpY(x) ;
#define dumpG(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }

typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fr<<','<<a.sc<<')';
    return out;
  }
}

//const int INF=5e8;
int n,m;
vector<int> g[100005];
void ng(){
  puts("-1");
  exit(0);
}
pi dfs(int v,int p){
  if(g[v].empty()) return mp(1,1);
  for(auto to:g[v]){
    if(to==p) continue;
    pi nxt=dfs(to,v);
    cost+=nxt.fr;
    sign^=nxt.sc;
  }
  if(sign==0) return mp(cost+1,1);
  else return mp(cost,0);
}

void solve1(){
  REP(i,n-1){
    int a,b;scanf("%d%d",&a,&b);--a;--b;
    g[a].pb(b);
    g[b].pb(a);
  }
  pi res=dfs(0,-1);
  if(res.sc==1) ng();
  printf("%d\n",res.fr);
}


int main(){
  cin>>n>>m;
  if(n&1) ng();
  if(m==n-1) solve1();


  return 0;
}





Compiler output:
a.cc: In function 'pi dfs(int, int)':
a.cc:57:5: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   57 |     cost+=nxt.fr;
      |     ^~~~
      |     cosl
a.cc:58:5: error: 'sign' was not declared in this scope; did you mean 'sin'?
   58 |     sign^=nxt.sc;
      |     ^~~~
      |     sin
a.cc:60:6: error: 'sign' was not declared in this scope; did you mean 'sin'?
   60 |   if(sign==0) return mp(cost+1,1);
      |      ^~~~
      |      sin
a.cc:60:25: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   60 |   if(sign==0) return mp(cost+1,1);
      |                         ^~~~
      |                         cosl
a.cc:61:18: error: 'cost' was not declared in this scope; did you mean 'cosl'?
   61 |   else return mp(cost,0);
      |                  ^~~~
      |                  cosl
Language: C++

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

const int N = 100005;
const int inf = 1e9+7;

int n, m, f[N][2];
vector<int> g[N];

void dfs(int v, int pr = -1) {
    f[v][0] = 0;
    f[v][1] = inf;
    for (auto& to : g[v]) {
        if (to == pr) continue;
        dfs(to, v);
        int b[2] = {f[v][0], f[v][1]};
        f[v][0] = f[v][1] = inf;
            f[v][1] = min(f[v][1], b[0] + f[to][0] + 1);
            f[v][1] = min(f[v][1], b[1] + f[to][1]);
            f[v][0] = min(f[v][0], b[0] + f[to][1]);
        }
    }
}

int main() {
    scanf("%d %d", &n, &m);
    if (n == m) {
        return 0;
    }
    for (int i = 0; i < m; ++i) {
        int x, y;
        scanf("%d %d", &x, &y);
        --x; --y;
        g[x].push_back(y);
        g[y].push_back(x);
    }
    dfs(0);
    cout << (f[0][1] == inf ? -1 : f[0][1]) << endl;
    return 0;
}


Compiler output:
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
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 << X*K << endl;
 }
else {cout << X*K+(N-K)*Y << endl; 
}

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

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

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

if(N<K){
  cout << X*K << endl;
 }
else {cout << X*K+(N-K)*Y << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:14: error: 'K' was not declared in this scope
    6 |  cin >> N >> K >> X >> Y;
      |              ^
a.cc:6:19: error: 'X' was not declared in this scope
    6 |  cin >> N >> K >> X >> Y;
      |                   ^
a.cc:6:24: error: 'Y' was not declared in this scope
    6 |  cin >> N >> K >> X >> Y;
      |                        ^
a.cc:12:2: error: expected '}' at end of input
   12 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

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

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


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 <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)
#define PI 3.14159265359
#define EPS 0.0000000001
#define MOD 1000000007
//cout << std::fixed << std::setprecision(15) << y << endl;


int main(){
    ll 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: In function 'int main()':
a.cc:29:32: error: no matching function for call to 'max(int, ll)'
   29 |     cout << min(N, K) * X + max(0, N - K) * Y << endl;
      |                             ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 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:29:32: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   29 |     cout << min(N, K) * X + max(0, N - K) * 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:29:32: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     cout << min(N, K) * X + max(0, N - K) * Y << endl;
      |                             ~~~^~~~~~~~~~
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;
  else cout << k*x + (n-k)*y;
  return;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
    9 |   return;
      |   ^~~~~~
Language: C++

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

string c;
    int ara[26] = {},j;
    cin>>c;
    int len = c.size();
    for(int i = 0; i< len; i++)
    {
        //j = 0;
        //j = c[i] - 'a';
        ara[c[i]]++;
    }
    // cout<<ara[j]<<endl;
    bool ok = true;
    for(int j = 0; j<26; j++)
    {
        if(ara[j]%2!=0)
            ok = false;
    }
    //cout<<ok<<endl;
    if(ok == true )
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}


Compiler output:
a.cc:7:5: error: 'cin' does not name a type
    7 |     cin>>c;
      |     ^~~
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for(int i = 0; i< len; i++)
      |     ^~~
a.cc:9:20: error: 'i' does not name a type
    9 |     for(int i = 0; i< len; i++)
      |                    ^
a.cc:9:28: error: 'i' does not name a type
    9 |     for(int i = 0; i< len; i++)
      |                            ^
a.cc:17:5: error: expected unqualified-id before 'for'
   17 |     for(int j = 0; j<26; j++)
      |     ^~~
a.cc:17:20: error: 'j' does not name a type
   17 |     for(int j = 0; j<26; j++)
      |                    ^
a.cc:17:26: error: 'j' does not name a type
   17 |     for(int j = 0; j<26; j++)
      |                          ^
a.cc:23:5: error: expected unqualified-id before 'if'
   23 |     if(ok == true )
      |     ^~
a.cc:25:5: error: expected unqualified-id before 'else'
   25 |     else
      |     ^~~~
a.cc:28:5: error: expected unqualified-id before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: Java

public class Abc_044 {
	public static void main(String args[]) {
		int N=5;
		int K=3;
		int X=10000;
		int Y=9000;
		int yen;
		
		yen= K*X+(N-K)*Y;
		System.out.println(yen);
	}
}

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

public class Abc_044 {
	public static void main(String args[]) {
		int N;
		int K;
		int X;
		int Y;
		int yen;
		
		yen= K*X+(N-K)*Y;
		System.out.println(yen);
	}
}

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

#include <stdio.h>

int main(void){

	int N,K,X,Y,total;
  	scanf("%d%d%d%d",&N,&K,&X,&Y);
  
  	total=(K*X)+(N-K)*Y;
  	printf("%d\n",total)
  	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:29: error: expected ';' before 'return'
    9 |         printf("%d\n",total)
      |                             ^
      |                             ;
   10 |         return 0;
      |         ~~~~~~
Language: C

#include <stdio.h>

int main(void){

	int N,K,X,Y,total;
  	scanf("%d%d%d%d",&N,&K,&X,%Y);
  
  	total=(K*X)+(N-K)*Y;
  	printf("%d\n",total)
  	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:35: error: expected expression before '%' token
    6 |         scanf("%d%d%d%d",&N,&K,&X,%Y);
      |                                   ^
main.c:9:29: error: expected ';' before 'return'
    9 |         printf("%d\n",total)
      |                             ^
      |                             ;
   10 |         return 0;
      |         ~~~~~~
Language: Java


import java.util.*;

public class main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();
        int x = in.nextInt();
        int y = in.nextInt();
        int z;
        if (k > n) {
            System.out.println(x * n);
        } else {
            z = n - k;
            System.out.println((x * k) + (y * z));
        }
    }
}


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


import java.util.*;

public 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){
            int sum = k * x + (n - k) * y;
            System.out.println(sum);
        }else{
            int sum = k * x;
        }
        System.out.println(sum);
    }
}

Compiler output:
Main.java:18: error: cannot find symbol
        System.out.println(sum);
                           ^
  symbol:   variable sum
  location: class Main
1 error
Language: C++

#include<iostream>
#include<string>

using namespace std;

int data[26];//

int main(){
	string str;
	//int str;
	cin>>str;

for(int i=0;i<str.size();i++){
//for(int i=0;i<strlen(str);i++){
	int index = str.at(i)-'a'; //今見ている文字列をアルファベット昇順の順番の数に変換する
	data[index]++; //カウンタを増やす
}

int flag=0; //数え上げたアルファベットの数を確認する

for(int i=0;i<26;i++){
	if(data[i]%2==1)flag=1;
}

	if(flag==0)cout<< "YES"<<endl;
	else cout<< "NO"<<endl;
	
	return 0;

	}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: reference to 'data' is ambiguous
   16 |         data[index]++; //カウンタを増やす
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:5: note:                 'int data [26]'
    6 | int data[26];//
      |     ^~~~
a.cc:22:12: error: reference to 'data' is ambiguous
   22 |         if(data[i]%2==1)flag=1;
      |            ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:6:5: note:                 'int data [26]'
    6 | int data[26];//
      |     ^~~~
Language: C

#include <stdio.h>

int main(void){
  int N, K, X, Y;
  scanf("%d %d %d %d",&N, &K, &X, &Y);
  if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){
    if (N<=K){
    printf("%d\n", X*K);
  	} else if (N>K){
    printf("%d\n", X*K+Y*(N-K));
   }  else {
        printf("%s\n","Invalid.");
   }
      return 0;    
 }
                   
                    


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

#include <stdio.h>

int main(void){
  int N, K, X, Y;
  scanf("%d %d %d %d",&N, &K, &X, &Y);
  if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){
    if (N<=K){
    printf("%d\n", X*K);
  	} else if (N>K){
    printf("%d\n", X*K+Y*(N-K);
   }  else {
             printf("%s\n","Invalid.");
   }
      return 0;    
 }
                   
                    


Compiler output:
main.c: In function 'main':
main.c:10:31: error: expected ')' before ';' token
   10 |     printf("%d\n", X*K+Y*(N-K);
      |           ~                   ^
      |                               )
main.c:10:32: error: expected ';' before '}' token
   10 |     printf("%d\n", X*K+Y*(N-K);
      |                                ^
      |                                ;
   11 |    }  else {
      |    ~                            
main.c:15:2: error: expected declaration or statement at end of input
   15 |  }
      |  ^
Language: C

#include <stdio.h>

int main(void){
  int N, K, X, Y;
  scanf("%d %d %d %d",&N, &K, &X, &Y);
  if(1<=Y<=X<=10000 && 1<=N<=10000 && 1<=K<=10000){
    if (N<=K){
    printf("%d\n", X*K);
  	} else if (N>K){
    printf("%d\n", X*K+Y*(N-K);
    }
   }  else {
             printf("%s\n","Invalid.");
   }
      return 0;    
 }
                   
                    

Compiler output:
main.c: In function 'main':
main.c:10:31: error: expected ')' before ';' token
   10 |     printf("%d\n", X*K+Y*(N-K);
      |           ~                   ^
      |                               )
main.c:10:32: error: expected ';' before '}' token
   10 |     printf("%d\n", X*K+Y*(N-K);
      |                                ^
      |                                ;
   11 |     }
      |     ~
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 << endl;
}
  else{
  cout << k:x << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:12: error: found ':' in nested-name-specifier, expected '::'
   10 |   cout << k:x << endl;
      |            ^
      |            ::
a.cc:10:11: error: 'k' is not a class, namespace, or enumeration
   10 |   cout << k:x << endl;
      |           ^
Language: C++

#include<iostream.h>
using namespace std;
int main()
{
  int n,k,x,y,i,sum=0;
  cin>>n;
  cin>>k;
  cin>>x;
  cin>>y;
  for(i=1;i<=n;i++)
  {
    if(i<=k)
    {
      
    sum+=x;
      
    }
    else
    {
      sum+=y;
    }
  }
  cout<<sum<<endl;
  return 0;
}

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

#include<iostream>
using namespace std;

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'll' was not declared in this scope
    7 |     ll ans=0;
      |     ^~
a.cc:10:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |         ans+=x;
      |         ^~~
      |         abs
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |         ans+=y;
      |         ^~~
      |         abs
a.cc:14:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C++

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

int main() {
  int a, b, x, y;
  cin >> a >> b >> x >> y;
  cout << a * x + (b - a) * y << endl;
}

Compiler output:
a.cc:1:24: warning: extra tokens at end of #include directive
    1 | #include <bits/stdc++>h>
      |                        ^
a.cc:1:10: fatal error: bits/stdc++>: No such file or directory
    1 | #include <bits/stdc++>h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

/**
 * auther: moririn_cocoa
 */
// #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_)

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define fi first
#define se second

int main(int argc, char* argv[]) {
  
  int N;
  int K;
  int X;
  int Y;
  
  cin >> N;
  cin >> K;
  cin >> X;
  cin >> Y;
  
  if ( N >= K ) {
    
    cout << K * X + ( N - K ) * Y << endl;
  }
  
  else if {
    
    cout << K * X << endl;
  }
  
  return 0;
}

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

#include <iostream>
using namespace std;
int main(void){
 int n, k, x, y;
  if (n >= k){
    cout << n * x << endl;}
  if(n < k) {
    cout << (n - k) * y + k * x; << endl;}
    
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected primary-expression before '<<' token
    8 |     cout << (n - k) * y + k * x; << endl;}
      |                                  ^~
Language: C++

#include <iostream>
using namespace std;
int main(void){
 int n, k, x, y;
  if (n >= k){
    cout << k * x << endl;
  }
  if(n > k) {
    cout << (n - k) * y + k * x; << endl;
  }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:34: error: expected primary-expression before '<<' token
    9 |     cout << (n - k) * y + k * x; << endl;
      |                                  ^~
Language: C++

#include <iostream>
using namespace std;
int main(void){
 int n, k, x, y;
  if (n >= k){
    cout << k * x << endl;
  if(n > k) {
    cout << (n - k) * y + k * x; << endl;
    
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:34: error: expected primary-expression before '<<' token
    8 |     cout << (n - k) * y + k * x; << endl;
      |                                  ^~
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:5:14: note: to match this '{'
    5 |   if (n >= k){
      |              ^
a.cc:11:2: error: expected '}' at end of input
   11 | }
      |  ^
a.cc:3:15: note: to match this '{'
    3 | int main(void){
      |               ^
Language: C

#include <stdio.h>
 
void main(){
  int i,k,n,x,y,total;
  
  scanf("%d",&n);
  scanf("%d",&k);
  scanf("%d",&x);
  scanf("%d",&y);
  
  for( i = 1; i < n, i++ ) {
    if( i <= k ) {
      total += x;
    } else {
      total += y;
    }
  }
  
  printf( "%d", total );
    
 return; 
}

Compiler output:
main.c: In function 'main':
main.c:11:25: error: expected ';' before ')' token
   11 |   for( i = 1; i < n, i++ ) {
      |                         ^~
      |                         ;
Language: C

#include <stdio.h>

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


Compiler output:
main.c: In function 'main':
main.c:11:25: error: expected ';' before ')' token
   11 |   for( i = 1; i < n, i++ ) {
      |                         ^~
      |                         ;
main.c:21:1: error: expected declaration or statement at end of input
   21 | }
      | ^
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int n, k, x, y;
    cin>>n>>k>>x>>y;
    if (n=<k){
    int ans=n*x;
    cout<<ans<<endl;
    }
    else {
    int a=k*y, b=(n-k)*y;
    int ans=a+b;
    cout<<ans<<endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: expected primary-expression before '<' token
    6 |     if (n=<k){
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >>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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout <<S<<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:9:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout <<S<<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)
      |     ^~~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout <<S<<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:12:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout <<S<<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>

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin >>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:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 |   cout <<S<<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:9:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
    9 |   cout <<S<<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)
      |     ^~~~
a.cc:12:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |   cout <<S<<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:12:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   12 |   cout <<S<<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(){
	long long n,k,x,y;
	cin>>n>>k>>x>>y;
	cout<<min(k,n)*x+max(0,n-k)*y;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:29: error: no matching function for call to 'max(int, long long int)'
    8 |         cout<<min(k,n)*x+max(0,n-k)*y;
      |                          ~~~^~~~~~~
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' ('int' and 'long long int')
    8 |         cout<<min(k,n)*x+max(0,n-k)*y;
      |                          ~~~^~~~~~~
/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 'int'
    8 |         cout<<min(k,n)*x+max(0,n-k)*y;
      |                          ~~~^~~~~~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: expected initializer before '<=' token
   10 |     if (int i <= k) {
      |               ^~
a.cc:10:14: error: expected ')' before '<=' token
   10 |     if (int i <= k) {
      |        ~     ^~~
      |              )
Language: Java

import java.util.Scanner;

public class Abc044a {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);

        // 入力(n)
        int n = sc.nextInt();
        // 入力(k)
        int k = sc.nextInt();
        // 入力(x)
        int x = sc.nextInt();
        // 入力(y)
        int y = sc.nextInt();

        int fee = 0;
        if (n <= k) {
            fee = n * x;
        } else {
            fee = k * x + (n - k) * y;
        }
        System.out.println(fee);
        sc.close();
    }
}

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected primary-expression before ';' token
    6 |     cin>>n>>k>>x>>;
      |                   ^
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<<X*K<<endl;
 }
 else{
 cout<<X*N+Y*(K-N)<<endl;
 }

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

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

using namespace std;

int main()
{
    string w = "";
    cin >> w;
    bool test = true;
    vector <char> tested;
    for (int i = 0; i < w.size()-1; i++)
    {
        if (find(tested.begin(), tested.end(), w[i]) == tested.end()) 
        {    
            
            tested.push_back(w[i]);
            int num = 1;
            for (int a = i+1; a < w.size(); a++)
            {
                if (w[i] == w[a])
                {   
                    num += 1;
                }
            }
            if (num % 2 != 0)
            {
                test = false;
                break;
            }
        }
    }
    if (test != false)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   15 |         if (find(tested.begin(), tested.end(), w[i]) == tested.end())
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:15:17: note:   '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   15 |         if (find(tested.begin(), tested.end(), w[i]) == tested.end())
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

int main()
{
    string w = "";
    cin >> w;
    sort(w.begin(), w.end());
    bool test = true;
    vector <char> tested;
    for (int i = 0; i < w.size()-1; i++)
    {
        if (find(tested.begin(), tested.end(), w[i]) == tested.end()) 
        {    
            
            tested.push_back(w[i]);
            int num = 1;
            for (int a = i+1; a < w.size(); a++)
            {
                if (w[i] == w[a])
                {   
                    num += 1;
                }
            }
            if (num % 2 != 0)
            {
                test = false;
                break;
            }
        }
    }
    if (test != false)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(w.begin(), w.end());
      |     ^~~~
      |     short
a.cc:16:17: error: no matching function for call to 'find(std::vector<char>::iterator, std::vector<char>::iterator, __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type&)'
   16 |         if (find(tested.begin(), tested.end(), w[i]) == tested.end())
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:16:17: note:   '__gnu_cxx::__normal_iterator<char*, std::vector<char> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   16 |         if (find(tested.begin(), tested.end(), w[i]) == tested.end())
      |             ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

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

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

import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner();
    // 整数の入力
    int N = sc.nextInt();
    int K = sc.nextInt();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    //　宿泊費の合計を計算
    int sum = 0;
    if (N<=K) {
      sum = N * X;
    } else {
      sum = K * X + (N - K) * Y;
    }
    // 出力
    System.out.println(sum);
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: Java

import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner();
    // 整数の入力
    int N = sc.nextInt();
    int K = sc.nextInt();
    int X = sc.nextInt();
    int Y = sc.nextInt();
    //　宿泊費の合計を計算
    int sum;
    if (N<=K) {
      sum = N * X;
    } else {
      sum = K * X + (N - K) * Y;
    }
    // 出力
    System.out.println(sum);
  }
}

Compiler output:
Main.java:4: error: no suitable constructor found for Scanner(no arguments)
    Scanner sc = new Scanner();
                 ^
    constructor Scanner.Scanner(Readable,Pattern) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Readable) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(InputStream,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(File,CharsetDecoder) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(Path,Charset) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,String) is not applicable
      (actual and formal argument lists differ in length)
    constructor Scanner.Scanner(ReadableByteChannel,Charset) is not applicable
      (actual and formal argument lists differ in length)
1 error
Language: Java

import java.util.*;
public 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();
    int sum = 0;
    
    if((n-k) >= 0){
      sum += (k*x)+((n-k)*y);
    }else{
      sum += n*x
    }
    System.out.println(sum);
  }
}

Compiler output:
Main.java:14: error: ';' expected
      sum += n*x
                ^
1 error
Language: C++

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

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


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'answer' was not declared in this scope
    9 |     answer == k*x
      |     ^~~~~~
a.cc:11:5: error: 'answer' was not declared in this scope
   11 |     answer == k*x+(n-k)*y
      |     ^~~~~~
a.cc:13:11: error: 'answer' was not declared in this scope
   13 |   cout << answer << endl;
      |           ^~~~~~
Language: C++

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

int main () {
  int n,k,x,y;
  cin >>n>>k>>x>>y;
  
  cout >> n*y-K*(x-y) >> endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: 'K' was not declared in this scope
    8 |   cout >> n*y-K*(x-y) >> endl;
      |               ^
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;
  }
  else if{
    cout << k*x + (n-k)*y << endl;
  }
}

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