Language: C++

#include<bits/stdc++.h>
u#include<algorithm>
#include<vector>
#include<cmath>
#include<string>
#include<stack>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;
using Graph = vector<vector<int>>;
const ll m = (1e+9) + 7;
int main() {
	int n, m;
	static ll ans;
	vector<pair<int, int>> p;
	cin >> n >> m;
	priority_queue<int> que;
	for (int i = 0; i < n; ++i) {
		int a, b;
		cin >> a >> b;
		p.push_back(make_pair(a, b));
	}
	sort(p.begin(), p.end(),greater<pair<int,int>>());
	for (int day = 1; day <= m; ++day) {
		while (!p.empty() && p.back().first == day) {
			que.push(p.back().second);
			p.pop_back();
		}
		if (!que.empty()) {
			ans += que.top();
			que.pop();
		}
	}
	cout<<endl;
	cout << ans << endl;
}

Compiler output:
a.cc:2:2: error: stray '#' in program
    2 | u#include<algorithm>
      |  ^
a.cc:2:1: error: 'u' does not name a type
    2 | u#include<algorithm>
      | ^
a.cc:11:15: error: 'vector' does not name a type
   11 | using Graph = vector<vector<int>>;
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:16:9: error: 'vector' was not declared in this scope
   16 |         vector<pair<int, int>> p;
      |         ^~~~~~
a.cc:16:9: note: suggested alternatives:
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: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:16:16: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
   16 |         vector<pair<int, int>> p;
      |                ^~~~
      |                std::pair
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc:16:21: error: expected primary-expression before 'int'
   16 |         vector<pair<int, int>> p;
      |                     ^~~
a.cc:17:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   17 |         cin >> n >> m;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:18:9: error: 'priority_queue' was not declared in this scope; did you mean 'std::priority_queue'?
   18 |         priority_queue<int> que;
      |         ^~~~~~~~~~~~~~
      |         std::priority_queue
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157:
/usr/include/c++/14/bits/stl_queue.h:496:11: note: 'std::priority_queue' declared here
  496 |     class priority_queue
      |           ^~~~~~~~~~~~~~
a.cc:18:24: error: expected primary-expression before 'int'
   18 |         priority_queue<int> que;
      |                        ^~~
a.cc:22:17: error: 'p' was not declared in this scope
   22 |                 p.push_back(make_pair(a, b));
      |                 ^
a.cc:22:29: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
   22 |                 p.push_back(make_pair(a, b));
      |                             ^~~~~~~~~
      |                             std::make_pair
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:24:14: error: 'p' was not declared in this scope
   24 |         sort(p.begin(), p.end(),greater<pair<int,int>>());
      |              ^
a.cc:24:33: error: 'greater' was not declared in this scope; did you mean 'std::greater'?
   24 |         sort(p.begin(), p.end(),greater<pair<int,int>>());
      |                                 ^~~~~~~
      |                                 std::greater
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stl_function.h:353:12: note: 'std::greater' declared here
  353 |     struct greater;
      |            ^~~~~~~
a.cc:24:46: error: expected primary-expression before 'int'
   24 |         sort(p.begin(), p.end(),greater<pair<int,int>>());
      |                                              ^~~
a.cc:24:50: error: expected primary-expression before 'int'
   24 |         sort(p.begin(), p.end(),greater<pair<int,int>>());
      |                                                  ^~~
a.cc:24:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   24 |         sort(p.begin(), p.end(),greater<pair<int,int>>());
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:27:25: error: 'que' was not declared in this scope
   27 |                         que.push(p.back().second);
      |                         ^~~
a.cc:30:22: error: 'que' was not declared in this scope
   30 |                 if (!que.empty()) {
      |                      ^~~
a.cc:35:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   35 |         cout<<endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:35:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   35 |         cout<<endl;
      |               ^~~~
      |               std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~