Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
#include <utility>
#include <cstring>
#include <numeric>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define repll(i,n) for(long long int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
template <typename T_char>
char ToUpper (char cX) { return toupper(cX); }
//g++ -std=c++1z temp.cpp
//./a.exe
ll digit(ll a){
    ll count = 0;
    for (ll i = 0; i < a; i++)
    {   if (a == 0)
        {
            break;
        }else
        {
            a = a/10;
            count++;
        }
    }
    return count;
}
//桁数のカウント
//pow(x,n) == x^n
//sum = accumulate(v.begin(),v.end(),0);
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a,   b) * b;}



int main(void){ios::sync_with_stdio(false);cin.tie(0);
/////////////////////////////////////////////////////
__int64 n,m,sum = 0;
cin >> n >> m;
vector<pair<__int64, __int64> > pairs(n);
rep(i,n) cin >> pairs[i].first >> pairs[i].second;

Sort(pairs);

rep(i,n){
    if(pairs[i].second <= m){
        sum += pairs[i].first * pairs[i].second;
        m = m - pairs[i].second;
    }else{
        sum += pairs[i].first * m;
        break;
    }
}
cout << sum << endl;


//////////////////////////////////////////////////////
return 0;}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:1: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   68 | __int64 n,m,sum = 0;
      | ^~~~~~~
      | __ynf64
a.cc:69:8: error: 'n' was not declared in this scope; did you mean 'yn'?
   69 | cin >> n >> m;
      |        ^
      |        yn
a.cc:69:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   69 | cin >> n >> m;
      |             ^
      |             tm
a.cc:70:31: error: template argument 1 is invalid
   70 | vector<pair<__int64, __int64> > pairs(n);
      |                               ^
a.cc:70:31: error: template argument 2 is invalid
a.cc:71:22: error: invalid types 'int[int]' for array subscript
   71 | rep(i,n) cin >> pairs[i].first >> pairs[i].second;
      |                      ^
a.cc:71:40: error: invalid types 'int[int]' for array subscript
   71 | rep(i,n) cin >> pairs[i].first >> pairs[i].second;
      |                                        ^
a.cc:35:24: error: request for member 'begin' in 'pairs', which is of non-class type 'int'
   35 | #define Sort(a) sort(a.begin(),a.end())
      |                        ^~~~~
a.cc:73:1: note: in expansion of macro 'Sort'
   73 | Sort(pairs);
      | ^~~~
a.cc:35:34: error: request for member 'end' in 'pairs', which is of non-class type 'int'
   35 | #define Sort(a) sort(a.begin(),a.end())
      |                                  ^~~
a.cc:73:1: note: in expansion of macro 'Sort'
   73 | Sort(pairs);
      | ^~~~
a.cc:76:13: error: invalid types 'int[int]' for array subscript
   76 |     if(pairs[i].second <= m){
      |             ^
a.cc:77:9: error: 'sum' was not declared in this scope
   77 |         sum += pairs[i].first * pairs[i].second;
      |         ^~~
a.cc:77:21: error: invalid types 'int[int]' for array subscript
   77 |         sum += pairs[i].first * pairs[i].second;
      |                     ^
a.cc:77:38: error: invalid types 'int[int]' for array subscript
   77 |         sum += pairs[i].first * pairs[i].second;
      |                                      ^
a.cc:78:22: error: invalid types 'int[int]' for array subscript
   78 |         m = m - pairs[i].second;
      |                      ^
a.cc:80:9: error: 'sum' was not declared in this scope
   80 |         sum += pairs[i].first * m;
      |         ^~~
a.cc:80:21: error: invalid types 'int[int]' for array subscript
   80 |         sum += pairs[i].first * m;
      |                     ^
a.cc:84:9: error: 'sum' was not declared in this scope
   84 | cout << sum << endl;
      |         ^~~