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

import java.util.*;

public class Main {
  
  public class Drink {
    public int A;
    public int B;
    public Drink(int a, int b) {
      this.A = a;
      this.B = b;
    }
  }
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N, M;
    N = sc.nextInt();
    M = sc.nextInt();
    
    long totalYen = 0L;
    List<Drink> list = new ArrayList<>();
    for (int i=0; i<N; i++) {
      list.add(new Drink(sc.nextInt(), nextInt()));
    }
    Collections.sort(list, new Comparator<Drink>(){
      @Override
      public int compareTo(Drink d1, Drink d2) {
        return d1.A - d2.A;
      }
    });
    
    for (int i=0; i<list.size(); i++) {
      Drink d = list.get(i);
      long yen = d.A*d.B;
      if (M - d.B > 0) {
        totalYen += yen;
        M -= d.B;
      } else if (M - d.B <= 0) {
        for (int j=1; j<=d.B, M>=0; j++, M--) {
          totalYen += d.A;
        }
      }
      if (M == 0) {
        System.out.println(totalYen);
        return;
      } 
    }
    return;
  }
}


Compiler output:
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                            ^
Main.java:39: error: not a statement
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                               ^
Main.java:39: error: ')' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                  ^
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                       ^
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                            ^
5 errors
Language: Java

import java.util.*;

public class Main {
  
  public class Drink {
    public int A;
    public int B;
    public Dring(int a, int b) {
      this.A = a;
      this.B = b;
    }
  }
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N, M;
    N = sc.nextInt();
    M = sc.nextInt();
    
    long totalYen = 0L;
    List<Drink> list = new ArrayList<>();
    for (int i=0; i<N; i++) {
      list.add(new Drink(sc.nextInt(), nextInt()));
    }
    Collections.sort(list, new Comparator<Drink>(){
      @Override
      public int compareTo(Drink d1, Drink d2) {
        return d1.A - d2.A;
      }
    });
    
    for (int i=0; i<list.size(); i++) {
      Drink d = list.get(i);
      long yen = d.A*d.B;
      if (M - d.B > 0) {
        totalYen += yen;
        M -= d.B;
      } else if (M - d.B <= 0) {
        for (int j=1; j<=d.B, M>=0; j++, M--) {
          totalYen += d.A;
        }
      }
      if (M == 0) {
        System.out.println(totalYen);
        return;
      } 
    }
    return;
  }
}

Compiler output:
Main.java:8: error: invalid method declaration; return type required
    public Dring(int a, int b) {
           ^
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                            ^
Main.java:39: error: not a statement
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                               ^
Main.java:39: error: ')' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                  ^
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                       ^
Main.java:39: error: ';' expected
        for (int j=1; j<=d.B, M>=0; j++, M--) {
                                            ^
6 errors
Language: C

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

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector <int> a(n);
    vector <int> b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }

    vector < pair<int, int> > store(n);
    for (int i = 0; i < n; i++) {
        store[i] = make_pair(a[i], b[i]);
    }

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

    long long count = 0;
    long long cost = 0;

    for (int i = 0; i < n; i++) {
        if (count + store[i].second >= m) {
            cost += store[i].first * (m - count);
            break;
        }

        count += store[i].second;
        cost += store[i].first * store[i].second;
    }

    cout << cost << endl;

    return 0;
}

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

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

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector <int> a(n);
    vector <int> b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i] >> b[i];
    }

    vector < pair<int, int> > store(n);
    for (int i = 0; i < n; i++) {
        store[i] = make_pair(a[i], b[i]);
    }

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

    long long count = 0;
    long long cost = 0;

    for (int i = 0; i < n; i++) {
        if (count + store[i].second >= m) {
            cost += store[i].first * (m - count);
            break;
        }

        count += store[i].second;
        cost += store[i].first * store[i].second;
    }

    cout << cost << endl;

    return 0;
}

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

#include<stdio.h>
int main(void){
  int n, 1 <= m <=100000, 1 <= a[1000] <= 1000000000, 1 <= b[1000] <= 100000;
  
  scanf("%d %d", &n, &m);
  for(i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
  for(j = 0 && k = 5; j < 5; j++ && k--){
    c = a[j] + b[k];
    if(c < d) d = c;
  }
  printf("%d\n", d);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:3:10: error: expected identifier or '(' before numeric constant
    3 |   int n, 1 <= m <=100000, 1 <= a[1000] <= 1000000000, 1 <= b[1000] <= 100000;
      |          ^
main.c:5:23: error: 'm' undeclared (first use in this function)
    5 |   scanf("%d %d", &n, &m);
      |                       ^
main.c:5:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
      |       ^
main.c:6:42: error: 'a' undeclared (first use in this function)
    6 |   for(i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
      |                                          ^
main.c:6:49: error: 'b' undeclared (first use in this function)
    6 |   for(i = 0; i < n; i++) scanf("%d %d", &a[i], &b[i]);
      |                                                 ^
main.c:7:7: error: 'j' undeclared (first use in this function)
    7 |   for(j = 0 && k = 5; j < 5; j++ && k--){
      |       ^
main.c:7:16: error: 'k' undeclared (first use in this function)
    7 |   for(j = 0 && k = 5; j < 5; j++ && k--){
      |                ^
main.c:8:5: error: 'c' undeclared (first use in this function)
    8 |     c = a[j] + b[k];
      |     ^
main.c:9:12: error: 'd' undeclared (first use in this function)
    9 |     if(c < d) d = c;
      |            ^
Language: C++

package main
import (
	"fmt"
	"os"
	"bufio"
	"strconv"
	"sort"
)

var stdin = bufio.NewScanner(os.Stdin)

type Data struct{
	A int
	B int
}

func Input_int() int {
	stdin.Scan()
	out,err := strconv.Atoi(stdin.Text())
	if err != nil{
		panic(err)
	}
	return out
}


func main() {
	stdin.Split(bufio.ScanWords)
	N,M := Input_int(),Input_int()
	Datas := []Data{}
	for i := 0; i < N; i++ {
		Data_temp := Data{Input_int(),Input_int()}
		Datas = append(Datas,Data_temp)
	}
	sort.Slice(Datas,func (i,j int) bool {return Datas[i].A<Datas[j].A})
	items := 0
	sum := 0
	for i:=0;items<M;i++ {
		if (Datas[i].B + items) > M{
			sum += (M-items)*Datas[i].A
			break
		}else{
			sum += Datas[i].A*Datas[i].B
			items += Datas[i].B
		}
	}
	fmt.Println(sum)
}

Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:17:1: error: 'func' does not name a type
   17 | func Input_int() int {
      | ^~~~
a.cc:27:1: error: 'func' does not name a type
   27 | func main() {
      | ^~~~
Language: Java

import java.util.*;
public class Main{
  static class Store implements Comparable<Store>{
    long price, cans;
    Store(long price, long cans){
      this.price = price;
      this.cans = cans;
    }
    public int compareTo(Store obj){
      return this.price - obj.price;
    }
  }
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long M = sc.nextLong();
    List<Store> stores = new ArrayList<>();
    for(int i=0; i<N; i++){
      stores.add(new Store(sc.nextLong(), sc.nextLong()));
    }
    long sum = 0;
    for(int i=0; i<N; i++){
      Store si = stores.get(i);
      if(si.cans < M){
        sum += si.price*si.cans;
        M -= si.cans;
      }else{
        sum += si.price*M;
        break;
      }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:10: error: incompatible types: possible lossy conversion from long to int
      return this.price - obj.price;
                        ^
1 error
Language: Java

import java.util.*;
public class Main{
  static class Store implements Comparable<Store>{
    long price, cans;
    Store(long price, cans){
      this.price = price;
      this.cans = cans;
    }
    public int compareTo(Store obj){
      return this.price - obj.price;
    }
  }
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();
    long M = sc.nextLong();
    List<Store> stores = new ArrayList<>();
    for(int i=0; i<N; i++){
      stores.add(new Store(sc.nextLong(), sc.nextLong()));
    }
    long sum = 0;
    for(int i=0; i<N; i++){
      Store si = stores.get(i);
      if(si.cans < M){
        sum += si.price*si.cans;
        M -= si.cans;
      }else{
        sum += si.price*M;
        break;
      }
    }
    System.out.print(sum);
  }
}

Compiler output:
Main.java:5: error: <identifier> expected
    Store(long price, cans){
                          ^
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();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    en.sort(en, Comparator.comparing(x -> x[0]));
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:14: error: method sort in interface List<E> cannot be applied to given types;
    en.sort(en, Comparator.comparing(x -> x[0]));
      ^
  required: Comparator<? super long[]>
  found:    List<long[]>,Comparator<Object>
  reason: actual and formal argument lists differ in length
  where E is a type-variable:
    E extends Object declared in interface List
Main.java:14: error: array required, but Object found
    en.sort(en, Comparator.comparing(x -> x[0]));
                                           ^
2 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, Comparator.comparing(x -> x[0]));
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:14: error: cannot find symbol
    Collection.sort(en, Comparator.comparing(x -> x[0]));
              ^
  symbol:   method sort(List<long[]>,Comparator<Object>)
  location: interface Collection
Main.java:14: error: array required, but Object found
    Collection.sort(en, Comparator.comparing(x -> x[0]));
                                                   ^
2 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, Comparator.comparing(x -> x[0]);
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}

Compiler output:
Main.java:14: error: ')' or ',' expected
    Collection.sort(en, Comparator.comparing(x -> x[0]);
                                                       ^
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();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new listComparator());
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}

public class listComparator implements Comparator<long[]>{
  @Override
  public long compare(long[] l1, long[] l2){
    return l1[0] - l2[0];
  }
}


Compiler output:
Main.java:30: error: class listComparator is public, should be declared in a file named listComparator.java
public class listComparator implements Comparator<long[]>{
       ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new listComparator());
              ^
  symbol:   method sort(List<long[]>,listComparator)
  location: interface Collection
Main.java:32: error: compare(long[],long[]) in listComparator cannot implement compare(T,T) in Comparator
  public long compare(long[] l1, long[] l2){
              ^
  return type long is not compatible with int
  where T is a type-variable:
    T extends Object declared in interface Comparator
Main.java:31: error: method does not override or implement a method from a supertype
  @Override
  ^
4 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      @Override
      public long compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    });
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:14: error: <anonymous Main$1> is not abstract and does not override abstract method compare(Object,Object) in Comparator
    Collection.sort(en, new Comparator(){
                                        ^
Main.java:15: error: method does not override or implement a method from a supertype
      @Override
      ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new Comparator(){
              ^
  symbol:   method sort(List<long[]>,<anonymous Comparator>)
  location: interface Collection
3 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = sc.nextLong();
      long Bi = sc.nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      public long compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    });
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:14: error: <anonymous Main$1> is not abstract and does not override abstract method compare(Object,Object) in Comparator
    Collection.sort(en, new Comparator(){
                                        ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new Comparator(){
              ^
  symbol:   method sort(List<long[]>,<anonymous Comparator>)
  location: interface Collection
2 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = nextLong();
      long Bi = nextLong();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      public long compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    });
    long sum = 0;
    for(int i=0; i<N; i++){
     long price = en.get(i)[0];
     long stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
      long Ai = nextLong();
                ^
  symbol:   method nextLong()
  location: class Main
Main.java:10: error: cannot find symbol
      long Bi = nextLong();
                ^
  symbol:   method nextLong()
  location: class Main
Main.java:14: error: <anonymous Main$1> is not abstract and does not override abstract method compare(Object,Object) in Comparator
    Collection.sort(en, new Comparator(){
                                        ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new Comparator(){
              ^
  symbol:   method sort(List<long[]>,<anonymous Comparator>)
  location: interface Collection
4 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      long Ai = nextInt();
      long Bi = nextInt();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      public int compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    });
    int sum = 0;
    for(int i=0; i<N; i++){
     int price = en.get(i)[0];
     int stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
      long Ai = nextInt();
                ^
  symbol:   method nextInt()
  location: class Main
Main.java:10: error: cannot find symbol
      long Bi = nextInt();
                ^
  symbol:   method nextInt()
  location: class Main
Main.java:14: error: <anonymous Main$1> is not abstract and does not override abstract method compare(Object,Object) in Comparator
    Collection.sort(en, new Comparator(){
                                        ^
Main.java:16: error: incompatible types: possible lossy conversion from long to int
        return l1[0] - l2[0];
                     ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new Comparator(){
              ^
  symbol:   method sort(List<long[]>,<anonymous Comparator>)
  location: interface Collection
Main.java:21: error: incompatible types: possible lossy conversion from long to int
     int price = en.get(i)[0];
                          ^
Main.java:22: error: incompatible types: possible lossy conversion from long to int
     int stock = en.get(i)[1];
                          ^
7 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      Ai = nextInt();
      Bi = nextInt();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      public int compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    });
    int sum = 0;
    for(int i=0; i<N; i++){
     int price = en.get(i)[0];
     int stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:9: error: cannot find symbol
      Ai = nextInt();
      ^
  symbol:   variable Ai
  location: class Main
Main.java:9: error: cannot find symbol
      Ai = nextInt();
           ^
  symbol:   method nextInt()
  location: class Main
Main.java:10: error: cannot find symbol
      Bi = nextInt();
      ^
  symbol:   variable Bi
  location: class Main
Main.java:10: error: cannot find symbol
      Bi = nextInt();
           ^
  symbol:   method nextInt()
  location: class Main
Main.java:11: error: cannot find symbol
      long[] li = new long[]{Ai, Bi};
                             ^
  symbol:   variable Ai
  location: class Main
Main.java:11: error: cannot find symbol
      long[] li = new long[]{Ai, Bi};
                                 ^
  symbol:   variable Bi
  location: class Main
Main.java:14: error: <anonymous Main$1> is not abstract and does not override abstract method compare(Object,Object) in Comparator
    Collection.sort(en, new Comparator(){
                                        ^
Main.java:16: error: incompatible types: possible lossy conversion from long to int
        return l1[0] - l2[0];
                     ^
Main.java:14: error: cannot find symbol
    Collection.sort(en, new Comparator(){
              ^
  symbol:   method sort(List<long[]>,<anonymous Comparator>)
  location: interface Collection
Main.java:21: error: incompatible types: possible lossy conversion from long to int
     int price = en.get(i)[0];
                          ^
Main.java:22: error: incompatible types: possible lossy conversion from long to int
     int stock = en.get(i)[1];
                          ^
11 errors
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    long M = sc.nextLong();
    List<long[]> en = new ArrayList<>();
    for(int i=0; i<N; i++){
      Ai = nextInt();
      Bi = nextInt();
      long[] li = new long[]{Ai, Bi};
      en.add(li);
    }
    Collection.sort(en, new Comparator(){
      public int compare(long[] l1, long[] l2){
        return l1[0] - l2[0];
      }
    })
    int sum = 0;
    for(int i=0; i<N; i++){
     int price = en.get(i)[0];
     int stock = en.get(i)[1];
     if(stock <= M){
       sum += price*stock;
       M -= stock;
     }else{
       sum += price*M;
     }
    }
    System.out.print(sum);
  }
}

Compiler output:
Main.java:18: error: ';' expected
    })
      ^
1 error
Language: C++

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


int main(){
    ll N, M; cin >> N >> M;
    vector<pair<ll, ll>> vec;
    for (int i = 0; i < N; i++) cin >> vec.at(i).first >> vec.at(i).second;

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

    ll ans = 0, m = M;

    for (int i = 0; i < N; i++) {
        if (m <= vec.at(i).second)) {
            ans += (vec.at(i).first) * m;
            break;
        }

        ans += (vec.at(i).first) * (vec.at(i).second);
        m -= vec.at(i).second
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: expected primary-expression before ')' token
   16 |         if (m <= vec.at(i).second)) {
      |                                   ^
a.cc:22:30: error: expected ';' before '}' token
   22 |         m -= vec.at(i).second
      |                              ^
      |                              ;
   23 |     }
      |     ~
Language: C++

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

void insertsort(pair<long long, long long> p[], long long N) {
    for(int i=0; i < N; i++){
        long long v = p[i].first;
        int j = i - 1;
        while ( j >= 0 && p[j].first > v){
            p[j + 1].first = p[j].first;
            j--;
        }
        p[j].first = v;
    }
}

int main(){
    long long N, M; cin >> N >> M;
    long long A[100010], B[100010]; for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

    pair<long long, long long> p[100010];
    for (int i=0; i < N; i++) {
        p[i] = make_pair(A[i], B[i]);
    }

    insertsort(p[], N);

    long long ans=0;

    long long m=M;

    for (int i=0; i < N; i++){
        if ( m < p[i].second ) {
            ans += (p[i].first)*m;
            break;
        }

        ans += (p[i].first)*(p[i].second);
        m -= p[i].second;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: expected primary-expression before ']' token
   25 |     insertsort(p[], N);
      |                  ^
Language: C++

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

void insertsort(pair<long long, long long> p[], long long N) {
    for(int i=0; i < N; i++){
        long long v = p[i].first;
        int j = i - 1;
        while ( j >= 0 && p[j].first > v){
            p[j + 1].first = p[j].first;
            j--;
        }
        p[j].first = v;
    }
}

int main(){
    long long N, M; cin >> N >> M;
    long long A[100010], B[100010]; for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

    pair<long long, long long> p[];
    for (int i=0; i < N; i++) {
        p[i] = make_pair(A[i], B[i]);
    }

    insertsort(p[], N);

    long long ans=0;

    long long m=M;

    for (int i=0; i < N; i++){
        if ( m < p[i].second ) {
            ans += (p[i].first)*m;
            break;
        }

        ans += (p[i].first)*(p[i].second);
        m -= p[i].second;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: array size missing in 'p'
   20 |     pair<long long, long long> p[];
      |                                ^
a.cc:25:18: error: expected primary-expression before ']' token
   25 |     insertsort(p[], N);
      |                  ^
Language: C++

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

void insertsort(pair<long long, long long> p[], long long N) {
    for(int i=0; i < N; i++){
        long long v = p[i].first;
        int j = i - 1;
        while ( j >= 0 && p[j].first > v){
            p[j + 1].first = p[j].first;
            j--;
        }
        p[j].first = v;
    }
}

int main(){
    long long N, M; cin >> N >> M;
    long long A[100010], B[100010]; for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

    pair<long long, long long> p[i];
    for (int i=0; i < N; i++) {
        p[i] = make_pair(A[i], B[i]);
    }

    insertsort(p[], N);

    long long ans=0;

    long long m=M;

    for (int i=0; i < N; i++){
        if ( m < p[i].second ) {
            ans += (p[i].first)*m;
            break;
        }

        ans += (p[i].first)*(p[i].second);
        m -= p[i].second;
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: 'i' was not declared in this scope
   20 |     pair<long long, long long> p[i];
      |                                  ^
a.cc:22:9: error: 'p' was not declared in this scope
   22 |         p[i] = make_pair(A[i], B[i]);
      |         ^
a.cc:25:16: error: 'p' was not declared in this scope
   25 |     insertsort(p[], N);
      |                ^
a.cc:25:18: error: expected primary-expression before ']' token
   25 |     insertsort(p[], N);
      |                  ^
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 M = sc.nextInt();
    int[][] AB = new int[N][N];
    for(int i=0; i<N; i++){
     for(int j=0; j<N; j++){
       AB[i][j] = sc.nextInt();
     }
    }
    TheComparator comparator = new TheComparator();
    comparator.setIndex(1);
    Arrays.sort(AB, comparator);
    int honnsuu;
    int sum;
    for(int i=0; i<N; i++){
      honnsuu += AB[i][1];
      if(honnsuu <= M){
        sum += AB[i][0] * AB[i][1];
      }else{
        sum += AB[i][0] * (AB[i][1] - (honnsuu - M));
      }
    }
    System.out.print(sum);
  }
}


Compiler output:
Main.java:13: error: cannot find symbol
    TheComparator comparator = new TheComparator();
    ^
  symbol:   class TheComparator
  location: class Main
Main.java:13: error: cannot find symbol
    TheComparator comparator = new TheComparator();
                                   ^
  symbol:   class TheComparator
  location: class Main
2 errors
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 M = sc.nextInt();
    int[][] AB = int[N][N];
    for(int i=0; i<N; i++){
     for(int j=0; j<N; j++){
       AB[i][j] = sc.nextInt();
     }
    }
    TheComparator comparator = new TheComparator;
    comparator.setIndex(1);
    Arrays.sort(AB, comparator);
    int honnsuu;
    int sum;
    for(int i=0; i<N; i++){
      honnsuu += AB[i][1];
      if(honnsuu <= M){
        sum += AB[i][0] * AB[i][1];
      }else{
        sum += AB[i][0] * (AB[i][1] - (honnsuu - M));
      }
    }
    System.out.print(sum);
  }
}

Compiler output:
Main.java:7: error: ']' expected
    int[][] AB = int[N][N];
                     ^
Main.java:7: error: ';' expected
    int[][] AB = int[N][N];
                      ^
Main.java:7: error: not a statement
    int[][] AB = int[N][N];
                        ^
Main.java:7: error: ';' expected
    int[][] AB = int[N][N];
                         ^
Main.java:13: error: '(' or '[' expected
    TheComparator comparator = new TheComparator;
                                                ^
5 errors
Language: C++

#include<iostream>
#include<utility>
#include<algorithm>

int main(){
  int N,M;
  std::vector<std::pair<long long int,long long int>> AB;
  std::cin >> N >> M;
  using cross = std::pair<long long int,long long int>;
  AB.resize(N);
  for(auto& e : AB){
    std::cin>>e.first>>e.second;
  }
  std::sort(AB.begin(),AB.end(),[](cross& a,cross& b){
    return a.first < b.first;
  });
  int ans=0,count=0;
  for(auto& e : AB){
    if((count + e.second) > M){
      for(int i=0;i<e.second;i++){
        count++;
        ans+=e.first;
        if(count == M)
          break;
      }
    }
    else if((count + e.second) <= M){
      count+=e.second;
      ans+=e.first*e.second;
    }
    if(count == M)
      break;
  }
  std::cout<<ans<<std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:8: error: 'vector' is not a member of 'std'
    7 |   std::vector<std::pair<long long int,long long int>> AB;
      |        ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include<algorithm>
  +++ |+#include <vector>
    4 | 
a.cc:7:52: error: expected primary-expression before '>' token
    7 |   std::vector<std::pair<long long int,long long int>> AB;
      |                                                    ^~
a.cc:7:55: error: 'AB' was not declared in this scope
    7 |   std::vector<std::pair<long long int,long long int>> AB;
      |                                                       ^~
Language: C++

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

int main(){
  int n,m;
  int price=0;
  int drink=0;
  cin >> n >> m;
  vector <int> a(n);
  vector <int> b(n);
  for (int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }
  while (drink<15){ 
  //一番安い店の添え字をminで取得
    int min=0;
    for (int i=1;i<=n-1;i++){
      if (a[min] > a[i]){
        min=i;
      }
    }
    //その店で15個のドリンクがそろうとき
    if (15 - drink < b[min]){
      price += (15-drink)*a[min];
      drink=15
    }
    //店で購入しても15に満たないとき
    else {
      price += a[min]*b[min];
      drink += b[min];
      a[min]=1000000001;
    }
  }
  cout << price << endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:25:15: error: expected ';' before '}' token
   25 |       drink=15
      |               ^
      |               ;
   26 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n,m;
    cin>>n>>m;
    vector<int> A(n),B(n);
    for(int i=0;i<n;i++){
        cin>> A[i]>>B[i];
    }
    vector<pair<int,int>> AB(n);
    for(int i=0;i<n;i++){
        AB[i]=make_pair(A[i],B[i]);
    }
    sort(AB.begin(), AB.end());
 
	long long ans = 0;
    for(int i=0;i<n;i++){
        int buy = min(M, AB[i].second);
        ans+=(long long)buy*AB[i].first;
        m-=buy;
        
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:23: error: 'M' was not declared in this scope
   18 |         int buy = min(M, AB[i].second);
      |                       ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, M;

  cin >> N >> M;

  vector<int> A(N), B(N);

  for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

  vector<pair<int, int> > AB(N);
  for (int i = 0; i < N; i++) AB[i] = make_pair(A[i], B[i]);

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

  long long ans = 0;
  for (int i = 0; M > 0; i++) {
    long long buy = (long long)min(M, AB[i].second);
    ans += buy * AB[i].first;
    M -= buy;
  }

  cout << ans << endl;

  return 0;
}


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

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, M;

  cin >> N >> M;

  vector<int> A(N), B(N);

  for (int i = 0; i < N; i++) cin >> A[i] >> B[i];

  vector<pair<int, int> > AB(N);
  for (int i = 0; i < N; i++) AB[i] = make_pair(A[i], B[i]);

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

  long long ans = 0;
  for (int i = 0; M > 0; i++) {
    int buy = (long long)min(M, AB[i].second);
    ans += buy * AB[i].first;
    M -= buy;
  }

  cout << ans << endl;

  return 0;
}


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

#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
	_int64 N, M, i, baikai, count, sum;
	cin >> N >> M;
	vector<int>price(N), border(N); //ｎ軒目の栄養ドリンクの値段といくつ買えるか
	for (i = 0; i < N; i++)
	{
		cin >> price[i] >> border[i];
	}
	//バブルソートを使う
	while (true)
	{
		count = 0;
		for (i = 0; i < N - 1; i++)
		{
			if (price[i + 1] < price[i])
			{
				baikai = price[i];
				price[i] = price[i + 1];
				price[i + 1] = baikai;
				baikai = border[i];
				border[i] = border[i + 1];
				border[i + 1] = baikai;
				count++;
			}
		}
		if (count == 0)
			break;
	}
	sum = 0;
	for(i=0;i<N;i++)
	{
		if (M - border[i] >= 0)
		{
			M = M - border[i];
			sum = sum + border[i] * price[i];
		}
		else
		{
			sum = sum + M * price[i];
			break;
		}
	}	
	cout << sum;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: '_int64' was not declared in this scope
    7 |         _int64 N, M, i, baikai, count, sum;
      |         ^~~~~~
a.cc:8:16: error: 'N' was not declared in this scope
    8 |         cin >> N >> M;
      |                ^
a.cc:8:21: error: 'M' was not declared in this scope
    8 |         cin >> N >> M;
      |                     ^
a.cc:10:14: error: 'i' was not declared in this scope
   10 |         for (i = 0; i < N; i++)
      |              ^
a.cc:17:17: error: 'count' was not declared in this scope
   17 |                 count = 0;
      |                 ^~~~~
a.cc:18:22: error: 'i' was not declared in this scope
   18 |                 for (i = 0; i < N - 1; i++)
      |                      ^
a.cc:22:33: error: 'baikai' was not declared in this scope
   22 |                                 baikai = price[i];
      |                                 ^~~~~~
a.cc:34:9: error: 'sum' was not declared in this scope
   34 |         sum = 0;
      |         ^~~
a.cc:35:13: error: 'i' was not declared in this scope
   35 |         for(i=0;i<N;i++)
      |             ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;


int main() {
    int base[2];
    for (int i = 0; i < 2; ++i) {
        scanf("%d", &base[i]);
    }

    vector<pair<long, long> > input(base[0]);
    for (int j = 0; j < base[0]; ++j) {
        cin >> input[j].first >> input[j].second;
    }

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

//    for (int k = 0; k < base[0]; ++k) {
//        cout << input[k].first << " " << input[k].second << "\n";
//    }

    long ans = 0;
    int requried = base[1];
    for (int k = 0; k < base[0]; ++k) {
        if (input[k].second >= requried) {
            ans += input[k].first * requried;
            cout << ans;
            return 0;
        } else {
            ans += input[k].first * input[k].second;
            requried -= input[k].second;
        }
    }

}

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

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

int main(){
    int n,m,i,j,m_now = 0;
  long ans = 0;
  cin >> n >> m;
  int a[n],b[n];
  vector <pair<int,int> >pairs(n);
  for(i = 0;i < n ; i++){
    cin >>a[i]>>b[i];
  }
  for(i = 0;i<n;i++){
      pairs[i] = make_pair(a[i],b[i]);
  }
  sort(pairs.begin(),pairs.end());
  for(i = 0;i < n;i++){
      for(j=0;j < pairs[i].first;j++){
        m_now ++;
        ans += pairs[i].second;
        if(m_now == m){
            return ans;
        }
      }
  }

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

N,M=map(int,input().split())

AB=[]
#B=[]

#print(N,M)

#AB[i][0]→A
#AB[i][1]→B

for i in range(N):
    a,b=map(int,input().split())
    AB.append([a,b])

"""
for i in range(N):
    print(AB[i][0],AB[i][1])
"""

AB.sort()
"""
for i in range(N):
    print(AB[i][0],AB[i][1])
"""    
ySum=0
dSum=0
for i in range(N):
    cnt=0
    while(cnt<AB[i][1]):
        if(dSum==M):
            break
        ySum=ySum+AB[i][0]
        cnt+=1
        dSum+=1
            
print(ySum)


Compiler output:
a.cc:4:2: error: invalid preprocessing directive #B
    4 | #B=[]
      |  ^
a.cc:6:2: error: invalid preprocessing directive #print
    6 | #print(N,M)
      |  ^~~~~
a.cc:8:2: error: invalid preprocessing directive #AB
    8 | #AB[i][0]→A
      |  ^~
a.cc:8:10: error: extended character → is not valid in an identifier
    8 | #AB[i][0]→A
      |          ^
a.cc:9:2: error: invalid preprocessing directive #AB
    9 | #AB[i][1]→B
      |  ^~
a.cc:9:10: error: extended character → is not valid in an identifier
    9 | #AB[i][1]→B
      |          ^
a.cc:15:3: warning: missing terminating " character
   15 | """
      |   ^
a.cc:15:3: error: missing terminating " character
a.cc:18:3: warning: missing terminating " character
   18 | """
      |   ^
a.cc:18:3: error: missing terminating " character
a.cc:21:3: warning: missing terminating " character
   21 | """
      |   ^
a.cc:21:3: error: missing terminating " character
a.cc:24:3: warning: missing terminating " character
   24 | """
      |   ^
a.cc:24:3: error: missing terminating " character
   24 | """
      |   ^    
a.cc:1:1: error: 'N' does not name a type
    1 | N,M=map(int,input().split())
      | ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#define FOR(i,a,n) for(i=(a);i<(n);i++)
#define swap(type,a,b) do{type t=a; a=b; b=t}while(0)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
typedef long long ll;
const ll INF=100000000;
const ll MOD=1000000007;
const int SIZE=100005;
typedef struct{
    int v1,v2;
}Pair;
int comp(const void *a,const void *b){
    return ((Pair*)a)->v1 - ((Pair*)b)->v1;
}
Pair p[SIZE];
int main(void){
    int n,m,i;
    ll res;
    scanf("%d%d",&n,&m);
    FOR(i,0,n) scanf("%d%d",&p[i].v1,&p[i].v2);
    qsort(p,n,sizeof(Pair),comp);
    FOR(i,0,n){
        int k=MIN(m,p[i].v2);
        res += (ll)k*(ll)p[i].v1;
        m -= k;
        if(m==0) break;
    }
    printf("%lld\n",res);
    return 0;
}

Compiler output:
main.c:20:6: error: variably modified 'p' at file scope
   20 | Pair p[SIZE];
      |      ^
Language: Java

public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc  = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		ArrayList<int[]> data = new ArrayList<int[]>();
		
		long result = 0;
		boolean flag = true;
		
		for(int i = 0; i < N; i++) {
			int[] input = new int[2];
			input[0] = sc.nextInt();
			input[1] = sc.nextInt();
			data.add(input);
		}
		data.sort((a,b) -> Integer.compare(a[0],b[0]));
	//	sort_data(data,0,N-1);
		
		int i = 0;
		int count_m = 0;
		int count = 0;
		
		while(M != count_m) {
			result += data.get(i)[0];
			count++;
			count_m++;
			
			int next_i = count/data.get(i)[1];
			count = count%data.get(i)[1];
			i += next_i;
		}
		System.out.println(result);
	}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C++

#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

typedef int _lcint;
#define REP(i, n) for (_lcint i = 0; i < n; i++)
#define FOR(i, a, b) for (_lcint i = (_lcint)(a); i < (_lcint)(b); i++)
#define FORREV(i, n) for (_lcint i = (_lcint)(b)-1; i >= (_lcint)(a); i--)
#define DEBUG(x) cout << #x << ": " << x << endl;
#define DEBUG_VEC(v)  \
  cout << #v << ": "; \
  REP(i, v.size()) cout << " " << v[i] << endl;

#define ALL(a) (a).begin(), (a).end()
#define CHMIN(a, b) a = min((a), (b))
#define CHMAX(a, b) a = min((a), (b))

struct Info {
  ll A, B;
};

bool operator<(const Info &left, const Info &right) { return left.A < right.A; }

int main() {
  int N, M;
  cin >> N >> M;
  vector<Info> shops(N);

  REP(i, N) { cin >> shops[i].A >> shops[i].B; }
  sort(shops.begin(), shops.end());

  // REP(i, N) { cout << shops[i].A << "-" << shops[i].B << endl; }

  ll count = M;
  ll total = 0;
  REP(i, N) {
    if (shops[i].B < count) {
      total += shops[i].B * shops[i].A;
      count -= shops[i].B;
    } else {
      total += shops[i].A * count;
      break;
    }
  }
  cout << total << endl;

  return 0;
}


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

#include <iostream>
#include <vector>

using namespace std;

vector<pair<int, int>> A;


int main() {
    int N, M;
    cin >> N >> M;
    for (int i=1; i<=N; i++) {
        int a, b;
        cin >> a >> b;
        A.push_back(make_pair(a,b));
    }
    sort(A.begin(), A.end());
    int c = 0;
    for (int i=0; i<N; i++) {
        if (M > A[i].second) {
            c+= A[i].first * A[i].second;
            M-=A[i].second;
        } else {
            c+=A[i].first * M;
            break;
        }
    }
    cout << c << endl;
}


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

package atCoderProblems_ABC_C;

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

public class ABC121_C {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		long M = sc.nextLong();

		List<Drink> drinkList = new ArrayList<>();
		sc.nextLine();
        for (int i = 0; i < N; i++) {
        	Drink drink = new Drink(sc.nextInt(), sc.nextInt());
        	drinkList.add(drink);
        	sc.nextLine();
        }

        long count = 0;
        long ansPrice = 0;
        while(true){
        	List<Long> priceList = new ArrayList<>();
        	for(Drink drink : drinkList){
            	priceList.add(drink.A);
            }
        	Collections.sort(priceList);

        	Drink drink = drinkList.stream().filter(drnk -> drnk.A == priceList.get(0)).findFirst().get();
        	if(M > count + drink.B) {
        		count += drink.B;
        		ansPrice += drink.A * drink.B;
        	}else{
        		ansPrice += drink.A * (M- count);
        		break;
        	}

        	drinkList.remove(drinkList.indexOf(drink));
        }

        System.out.println(ansPrice);

	}


}

class Drink {

	Drink(long a, long b){
		this.A = a;
		this.B = b;
	}

	long A;
	long B;
}


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

#include<iostream>
#include<algorithm>
struct P{
long long A;
long long B;
};
bool operator< (const P&a, const P&b){
return a.A < b.A;
}
long long main(){
    const long long N = 100100;
     P p[N];
     long long n;
     long long m;
     std::cin >> n >> m;
     long long i = 0;
     for( ;i < n; i++ ){
        std::cin >> p[i].A;
        std::cin >> p[i].B;
     }
     std::sort (&p[0],&p[n]);
     long long cost = 0;
     for(i = 0; i < n; i++){
        if(m >= p[i].B){
            cost += p[i].A * p[i].B;
            m -= p[i].B;
        }
        else{
            cost += m * p[i].A;
            break;
        }

     }
     std::cout << cost;
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <vector>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double

int main() {

  cout << fixed << setprecision(16);

  ll N, M;
  cin >> N >> M;

  vector<pair<ll, ll>> a(N);

  for (ll i = 0; i < N; i++) {
    cin >> a[i].first >> a[i].second;
  }

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

  ll i = 0;
  ll ans = 0;
  while(i < M) {
    for (ll j = 0; j < N; j++) {
      if (i + a[j].second > M) {
        ans += a[j].first * (M - i);
        i = M;
      } else {
        ans += a[j].first * a[j].second;
        i += a[j].second;
      }
    }
  }

  cout << ans << endl;

  return 0;

}

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

#include <iostream>
#include <algorithm>
typedef struct {
	long long yen, stock;
}Store;
bool cmp(Store a, Store b) {
	return a.yen < b.yen;
}
int main()
{
	long long N, M, L, ans = 0;;
	Store s[100000];
	std::cin >> N >> M;
	for (int i = 0; i < N; i++)
		std::cin >> s[i].yen >> s[i].stock;
	std::sort(s, s + N, cmp);
	L = M;
	for (int i = 0; i < N; i++) {
		if (L <= s[i].stock) {
			ans += L * s[i].yen;
			break;
		}
		else {
			L -= s[i].stock;
			ans += s[i].stock * s[i].yen;
		}
	}
	std::cout << ans << "\n";
}

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