Problem p03030 (C++)

Buggy submission (status: Runtime Error):
#if defined(__GNUC__)
#include <bits/stdc++.h>
#define __int32 __int32_t
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#define itn __int32
#define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y)                                                          \
  [](int a, int b) -> int {                                                    \
    int c = a;                                                                 \
    REP(i, b - 1) { c *= a; }                                                  \
    return c;                                                                  \
  }(x, y)
#define INT_POWM(x, y, m)                                                      \
  [](int a, int b, int m) -> int {                                             \
    int c = a;                                                                 \
    REP(i, b - 1) {                                                            \
      c *= a;                                                                  \
      c %= m;                                                                  \
    }                                                                          \
    return c;                                                                  \
  }(x, y, m)

itn main() {
  std::ios::sync_with_stdio(false);

  int n;

  cin >> n;

  vector<pair<pair<string, int>, int>> a;

  REP(i, n) {
    cin >> a[i].first.first >> a[i].first.second;
    a[i].first.second *= -1;
    a[i].second = i + 1;
  }

  SORT(a);

  REP(i, n) { cout << a[i].second << '\n'; }

  return 0;
}

Fixed submission:
#if defined(__GNUC__)
#include <bits/stdc++.h>
#define __int32 __int32_t
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#define itn __int32
#define REP(i, n) for (itn(i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for (itn(i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y)                                                          \
  [](int a, int b) -> int {                                                    \
    int c = a;                                                                 \
    REP(i, b - 1) { c *= a; }                                                  \
    return c;                                                                  \
  }(x, y)
#define INT_POWM(x, y, m)                                                      \
  [](int a, int b, int m) -> int {                                             \
    int c = a;                                                                 \
    REP(i, b - 1) {                                                            \
      c *= a;                                                                  \
      c %= m;                                                                  \
    }                                                                          \
    return c;                                                                  \
  }(x, y, m)

itn main() {
  std::ios::sync_with_stdio(false);

  int n;

  cin >> n;

  vector<pair<pair<string, int>, int>> a(n);

  REP(i, n) {
    cin >> a[i].first.first >> a[i].first.second;
    a[i].first.second *= -1;
    a[i].second = i + 1;
  }

  SORT(a);

  REP(i, n) { cout << a[i].second << '\n'; }

  return 0;
}