criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <iomanip>
#include <utility>
#include <map>
using namespace std;
using int64 = long long;
#define ForInt(i, n) for (int (i) = 0; (i) < (n); ++(i))
#define ForItr(it, itBegin, itEnd) for (auto (it) = (itBegin); (it) != (itEnd); ++(it))


int main()
{
	int n;
	cin >> n;
	map<string, int> map;
	ForInt(i, n)
	{
		string tmp;
		cin >> tmp;
		char chs[11];
		ForInt(j, 10)
		{
			chs[j] = tmp[j];
		}
		sort(chs, chs + 10);
		chs[10] = '\0';
		string key = chs;
		++map[key];
	}
	int64 c = 0;
	ForItr(it, map.begin(), map.end())
	{
		ForInt(i, it->second)
		{
			c += i;
		}
	}
	cout << c << endl;


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |                 sort(chs, chs + 10);
      |                 ^~~~
      |                 short
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin >> n;
  map<string,int> mp;
  
  rep(i,n){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    ma[s]++;
  }
  ll ans = 0;
  for(auto& p : mp){
    int s = p.second;
    ans = (ll)s*(s-1)/2;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'ma' was not declared in this scope; did you mean 'mp'?
   15 |     ma[s]++;
      |     ^~
      |     mp
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

int main(){
  int n;
  cin >> n;
  map<string,int> mp;
  
  rep(i,n){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    map[s]++;
  }
  ll ans = 0;
  for(auto& p : mp){
    int s = p.second;
    ans = (ll)s*(s-1)/2;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: conflicting declaration 'auto s'
   15 |     map[s]++;
      |         ^
a.cc:12:12: note: previous declaration as 'std::string s'
   12 |     string s;
      |            ^
a.cc:15:11: error: expected initializer before '++' token
   15 |     map[s]++;
      |           ^~
Language: C++

n = int(input())
d = {}

for _ in range(n):
    s = ''.join(sorted(input()))
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

ans = 0
for k, v in d.items():
    ans += (v * (v - 1)) / 2

print(int(ans))


Compiler output:
a.cc:5:9: error: empty character constant
    5 |     s = ''.join(sorted(input()))
      |         ^~
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for _ in range(n):
      | ^~~
Language: C++

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
string arr[1000000];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		char abc[11];
		cin>>abc;
		sort(abc,abc+strlen(abc));
		arr[i]=abc;
	}
	sort(arr,arr+n);
	ll sum=0;
	ll p=0;
	for(int i=0;i<n;i++){
		if(i!=n){
			if(arr[i]==arr[i+1]){
				p++;
			}
			else{
				p++;
				if(p!=1){
					sum+=p*(p-1)/2;
				}
				p=0;
			}
		}
		else{
			p++;
			if(p!=1){
				sum+=p*(p-1);
			}
		}
	}
	cout<<sum<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'll' was not declared in this scope
   17 |         ll sum=0;
      |         ^~
a.cc:18:11: error: expected ';' before 'p'
   18 |         ll p=0;
      |           ^~
      |           ;
a.cc:22:33: error: 'p' was not declared in this scope
   22 |                                 p++;
      |                                 ^
a.cc:25:33: error: 'p' was not declared in this scope
   25 |                                 p++;
      |                                 ^
a.cc:27:41: error: 'sum' was not declared in this scope
   27 |                                         sum+=p*(p-1)/2;
      |                                         ^~~
a.cc:33:25: error: 'p' was not declared in this scope
   33 |                         p++;
      |                         ^
a.cc:35:33: error: 'sum' was not declared in this scope
   35 |                                 sum+=p*(p-1);
      |                                 ^~~
a.cc:39:15: error: 'sum' was not declared in this scope
   39 |         cout<<sum<<endl;
      |               ^~~
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int a[100002][26]= {0};
int pan(int x,int y)
{
    int i,flag=0;
    for(i=0; i<26; i++)
    {
        if(a[x][i]!=a[y][i]){
            flag=1;
            break;}
    }
    return flag;
}
int main()
{
    int i,j,n,m,b[100000];
    string s;
    map<int,
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>s;
        for(j=0; j<10; j++)
            a[i][s[j]-'a']++;
    }
    long long int num=0;
    for(i=0; i<n; i++)
    {
        for(j=i+1; j<n; j++)
        {
            if(!pan(i,j))
                num++;
        }
    }

    cout<<num;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: type/value mismatch at argument 2 in template parameter list for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
   21 |     cin>>n;
      |     ^~~
a.cc:21:5: note:   expected a type, got 'std::cin'
a.cc:21:5: error: template argument 4 is invalid
a.cc:21:8: error: expected unqualified-id before '>' token
   21 |     cin>>n;
      |        ^~
Language: C++

#include <set>
#include <map>
#include <list>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;

int main(){
    string s[100000],key,key1;
    int N,ans = 0;
    cin >> N;
    for(int i=0;i<N;i++)cin>>s[sort(i.begin(),i.end()];
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(i == j)continue;
            else
            {
                if(s[i] == s[j]) ans++;
            }
            
        }
    }
    cout << ans /2 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:39: error: request for member 'begin' in 'i', which is of non-class type 'int'
   30 |     for(int i=0;i<N;i++)cin>>s[sort(i.begin(),i.end()];
      |                                       ^~~~~
a.cc:30:49: error: request for member 'end' in 'i', which is of non-class type 'int'
   30 |     for(int i=0;i<N;i++)cin>>s[sort(i.begin(),i.end()];
      |                                                 ^~~
Language: C++

for (int i = 1; i < N; i++){
        if (old == S[i]){
            count++;
            if (i == N-1){
                ans += count * (count-1) / 2;
            }
        } else {
            if (count >= 2){
                ans += count * (count-1) / 2;
            }
            count = 1;
            old = S[i];
        }
    }

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'for'
    1 | for (int i = 1; i < N; i++){
      | ^~~
a.cc:1:17: error: 'i' does not name a type
    1 | for (int i = 1; i < N; i++){
      |                 ^
a.cc:1:24: error: 'i' does not name a type
    1 | for (int i = 1; i < N; i++){
      |                        ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <undered_map>

int main() {
    int n, ans = 0;
    std::undered_map<std::string, int> string_map;
    std::cin >> n;
    std::string s;
    for (int i = 0; i < n; i++) {
        std::cin >> s;
        std::sort(s.begin(), s.end());
        if (string_map.find(s) == string_map.end()) string_map[s] = 0;
        else string_map[s] += 1;
    }
    for (auto &i: string_map) {
        long x = i.second;
        ans += x * (x + 1) / 2;
    }
    std::cout << ans << std::endl; 
}

Compiler output:
a.cc:5:10: fatal error: undered_map: No such file or directory
    5 | #include <undered_map>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>

int main() {
    int n, ans = 0;
    std::ubdered_map<std::string, int> string_map;
    std::cin >> n;
    std::string s;
    for (int i = 0; i < n; i++) {
        std::cin >> s;
        std::sort(s.begin(), s.end());
        if (string_map.find(s) == string_map.end()) string_map[s] = 0;
        else string_map[s] += 1;
    }
    for (auto &i: string_map) {
        long x = i.second;
        ans += x * (x + 1) / 2;
    }
    std::cout << ans << std::endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'ubdered_map' is not a member of 'std'
    9 |     std::ubdered_map<std::string, int> string_map;
      |          ^~~~~~~~~~~
a.cc:9:33: error: expected primary-expression before ',' token
    9 |     std::ubdered_map<std::string, int> string_map;
      |                                 ^
a.cc:9:35: error: expected primary-expression before 'int'
    9 |     std::ubdered_map<std::string, int> string_map;
      |                                   ^~~
a.cc:15:13: error: 'string_map' was not declared in this scope
   15 |         if (string_map.find(s) == string_map.end()) string_map[s] = 0;
      |             ^~~~~~~~~~
a.cc:18:19: error: 'string_map' was not declared in this scope
   18 |     for (auto &i: string_map) {
      |                   ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    map<string,long long> mp;
    map<string,long long> inc;
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        if(mp.find(s)==mp.end()){
            mp[s]=0;
            inc[s]=0
        }
        else {
            inc[s]++;
            mp[s]+=inc[s];
        }
    }
    long long ans=0;
    for(auto itr = mp.begin();itr!=mp.end();itr++){
        ans+=itr->second;
    }
    cout<<ans<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: expected ';' before '}' token
   14 |             inc[s]=0
      |                     ^
      |                     ;
   15 |         }
      |         ~
Language: C++

#include <iostream>
#include <map>
#include <string>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n;
	string s[100000];
	cin>>n;
	rep(i,n) cin>>s[i], sort(s[i].begin(),s[i].end());

	map<string,int> f;
	rep(i,n) ++f[s[i]];

	long long ans=0;
	for(auto a:f) ans+=a.second*(a.second-1LL)/2;
	cout<<ans<<endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |         rep(i,n) cin>>s[i], sort(s[i].begin(),s[i].end());
      |                             ^~~~
      |                             short
Language: C++

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

int main(){
    long long n = 3; 
    
    cin >> n;
    
    // map<string, long long> m;

    // long n = 3;
    map<string, long long> m = {{"acornistnt", 1}, {"peanutbomb", 2} ,{"constraint", 3}};
    map<string, long long> m;
    
    // vector<string> ss = {"acornistnt", "peanutbomb","constraint"};

    // for(long long i=0; i<n; i++){
    //     string s = ss.at(i);
    //     sort(s.begin(), s.end());
    //     m.insert(make_pair(s, i));
    // }

    // for(long long i=0; i<n; i++){
    //     string s;
    //     // cin >> s;
    //     sort(s.begin(), s.end());
    //     m[s]++;
    // }

    long long ans=0;

    for(auto p : m){
        long long x = p.second;
        cout << "x = " << x <<endl;
        ans += x * (x-1)/2;
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:28: error: redeclaration of 'std::map<std::__cxx11::basic_string<char>, long long int> m'
   15 |     map<string, long long> m;
      |                            ^
a.cc:14:28: note: 'std::map<std::__cxx11::basic_string<char>, long long int> m' previously declared here
   14 |     map<string, long long> m = {{"acornistnt", 1}, {"peanutbomb", 2} ,{"constraint", 3}};
      |                            ^
Language: C++

#include <iostream>
#include <string>
using namespace std;

int main(){
	int n;
  	int len = 'z'-'a' + 1;
  	long count=0;
  	cin >> n;
  	int **moji = new int*[n];
  	for(int i=0;i<n;i++){
    	moji[i] = new int[len];
    }
  	for(int i=0;i<n;i++){
    	string str;
      	cin >> str;
      	for(int j=0;j<10;j++){
        	moji[i][str[j]-'a']++;
        }
    }
  	for(int i=0;i<n-1;i++){
    	for(int j=i+1;j<n;j++){
          	bool flg = true;
        	for(int k=0;k<len;k++){
            	if(moji[i][k])!=moji[j][k]){
                	flg = false;
                  	break;
                }
            }
          	if(flg){
            	count++;
            }
        }
    }
  	cout <<count<< endl;
  	for(int i=0;i<n;i++){
    	delete[] moji[i];
    }
  	delete[] moji;
  	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:25:31: error: expected primary-expression before '!=' token
   25 |                 if(moji[i][k])!=moji[j][k]){
      |                               ^~
Language: Java

import java.util.*;
import java.lang.*;

public class ABC137C {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 0;
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            char[] chars = sc.next().toCharArray();
            Arrays.sort(chars);
            String s = new String(chars);
            Integer cnt = map.get(s);
            if (cnt == null) {
                cnt = 0;
            }
            map.put(s, cnt + 1);
        }
        for (long num : map.values()) {
            ans += num * (num - 1) / 2;
        }
        System.out.println(ans);
    }
}

Compiler output:
Main.java:4: error: class ABC137C is public, should be declared in a file named ABC137C.java
public class ABC137C {
       ^
1 error
Language: Java

import java.util.*;
import java.lang.*;

public class ABC137C {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = new String[n];
        
        for (int i = 0; i < n; i++) {
            char[] c = sc.next().toCharArray();
            Arrays.sort(c);
            s[i] = new String(c);
        }

        Arrays.sort(s);
        
        int cnt = 0;
        long ans = 0;
        
        for (int i = 1; i < n; i++) {
            if (s[i - 1].equals(s[i])) {
                cnt++;
            } else {
                ans += cnt * (cnt + 1) / 2;
                cnt = 0;
            }
            //System.out.println(cnt);
        }
        ans += cnt * (cnt + 1) / 2;
        //System.out.println("---");
        System.out.println(ans);
    }
}


Compiler output:
Main.java:4: error: class ABC137C is public, should be declared in a file named ABC137C.java
public class ABC137C {
       ^
1 error
Language: C++

#include<algorithm>
#include<string>
#include<iostream>
#define ll long long
int main(){
  ll N;
  cin >> N;
  string str[N];
  ll i;
  for(i=0;i<N;i++){
    cin >> str[i];
    sort(str[i].begin(),str[i].end());
  }
  sort(str,str+N);
  ll tmp=1;
  ll ans=0;
  for(i=1;i<N;i++){
    if(str[i-1]==str[i]){
      ans+=tmp;
      tmp++;
    }else tmp=1;
  }
       return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:8:3: error: 'string' was not declared in this scope
    8 |   string str[N];
      |   ^~~~~~
a.cc:8:3: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:11:12: error: 'str' was not declared in this scope; did you mean 'std'?
   11 |     cin >> str[i];
      |            ^~~
      |            std
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   12 |     sort(str[i].begin(),str[i].end());
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:14:8: error: 'str' was not declared in this scope; did you mean 'std'?
   14 |   sort(str,str+N);
      |        ^~~
      |        std
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   14 |   sort(str,str+N);
      |   ^~~~
      |   std::sort
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <iostream>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

int main() {
    int n;
    cin >> n;

    long long ans = 0;
    map<string, int> m;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        sort(s.begin(), s.end());
        ans += m[s++];
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: no 'operator++(int)' declared for postfix '++' [-fpermissive]
   18 |         ans += m[s++];
      |                  ~^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define LL long long
char s[20];
map<ll,int>mp;
int main(){
	int n;scanf("%d",&n);
	LL ans=0;
	for(int i=0;i<n;i++){
		scanf("%s",s);
		sort(s,s+10);ll x=0;
		for(int j=0;s[j];j++){
			x=x*26+s[j]-'a';
		}
		ans+=mp[x];
		mp[x]++;
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc:5:5: error: 'll' was not declared in this scope; did you mean 'LL'?
    5 | map<ll,int>mp;
      |     ^~
      |     LL
a.cc:5:11: error: template argument 1 is invalid
    5 | map<ll,int>mp;
      |           ^
a.cc:5:11: error: template argument 3 is invalid
a.cc:5:11: error: template argument 4 is invalid
a.cc: In function 'int main()':
a.cc:11:30: error: 'll' was not declared in this scope; did you mean 'LL'?
   11 |                 sort(s,s+10);ll x=0;
      |                              ^~
      |                              LL
a.cc:13:25: error: 'x' was not declared in this scope
   13 |                         x=x*26+s[j]-'a';
      |                         ^
a.cc:15:25: error: 'x' was not declared in this scope
   15 |                 ans+=mp[x];
      |                         ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class Main3 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int mojiSum[] = new int[n];
		char c[] = new char[10];
		for (int i = 0; i < n; i++) {
			c = sc.next().toCharArray();
			for (int j = 0; j < 10; j++) {
				mojiSum[i] += (int) c[j];
			}
		}

		Arrays.sort(mojiSum);
		long ans = 0;
		int j = 1;
		for (int i = 0; i < n - 1; i++) {
			if (mojiSum[i] == mojiSum[i + 1]) {
				ans += j++;
			} else {
				j = 1;
			}
		}

		System.out.println(ans);
	}
}


Compiler output:
Main.java:4: error: class Main3 is public, should be declared in a file named Main3.java
public class Main3 {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repm(i, m, n) for (int i = (m); i < (int)(n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  cin >> n;
  map<string, int> mp;
  rep(i, n){
    string s;
    cin >> s;
    sort(all(s));
    mp[s]++;
  }
  long long ans = 0;
  for (string &p : mp){
    int s = p.second;
    ans += (long long)s * (s - 1) / 2;
  }

  //string ans = "Yes";
  //string ans = "No";
  //string ans = "YES";
  //string ans = "NO";
  int cnt = 0;


  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   19 |   for (string &p : mp){
      |                    ^~
a.cc:20:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'second'
   20 |     int s = p.second;
      |               ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repm(i, m, n) for (int i = (m); i < (int)(n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  cin >> n;
  map<string, int> mp;
  rep(i, n){
    string s;
    cin >> s;
    sort(all(s));
    mp[s]++;
  }
  long long int = 0;
  for (string &p : mp){
    int s = p.second;
    ans += (long long)s * (s - 1) / 2;
  }

  //string ans = "Yes";
  //string ans = "No";
  //string ans = "YES";
  //string ans = "NO";
  int cnt = 0;


  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: expected unqualified-id before '=' token
   18 |   long long int = 0;
      |                 ^
a.cc:19:20: error: invalid initialization of reference of type 'std::string&' {aka 'std::__cxx11::basic_string<char>&'} from expression of type 'std::pair<const std::__cxx11::basic_string<char>, int>'
   19 |   for (string &p : mp){
      |                    ^~
a.cc:20:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'second'
   20 |     int s = p.second;
      |               ^~~~~~
a.cc:21:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     ans += (long long)s * (s - 1) / 2;
      |     ^~~
      |     abs
a.cc:31:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repm(i, m, n) for (int i = (m); i < (int)(n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define all(vec) vec.begin(), vec.end()
using namespace std;

int main(){
  int n;
  cin >> n;
  map(string, int) mp;
  rep(i, n){
    string s;
    cin >> s;
    sort(all(s));
    mp[s]++;
  }
  long long int = 0;
  for (string &p : mp){
    int s = p.second;
    ans += (long long)s * (s - 1) / 2;
  }

  //string ans = "Yes";
  //string ans = "No";
  //string ans = "YES";
  //string ans = "NO";
  int cnt = 0;


  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:6: error: missing template arguments before '(' token
   11 |   map(string, int) mp;
      |      ^
a.cc:11:13: error: expected primary-expression before ',' token
   11 |   map(string, int) mp;
      |             ^
a.cc:11:15: error: expected primary-expression before 'int'
   11 |   map(string, int) mp;
      |               ^~~
a.cc:16:5: error: 'mp' was not declared in this scope
   16 |     mp[s]++;
      |     ^~
a.cc:18:17: error: expected unqualified-id before '=' token
   18 |   long long int = 0;
      |                 ^
a.cc:19:20: error: 'mp' was not declared in this scope; did you mean 'p'?
   19 |   for (string &p : mp){
      |                    ^~
      |                    p
a.cc:20:15: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'second'
   20 |     int s = p.second;
      |               ^~~~~~
a.cc:21:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     ans += (long long)s * (s - 1) / 2;
      |     ^~~
      |     abs
a.cc:31:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) {return *(char*)a - *(char*)b;}
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)


int main(void)
{
	char s[100001][11];
	int n;
	scanf("%d", &n);
	int i, j;
	for (i = 0; i < n; i++) {
		scanf("%s", s[i]);
		qsort(s[i], 10, sizeof(char), compare_string);
	}
	for (i = 0; i < n; i++)
	{
		printf("%s\n", s[i]);
		qsort(s[i], 10, sizeof(char), cmp_char);
	}
	
	int ana = 0;
	for (i = 0; i < n - 1; i++)
	{
		for (j = i + 1; j < n; j++)
		{
			if(strcmp(s[i], s[j]) == 0) ana++;
		}
	}
	printf("%d\n", ana);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:47: error: 'compare_string' undeclared (first use in this function)
   23 |                 qsort(s[i], 10, sizeof(char), compare_string);
      |                                               ^~~~~~~~~~~~~~
main.c:23:47: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<string>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define vi vector<ll>
#define el printf("\n")
#define N 100001
using namespace std;
ll fact(ll n)
{
ll    res=1;
    for(int i = 1; i <= n;i++){
    res = res * i ;
}
return res;
}



int main()
{   IOS;
    ll a;
    cin >> a;
    vector<string> L;
    for(int i=0;i<a;i++)
    {
        string ch;
        cin >> ch ;
        sort(ch.begin(),ch.end());
        L.push_back(ch);
    }
    sort(L.begin(),L.end());
    /*for(int i=0;i<a;i++)
        cout << L[i];*/
    ll str=1;
    vector <ll> L2;
    for(int i=0;i<a-1;i++)
    {
        if (L[i]==L[i+1])
            str++;
        else
           {
                L2.push_back(str);
                str=1;
           }5

    }
    if(str!=0) L2.push_back(str);
    ll res=0;
    for(int i=0;i<L2.size();i++)
        {
            if(L2[i]!=1)
                res+=fact(L2[i])/((fact(2)*fact(L2[i]-2)));
        }


    cout << res;




    cout.precision(30);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:14: error: expected ';' before '}' token
   47 |            }5
      |              ^
      |              ;
   48 | 
   49 |     }
      |     ~
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define int long long
#define FOR(i, m, n) for(int i = m;i < n;i++)
typedef vector<int> VI;
typedef vector<VI> VVI;
const int MOD=1000000007;
const long long INF = 1LL << 60;
//----------------------------------------------
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    map<string,int>mozi;
    rep(i,n){
        string s;
        cin >> s;
        sort(s.begin(),s.end());
		mozi[s]++;
    }
    int ans = 0;
    int x;
    for(auto p:mozi){
        x = p.second;
        ans += (x * ( x - 1 ) / 2);
    }
    cout << ans <<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   29 |         sort(s.begin(),s.end());
      |         ^~~~
      |         short
Language: C++

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

int main(){

  long long n;
  cin >> n;

  
  unordered_map<string,int> mp;
  for(int i=0;i<n;i++){
  string s;
  
cin >>s;
    sort(s.begin(),s.end());
    
    mp[s]++;
  }
  
  

long long  count=;
  for(auto& p : mp){
  long long c=p.second;
    count+= c*(c-1)/2;
  
  }
  
  cout << count << endl;



}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:18: error: expected primary-expression before ';' token
   22 | long long  count=;
      |                  ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;
using sl = signed long;
using sll = signed long long;
using ll = long long;

// -exec call dup2(open("input.txt", 0), 0)
int main(int argc, char *argv[])
{
	int N;
	cin >> N;
	string tmp;
	vector<string> vec;

	for(int i=0;i<N;i++){
		cin >> tmp;	
		sort(tmp.begin(), tmp.end());
		vec.push_back(tmp);
	}

	sort(vec.begin(), vec.end());

	int cnt = 0, k = 0, sum = 0;
	for(int i=1;i<N;i++){
		if (vec[i]==vec[cnt] ){
			k++;
			//sum += k;
		}else{
			sum += k*(k-1)/2;
			k = 1
			cnt = i;
		}
	}
	sum += k*(k-1)/2;

	cout << sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:34:30: error: expected ';' before 'cnt'
   34 |                         k = 1
      |                              ^
      |                              ;
   35 |                         cnt = i;
      |                         ~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define int long long
int main(){
	int n;
	cin>>n;
	string a[n];
	map<string,int>ma;
	for(int i=0;i<n;++i){
		cin>>a[i];
		sort(a[i].begin(),a[i].end());
	}
	int tot=0;
	for(int i=0;i<n;++i){
		tot+=ma[a[i]];
		++ma[a[i]];
	}
	cout<<tot<<endl;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#define SIZE 100005

using namespace std;
typedef long long int ll;

int main()
{
    int n;
    scanf("%d", &n);
    map<string, int> mp;
    for (int i=0; i<n; i++)
    {
        string str;
        cin >> str;
        sort(str.begin(), str.end());
        mp[str]++;
    }

    ll sum = 0;
    for (auto& e : map)
    {
        sum += e.second * (e.second - 1) / 2;
    }
    printf("%lld\n", sum);

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:23: error: missing template arguments before ')' token
   21 |     for (auto& e : map)
      |                       ^
Language: C++

#include <iostream>
#include <array>
#include <map>
using namespace std;
int main()
{
	int N;
	cin >> N;
	map<string, uint64_t> map;

	for (auto i = 0; i < N; i++) {
		string str;
		cin >> str;
		sort(str.begin(), str.end());
		map[str]++;
	}

	uint64_t result = 0;
	for (auto& e : map) {
		result += (e.second) * (e.second - 1) / 2;
	}
	cout << result << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: 'uint64_t' was not declared in this scope
    9 |         map<string, uint64_t> map;
      |                     ^~~~~~~~
a.cc:4:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    3 | #include <map>
  +++ |+#include <cstdint>
    4 | using namespace std;
a.cc:9:29: error: template argument 2 is invalid
    9 |         map<string, uint64_t> map;
      |                             ^
a.cc:9:29: error: template argument 4 is invalid
a.cc:14:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |                 sort(str.begin(), str.end());
      |                 ^~~~
      |                 short
a.cc:15:20: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   15 |                 map[str]++;
      |                    ^
a.cc:18:17: error: expected ';' before 'result'
   18 |         uint64_t result = 0;
      |                 ^~~~~~~
      |                 ;
a.cc:19:24: error: 'begin' was not declared in this scope; did you mean 'std::begin'?
   19 |         for (auto& e : map) {
      |                        ^~~
      |                        std::begin
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:114:37: note: 'std::begin' declared here
  114 |   template<typename _Tp> const _Tp* begin(const valarray<_Tp>&) noexcept;
      |                                     ^~~~~
a.cc:19:24: error: 'end' was not declared in this scope; did you mean 'std::end'?
   19 |         for (auto& e : map) {
      |                        ^~~
      |                        std::end
/usr/include/c++/14/bits/range_access.h:116:37: note: 'std::end' declared here
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
a.cc:20:17: error: 'result' was not declared in this scope
   20 |                 result += (e.second) * (e.second - 1) / 2;
      |                 ^~~~~~
a.cc:22:17: error: 'result' was not declared in this scope
   22 |         cout << result << endl;
      |                 ^~~~~~
Language: C++

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

int main(void){
  int n;
  map<string,int> counter;
  cin >> n;
  int doble = 0;
  string t;
  for(int i = 0 i < n; i++){
    cin >> t;
    sort(t.begin(),t.end());
    counter[t]++;
    doble += (counter[t]*(counter[t]-1))/2;
  }
  cout << doble << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: expected ';' before 'i'
   10 |   for(int i = 0 i < n; i++){
      |                ^~
      |                ;
Language: Java

import java.util.Collections;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.Map;

public class GreenBIn {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        Map<String, Integer> m = new HashMap<>();

        for (int i=0; i<n; i++){
            String st = sc.next();
            char[] c = st.toCharArray();
            Arrays.sort(c);
            st = new String(c);
//            System.out.println(st);
            if (m.containsKey(st)){
                m.put(st, m.get(st)+1);
            }else{
                m.put(st, 1);
            }
        }
//        System.out.println(m);

        long ans = 0;

        for (Integer v: m.values()){
            ans += v*(v-1)/2;
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:7: error: class GreenBIn is public, should be declared in a file named GreenBIn.java
public class GreenBIn {
       ^
1 error
Language: C++

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

int main()
{
  int i,j,k;
  map<string,int> m;
  string str;
  
  cin>>n;
  for(i=0;i<n;i++)
  {
    cin>>str;
    sort(str.begin(),str.end());
    m[str]++;
  }
  for(auto it=m.begin(),it!=m.end();it++)
  {
    j=it->second;
    res+=(j*(j-1))/2;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: 'n' was not declared in this scope
   10 |   cin>>n;
      |        ^
a.cc:17:27: error: expected ';' before '!=' token
   17 |   for(auto it=m.begin(),it!=m.end();it++)
      |                           ^~
      |                           ;
a.cc:17:27: error: expected primary-expression before '!=' token
   17 |   for(auto it=m.begin(),it!=m.end();it++)
      |                           ^~
a.cc:20:5: error: 'res' was not declared in this scope
   20 |     res+=(j*(j-1))/2;
      |     ^~~
Language: Java

import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for(int i = 0; i < n; i++){
			s[i] = sc.next();
		}
		TreeMap<Integer,Integer> map = new TreeMap<Integer,Integer>();
		for(int i = 0; i < n; i++){
			int[] a = new int[10];
			for(int j = 0; j < 10; j++){
				a[j] = s[i].charAt(j);
			}
			Arrays.sort(a);
			long b = 0;
			for(int j = 0; j < 10; j++){
				b*=10;
				b+=a[j];
			}
			if(map.containsKey(b)){
				map.put(b,map.get(b)+1);
			}else{
				map.put(b,0);
			}
		}
		long ans = 0;
		Iterator<Integer> it = map.keySet().iterator();
		while (it.hasNext()) {
			int key = it.next();
			ans+=(long)map.get(key)*(map.get(key)+1)/2;
		}
		System.out.print(ans);
	}
}


Compiler output:
Main.java:24: error: incompatible types: long cannot be converted to Integer
				map.put(b,map.get(b)+1);
				        ^
Main.java:26: error: incompatible types: long cannot be converted to Integer
				map.put(b,0);
				        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: C++

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;

int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    for (int i = 0; i < n; i++) {
        cin >> s[i];
        sort(s[i].begin(), s[i].end())
    }
    map<string, int> mp;
    for (string x : s) map[x]++;
    long long ans = 0;
    for (auto p : mp) {
        long long c = p.second;
        ans += c * (c-1) /2;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:39: error: expected ';' before '}' token
   24 |         sort(s[i].begin(), s[i].end())
      |                                       ^
      |                                       ;
   25 |     }
      |     ~                                  
a.cc:27:28: error: redeclaration of 'auto x'
   27 |     for (string x : s) map[x]++;
      |                            ^
a.cc:27:17: note: 'std::string x' previously declared here
   27 |     for (string x : s) map[x]++;
      |                 ^
a.cc:27:30: error: expected initializer before '++' token
   27 |     for (string x : s) map[x]++;
      |                              ^~
a.cc:27:30: error: expected ';' before '++' token
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
using namespace std;

int main()
{
    int STRLEN = 10;
    char buff[STRLEN+1];
    buff[STRLEN] = 0;

    int N;
    cin >> N;

    map<string, int> anaCounts;

    for (int i = 0; i < N; ++i) {
        string s;
        cin >> s;
        memcpy(buff, s.c_str(), STRLEN);
        sort(buff, buff+STRLEN);
        ++(anaCounts[buff]);
    }

    int ans = 0;
    for (auto it = anaCounts.begin(); it != anaCounts.end(); ++it) {
        int count = it->second;
        ans += count * (count-1) / 2;
    }

    cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'memcpy' was not declared in this scope
   22 |         memcpy(buff, s.c_str(), STRLEN);
      |         ^~~~~~
a.cc:6:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <map>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i, n) for(int i=((int)(n));i>0;i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)	
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	int N;
	ll cnt;
	cin >> N;
	map<string, ll> C;
	rep(i, N){
		string S;
		cin >> S;
		SORT(S);
		if(C,count(S)){
			cnt += C.at(S);
			C.at(S)++;
		} else {
			C[S] = 0;
		}
	}
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: no matching function for call to 'count(std::string&)'
   23 |                 if(C,count(S)){
      |                      ~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i, n) for(int i=((int)(n));i>0;i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)	
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
const long long MOD = 1000000007;
typedef long long ll;

int main(){
	int N;
	ll cnt;
	cin >> N;
	map<string, ll> C;
	rep(i, N){
		string S;
		cin >> S;
		SORT(S);
		if(!C,count(S)){
			C[S] = 0;
		} else {
			cnt += C[S];
			C[S]++;
		}
	}
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: no match for 'operator!' (operand type is 'std::map<std::__cxx11::basic_string<char>, long long int>')
   23 |                 if(!C,count(S)){
      |                    ^~
a.cc:23:20: note: candidate: 'operator!(bool)' (built-in)
a.cc:23:20: note:   no known conversion for argument 1 from 'std::map<std::__cxx11::basic_string<char>, long long int>' to 'bool'
a.cc:23:28: error: no matching function for call to 'count(std::string&)'
   23 |                 if(!C,count(S)){
      |                       ~~~~~^~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4025:5: note: candidate: 'template<class _IIter, class _Tp> typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::count(_IIter, _IIter, const _Tp&)'
 4025 |     count(_InputIterator __first, _InputIterator __last, const _Tp& __value)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:4025:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Tp> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, typename std::iterator_traits<_II>::difference_type> std::count(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, const _Tp&)'
  101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value);
      | ^~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note:   candidate expects 4 arguments, 1 provided
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define for(i, m, n) for(int i = m; i < n; i++)
#define inf 1e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main(){
  int n;
  cin >> n;
  map<string, int> s;
  rep(i, n) {
    string si;
    cin >> si;
    sort(si.begin(), si.end());
    mp[si]++;
  }
  ll ans = 0;
  for (auto& p : s) {
    int x = p.second;
    ans += (ll)s * (s-1) / 2;
  }
  cout << ans << endl;
}

Compiler output:
a.cc:14:11: error: macro "for" requires 3 arguments, but only 1 given
   14 |   rep(i, n) {
      |           ^
a.cc:4:9: note: macro "for" defined here
    4 | #define for(i, m, n) for(int i = m; i < n; i++)
      |         ^~~
a.cc:21:19: error: macro "for" requires 3 arguments, but only 1 given
   21 |   for (auto& p : s) {
      |                   ^
a.cc:4:9: note: macro "for" defined here
    4 | #define for(i, m, n) for(int i = m; i < n; i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:14:13: error: expected '(' before '{' token
   14 |   rep(i, n) {
      |             ^
      |             (
a.cc:14:13: error: expected primary-expression before '{' token
a.cc:21:3: error: expected primary-expression before 'for'
   21 |   for (auto& p : s) {
      |   ^~~
a.cc:20:14: error: expected ')' before 'for'
   20 |   ll ans = 0;
      |              ^
      |              )
   21 |   for (auto& p : s) {
      |   ~~~         
a.cc:14:13: note: to match this '('
   14 |   rep(i, n) {
      |             ^
a.cc:21:21: error: expected '(' before '{' token
   21 |   for (auto& p : s) {
      |                     ^
      |                     (
a.cc:21:21: error: expected primary-expression before '{' token
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
a.cc:25:23: error: expected ')' before '}' token
   25 |   cout << ans << endl;
      |                       ^
      |                       )
   26 | }
      | ~                      
a.cc:21:21: note: to match this '('
   21 |   for (auto& p : s) {
      |                     ^
a.cc:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^
Language: C++

#include <cstdio>
#include <string>
#include <unordered_map>

using namespace std;

long sum(long n) {
  if (n == 0) return 0;
  return n + sum(n - 1);
}

int main() {
  int n;
  scanf("%d", &n);
  unsigned char arr[n][26];
  memset(arr, 0, n * 26);

  unordered_map<string, long> hoge;

  for (int i = 0; i < n; ++i) {
    char box[12];
    scanf("%s", &box[0]);
    char tmp[26];
    memset(tmp, 0, 26);
    for (int j = 0; j < 10; ++j) {
      tmp[(unsigned char)box[j] - 0x61]++;
    }
    string str = "";
    for (int j = 0; j < 26; ++j) {
      str += (char)(tmp[j] + 0x61) + to_string((int)tmp[j]);
    }
    if (hoge.find(str) == hoge.end()) {
      hoge.insert(make_pair(str, 0));
    } else {
      hoge[str]++;
    }
  }

  long cnt = 0;

  auto itr = hoge.begin();
  for (itr; itr != hoge.end(); itr++) {
    cnt += sum(itr->second);
  }

  printf("%ld\n", cnt);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'memset' was not declared in this scope
   16 |   memset(arr, 0, n * 26);
      |   ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <unordered_map>
  +++ |+#include <cstring>
    4 |