Language: C++

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>

#define int unsigned long long;

const int MAXN = 100001;
const int MAXS = 11;
const int mod1 = 19260817;
const int mod2 = 19660813;
const int base = 1e7 + 7;

typedef unsigned long long ull;

struct node {
	ull a, b;
	bool operator <(const node &x)const{
		return x.a < a;
	}
}G[MAXN];

int N, cnt, ans[MAXN];
ull sum;

char s[MAXS];

inline ull hash ( int );

signed main()
{
	scanf("%llu", &N);

	for(register int i = 1; i <= N; i++){
		scanf("%s", s);
		G[i].a = hash(mod1);
		G[i].b = hash(mod2);
	}

	std::sort(G + 1, G + N + 1);

	for(register int i = 1; i < N; i++)
		if(G[i].a == G[i + 1].a && G[i].b == G[i + 1].b)
			ans[cnt]++;
		else cnt++;

	for(register int i = 0; i <= cnt; i++)
		sum += (((ans[i] + 1) * ans[i]) >> 1);

	printf("%lld", sum);

	return 0;
}

inline ull hash ( int mod )
{
	int len = strlen(s) - 1;
	ull sum = 0;
	for(register int i = 0; i <= len; i++)
		sum = ( sum + (ull)s[i] * base) % mod;
	return sum;
}


Compiler output:
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:8:7: note: in expansion of macro 'int'
    8 | const int MAXN = 100001;
      |       ^~~
a.cc:8:11: error: 'MAXN' does not name a type
    8 | const int MAXN = 100001;
      |           ^~~~
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:9:7: note: in expansion of macro 'int'
    9 | const int MAXS = 11;
      |       ^~~
a.cc:9:11: error: 'MAXS' does not name a type
    9 | const int MAXS = 11;
      |           ^~~~
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:10:7: note: in expansion of macro 'int'
   10 | const int mod1 = 19260817;
      |       ^~~
a.cc:10:11: error: 'mod1' does not name a type
   10 | const int mod1 = 19260817;
      |           ^~~~
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:11:7: note: in expansion of macro 'int'
   11 | const int mod2 = 19660813;
      |       ^~~
a.cc:11:11: error: 'mod2' does not name a type
   11 | const int mod2 = 19660813;
      |           ^~~~
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:12:7: note: in expansion of macro 'int'
   12 | const int base = 1e7 + 7;
      |       ^~~
a.cc:12:11: error: 'base' does not name a type
   12 | const int base = 1e7 + 7;
      |           ^~~~
a.cc:21:4: error: 'MAXN' was not declared in this scope
   21 | }G[MAXN];
      |    ^~~~
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:23:1: note: in expansion of macro 'int'
   23 | int N, cnt, ans[MAXN];
      | ^~~
a.cc:23:5: error: 'N' does not name a type
   23 | int N, cnt, ans[MAXN];
      |     ^
a.cc:26:8: error: 'MAXS' was not declared in this scope
   26 | char s[MAXS];
      |        ^~~~
a.cc:6:31: error: expected ')' before ';' token
    6 | #define int unsigned long long;
      |                               ^
a.cc:28:19: note: in expansion of macro 'int'
   28 | inline ull hash ( int );
      |                   ^~~
a.cc:28:17: note: to match this '('
   28 | inline ull hash ( int );
      |                 ^
a.cc:28:23: error: expected unqualified-id before ')' token
   28 | inline ull hash ( int );
      |                       ^
a.cc: In function 'int main()':
a.cc:32:24: error: 'N' was not declared in this scope
   32 |         scanf("%llu", &N);
      |                        ^
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:34:22: note: in expansion of macro 'int'
   34 |         for(register int i = 1; i <= N; i++){
      |                      ^~~
a.cc:34:26: error: 'i' was not declared in this scope
   34 |         for(register int i = 1; i <= N; i++){
      |                          ^
a.cc:34:39: error: expected ')' before ';' token
   34 |         for(register int i = 1; i <= N; i++){
      |            ~                          ^
      |                                       )
a.cc:34:41: error: 'i' was not declared in this scope
   34 |         for(register int i = 1; i <= N; i++){
      |                                         ^
a.cc:40:19: error: 'G' was not declared in this scope
   40 |         std::sort(G + 1, G + N + 1);
      |                   ^
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:42:22: note: in expansion of macro 'int'
   42 |         for(register int i = 1; i < N; i++)
      |                      ^~~
a.cc:42:38: error: expected ')' before ';' token
   42 |         for(register int i = 1; i < N; i++)
      |            ~                         ^
      |                                      )
a.cc:45:17: error: 'else' without a previous 'if'
   45 |                 else cnt++;
      |                 ^~~~
a.cc:45:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   45 |                 else cnt++;
      |                      ^~~
      |                      int
a.cc:6:27: error: declaration does not declare anything [-fpermissive]
    6 | #define int unsigned long long;
      |                           ^~~~
a.cc:47:22: note: in expansion of macro 'int'
   47 |         for(register int i = 0; i <= cnt; i++)
      |                      ^~~
a.cc:47:41: error: expected ')' before ';' token
   47 |         for(register int i = 0; i <= cnt; i++)
      |            ~                            ^
      |                                         )
a.cc: At global scope:
a.cc:6:31: error: expected ')' before ';' token
    6 | #define int unsigned long long;
      |                               ^
a.cc:55:19: note: in expansion of macro 'int'
   55 | inline ull hash ( int mod )
      |                   ^~~
a.cc:55:17: note: to match this '('
   55 | inline ull hash ( int mod )
      |                 ^
a.cc:55:23: error: 'mod' does not name a type
   55 | inline ull hash ( int mod )
      |                       ^~~