Language: C++

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

struct data {
  string name;
  int pnt, id;
  data() {}
  data(string name, int pnt, int id):
    name(name), pnt(pnt), id(id) {}
};

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int n;
  cin >> n;
  int id = 0;
  vector<data> v(n);
  for (auto &i : v) {
    string name;
    int pnt = 0;
    cin >> name >> pnt;
    i = data(name, pnt, ++id);
  }
  sort(all(v), [](data &a, data &b) -> bool {
    if (a.name == b.name) return a.pnt > b.pnt;
    return a.name < b.name;
  });
  for (auto &i : v) cout << i.id << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: template argument 1 is invalid
   29 |   vector<data> v(n);
      |              ^
a.cc:29:14: error: template argument 2 is invalid
a.cc:30:18: error: 'begin' was not declared in this scope
   30 |   for (auto &i : v) {
      |                  ^
a.cc:30:18: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:30:18: error: 'end' was not declared in this scope
   30 |   for (auto &i : v) {
      |                  ^
a.cc:30:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:34:9: error: reference to 'data' is ambiguous
   34 |     i = data(name, pnt, ++id);
      |         ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'struct data'
   12 | struct data {
      |        ^~~~
a.cc:10:20: error: request for member 'begin' in 'v', which is of non-class type 'int'
   10 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:36:8: note: in expansion of macro 'all'
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |        ^~~
a.cc:10:32: error: request for member 'end' in 'v', which is of non-class type 'int'
   10 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:36:8: note: in expansion of macro 'all'
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |        ^~~
a.cc:36:19: error: reference to 'data' is ambiguous
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |                   ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'struct data'
   12 | struct data {
      |        ^~~~
a.cc:36:19: error: 'data' has not been declared
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |                   ^~~~
a.cc:36:28: error: reference to 'data' is ambiguous
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |                            ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'struct data'
   12 | struct data {
      |        ^~~~
a.cc:36:28: error: 'data' has not been declared
   36 |   sort(all(v), [](data &a, data &b) -> bool {
      |                            ^~~~
a.cc: In lambda function:
a.cc:37:11: error: request for member 'name' in 'a', which is of non-class type 'int'
   37 |     if (a.name == b.name) return a.pnt > b.pnt;
      |           ^~~~
a.cc:37:21: error: request for member 'name' in 'b', which is of non-class type 'int'
   37 |     if (a.name == b.name) return a.pnt > b.pnt;
      |                     ^~~~
a.cc:37:36: error: request for member 'pnt' in 'a', which is of non-class type 'int'
   37 |     if (a.name == b.name) return a.pnt > b.pnt;
      |                                    ^~~
a.cc:37:44: error: request for member 'pnt' in 'b', which is of non-class type 'int'
   37 |     if (a.name == b.name) return a.pnt > b.pnt;
      |                                            ^~~
a.cc:38:14: error: request for member 'name' in 'a', which is of non-class type 'int'
   38 |     return a.name < b.name;
      |              ^~~~
a.cc:38:23: error: request for member 'name' in 'b', which is of non-class type 'int'
   38 |     return a.name < b.name;
      |                       ^~~~
a.cc: In function 'int main()':
a.cc:40:18: error: 'begin' was not declared in this scope
   40 |   for (auto &i : v) cout << i.id << '\n';
      |                  ^
a.cc:40:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:40:18: error: 'end' was not declared in this scope
   40 |   for (auto &i : v) cout << i.id << '\n';
      |                  ^
a.cc:40:18: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~