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

import java.util.Scanner; 
class Main { public static void main(String[] args{ 
Scanner sc = new Scanner(System.in); 
int n=sc.nextInt(); int m=sc.nextInt(); 
int a[] = new int[n]; int b[]=new int[n]; 
for(int i=0; i<n; i++){ 
a[i]=sc.nextInt(); b[i]=sc.nextInt(); } 
for(int i=0; i<n; i++){ 
for(int j=i+1; j<n; j++){ 
if(a[i]>a[j]){ 
int dummy=a[i]; a[i]=a[j]; a[j]=dummy; 
dummy=b[i]; b[i]=b[j]; b[j]=dummy; }}} 
long sum =0; 
for(int i=0; i<m; i++){ 
m=m-b[i]; 
if (m>=0) sum=sum+a[i]*b[i]; 
else { sum=sum+a[i]*(m+b[i]); break; }} System.out.println(sum); }}


Compiler output:
Main.java:2: error: ',', ')', or '[' expected
class Main { public static void main(String[] args{ 
                                                  ^
1 error
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
ll n,m; cin>>n>>m;
  vector<pair<ll, ll>> vec;
  rep(i, n){
    ll a,b;
    cin>>a>>b;
    vec[i].first=a;
    vec[i].second=b;
  }
  
  sort(ALL(vec));
  
  ll money=0;
  ll count=0;
  for(int i=0,i<n;i++){
    bool fin=false;
    if(count+vec[i].second>=m){
      for(int j=0;j<vec[i].second;j++){
        money+=vec[i].first;
        count++;
        if(count==m){fin=true;
                     break;}
      }
    }
    if(fin) break;
    money+=vec[i].first*vec[i].second;
    count+=vec[i].second;
  }
    
  cout<<money<<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected ';' before '<' token
   21 |   for(int i=0,i<n;i++){
      |                ^
      |                ;
a.cc:21:16: error: expected primary-expression before '<' token
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
ll n,m; cin>>n>>m;
  vector<pair<ll, ll>> vec;
  rep(i, n){
    ll a,b;
    cin>>a>>b;
    vec[i].first=a;
    vec[i].second=b;
  }
  
  sort(ALL(vec));
  
  ll money=0;
  ll count=0;
  for(int i,i<n;i++){
    bool fin=false;
    if(count+vec[i].second>=m){
      for(int j=0;j<vec[i].second;j++){
        money+=vec[i].first;
        count++;
        if(count==m){fin=true;
                     break;}
      }
    }
    if(fin) break;
    money+=vec[i].first*vec[i].second;
    count+=vec[i].second;
  }
    
  cout<<money<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:14: error: expected ';' before '<' token
   21 |   for(int i,i<n;i++){
      |              ^
      |              ;
a.cc:21:14: error: expected primary-expression before '<' token
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long m = sc.nextLong();
    HashMap<Long, Long> map = new HashMap<Long, Long>();
    long[] a = new long[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextLong();
      long b = sc.nextLong();
      if(map.containsKey(a[i])) {
        map.put(a[i], map.get(a[i]) + b);
      } else {
        map.put(a[i], b);
      }
    }
    Arrays.sort(a);
    long ans = 0;
    for(int i = 0; i < n; i++) {
      long kosuu = map.get(a[i]);
      if(m > kosuu) {
        ans += (a[i] * kosuu);
        m -= kosuu;
        map.put(a[i], (long)0);
      } else {
        ans += (a[i] * m);
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
    long[] a = new long[n];
                        ^
1 error
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long n = sc.nextLong();
    long m = sc.nextLong();
    HashMap<Long, Long> map = new HashMap<Long, Long>();
    long[] a = new long[n];
    for(int i = 0; i < n; i++) {
      a[i] = sc.nextLong();
      long b = sc.nextLong();
      if(map.containsKey(a[i])) {
        map.put(a[i], map.get(a[i]) + b);
      } else {
        map.put(a[i], b);
      }
    }
    Arrays.sort(a);
    long ans = 0;
    for(int i = 0; i < n; i++) {
      long kosuu = map.get(a[i]);
      if(m > kosuu) {
        ans += (a[i] * kosuu);
        m -= kosuu;
        map.put(a[i], 0);
      } else {
        ans += (a[i] * m);
        break;
      }
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:9: error: incompatible types: possible lossy conversion from long to int
    long[] a = new long[n];
                        ^
Main.java:26: error: incompatible types: int cannot be converted to Long
        map.put(a[i], 0);
                      ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N, M;
  cin >> N >> M;
  int price=0;
  int drink=0;
  int min;
    //minにはAを小さい順に並べその整数iを順番に格納する（格納されるのは店ナンバー）
  vector <int> A(N+1);
  vector <int> B(N+1);
  
  for (int i=1; i<=N; i++)
  {
    cin >> A.at(i) >> B.at(i);
  }
  while (drink != M)
  {
    min=0;
    for (int i=1; i<=N; i++)
    {
      if (B.at(i)==0)
      {
        continue;
      }
      else 
      {
        if (min==0)
        {
          min=i;
        }
        if (min!=0 && A.at(min)>A.at(i))
        {
          min=i;
        }
      }
        
    } 
      
    drink += B.at(min);
    price += A.at(min)*B.at(min);
    if (drink >M)
    {
      price -= A.at(min)*(drink-M)
      drink=M;
    }
      B.at(min)=0;
  }
  cout << price << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:35: error: expected ';' before 'drink'
   45 |       price -= A.at(min)*(drink-M)
      |                                   ^
      |                                   ;
   46 |       drink=M;
      |       ~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N, M;
  cin >> N >> M;
  int price=0;
  int drink=0;
  int min;
    //minにはAを小さい順に並べその整数iを順番に格納する（格納されるのは店ナンバー）
  vector <int> A(N+1);
  vector <int> B(N+1);
  
  for (int i=1; i=<N; i++)
  {
    cin >> A.at(i) >> B.at(i);
  }
  while (drink != 12)
  {
    min=0;
    for (int i=1; i=<N; i++)
    {
      if (min==0 && B.at(i)!=0)
      {
        min=i;
      }
      if (min!=0)
      {
        if (A.at(min)>A.at(i))
        {
          if (B.at(i)==0)
          {
            min=i;
          }
        }
      }
    }
  B.at(min)--;
  drink++;
  price += A.at(min);
  }
  cout << price << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: expected primary-expression before '<' token
   14 |   for (int i=1; i=<N; i++)
      |                   ^
a.cc:21:21: error: expected primary-expression before '<' token
   21 |     for (int i=1; i=<N; i++)
      |                     ^
Language: C++

////////////////////////////////////////////////////////////////////
// This source code is for Visual C++ 2010 Express
////////////////////////////////////////////////////////////////////
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <stack>
#include <functional>
#include <iomanip>
#include <string>
#include <cstring>
#include <deque>
#include <math.h>
#include "UnionFind.h"

#define	numberof(a)	(sizeof(a) / sizeof(a[0]))
#define	INF		(1000000)
#define Rep(i,n) for(int i = 0; i < (n); i++ )

using namespace std;

typedef vector< vector<int> > mat;
typedef pair<int, int> P;
typedef long long ll;
struct Point{
	ll x;
	ll y;
	Point() {};
	Point( ll xx, ll yy ) : x(xx), y(yy) {};
};

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main()
{
	ll M = 0;
	ll N = 0;
	ll ret = 0;
	cin >> N >> M;

	vector< pair<ll, ll> > AB(N);
	Rep(i, N){
		cin >> AB[i].first >> AB[i].second;
	}
	sort(AB.begin(), AB.end());

	ll buy = 0;
	ll cnt = 0;
	Rep(i, N){
		buy = min(AB[i].second, M - cnt);
		ret += buy * AB[i].first;
		cnt += buy;
		if( cnt >= M ) break;
	}

	cout << ret << endl;

	return 0;
}





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

using namespace std;

class PandC{
public:
    long p;
    long c;
};

int main(){
    long N, M;
    cin >> N >> M;
    PandC pc_list[N];
    for(int i = 0; i < N; i++){
        cin >> pc_list[i].p >> pc_list[i].c;
    }
    
    long answer = 0;
    
    sort(pc_list, pc_list + N,
         [](const PandC& x, const PandC& y) { return x.p < y.p;});
    
    int count = 0;
    for(int i = 0; i < N; i++){
        long M_remain = M - count;
        if(M_remain > pc_list[i].c){
            answer += pc_list[i].p * pc_list[i].c;
            count += pc_list[i].c;
        }else{
            answer += pc_list[i].p * M_remain;
            break;
        }
    }
    cout << answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> N >> M;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |     sort(pc_list, pc_list + N,
      |     ^~~~
      |     short
a.cc:33:5: error: 'cout' was not declared in this scope
   33 |     cout << answer;
      |     ^~~~
a.cc:33:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

int main()
{
    int N, M;

    std::cin >> N >> M;

    // std::vector<int> A(N), B(N);
    std::vector<std::pair<int, int> > A(N);

    for (int i = 0; i < N; ++i) {
        std::cin >> A.at(i).first >> A.at(i).second;
    }

    std::sort(A.begin(), A.end());

    int store = 0;
    long price = 0;
    for (int i = 0; i < M; ++i) {
        price += A.at(store).first;
        --A.at(store).second;
        if (A.at(store).second == 0) {
            ++store;
        }
    }

    std::cout << price << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   18 |     std::sort(A.begin(), A.end());
      |          ^~~~
      |          qsort
Language: C++

#include <iostream>
using namespace std;

int64_t main(){
	int64_t buf_a[110000];	//nedan
	int64_t buf_b[110000];	//honsu

	int64_t n, m;
	cin >> n >> m;

	for(int64_t i = 0; i < n; ++i){
		cin >> buf_a[i] >> buf_b[i];
	}

	for(int i = 0; i < n-1; ++i){
		for(int j = 0; j < n-1; ++j){
			int64_t tmp_left = buf_a[j];
			int64_t tmp_right = buf_a[j+1];

			if(buf_a[j] > buf_a[j+1]){
				int64_t tmp_a = buf_a[j];
				buf_a[j] = buf_a[j+1];
				buf_a[j+1] = tmp_a;

				int64_t tmp_b = buf_b[j];
				buf_b[j] = buf_b[j+1];
				buf_b[j+1] = tmp_b;
			}
		}
	}

	int64_t sum = 0;
	int64_t value = 0;

	for(int i = 0; i < n; ++i){
		int64_t tmp_sum = sum + buf_b[i];
		if(tmp_sum >= m){
			value += (m - sum) * buf_a[i];
			break;
		}else{
			sum += buf_b[i];
			value += buf_a[i] * buf_b[i];
		}

	}

	cout << value << endl;

	return 0;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | int64_t main(){
      | ^~~~~~~
Language: C++

#include <iostream>
using namespace std;

int64_t main(){
	int64_t buf_a[110000];	//nedan
	int64_t buf_b[110000];	//honsu

	int64_t n, m;
	cin >> n >> m;

	for(int64_t i = 0; i < n; ++i){
		cin >> buf_a[i] >> buf_b[i];
	}

	for(int i = 0; i < n-1; ++i){
		for(int j = 0; j < n-1; ++j){
			int64_t tmp_left = buf_a[j];
			int64_t tmp_right = buf_a[j+1];

			if(buf_a[j] > buf_a[j+1]){
				int64_t tmp_a = buf_a[j];
				buf_a[j] = buf_a[j+1];
				buf_a[j+1] = tmp_a;

				int64_t tmp_b = buf_b[j];
				buf_b[j] = buf_b[j+1];
				buf_b[j+1] = tmp_b;
			}
		}
	}

	int64_t sum = 0;
	int64_t value = 0;

	for(int i = 0; i < n; ++i){
		int64_t tmp_sum = sum + buf_b[i];
		if(tmp_sum >= m){
			value += (m - sum) * buf_a[i];
			break;
		}else{
			sum += buf_b[i];
			value += buf_a[i] * buf_b[i];
		}

	}

	cout << value << endl;
}

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | int64_t main(){
      | ^~~~~~~
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
using ll = long long;

int main(){
    ll n,m,b,sum=0;
    cin >> n >> m;
    vector<ll> a(n);
    map<ll,ll> mp;
    for(ll i=0;i<n;i++){
         cin >> a[i] >> b;
         if(mp[a[i]>0]) mp[a[i]]+=b;
         else mp[a[i]]=b;
    }
    sort(a.begin(),a.end());
    for(int i=0;i<a.size()-1;i++){
        if(a[i]==a[i+1])    a.erase(i+1);
    }
    ll t=0;
    for(ll i=0;i<m;i++){
        if(mp[a[t]]!=0){
                mp[a[t]]--;
                sum+=a[t];
        }
        else{
            t++;
            mp[a[t]]--;
            sum+=a[t];
        }
    }
    
    cout << sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:36: error: no matching function for call to 'std::vector<long long int>::erase(int)'
   21 |         if(a[i]==a[i+1])    a.erase(i+1);
      |                             ~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = long long int; _Alloc = std::allocator<long long int>; iterator = std::vector<long long int>::iterator; const_iterator = std::vector<long long int>::const_iterator]'
 1536 |       erase(const_iterator __position)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note:   no known conversion for argument 1 from 'int' to 'std::vector<long long int>::const_iterator'
 1536 |       erase(const_iterator __position)
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = long long int; _Alloc = std::allocator<long long int>; iterator = std::vector<long long int>::iterator; const_iterator = std::vector<long long int>::const_iterator]'
 1564 |       erase(const_iterator __first, const_iterator __last)
      |       ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include <iostream>
#include <utility>
using namespace std;
#define ll long long

int main () {
  ll n, m;
  cin >> n >> m;
  pair<ll, ll> box[n];
  for (ll i = 0; i < n; i++) {
    ll s, ss;
    cin >> s >> ss;
    box[i] = make_pair(s, ss);    
  }  
  sort(box, box + n);
  ll ans = 0;
  ll num = 0;
  for (ll i = 0; i < n; i++) {
    num += box[i].second;
    ans += box[i].second * box[i].first;
    if (num >= m) {
      ans -= box[i].first * (num - m);
      cout << ans << endl;
      return 0;    
    }    
  }
}

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

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

int main() {
	int N, M;
	cin >> N >> M;
	vector<int> A(N), B(N);
	int i,j;
	for (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_number = min(M, AB[i].second);
		ans += buy_number * AB[i].first
		M -= buy_number;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:48: error: expected ';' before 'M'
   26 |                 ans += buy_number * AB[i].first
      |                                                ^
      |                                                ;
   27 |                 M -= buy_number;
      |                 ~
Language: C++


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

#define int long long

using namespace std;

int32_t main () {
    
    int N, M;
    
    int ans = 0;
    
    cin >> N >> M;
    
    pair <int, int> store[N];
    
    for (int i=0; i<N; i++) {
        int x, y;
        cin >> x >> y;
        store[i].first = x;
        store[i].second = y;
    }
    
    sort(store, store+sizeof(store)/sizeof(store[0]));
    
    int x = 0;
    
    while (M-->0) {
        if (store[x].second>0) {
            store[x].second--;
            ans+=store[x].first;
        } else {
            x++;
            M++;
        }
    }
    
    cout << ans;
    
    return 0;
    
}


using namespace std;

int main () {
    
    int N, M;
    
    int ans = 0;
    
    cin >> N >> M;
    
    pair <int, int> store[N];
    
    for (int i=0; i<N; i++) {
        int x, y;
        cin >> x >> y;
        store[i].first = x;
        store[i].second = y;
    }
    
    sort(store, store+sizeof(store)/sizeof(store[0]));
    
    int x = 0;
    
    while (M-->0) {
        if (store[x].second>0) {
            store[x].second--;
            ans+=store[x].first;
        } else {
            x++;
            M++;
        }
    }
    
    cout << ans;
    
    return 0;
    
}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main () {
      |     ^~~~
a.cc:10:9: note: 'int32_t main()' previously defined here
   10 | int32_t main () {
      |         ^~~~
Language: C++


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

#define int long long

using namespace std;

int main () {
    
    int N, M;
    
    int ans = 0;
    
    cin >> N >> M;
    
    pair <int, int> store[N];
    
    for (int i=0; i<N; i++) {
        int x, y;
        cin >> x >> y;
        store[i].first = x;
        store[i].second = y;
    }
    
    sort(store, store+sizeof(store)/sizeof(store[0]));
    
    int x = 0;
    
    while (M-->0) {
        if (store[x].second>0) {
            store[x].second--;
            ans+=store[x].first;
        } else {
            x++;
            M++;
        }
    }
    
    cout << ans;
    
    return 0;
    
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: Java

import java.util.*;

public class Main {

	public static Drink [] drinks;
	
	public class Drink implements Comparable<Drink>{
		int cost;
		int drinks;
		double cperd;
		
		public Drink(){
			
		}
		
		public Drink(int cost_, int drinks_){
			 cost = cost_;
			 drinks = drinks_;
		 }

		@Override
		public int compareTo(Drink o) {
			// TODO Auto-generated method stub
			return (int)(this.cost - o.cost);
		}
		
	}
	
	
	
	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();
		
		PriorityQueue <Drink> q = new PriorityQueue<Drink>();
		for(int i = 0 ;i<N; i++) {
		
			q.add(new Drink(sc.nextInt(),sc.nextInt()));
			
		}
		
		
	}

}

Compiler output:
Main.java:41: error: non-static variable this cannot be referenced from a static context
			q.add(new Drink(sc.nextInt(),sc.nextInt()));
			      ^
1 error
Language: C++


#include <iostream>
#include <utility>
#include <string>
using namespace std;

int main () {
    
    int N, M;
    
    int ans = 0;
    
    cin >> N >> M;
    
    pair <int, int> store[N];
    
    for (int i=0; i<N; i++) {
        int x, y;
        cin >> x >> y;
        store[i].first = x;
        store[i].second = y;
    }
    
    sort(store, store+sizeof(store)/sizeof(store[0]));
    
    int x = 0;
    
    while (M-->0) {
        if (store[x].second>0) {
            store[x].second--;
            ans+=store[x].first;
        } else {
            x++;
            M++;
        }
    }
    
    cout << ans;
    
    return 0;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort(store, store+sizeof(store)/sizeof(store[0]));
      |     ^~~~
      |     short
Language: C

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

#define TLong long long

typedef struct {
	TLong a;	// price
	TLong b;	// limit
} store;

int comp(const void *p,const void *q){
    return ((store *)p).a - ((store*)q).a;
}

int main(int argc, char const *argv[])
{
	TLong n,m;
	TLong t_price = 0;
	TLong temp;
	store st[100000];
	scanf("%lld%lld",&n,&m);
	for (TLong i = 0; i < n; ++i)	scanf(" %lld%lld", &st[i].a, &st[i].b);

	qsort(st,n,sizeof(store),comp);
	for (int i = 0; (i < n && m > 0); ++i)
	{
		temp = (st[i].b <= m) ? st[i].b : m;
		t_price += st[i].a * temp;
		m -= temp;
	}
	printf("%lld\n",t_price);
	return 0;
}


Compiler output:
main.c: In function 'comp':
main.c:15:24: error: '(store *)p' is a pointer; did you mean to use '->'?
   15 |     return ((store *)p).a - ((store*)q).a;
      |                        ^
      |                        ->
main.c:15:40: error: '(store *)q' is a pointer; did you mean to use '->'?
   15 |     return ((store *)p).a - ((store*)q).a;
      |                                        ^
      |                                        ->
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(void){
    int N,M;
    int *A, *B;
    int i,j;

    A = (int*)malloc(sizeof(int)*N);
    B = (int*)malloc(sizeof(int)*N);

    scanf("%d %d",&N, %M);

    for(i=0;i<N;i++){
        scanf("%d %d",&A[i],&B[i]);
    }

    int cur = 0;
    int min = 1000000000, cost = 0, ic;

    while(cur =< M){
        for(i=0;i<N;i++){
            if(A[i]<min && B[i]>0){
                min = A[i];
                ic = i;
            }
        }
        if(M > cur+B[ic]){
            cur += B[ic];
            cost += A[ic] * B[ic]; 
            B[ic] = 0;
        }else{
            cur += B[ic] - (M - cur);
            cost += A[ic] * (B[ic]-(M - cur));
        }
    }

    printf("%d",cost);

    return 0;

}

Compiler output:
main.c: In function 'main':
main.c:11:23: error: expected expression before '%' token
   11 |     scanf("%d %d",&N, %M);
      |                       ^
main.c:20:16: error: expected expression before '<' token
   20 |     while(cur =< M){
      |                ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  vector<pair<long long, long long>>ju();
  for (int i = 0; i < N; i ++) {
    int A, B;
    cin >> A >> B;
    ju.push_back(make_pair(A, B));
  }
  sort(ju.begin(), ju.end());
  long long ans = 0;
  int i = 0;
  long long co = 0;
  while(co < M) {
    co += ju[i].second;
    ans += ju[i].first * ju[i].second;
    i ++;
  }
  ans -= (co - M) * ju[--i].first;
  cout << ans << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:39: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
    7 |   vector<pair<long long, long long>>ju();
      |                                       ^~
a.cc:11:8: error: request for member 'push_back' in 'ju', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   11 |     ju.push_back(make_pair(A, B));
      |        ^~~~~~~~~
a.cc:13:11: error: request for member 'begin' in 'ju', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   13 |   sort(ju.begin(), ju.end());
      |           ^~~~~
a.cc:13:23: error: request for member 'end' in 'ju', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   13 |   sort(ju.begin(), ju.end());
      |                       ^~~
a.cc:13:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |   sort(ju.begin(), ju.end());
      |   ^~~~
      |   short
a.cc:18:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |     co += ju[i].second;
      |               ^
a.cc:18:17: error: request for member 'second' in '*(ju + ((sizetype)i))', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   18 |     co += ju[i].second;
      |                 ^~~~~~
a.cc:19:16: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |     ans += ju[i].first * ju[i].second;
      |                ^
a.cc:19:18: error: request for member 'first' in '*(ju + ((sizetype)i))', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   19 |     ans += ju[i].first * ju[i].second;
      |                  ^~~~~
a.cc:19:30: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |     ans += ju[i].first * ju[i].second;
      |                              ^
a.cc:19:32: error: request for member 'second' in '*(ju + ((sizetype)i))', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   19 |     ans += ju[i].first * ju[i].second;
      |                                ^~~~~~
a.cc:22:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   22 |   ans -= (co - M) * ju[--i].first;
      |                           ^
a.cc:22:29: error: request for member 'first' in '*(ju, (ju + ((sizetype)(-- i))))', which is of non-class type 'std::vector<std::pair<long long int, long long int> >()'
   22 |   ans -= (co - M) * ju[--i].first;
      |                             ^~~~~
Language: C++

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

int main() {

  long M;
  long N;
  cin >> N >> M;

  int i, j;
  vector <long> A(N), B(N);
  for(i=0;i<N;i++){
    cin >> A.at(i) >> B.at(i);
  }

  long hon = M;
  long cost = A.at(0);
  long total = 0;

  while(hon > 0 ){

    for(i=0;i<N;i++){
      if(cost >= A.at(i)){
        cost = A.at(i);
      }
    }
    //cout << cost << endl;
    int k;
    for(k=0;k<N;k++){
      if(A.at(k) == cost ){
        if((hon-B.at(k))<=0){
          total += A.at(k)*hon;
          hon = 0; 
          break;
        }
        else{
          total += A.at(k)*B.at(k);
          A.at(k) = 10^9 * A.at(k);
          hon -= B.at(k);
          cost = A.at(k); 
        }
      }
    }
  }

  cout << total << endl;
  return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N >> M;
      |   ^~~
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector <long> A(N), B(N);
      |   ^~~~~~
a.cc:11:11: error: expected primary-expression before 'long'
   11 |   vector <long> A(N), B(N);
      |           ^~~~
a.cc:13:12: error: 'A' was not declared in this scope
   13 |     cin >> A.at(i) >> B.at(i);
      |            ^
a.cc:13:23: error: 'B' was not declared in this scope
   13 |     cin >> A.at(i) >> B.at(i);
      |                       ^
a.cc:17:15: error: 'A' was not declared in this scope
   17 |   long cost = A.at(0);
      |               ^
a.cc:31:17: error: 'B' was not declared in this scope
   31 |         if((hon-B.at(k))<=0){
      |                 ^
a.cc:46:3: error: 'cout' was not declared in this scope; did you mean 'cost'?
   46 |   cout << total << endl;
      |   ^~~~
      |   cost
a.cc:46:20: error: 'endl' was not declared in this scope
   46 |   cout << total << endl;
      |                    ^~~~
Language: C++

#include <iostream>
#include <algorithm> 
#include <vector>
#include <string>
#include <cstdio>

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;i<n;i++){
  	int buy = min(m,AB[i].second)
    ans = buy*AB[i].first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:5: error: expected ',' or ';' before 'ans'
   30 |     ans = buy*AB[i].first;
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm> 
#include <vector>
#include <string>
#include <cstdio>

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;i<n;i++){
  	int buy = min(m,AB.second)
    ans = buy*AB.first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: expected ';' before 'long'
   24 |   sort(AB.begin(),AB.end())
      |                            ^
      |                            ;
   25 | 
   26 |   long long ans = 0;
      |   ~~~~                      
a.cc:29:28: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
   29 |         int buy = min(m,AB.second)
      |                            ^~~~~~
a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <iostream>
#include <algorithm> 
#include <vector>
#include <string>
#include <cstdio>

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<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.second)
    ans = buy*AB.first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:19:23:   required from here
   19 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
a.cc:19:23:   required from here
   19 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:21:7: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   21 |     AB[i]=make_pair(A[i],B[i]);
      |       ^
a.cc:24:11: error: 'class std::vector<int, int>' has no member named 'begin'
   24 |   sort(AB.begin(),AB.end())
      |           ^~~~~
a.cc:24:22: error: 'class std::vector<int, int>' has no member named 'end'
   24 |   sort(AB.begin(),AB.end())
      |                      ^~~
a.cc:29:28: error: 'class std::vector<int, int>' has no member named 'second'
   29 |         int buy = min(m,AB.second)
      |                            ^~~~~~
a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <iostream>
#include <algorithm> 
#include <vector>
#include <string>
#inlcude <cstdio>

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<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.second)
    ans = buy*AB.first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
a.cc:5:2: error: invalid preprocessing directive #inlcude; did you mean #include?
    5 | #inlcude <cstdio>
      |  ^~~~~~~
      |  include
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:19:23:   required from here
   19 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
a.cc:19:23:   required from here
   19 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:21:7: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   21 |     AB[i]=make_pair(A[i],B[i]);
      |       ^
a.cc:24:11: error: 'class std::vector<int, int>' has no member named 'begin'
   24 |   sort(AB.begin(),AB.end())
      |           ^~~~~
a.cc:24:22: error: 'class std::vector<int, int>' has no member named 'end'
   24 |   sort(AB.begin(),AB.end())
      |                      ^~~
a.cc:29:28: error: 'class std::vector<int, int>' has no member named 'second'
   29 |         int buy = min(m,AB.second)
      |                            ^~~~~~
a.cc:33:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <bits/stdc++.h>
#include <vector>

using namespace std;

int main(){
  int m,n;
  cin >> m >> n;
  
  vector<int> A(n),B(n);
  
  for(int  i = 0;i < n; i++){
    cin >> A[i] >> B[i];
  }
  
  vector<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.second)
    ans = buy*AB.first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:16:23:   required from here
   16 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
a.cc:16:23:   required from here
   16 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:18:7: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   18 |     AB[i]=make_pair(A[i],B[i]);
      |       ^
a.cc:21:11: error: 'class std::vector<int, int>' has no member named 'begin'
   21 |   sort(AB.begin(),AB.end())
      |           ^~~~~
a.cc:21:22: error: 'class std::vector<int, int>' has no member named 'end'
   21 |   sort(AB.begin(),AB.end())
      |                      ^~~
a.cc:26:28: error: 'class std::vector<int, int>' has no member named 'second'
   26 |         int buy = min(m,AB.second)
      |                            ^~~~~~
a.cc:30:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   30 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

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

int main(){
  int m,n;
  cin >> m >> n;
  
  vector<int> A(n),B(n);
  
  for(int  i = 0;i < n; i++){
    cin >> A[i] >> B[i];
  }
  
  vector<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.second)
    ans = buy*AB.first;
    m-=buy;
  }
	cout << ans;
  
  return 0;
}

Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<int, int>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:14:23:   required from here
   14 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>':
a.cc:14:23:   required from here
   14 |   vector<int,int> AB(n);
      |                       ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:7: error: no match for 'operator[]' (operand types are 'std::vector<int, int>' and 'int')
   16 |     AB[i]=make_pair(A[i],B[i]);
      |       ^
a.cc:19:11: error: 'class std::vector<int, int>' has no member named 'begin'
   19 |   sort(AB.begin(),AB.end())
      |           ^~~~~
a.cc:19:22: error: 'class std::vector<int, int>' has no member named 'end'
   19 |   sort(AB.begin(),AB.end())
      |                      ^~~
a.cc:24:28: error: 'class std::vector<int, int>' has no member named 'second'
   24 |         int buy = min(m,AB.second)
      |                            ^~~~~~
a.cc:28:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    ll n,m,sum=0;
    cin >> n >> m;
    vector<p> p(n);
    rep(i,n){
        ll a,b;
        cin >> a >>b;
        p[i] = make_pair(a,b);
    }
    sort(all(p));
    rep(i,n){
        sum += min(m,p[i].second)*p[i].first;
        m -= min(m,p[i].second);
        if(m == 0){
            cout << sum << endl;
            return 0;
        }
    }
    return 0;
}

Compiler output:
a.cc:9:19: error: extended character 　 is not valid in an identifier
    9 | #define REP(i,s,n)　for(int i=(s);i<(n);i++)
      |                   ^
a.cc:20:16: error: extended character 　 is not valid in an identifier
   20 | #define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
      |                ^
a.cc: In function 'int main()':
a.cc:59:12: error: 'p' was not declared in this scope
   59 |     vector<p> p(n);
      |            ^
a.cc:59:13: error: template argument 1 is invalid
   59 |     vector<p> p(n);
      |             ^
a.cc:59:13: error: template argument 2 is invalid
Language: C++

#include <bits/stdc++.h>
#define ll long long 
using namespace std;
int main()
{
	static unsigned pair<int,int> a[100000];
	static unsigned ll N,M;
	static unsigned ll c,d;
	static unsigned ll ans=0;

	cin>>N>>M;
	for(ll i=0;i<N;i++){
		cin>>c>>d;
		a[i]=make_pair(c,d);
	}
	
	sort(a,a+N);

	ll i=0;

	while(M){
		if(a[i].second>=M){
			ans+=a[i].first*M;
			M=0;
		}else{
			ans+=a[i].first*a[i].second;
			M-=a[i].second;
		}
		//cout<<"残り本数"<<M<<endl;
		i++;
	}

	cout<<ans<<endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:39: error: invalid declarator before 'a'
    6 |         static unsigned pair<int,int> a[100000];
      |                                       ^
a.cc:14:17: error: 'a' was not declared in this scope
   14 |                 a[i]=make_pair(c,d);
      |                 ^
a.cc:17:14: error: 'a' was not declared in this scope
   17 |         sort(a,a+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();
        long M = sc.nextLong();
        long count_opt =0;
        long price_opt =0;
        ArrayList<Drink> List = new ArrayList<>();
        for(int a=0;a<N;a++){
            long price = sc.nextLong();
            long count = sc.nextLong();
            Drink d = new Drink(price,count);
            List.add(d);
        }
        Comparator<Drink> comparator = new Comparator<Drink>() {
            @Override
            public int compare(Drink o1, Drink o2) {
                return o1.price<o2.price ? -1:1;
            }
        };

        Collections.sort(List,comparator);
        for(Drink d:List){
            if(count_opt+d.count>=M){
                price_opt += (M-count_opt)*d.price;
                break;
            }
            count_opt+=d.count;
            price_opt+=d.count*d.price;
        }
        System.out.println(price_opt);
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        ArrayList<Drink> List = new ArrayList<>();
                  ^
  symbol:   class Drink
  location: class Main
Main.java:13: error: cannot find symbol
            Drink d = new Drink(price,count);
            ^
  symbol:   class Drink
  location: class Main
Main.java:13: error: cannot find symbol
            Drink d = new Drink(price,count);
                          ^
  symbol:   class Drink
  location: class Main
Main.java:16: error: cannot find symbol
        Comparator<Drink> comparator = new Comparator<Drink>() {
                   ^
  symbol:   class Drink
  location: class Main
Main.java:16: error: cannot find symbol
        Comparator<Drink> comparator = new Comparator<Drink>() {
                                                      ^
  symbol:   class Drink
  location: class Main
Main.java:18: error: cannot find symbol
            public int compare(Drink o1, Drink o2) {
                               ^
  symbol: class Drink
Main.java:18: error: cannot find symbol
            public int compare(Drink o1, Drink o2) {
                                         ^
  symbol: class Drink
Main.java:24: error: cannot find symbol
        for(Drink d:List){
            ^
  symbol:   class Drink
  location: class Main
8 errors