Language: C++

#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct index{
	string s;
	int p;
	bool operator<(const index &right) const{
		return right.s != s ? right.s > s :right.p > p;
	}

};
int main() {
	vector<index> book;
	string s;
	int n;
	while (cin >> s >> n)
		book.push_back({ s, n });
	SORT(book);
	s = "";
	REP(i, book.size()){
		if (book[i].s != s){
			if (i != 0)cout << endl;
			cout << book[i].s << endl;
			cout << book[i].p;
		}
		else{
			cout << ' ' << book[i].p;
		}
		s = book[i].s;
	}
	cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:21: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
   54 |         vector<index> book;
      |                     ^
a.cc:54:21: note:   expected a type, got 'index'
a.cc:54:21: error: template argument 2 is invalid
a.cc:58:22: error: request for member 'push_back' in 'book', which is of non-class type 'int'
   58 |                 book.push_back({ s, n });
      |                      ^~~~~~~~~
a.cc:29:26: error: request for member 'begin' in 'book', which is of non-class type 'int'
   29 | #define SORT(c) sort((c).begin(),(c).end())
      |                          ^~~~~
a.cc:59:9: note: in expansion of macro 'SORT'
   59 |         SORT(book);
      |         ^~~~
a.cc:29:38: error: request for member 'end' in 'book', which is of non-class type 'int'
   29 | #define SORT(c) sort((c).begin(),(c).end())
      |                                      ^~~
a.cc:59:9: note: in expansion of macro 'SORT'
   59 |         SORT(book);
      |         ^~~~
a.cc:61:21: error: request for member 'size' in 'book', which is of non-class type 'int'
   61 |         REP(i, book.size()){
      |                     ^~~~
a.cc:25:38: note: in definition of macro 'REP'
   25 | #define REP(i,n) for(int i=0;i<(int)(n);++i)
      |                                      ^
a.cc:62:25: error: invalid types 'int[int]' for array subscript
   62 |                 if (book[i].s != s){
      |                         ^
a.cc:64:37: error: invalid types 'int[int]' for array subscript
   64 |                         cout << book[i].s << endl;
      |                                     ^
a.cc:65:37: error: invalid types 'int[int]' for array subscript
   65 |                         cout << book[i].p;
      |                                     ^
a.cc:68:44: error: invalid types 'int[int]' for array subscript
   68 |                         cout << ' ' << book[i].p;
      |                                            ^
a.cc:70:25: error: invalid types 'int[int]' for array subscript
   70 |                 s = book[i].s;
      |                         ^