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

#include <bits/stdc++.h>
using namespace std;
#include <iostream>
/*cout <<"Debug"
cout <<x-30<<' '<<y-30<<endl;*/
typedef pair<pair<int ,int>, int> P;
vector<pair<pair<int ,int>, int> > v_ans;
vector<int>v_;
vector<long int>v_ansl;
/*taro tenn,hanako_ten,sum*/

bool cmp(P h, P r){
  return h.second < r.second;
}
int v[101];
int main(){
  int N,M;
  float P;

  cin >>N>>M>>P;
  while(N!=0 and M!=0 and P!=0){
    long int NUMP = 0;
    int ans = 0;
    for(int i = 0;i < N ; i++){
      cin >>v[i];
      NUMP += v[i];
    }
    NUMP *= (100-P);
    if(v[M-1] == 0){
      ans = 0;
      cout <<(int)ans<<endl;
    }
    else{
    cout <<NUMP/v[M-1]<<endl;
  }
    cin >>N>>M>>P;
    v.clear();
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:37:7: error: request for member 'clear' in 'v', which is of non-class type 'int [101]'
   37 |     v.clear();
      |       ^~~~~
Language: C++

ansli=[]

while 1:
    a=input().split()
    if a[0]=="0" and a[1]=="0" and a[2]=="0":
        break
    for i in range(len(a)):
        a[i]=int(a[i])
    x=[]
    for i in range(a[0]):
        x.append(int(input()))

    sum0=0
    for i in x:
        sum0+=i
    sum=sum0*100*((100-a[2])/100)
    hit=x[a[1]-1]
    if hit==0:
        ansli.append(0)
    else:
        ansli.append(int(sum/hit))

for i in ansli:
    print(i)



Compiler output:
a.cc:1:1: error: 'ansli' does not name a type
    1 | ansli=[]
      | ^~~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int N, M, P;
	while( 1 ){
		//cout << "N M P" <<endl;
		cin >> N >> M >> P;
		int money = 0;
		vector<int> X(N);
		if( N == 0 && M == 0 && P == 0 ) break;
		for( int i = 0; i < N; i++ ){
			cin >> X[i];
			money += X[i];
		}
		if( X[M-1] == 0 ){
			cout << 0 << endl;
		}else{
			money *= (double)(100 - P) / (double)X[M-1];
			cout << (int)money << endl;
		}
		X.clear();
	}
}#include <iostream>
#include <vector>
using namespace std;
int main(){
	int N, M, P;
	while( 1 ){
		//cout << "N M P" <<endl;
		cin >> N >> M >> P;
		int money = 0;
		vector<int> X(N);
		if( N == 0 && M == 0 && P == 0 ) break;
		for( int i = 0; i < N; i++ ){
			cin >> X[i];
			money += X[i];
		}
		if( X[M-1] == 0 ){
			cout << 0 << endl;
		}else{
			money *= (double)(100 - P) / (double)X[M-1];
			cout << (int)money << endl;
		}
		X.clear();
	}
}

Compiler output:
a.cc:24:2: error: stray '#' in program
   24 | }#include <iostream>
      |  ^
a.cc:24:3: error: 'include' does not name a type
   24 | }#include <iostream>
      |   ^~~~~~~
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: Java

import java.util.Scanner;

public class Princess {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)){
            while(sc.hasNext()) {
                int N=sc.nextInt();
                int M=sc.nextInt();
                if(N+M==0)    break;
                int[] ds = new int[11];
                for(int i=0; i<N; i++) {
                    int d = sc.nextInt();
                    int p = sc.nextInt();
                    ds[p] += d;
                }
                int P = 0;
                for(int p= 10; p >=0; p--) {
                    if(M >= ds[p]) {
                        M -= ds[p];
                    }
                    else {
                        P += (ds[p] - M) * p;
                        M = 0;
                    }
                }
                System.out.println(P);
            }
        }
    }
}


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

import java.util.Scanner;

public class Princess {
public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)){
            while(sc.hasNext()) {
                int N=sc.nextInt();
                int M=sc.nextInt();
                if(N+M==0)    break;
                int[] ds = new int[11];
                for(int i=0; i<N; i++) {
                    int d = sc.nextInt();
                    int p = sc.nextInt();
                    ds[p] += d;
                }
                int P = 0;
                for(int p= 10; p >=0; p--) {
                    if(M >= ds[p]) {
                        M -= ds[p];
                    }
                    else {
                        P += (ds[p] - M) * p;
                        M = 0;
                    }
                }
                System.out.println(P);
            }
        }
    }
}


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

import java.util.Scanner;

public class Princess {
    public static void main(String[] args) {
        try(Scanner sc = new Scanner(System.in)){
            while(sc.hasNext()) {
                int N=sc.nextInt();
                int M=sc.nextInt();
                if(N+M==0)    break;
                int[] ds = new int[11];
                for(int i=0; i<N; i++) {
                    int d = sc.nextInt();  //距離
                    int p = sc.nextInt();  //単位距離あたりの期待値
                    ds[p] += d;            //各期待値を持つ距離が何単位分あるかカウント
                }
                int P = 0;                 //リスクの合計値
                for(int p= 10; p >=0; p--) {     //期待値の高い方から
                    if(M >= ds[p]) {
                        M -= ds[p];       //予算を消費
                    }
                    else {
                        P += (ds[p] - M) * p;  //予算が無くなった分だけ期待値を合計
                        M = 0;
                    }
                }
                System.out.println(P);
            }
        }
    }
}


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

import java.util.Arrays;
import java.util.Scanner;

//Princess's Marriage
public class Main{

	class P implements Comparable<P>{
		int d, p;
		public P(int d, int p) {
			this.d = d;
			this.p = p;
		}
		public int compareTo(P o) {
			return o.p-p;
		}
	}

	int n, m;
	P[] p;

	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			n = sc.nextInt();
			m = sc.nextInt();
			if((n|m)==0)break;
			p = new P[n];
			int s = 0;
			for(int i=0;i<n;i++){
				p[i]=new P(sc.nextInt(), sc.nextInt());
				s += p[i].d*p[i].p;
			}
			Arrays.sort(p);
			int r = 0;
			int i = 0;
			while(m>0 && i<n){
				int min = Math.min(m, p[i].d);
				r += min*p[i].p;
				i++;
				m-=min;
			}
			System.out.println(s-r);
		}
	}

	public static void main(String[] args) {
		new Main.run();
	}
}

Compiler output:
Main.java:47: error: cannot find symbol
		new Main.run();
		        ^
  symbol:   class run
  location: class Main
1 error
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (true) {
			int n = sc.nextInt();// æÔ
			int m = sc.nextInt();// PÌ¨©Ë
			if (n == 0 && m == 0) {
				break;
			}
			int c = 0;
			int dp[][] = new int[n][2];
			for (int i = 0; i < n; i++) {
				dp[i][0] = sc.nextInt();
				dp[i][1] = sc.nextInt();
			}
			for (int k = 10; k > 0 && m > 0; k--) {
				for (int i = 0; i < n && m > 0; i++) {
					if (dp[i][1] == k) {
						if (dp[i][0] <= m) {
							m -= dp[i][0];
							dp[i][0] = 0;
						} else {
							dp[i][0] -= m;
							m = 0;
							break;
						}
					}
				}
			}

			for (int i = 0; i < n; i++) {
				c += dp[i][0] * dp[i][1];
			}
			System.out.println(c);
		}
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

#include <stdio.h>

int n, m, i, d, p, r[11];

int main()
{
    while(true)
    {
        scanf("%d", &n);
        scanf("%d", &m);
        
        if(n == 0 && m == 0) { break; }
        
        for(i = 0; i < 11; i++)
        {
            r[i] = 0;
        }
        
        for(i = 0; i < n; i++)
        {
            scanf("%d", &d);
            scanf("%d", &p);
            
            r[p] += d;
        }
        
        for(i = 10; i >= 0; i--)
        {
            if(m >= r[i])
            {
                m -= r[i];
                
                r[i] = 0;
            }
            else
            {
                r[i] -= m;
                
                break;
            }
        }
        
        int sum = 0;
        
        for(i = 0; i <= 10; i++)
        {
            sum += i * r[i];
        }
        
        printf("%d\n", sum);
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:11: error: 'true' undeclared (first use in this function)
    7 |     while(true)
      |           ^~~~
main.c:2:1: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:7:11: note: each undeclared identifier is reported only once for each function it appears in
    7 |     while(true)
      |           ^~~~
Language: C++

#include<iostream>
#include<vector>
#define MAX 10000
using namespace std;
bool compare(int a,int b)
{
  return a>b;
}
int main()
{
    int N,M,P=0;
    //vector<int> d,p;
    while(cin>>N>>M&&N)
    {
    //d.resize(N);
    int d,p,sum=0;
    pair<int,int> pd[MAX];
    int i;
    for(i=0;i<N;i++)
    {
        cin>>d>>p;
        pd=make_pair(p,d);
    }
    sort(pd,pd+N,compare);
    for(i=0;i<N;i++)
    {
        if(sum+pd[i].second<=M)
         sum+=pd[i].second;
        else if(sum<M&&sum+pd[i].second>M)
        {
            P+=(sum-pd[i].second)*pd[i].first;
            sum=M+1;
        }
        else
            P+=pd[i].first*pd[i].second;
    }
    cout<<P<<endl;
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: incompatible types in assignment of 'std::pair<int, int>' to 'std::pair<int, int> [10000]'
   22 |         pd=make_pair(p,d);
      |         ~~^~~~~~~~~~~~~~~
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   24 |     sort(pd,pd+N,compare);
      |     ^~~~
      |     short
Language: C++

using namespace std;

int main(void)
{
	int N;
	long M;
	while(cin >> N >> M, N > 0){
		long D[MAX_P + 1];
		long result = 0;
		//配列Dを初期化
		rep(i, MAX_P + 1){
			D[i] = 0;
		}
		//配列Dを構成
		rep(i, N){
			int d, p;
			cin >> d >> p;
			D[p] += d;
		}
		rep(i, MAX_P + 1){
			if (M >= D[MAX_P - i]){
				M -= D[MAX_P - i];
			}else if(M > 0){
				result += (D[MAX_P - i]-M) * (MAX_P - i);
				M = 0;
			}else{
				result += D[MAX_P - i] * (MAX_P - i);
			}
		}
		cout << result << endl;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: 'cin' was not declared in this scope
    7 |         while(cin >> N >> M, N > 0){
      |               ^~~
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:8:24: error: 'MAX_P' was not declared in this scope
    8 |                 long D[MAX_P + 1];
      |                        ^~~~~
a.cc:11:21: error: 'i' was not declared in this scope
   11 |                 rep(i, MAX_P + 1){
      |                     ^
a.cc:11:17: error: 'rep' was not declared in this scope
   11 |                 rep(i, MAX_P + 1){
      |                 ^~~
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << result << endl;
      |                 ^~~~
a.cc:30:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:30:35: error: 'endl' was not declared in this scope
   30 |                 cout << result << endl;
      |                                   ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

bool cmp(pair<int, int> &x, pair<int, int> &y)
{
	return x.second > y.second;
}

int main(void)
{
	int n, m;
	while(cin >> n >> m, n > 0){
		int j = 0, ans = 0;
		vector<pair<int, int>> dp(n);
		rep(i, n){
			int d, p;
			cin >> d >> p;
			dp[i] = make_pair(d, p);
		}
		sort(dp.begin(), dp.end(), cmp);
		while(m > 0){
			if (dp[j].first > 0){
				dp[j].first--;
				m--;
			}else{
				j++;
				if (j == n) break;
			}
		}
		rep(i, n){
			ans += dp[i].first * dp[i].second;
		}
		cout << ans << endl;
	}
	return 0;
}


Compiler output:
a.cc:1:10: error: 'pair' was not declared in this scope
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |          ^~~~
a.cc:1:15: error: expected primary-expression before 'int'
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |               ^~~
a.cc:1:20: error: expected primary-expression before 'int'
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |                    ^~~
a.cc:1:29: error: 'pair' was not declared in this scope
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |                             ^~~~
a.cc:1:34: error: expected primary-expression before 'int'
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |                                  ^~~
a.cc:1:39: error: expected primary-expression before 'int'
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |                                       ^~~
a.cc:1:46: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | bool cmp(pair<int, int> &x, pair<int, int> &y)
      |                                              ^
a.cc: In function 'int main()':
a.cc:9:15: error: 'cin' was not declared in this scope
    9 |         while(cin >> n >> m, n > 0){
      |               ^~~
a.cc:11:17: error: 'vector' was not declared in this scope
   11 |                 vector<pair<int, int>> dp(n);
      |                 ^~~~~~
a.cc:11:24: error: 'pair' was not declared in this scope
   11 |                 vector<pair<int, int>> dp(n);
      |                        ^~~~
a.cc:11:29: error: expected primary-expression before 'int'
   11 |                 vector<pair<int, int>> dp(n);
      |                             ^~~
a.cc:12:21: error: 'i' was not declared in this scope
   12 |                 rep(i, n){
      |                     ^
a.cc:12:17: error: 'rep' was not declared in this scope
   12 |                 rep(i, n){
      |                 ^~~
a.cc:17:22: error: 'dp' was not declared in this scope
   17 |                 sort(dp.begin(), dp.end(), cmp);
      |                      ^~
a.cc:17:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |                 sort(dp.begin(), dp.end(), cmp);
      |                 ^~~~
      |                 short
a.cc:30:17: error: 'cout' was not declared in this scope
   30 |                 cout << ans << endl;
      |                 ^~~~
a.cc:30:32: error: 'endl' was not declared in this scope
   30 |                 cout << ans << endl;
      |                                ^~~~
Language: C++

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

void main() {
  int number_of_interval, money, expectation, distance[number_of_interval], probability[number_of_interval], index;
  while (cin >> number_of_interval >> money) {
    for (int i {}; i < number_of_interval; i++) {
      cin >> distance[i] >> probability[i];
    }
    sort(probability, probability + number_of_interval);
    expectation = 0;
    index = 0;
    for (; index < number_of_interval && money > 0; index++) {
      expectation += probability[index] * distance[index];
      money -= distance[index];
    }
    if (money > 0) {
      expactation += probability[index] * (distance[index] - money);
    }
    cout << expectation << endl;
  }
}



Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:7: error: 'expactation' was not declared in this scope; did you mean 'expectation'?
   19 |       expactation += probability[index] * (distance[index] - money);
      |       ^~~~~~~~~~~
      |       expectation
Language: C++

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

void main() {
  int number_of_interval, money, expectation;
  while (cin >> number_of_interval >> money) {
    int distance[number_of_interval], probability[number_of_interval], index;
    for (int i {}; i < number_of_interval; i++) {
      cin >> distance[i] >> probability[i];
    }
    sort(probability, probability + number_of_interval);
    expectation = 0;
    index = 0;
    for (; index < number_of_interval && money > 0; index++) {
      expectation += probability[index] * distance[index];
      money -= distance[index];
    }
    if (money > 0) {
      expactation += probability[index] * (distance[index] - money);
    }
    cout << expectation << endl;
  }
}



Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | void main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:20:7: error: 'expactation' was not declared in this scope; did you mean 'expectation'?
   20 |       expactation += probability[index] * (distance[index] - money);
      |       ^~~~~~~~~~~
      |       expectation
Language: C++

#include<iostream>
using namespace std;
struct P
{
	int d = 0;
	int p = 0;
};
int main()
{
	long N, M;
	while (cin >> N >> M && N != 0 && M != 0)
	{
		P dp[100000] = {};
		for (int i = 0; i < N; i++)
		{
			int d, p;
			cin >>d >> p;
			dp[i].d = d;
			dp[i].p = p;
		}

		for (int i = 0; i < N - 1; i++)
		{
			for (int j = i + 1; j < N; j++)
			{
				if (dp[i].p < dp[j].p)
				{
					int tp = dp[i].p;
					int td = dp[i].d;
					dp[i].p = dp[j].p;
					dp[i].d = dp[j].d;
					dp[j].p = tp;
					dp[j].d = td;
				}
			}
		}

		for (int i = 0; i < N; i++)
		{
			if (M <= 0)break;
			if (M >= dp[i].d)
			{
				M -= dp[i].d;
				dp[i].d = 0;
			}
			else
			{
				dp[i].d -= M;
				M = 0;
			}
		}
		int Psum = 0;
		for (int i = 0; i < N; i++)
		{
			cout << dp[i].d * dp[i].p  << endl;
			Psum += dp[i].d * dp[i].p;
		}

		cout << Psum << endl;



	}
	return 0;

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

// Princess's Marriage
#include <iostream>
#include <utility>
#include <algorithm>
using namespace std;
int N, M;
pair<int,int> PD[10010];
pair<int,int> PD2[10010];
int main() {
  while (cin >> N >> M && N) { 
    int d, p;
    for (int i=0; i<N; ++i) {
      cin >> d >> p;
      PD[i] = make_pair(p, d); 
      // PD[i].first ??????i?????±?????? p
      // PD[i].second ??????i?????????  d
    }
    sort(PD,PD+N); // PD ?????§??????????????´????????????
    for (int i=0;i<N; ++i)
      PD2[N-i-1] = PD[i];
    int S = 0;p
    for (int i=0; i<N; ++i)
      S += PD2[i].first * PD2[i].second;
    // ??????0?????????????????????,?????¨???S??????
    for (int i=0; i<N; ++i) {
      if (M <= 0) break;
      int guarded = min(M,PD2[i].second); // ????????????
      S -= PD2[i].first * guarded;
      M -= guarded;
    }
    cout << S << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:16: error: expected ';' before 'for'
   21 |     int S = 0;p
      |                ^
      |                ;
   22 |     for (int i=0; i<N; ++i)
      |     ~~~         
a.cc:22:19: error: 'i' was not declared in this scope
   22 |     for (int i=0; i<N; ++i)
      |                   ^
Language: C++

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

int n,m;

int kitaichi(pair<int,int>* pd, int size){
    int sum = 0;
    for(int i=0;i<n;i++){
        sum += pd[i].first*pd[i].second;
    }
    return sum;
}

int solve(){
    pair<int,int> pd[n];
    for(int i=0;i<n;i++){
        int d,p; cin >> d >> p;
        pd[i] = make_pair(p,d);
    }
    sort(pd,pd+n);
    reverse(pd,pd+n);
    int e = kitaichi(pd,n);
    int current = 0;
    while(m > 0 && current >n-1){
        if(pd[current].second < m){
            m -= pd[current].second;
            e -= pd[current].second*pd[current].first;
            current++;
        }
        else{
            e -= m*pd[current].first;
        }
    }
    if(current > n-1)
        e = 0;
    return e;
}

int main(){
    while(cin >> n >> m && n!=0){
        cout << solve() << endl;
    }
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(pd,pd+n);
      |     ^~~~
      |     short
a.cc:22:5: error: 'reverse' was not declared in this scope
   22 |     reverse(pd,pd+n);
      |     ^~~~~~~
Language: C++

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

int n,m;

int kitaichi(pair<int,int>* pd, int size){
    int sum = 0;
    for(int i=0;i<n;i++){
        sum += pd[i].first*pd[i].second;
    }
    return sum;
}

int solve(){
    pair<int,int> pd[10000];
    for(int i=0;i<n;i++){
        int d,p; cin >> d >> p;
        pd[i] = make_pair(p,d);
    }
    sort(pd,pd+n);
    reverse(pd,pd+n);
    int e = kitaichi(pd,n);
    int current = 0;
    while(m > 0 && current < n-1){
        if(pd[current].second < m){
            m -= pd[current].second;
            e -= pd[current].second*pd[current].first;
            current++;
        }
        else{
            e -= m*pd[current].first;
        }
    }
    if(current > n-1)
        e = 0;
    return e;
}

int main(){
    while(cin >> n >> m && n!=0){
        cout << solve() << endl;
    }
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(pd,pd+n);
      |     ^~~~
      |     short
a.cc:22:5: error: 'reverse' was not declared in this scope
   22 |     reverse(pd,pd+n);
      |     ^~~~~~~
Language: C++

#include<bits/stdc++.h>
int d[11],n,m,i,a,b,s,e;
int main(){
while(true) {
memset(d,0,sizeof(d));s=0;
std::cin>>n>>m;if(!n){break;}
for(i=0;i<n;i++){std::cin>>a>>b;d[b]+=a;}
for(i=10;i>=0;i--){e=min(d[i],m);m-=e;s+=i*(d[i]-e);}
printf("%d\n",s);}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: 'min' was not declared in this scope; did you mean 'std::min'?
    8 | for(i=10;i>=0;i--){e=min(d[i],m);m-=e;s+=i*(d[i]-e);}
      |                      ^~~
      |                      std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include <cstdio>
#include <vetcor>

int n, m, d, p;

int main()
{
    while(true)
    {
        scanf("%d", &n);
        scanf("%d", &m);
        
        if(n == 0 && m == 0) { break; }
        
        vector<int> r(11);
        
        for(int i = 0; i < n; i++)
        {
            scanf("%d", &d);
            scanf("%d", &p);
            
            r[p] += d;
        }
        
        for(int i = 10; i >= 0; i--)
        {
            if(m >= r[i])
            {
                m -= r[i];
                
                r[i] = 0;
            }
            else
            {
                r[i] -= m;
                
                break;
            }
        }
        
        int sum = 0;
        
        for(int i = 0; i <= 10; i++)
        {
            sum += i * r[i];
        }
        
        printf("%d\n", sum);
    }
    
    return 0;
}

Compiler output:
a.cc:2:10: fatal error: vetcor: No such file or directory
    2 | #include <vetcor>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <cstdio>
#include <vector>

int n, m, d, p;

int main()
{
    while(true)
    {
        scanf("%d", &n);
        scanf("%d", &m);
        
        if(n == 0 && m == 0) { break; }
        
        vector<int> r(11);
        
        for(int i = 0; i < n; i++)
        {
            scanf("%d", &d);
            scanf("%d", &p);
            
            r[p] += d;
        }
        
        for(int i = 10; i >= 0; i--)
        {
            if(m >= r[i])
            {
                m -= r[i];
                
                r[i] = 0;
            }
            else
            {
                r[i] -= m;
                
                break;
            }
        }
        
        int sum = 0;
        
        for(int i = 0; i <= 10; i++)
        {
            sum += i * r[i];
        }
        
        printf("%d\n", sum);
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'vector' was not declared in this scope
   15 |         vector<int> r(11);
      |         ^~~~~~
a.cc:15:9: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:15:16: error: expected primary-expression before 'int'
   15 |         vector<int> r(11);
      |                ^~~
a.cc:22:13: error: 'r' was not declared in this scope
   22 |             r[p] += d;
      |             ^
a.cc:27:21: error: 'r' was not declared in this scope
   27 |             if(m >= r[i])
      |                     ^
a.cc:45:24: error: 'r' was not declared in this scope
   45 |             sum += i * r[i];
      |                        ^
Language: C++

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

 int main() {
	for(int N, M; cin >> N >> M && N; ) {
		vector<pair<int, int>> roads;
		
		int danger = 0;
		
		for(int i = 0; i < N; i++) {
			int d, p;
			cin >> d >> p;
			
			roads.push_back(make_pair(p, d));
			danger += d * p;
		}
		
		sort(roads.begin(), roads.end(), greater<pair<int, int>>());
		
		for(int i = 0; i < N; i++) {
			danger -= min(M, roads[i].second) * roads[i].first;
			M = max(M - roads[i].second, 0);
		}
		
		cout << danger << endl;
	 }
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |                 sort(roads.begin(), roads.end(), greater<pair<int, int>>());
      |                 ^~~~
      |                 short
Language: C++

#include<iostream>
using namespace std;

int N,M;
    pair<int,int> PD[10010];

int main()
{
    while(cin>>N>>M&&N){
        int d,p,S=0;
        for(int i=0;i<N;i++){
            cin>>d>>p;
            PD[i]=make_pair(p,d);
            S+=d*p;
        }
        sort(PD,PD+N);
        reverse(PD,PD+N);
        for(int i=0;i<N;i++){
            if(M<=0)break;
            int pro;
            if(M>PD[i].second)pro=PD[i].second;
            else pro=M;
            S-=PD[i].first*pro;
            M-=pro;
        }
        cout<<S<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |         sort(PD,PD+N);
      |         ^~~~
      |         short
a.cc:17:9: error: 'reverse' was not declared in this scope
   17 |         reverse(PD,PD+N);
      |         ^~~~~~~
Language: C++

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

int main() {
	while (1) {
		int n, m;
		cin >> n >> m;
		if ( n == 0 && m == 0 ) break;
		int pd[10000];
		int d, p;
		for ( int i = 0; i < n; i++ ) {
			cin >> d >> p;
			pd[i] = make_pair( p, d );
		}
		sort( pd, pd + n );
		int ans = 0;
		for ( int i = 0; i < n; i++ ) {
			if ( pd[i].second < m ) {
				ans += pd[i].first * pd[i].second;
				m -= pd[i].second;
			} else {
				ans += pd[i].first * m;
				break;
			}
		}
		cout << ans << endl;
	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:42: error: cannot convert 'std::pair<int, int>' to 'int' in assignment
   15 |                         pd[i] = make_pair( p, d );
      |                                 ~~~~~~~~~^~~~~~~~
      |                                          |
      |                                          std::pair<int, int>
a.cc:20:36: error: request for member 'second' in 'pd[i]', which is of non-class type 'int'
   20 |                         if ( pd[i].second < m ) {
      |                                    ^~~~~~
a.cc:21:46: error: request for member 'first' in 'pd[i]', which is of non-class type 'int'
   21 |                                 ans += pd[i].first * pd[i].second;
      |                                              ^~~~~
a.cc:21:60: error: request for member 'second' in 'pd[i]', which is of non-class type 'int'
   21 |                                 ans += pd[i].first * pd[i].second;
      |                                                            ^~~~~~
a.cc:22:44: error: request for member 'second' in 'pd[i]', which is of non-class type 'int'
   22 |                                 m -= pd[i].second;
      |                                            ^~~~~~
a.cc:24:46: error: request for member 'first' in 'pd[i]', which is of non-class type 'int'
   24 |                                 ans += pd[i].first * m;
      |                                              ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
using namespace std;
int main(){
  int n,m,d,p,o;
  typedef pair<int,int> ma;
  
  int i,j,k;
  cin >> n >> m;
  while(n!=0&&m!=0){
    vector <ma> map;
    ma b;
    for(i=0;i<n;i++) {
      cin >> d >> p;
      b.first=p;b.second=d;
      map.push_back(b);
    }
    sort(map.begin(),map.end(),greater<ma>());
    o=0;
    for(i=0;i<map.size();i++){
      if(m>=map[i].second) m-=map[i].second;
      else if(m>0) {
	o+=(map[i].second-m)*map[i].first;
	m=0;
      }else o+=map[i].first*map[i].second;
    }
    cout << o << endl;
    cin >> n >> m;
  }
  return 0;
}

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

#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define ROUNDED(N) fixed << setprecision(N)
#define SPACE " "

typedef long long ll;
using namespace std;

int nextInt() { int n; cin >> n; return n; }
double nextDouble() { double d; cin >> d; return d; }
string nextString() { string str; cin >> str; return str; }

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????

	int n,m;
	while(cin>>n>>m,n){
		vector<pair<int,int>> load(n);
		REP(i,n)cin >> load[i].second >> load[i].first;
		sort(load.begin(),load.end());
		reverse(load.begin(),load.end());
		for(int i = 0;m>0&&i<n;i++){
			javascript:void(0)if(m-load[i].second>=0){//second????????¢
				m -= load[i].second;
				load[i].second = 0;
			}else{
				load[i].second -= m;
				m = 0;
			}
		}
		int ans=0;
		REP(i,n)ans += load[i].first * load[i].second;
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:43: error: expected ';' before 'if'
   43 |                         javascript:void(0)if(m-load[i].second>=0){//second????????¢
      |                                           ^~
      |                                           ;
a.cc:46:26: error: 'else' without a previous 'if'
   46 |                         }else{
      |                          ^~~~
Language: C++

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

pair<int, int> pd[10000];

int main(){
	
	int n=0,m=0,i,j,tmp,secure=0, ans=0;
	int d[10000];
	int p[10000];
	int idx[10000];
	while(1){
		memset(d,0,sizeof(d));
		memset(p,0,sizeof(d));
		
		cin >> n >> m;
		
		if(n == 0 && m == 0){
			break;
		}
		
		for(i=0;i<n;i++){
			cin >> d[i] >> p[i];
			pd[i] = make_pair(p[i],d[i]);
		}
		
		for(i=0;i<n;i++){
			idx[i] = i;
		}
		
		
		//sort
		sort(pd, pd+n);
		reverse(pd, pd+n);

		
		secure = 0;
		
//		while(m > 0){
//			cout << secure << " (^^) " << idx[secure]  << endl;
//			m--;
//			d[secure]--;
//			if(d[secure] == 0){secure--;}		
//		}
		
		for(i=0;i<n;i++){
			if(m >= pd[i].second){
				m -= pd[i].second;
				pd[i].first = 0;
			}else{
				pd[i].second -= m;
				break;
			}
		}
		
		ans = 0;
		
		for(i=0;i<n;i++){
//			cout << d[i] << " " << p[i] << endl;
			ans += pd[i].first * pd[i].second;
		}
		
		cout << ans << endl;
		
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
   14 |                 memset(d,0,sizeof(d));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#define MAX 200000000
#define ll long long 
using namespace std;

struct Data{
  int D;
  ll P;
};

struct Data D_P[MAX];
struct Data L[MAX/2+2],R[MAX/2+2];

void merge(int n,int left,int mid,int right){
  int n1=mid-left;
  int n2=right-mid;
  for(int i=0;i<n1;i++) L[i]=D_P[left+i];
  for(int i=0;i<n2;i++) R[i]=D_P[mid+i];
  L[n1].P=R[n2].P=MAX;
  int i=0,j=0;
  for(int k=left;k<right;k++){
    if(L[i].P<=R[j].P) D_P[k]=L[i++];
    else D_P[k]=R[j++];
  }
}

void mergeSort(int n,int left,int right){
  int mid;
  if(left+1<right){
    mid=(left+right)/2;
    mergeSort(n,left,mid);
    mergeSort(n,mid,right);
    merge(n,left,mid,right);
  }
}

int main(){
  int N;
  ll M,ans;  
  
  while(1){
    ans=0;
    cin>>N>>M;
    if(N+M==0)break;

    for(int i=0;i<N;i++)D_P[i].D=D_P[i].P=0;
    
    for(int i=0;i<N;i++){
      cin>>D_P[i].D>>D_P[i].P;
    }

    mergeSort(N,0,N);

    // for(int i=0;i<N;i++) cout<<D_P[i].D<<" "<<D_P[i].P<<endl;
    
    for(int i=N-1;i>=0;i--){
      if(D_P[i].P<=M) M-=D_P[i].D;
      else if(M<D_P[i].D&&M!=0){
	D_P[i].D-=M;
	M=0;
	ans+=D_P[i].P*D_P[i].D;
      }else if(M==0){
	ans+=D_P[i].P*D_P[i].D;
      }
      //  cout<<M<<endl;
    }
    cout<<ans<<endl;
  }
  
  return 0;
}

Compiler output:
/tmp/ccml4diL.o: in function `merge(int, int, int, int)':
a.cc:(.text+0x42): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x97): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0xdb): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0xf6): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x10e): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x155): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x18b): relocation truncated to fit: R_X86_64_PC32 against symbol `L' defined in .bss section in /tmp/ccml4diL.o
a.cc:(.text+0x1ce): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/ccml4diL.o
collect2: error: ld returned 1 exit status
Language: C++

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

typedef long long ll;
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RALL(x) (x).rbegin(),(x).rend()
#define F first
#define S second

void solve(int n, int m) {
    vector<pair<int,int>> data(n);
    for(auto& i : data) scanf("%lld%lld", &i.F, &i.S);
    sort(RALL(data));

    ll ans = 0;
    for(auto& i : data) {
        if(m - i.F >= 0) {
            m -= i.F;
        } else {
            ans += i.S * (i.F - m);
            m = 0;
        }
    }
    cout << ans << "\n";
}

signed main() {
    int n,m;
    while(cin>>n>>m, n) solve(n,m);
    return 0;

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

#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define Rep(i, N) for(int i = 0; i < N; i++)

typedef pair<int, int> Pi;
#define fi first
#define se second


int main()
{
  int N, M;
  Pi data[10005];
  int sum = 0;
  
  cin >> N >> M;
  
  Rep(i, N) {
    cin >> data[i].se >> data[i].fi;
  }
  
  sort(data, data + N, greater<Pi>());
  
  Rep(i, N) {
    int val = min(M, data[i].se);

    data[i].se -= val; M -= val;
    
    sum += data[i].se * data[i].fi;
  }
  
  cout << sum << endl;

  return 0;
}
  

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

#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7+1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <string> vs;
typedef vector <char> vc;
typedef list <ll> lst;

ll n,m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

int main()
{
	while (1) {
		cin >> n >> m;
		if (n == 0 && m == 0) {
			return 0;
		} else {
			vi vans;
			ll a, b;
			vp v;
			REP(i, n)
			{
				cin >> a >> b;
				v.push_back(make_pair(b, a));
			}
			REP(i, n)
			{
				REP(j, v[i].second)
				{
					vans.push_back(v[i].first);
				}
			}
			sort(RALL(vans));
			sum = 0;
			FOR(i, m, vans.size())
			{
				sum += vans[i];
			}
			cout << sum << endl;
			vans.clear;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:30: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = long long int; _Alloc = std::allocator<long long int>]'
   54 |                         vans.clear;
      |                         ~~~~~^~~~~
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:1607:7: note: declared here
 1607 |       clear() _GLIBCXX_NOEXCEPT
      |       ^~~~~
Language: C++

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

void calc_danger(int res,int i,pair<int,int> b[],int n){
  int danger=0;
  danger+=res*(-1)*b[i].first;
  for(int j=0;j<i;j++){
    danger+=b[j].first*b[j].second;
  }
  cout<<danger<<endl;
  return;
}

int main(){
  int n,m;
  int danger;
  while(cin>>n>>m){
    if(n==0&&m==0) break;
    int d[n],p[n];
    pair<int,int> b[n];
    for(int i=0;i<n;i++){
      cin>>d[i]>>p[i];
      b[i]=make_pair(p[i],d[i]);
    }
    sort(b,b+n);
    int res=m;
    for(int i=n-1;i>=0;i--){
      res=res-b[i].second;
      if(res<=0){
        calc_danger(res,i,b,n);
	break;
      }
    }
  }
  return 0;
}

    

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

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

void calc_danger(int res,int i,pair<int,int> b[],int n){
  int danger=0;
  danger+=res*(-1)*b[i].first;
  for(int j=0;j<i;j++){
    danger+=b[j].first*b[j].second;
  }
  cout<<danger<<endl;
  return;
}

int main(){
  int n,m;
  int danger;
  while(cin>>n>>m){
    if(n==0&&m==0) break;
    int d[n],p[n];
    pair<int,int> b[n];
    for(int i=0;i<n;i++){
      cin>>d[i]>>p[i];
      b[i]=make_pair(p[i],d[i]);
    }
    sort(b,b+n);
    int res=m;
    for(int i=n-1;i>=0;i--){
      res=res-b[i].second;
      if(res<=0){
        calc_danger(res,i,b,n);
	break;
      }else if(I==0){
cout<<0<<endl;
}
    }
  }
  return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:34:16: error: 'I' was not declared in this scope
   34 |       }else if(I==0){
      |                ^
Language: C++

#include<iostream>
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;

int main(){

  int N,M;
  while(1){
    cin>>N>>M;
    if(N==0&&M==0) break;
    
    vector<pair<int,int> > PD(N);

    unsigned long long prob;
    
  for(int i=0; i<N;i++) {
    cin>>PD[i].second>>PD[i].first;
    }

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

    
  int k=N-1;
  while(M>=0 && k>=0){

    if (PD[k].second<=M) { 
      M-=PD[k].second;
      PD[k].second=0;
      }
      #include<iostream>
#include<vector>
#include<stdio.h>
#include<algorithm>
using namespace std;

int main(){

  int N,M;
  while(1){
    cin>>N>>M;
    if(N==0&&M==0) break;
    
    vector<pair<int,int> > PD(N);

    unsigned long long prob;
    
  for(int i=0; i<N;i++) {
    cin>>PD[i].second>>PD[i].first;
    }

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

    
  int k=N-1;
  while(M>=0 && k>=0){

    if (PD[k].second<=M) { 
      M-=PD[k].second;
      PD[k].second=0;
      }
      
    else {
      PD[k].second-=M;
      M-=PD[k].second;
    }
    k--;
  }
  
  prob=0;
  for(int i=0;i<N;i++) prob+=PD[i].first*PD[i].second;
  cout<<prob<<endl;
  }
  return 0;}

    else {
      PD[k].second-=M;
      M-=PD[k].second;
    }
    k--;
  }
  
  prob=0;
  for(int i=0;i<N;i++) prob+=PD[i].first*PD[i].second;
  cout<<prob<<endl;
  }
  return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   38 | int main(){
      |         ^~
a.cc:38:9: note: remove parentheses to default-initialize a variable
   38 | int main(){
      |         ^~
      |         --
a.cc:38:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:38:11: error: a function-definition is not allowed here before '{' token
   38 | int main(){
      |           ^
a.cc:77:5: error: 'else' without a previous 'if'
   77 |     else {
      |     ^~~~
Language: C++

#include<utility>
#include<algorithm>
#include<iostream>
#include<functional>
using namespace std;

#if 0
????????????30????????????sort???greater??????????????§'>>'??§?????????'> >'??§????????¨??????????????????????????????????????????
??????N,??????M???????????????N??????pair????????£??\???N??????????´??????????????????????(NlogN)???N????????????????????§????¨???§O(NlogN)??¨??????
#endif

int main(){
  int N,M;
  pair<int,int> PD[10010];
  while(cin >> N >> M && N){
    int d,p;
    for (int i=0; i<N; ++i){
      cin >> d >> p;
      PD[i]=make_pair(p,d);
    }
    sort(PD,PD+N,greater<pair<int,int>>());
    int ans=0;
    for (int i=0;i<N;++i){
      if (M>PD[i].second) M-=PD[i].second;
      else {
	ans+=(PD[i].second-M)*PD[i].first;
	M=0;
      }
    }
    cout << ans << endl;
  }  
}
  

Compiler output:
a.cc:8:55: error: extended character § is not valid in an identifier
    8 | ????????????30????????????sort???greater??????????????§'>>'??§?????????'> >'??§????????¨??????????????????????????????????????????
      |                                                       ^
a.cc:8:62: error: extended character § is not valid in an identifier
    8 | ????????????30????????????sort???greater??????????????§'>>'??§?????????'> >'??§????????¨??????????????????????????????????????????
      |                                                              ^
a.cc:8:70: warning: trigraph ??' ignored, use -trigraphs to enable [-Wtrigraphs]
    8 | ????????????30????????????sort???greater??????????????§'>>'??§?????????'> >'??§????????¨??????????????????????????????????????????
a.cc:8:79: error: extended character § is not valid in an identifier
    8 | ????????????30????????????sort???greater??????????????§'>>'??§?????????'> >'??§????????¨??????????????????????????????????????????
      |                                                                               ^
a.cc:9:50: error: extended character £ is not valid in an identifier
    9 | ??????N,??????M???????????????N??????pair????????£??\???N??????????´??????????????????????(NlogN)???N????????????????????§????¨???§O(NlogN)??¨??????
      |                                                  ^
a.cc:9:89: warning: trigraph ??( ignored, use -trigraphs to enable [-Wtrigraphs]
    9 | ??????N,??????M???????????????N??????pair????????£??\???N??????????´??????????????????????(NlogN)???N????????????????????§????¨???§O(NlogN)??¨??????
a.cc:9:122: error: extended character § is not valid in an identifier
    9 | ??????N,??????M???????????????N??????pair????????£??\???N??????????´??????????????????????(NlogN)???N????????????????????§????¨???§O(NlogN)??¨??????
      |                                                                                                                          ^
a.cc:9:131: error: extended character § is not valid in an identifier
    9 | ??????N,??????M???????????????N??????pair????????£??\???N??????????´??????????????????????(NlogN)???N????????????????????§????¨???§O(NlogN)??¨??????
      |                                                                                                                                   ^
Language: C++

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

#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back

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

//-----------------------------------------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,m;
while(cin>>n>>m,n|m)
{
    int cnt[11]={0};
    int sum=0;
    REP(i,n){
        int d,p; cin>>d>>p;
        cnt[p]+=d,sum+=p*d;
    }

    for(int i=10;i>=0;i--){
        if(m>cnt[i]){
            m-=cnt[i];
            sum-=i*cnt[i];
        } else{
            sum-=i*m;
            break;
        }
        cout<<sum<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:14:1: note: to match this '{'
   14 | {
      | ^