Language: C++

#include <iostream>
#include <queue>
#include <vector>

int main() {
  uint32_t n_jobs, time_limit;
  std::cin >> n_jobs >> time_limit;
  std::vector<std::pair<uint32_t, uint32_t>> vec;
  vec.reserve(n_jobs);
  for (uint32_t i = 0; i < n_jobs; ++i) {
    uint32_t x, y;
    std::cin >> x >> y;
    if (time_limit >= x) {
      vec.emplace_back(x, y);
    }
  }
  std::sort(vec.begin(), vec.end());
  std::priority_queue<uint32_t> pq;
  uint32_t index = 0;
  uint32_t ans = 0;
  for (uint32_t t = 0; t <= time_limit; ++t) {
    while (index < vec.size() && vec[index].first <= t) {
      pq.push(vec[index].second);
      index++;
    }
    if (pq.size() != 0) {
      auto res = pq.top();
      pq.pop();
      ans += res;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'uint32_t' was not declared in this scope
    6 |   uint32_t n_jobs, time_limit;
      |   ^~~~~~~~
a.cc:3:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <queue>
  +++ |+#include <cstdint>
    3 | #include <vector>
a.cc:7:15: error: 'n_jobs' was not declared in this scope
    7 |   std::cin >> n_jobs >> time_limit;
      |               ^~~~~~
a.cc:7:25: error: 'time_limit' was not declared in this scope; did you mean 'time_t'?
    7 |   std::cin >> n_jobs >> time_limit;
      |                         ^~~~~~~~~~
      |                         time_t
a.cc:8:43: error: template argument 1 is invalid
    8 |   std::vector<std::pair<uint32_t, uint32_t>> vec;
      |                                           ^~
a.cc:8:43: error: template argument 2 is invalid
a.cc:9:7: error: request for member 'reserve' in 'vec', which is of non-class type 'int'
    9 |   vec.reserve(n_jobs);
      |       ^~~~~~~
a.cc:10:16: error: expected ';' before 'i'
   10 |   for (uint32_t i = 0; i < n_jobs; ++i) {
      |                ^~
      |                ;
a.cc:10:24: error: 'i' was not declared in this scope
   10 |   for (uint32_t i = 0; i < n_jobs; ++i) {
      |                        ^
a.cc:11:13: error: expected ';' before 'x'
   11 |     uint32_t x, y;
      |             ^~
      |             ;
a.cc:12:17: error: 'x' was not declared in this scope
   12 |     std::cin >> x >> y;
      |                 ^
a.cc:12:22: error: 'y' was not declared in this scope
   12 |     std::cin >> x >> y;
      |                      ^
a.cc:14:11: error: request for member 'emplace_back' in 'vec', which is of non-class type 'int'
   14 |       vec.emplace_back(x, y);
      |           ^~~~~~~~~~~~
a.cc:17:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   17 |   std::sort(vec.begin(), vec.end());
      |        ^~~~
      |        qsort
a.cc:17:17: error: request for member 'begin' in 'vec', which is of non-class type 'int'
   17 |   std::sort(vec.begin(), vec.end());
      |                 ^~~~~
a.cc:17:30: error: request for member 'end' in 'vec', which is of non-class type 'int'
   17 |   std::sort(vec.begin(), vec.end());
      |                              ^~~
a.cc:18:31: error: template argument 2 is invalid
   18 |   std::priority_queue<uint32_t> pq;
      |                               ^
a.cc:18:31: error: template argument 3 is invalid
a.cc:19:11: error: expected ';' before 'index'
   19 |   uint32_t index = 0;
      |           ^~~~~~
      |           ;
a.cc:20:11: error: expected ';' before 'ans'
   20 |   uint32_t ans = 0;
      |           ^~~~
      |           ;
a.cc:21:16: error: expected ';' before 't'
   21 |   for (uint32_t t = 0; t <= time_limit; ++t) {
      |                ^~
      |                ;
a.cc:21:24: error: 't' was not declared in this scope; did you mean 'tm'?
   21 |   for (uint32_t t = 0; t <= time_limit; ++t) {
      |                        ^
      |                        tm
a.cc:22:12: error: 'index' was not declared in this scope
   22 |     while (index < vec.size() && vec[index].first <= t) {
      |            ^~~~~
a.cc:22:24: error: request for member 'size' in 'vec', which is of non-class type 'int'
   22 |     while (index < vec.size() && vec[index].first <= t) {
      |                        ^~~~
a.cc:23:10: error: request for member 'push' in 'pq', which is of non-class type 'int'
   23 |       pq.push(vec[index].second);
      |          ^~~~
a.cc:26:12: error: request for member 'size' in 'pq', which is of non-class type 'int'
   26 |     if (pq.size() != 0) {
      |            ^~~~
a.cc:27:21: error: request for member 'top' in 'pq', which is of non-class type 'int'
   27 |       auto res = pq.top();
      |                     ^~~
a.cc:28:10: error: request for member 'pop' in 'pq', which is of non-class type 'int'
   28 |       pq.pop();
      |          ^~~
a.cc:29:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |       ans += res;
      |       ^~~
      |       abs
a.cc:32:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |   std::cout << ans << std::endl;
      |                ^~~
      |                abs