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

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

int main(){
  int n;
  cin >> n;
  map<string,int> mp;
  rep(i,n){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    mp[s]++;
  }
  ll ans=0;
  for (auto p : mp){
    int s = p.second;//s・・・sortしたときに同じ文字列となっている文字列の個数
    //ans+=s*(s-1)/2;と書くとs*(s-1)がオーバーフローしちゃうからllでキャストしておく
    ans+=(ll)s*(s-1)/2;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'll'
    4 | using ll long long;
      |       ^~
a.cc: In function 'int main()':
a.cc:16:3: error: 'll' was not declared in this scope
   16 |   ll ans=0;
      |   ^~
a.cc:20:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     ans+=(ll)s*(s-1)/2;
      |     ^~~
      |     abs
a.cc:22:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

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

int main()
{
	int n; cin >> n;
	vector<string> c;
	for (int i = 0; i < n; i++) {
		string tmp_s; cin >> tmp_s;
		sort(tmp_s.begin(), tmp_s.end());
		c.push_back(tmp_s)
	}
	sort(c.begin(), c.end());
	
	ll ans = 0;
	for (int i = 0; i < n - 1; ) {
		ll cnt = 1;
		for (int j = i; j < n - 1; j++) {
			if (c[j] == c[j + 1]) {
				cnt++;
			}
			else {
				break;
			}
		}
		ans += cnt * (cnt - 1) / 2;
		i += cnt;
	}

	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:35: error: expected ';' before '}' token
   12 |                 c.push_back(tmp_s)
      |                                   ^
      |                                   ;
   13 |         }
      |         ~
Language: C++

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

// 二項係数計算
long long COM(int n, int k) {
	return n * (n - 1) / 2;
}

string SortString(string s) {

	string s_sort;
	vector<char> tmp(s.size());
	for (int i = 0; i < s.size(); i++) tmp[i] = s[i];
	sort(tmp.begin(), tmp.end());
	for (int i = 0; i < s.size(); i++) s_sort += tmp[i];
	return s_sort;
}

int main()
{
	int n; cin >> n;
	vector<string> c;
	for (int i = 0; i < n; i++) {
		string tmp_s; cin >> tmp_s;
		tmp_s = SortString(tmp_s);
		c.push_back(tmp_s);
	}
	sort(c.begin(), c.end());
	
	COMinit();
	ll ans = 0;
	for (int i = 0; i < n - 1; ) {
		ll cnt = 1;
		for (int j = i; j < n - 1; j++) {
			if (c[j] == c[j + 1]) {
				cnt++;
			}
			else {
				break;
			}
		}
		ans += COM(cnt, 2);
		i += cnt;
	}

	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'COMinit' was not declared in this scope
   31 |         COMinit();
      |         ^~~~~~~
Language: C++

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

int main(){
  int n;
  cin>>n;
  vector<string> v(n);
  for(int i=0; i<n; i++){
    cin>>v[i];
    sort(v[i].begin(), v[i].end());
  }
  int contador=0;
  for(int i=0; i<n; i++){
    for(int j=i+1; j<n; j++){
      if(v[i]==v[j])
        contador++;
    }
  }
  cout<<contador<<endl;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc.h++: No such file or directory
    1 | #include<bits/stdc.h++>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long[] a = new long[270];
        for(int i = 0; i < n; i++){
            String s = scanner.next();
            long count = 0;
            for(int j = 0; j < 10; j++){
                count += (s.charAt(j)-'a');
            }
            a[count]++;
        }
        long ans = 0;
        for(int i = 0; i < 270; i++){
            ans += a[i] * (a[i] - 1) / 2;
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:13: error: incompatible types: possible lossy conversion from long to int
            a[count]++;
              ^
1 error
Language: Java

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long ans = 0;
        int n = sc.nextInt();
        Map<String, Long> map = new HashMap<>();
        for(int i = 0; i < n; i++) {
            char[] ca = sc.next().toCharArray();
            Arrays.sort(ca);
            String s = String.valueOf(ca);
            if(map.containsKey(s)) map.put(s, map.get(s) + 1);
            else map.put(s, 1);
        }
        for(String key : map.keySet()) {
            ans += map.get(key) * (map.get(key) - 1) / 2;
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:17: error: incompatible types: int cannot be converted to Long
            else map.put(s, 1);
                            ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <iostream>
#include <math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <map>
#include <utility>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)
typedef pair<int, string> P;




int main() {
    int n;
    cin >> n;
    vector<string> s(n);
    rep(i, n) {
        cin >> s[i];
    }
    sort(s[i].begin(), s[i].end());
    sort(s.begin(), s.end());
    int c = 0;
    rep(i, n) {
        for (int j = i + 1; j < n; j++) {
            if (s[i] == s[j])c++;
            else break;
        }
    }
    cout << c << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:12: error: 'i' was not declared in this scope
   24 |     sort(s[i].begin(), s[i].end());
      |            ^
Language: C++

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

int main(){
  long long  N;
  cin >> N;
  vector<string> vec(N);
  for(int i=0;i<N;i++){
    cin >> vec.at(i);
  }
  
  for(long long i=0;i<N;i++){
    sort(vec.at(i).begin,vec.at(i).end));
  }
  
  long long count=0;
  
  for(long long i=0;i<N;i++){
    for(long long j=i;j<N;j++){
    if(vec.at(i)==vec.at(j)){
      count++;
    }
    }
  }
  
  cout << count << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   13 |     sort(vec.at(i).begin,vec.at(i).end));
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:13:9: note:   couldn't deduce template parameter '_RAIter'
   13 |     sort(vec.at(i).begin,vec.at(i).end));
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fi first
#define se second
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define rep11(i, n) for (int i = 1; i < (int)(n); ++i)
#define rep0(i, n) for (int i = 1; i <= (int)(n); ++i)
#define repo(i, o, n) for (int i = o; i < (int)(n); ++i)
#define repm(i, n) for (int i = (int)(n)-1; i >= 0; --i)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1002000007
#define INF LO

int main(){
    long long n;
    cin>>n;
    vector<string> s;
    rep(i,n){
        string S;
        cin>>S;
        s.push_back(S);
    }
    map<string,long long> mp;
    rep(i,n){
        sort(s[i].begin(),s[i].end());
        mp[s[i]]+=1;
    }
    long long ans_a=0;
    for(auto it=mp.begin(); it!=mp.end(); ++it){
        pair<string,long long> v =*it;
        ans_a+=v.second*(v.second-1)/2;
    
    cout<<ans_a<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:20:11: note: to match this '{'
   20 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REP(a, b, m) for (ll a = (ll)(b); a < (ll)(m); a++)

int main()
{
    ll n;
    cin >> n;
    vector<string> v(n);
    ll ans = 0;
    rep(i, n)
    {
        cin >> v[i];
        sort(v[i].begin(), v[i].end());
    }
    sort(v.begin(), v.end());
    ll memo = 0;
    rep(i, n)
    {

        if (i == 0)
        {
            memo++;
        }
        else if (v[i] == v[i - 1])
        {
            memo++;
        }
        else
        {
            ans += memo * (memo - 1) / 2;
            memo = 1;
        }
        if (i == n - 1)
        {
            ans += memo * (memo - 1) / 2;
        }
        cout << ans << endl;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:44:6: error: expected '}' at end of input
   44 |     }
      |      ^
a.cc:11:1: note: to match this '{'
   11 | {
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
int main() {
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  vector<string> s(n);
  map<string,int> mp;
  rep(i,n){
    cin >> s.at(i);
    sort(ALL(s.at(i)));
    mp[s.at(i)]++;
  }
  ll ans = 0;
  for(auto p:mp){
    ll i = p.second();
    ans+=i*(i-1)/2;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:20: error: expression cannot be used as a function
   28 |     ll i = p.second();
      |            ~~~~~~~~^~
Language: C++

import itertools
n= int(input())
s = [str(sorted(list(input()))) for i in range(n)]
l=[]
for si in set(s):
  x=0
  for sj in s:
    if si==sj:
      x+=1
  l.append(x)
ans=0
for i in l:
  x=len(list(itertools.combinations(range(i),2)))
  ans+=x
print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import itertools
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main()
{
  ll n, c=0;
  cin >> n;
  string st;
  map<vecll, ll> m;
  forll(i, 0, n){
	cin >> st;
	vecll t(26, 0);
	forll(j, 0, 10){
	  t[st[j] - 'a']++;
	}
	m[t]++;
  }
  for(auto i=m.begin(); i!=m.end(); i++){
	c += (i->second) * (i->second - 1) / 2
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:47: error: expected ';' before '}' token
   29 |         c += (i->second) * (i->second - 1) / 2
      |                                               ^
      |                                               ;
   30 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    long long N;
    cin >> N;
    map<string,long long> m;
    rep(i,N){
        string x;
        cin >> x;
        sort(x.begin(),x.end());
        m[x]++;
    }
    long long ans=0;
    for(auto p:m){
        ans+=p.second*(p.second-1)/LL;
    }
    cout << ans << endl;



}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: 'LL' was not declared in this scope
   27 |         ans+=p.second*(p.second-1)/LL;
      |                                    ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  string s[N];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < n; j++) {
      if (s[i] == s[j]) {
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:23: error: 'n' was not declared in this scope
    8 |   for (int i = 0; i < n; i++) {
      |                       ^
a.cc:13:29: error: 'n' was not declared in this scope
   13 |     for (int j = i + 1; j < n; j++) {
      |                             ^
Language: C

#include <stdio.h>
#include <stdlib.h>

int StringInt(char* str){
	const int string_num = 10;
	int i;
	int str_total_num = 0;
	for(i = 0; i < string_num; i++){
		str_total_num += str[i];
	}
	return str_total_num;
}

int main(void){
	int N;
	int str_total_num;
	int i, j;
	long long count = 0;
	char** str;
	int* str_int;
	scanf("%d", &N);
	
	str_int = malloc(N * sizeof(int))
	//2次元配列動的生成
	str = malloc(N * sizeof(char*));
	for(i = 0; i < N; i++){
		str[i] = malloc(11);
	}
	
	//文字列入力
	for(i = 0; i < N; i++){
		scanf("%s", str[i]);
	}
	
	//i番目の文字列の数値データを生成する
	for(i = 0; i < N; i++){
		str_int[i] = StringInt(str[i]);
	}
	
	for(i = 0; i < N; i++){
		//同じ総数値の文字列を探す
		for(j = i + 1; j < N; j++){
			if(str_int[i] == str_int[j]){
				count++;
			}
		}
	}
	printf("%I64llu", count);
	
	//メモリの解放
	for(i = 0; i < N; i++){
		free(str[i]);
	}
	free(str);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:23:42: error: expected ';' before 'str'
   23 |         str_int = malloc(N * sizeof(int))
      |                                          ^
      |                                          ;
   24 |         //2次元配列動的生成
   25 |         str = malloc(N * sizeof(char*));
      |         ~~~
Language: C

#include <stdio.h>
#include <stdlib.h>

int StringInt(char* str){
	const int string_num = 10;
	int i;
	int str_total_num = 0;
	for(i = 0; i < string_num; i++){
		str_total_num += str[i];
	}
	return str_total_num;
}

int main(void){
	int N;
	int str_total_num;
	int i, j;
	__int64 count = 0;
	char** str;
	scanf("%d", &N);
	
	//2次元配列動的生成
	str = malloc(N * sizeof(char*));
	for(i = 0; i < N; i++){
		str[i] = malloc(11);
	}
	
	//文字列入力
	for(i = 0; i < N; i++){
		scanf("%s", str[i]);
	}
	
	for(i = 0; i < N; i++){
		//i番目の文字列の文字データの総数値を求める
		str_total_num = StringInt(str[i]);
		
		//同じ総数値の文字列を探す
		for(j = i + 1; j < N; j++){
			if(str_total_num == StringInt(str[j])){
				count++;
			}
		}
	}
	printf("%I64llu", count);
	
	//メモリの解放
	for(i = 0; i < N; i++){
		free(str[i]);
	}
	free(str);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:18:9: error: unknown type name '__int64'; did you mean '__int64_t'?
   18 |         __int64 count = 0;
      |         ^~~~~~~
      |         __int64_t
Language: C++

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




int main()
{	
	ll n,ans=0;
	cin>>n;
 string s;
  set<string>st;


for(ll i=0;i<n;i++)
{
  cin>>s;
  sort(s.begin(),s.end());
  if(st.count!=0)ans++;
  st.insert(s);
}

  cout<<ans;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   20 |   if(st.count!=0)ans++;
      |      ~~~~~~~~^~~
      |         |      |
      |         |      int
      |         <unresolved overloaded function type>
Language: C++

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




int main()
{	
	ll n,ans=0;
	cin>>n;
 string s;
  set<string>st;


for(ll i=0;i<n;i++)
{
  cin>>s;
  sort(s.begin(),s.end());
  if(s.count!=0)ans++;
  st.insert(s);
}

  cout<<ans;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   20 |   if(s.count!=0)ans++;
      |        ^~~~~
Language: C++

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




int main()
{	
	ll n;
	cin>>n;
 string s;
  set<string>st;


for(ll i=0;i<n;i++)
{
  cin>>s;
  sort(s.begin(),s.end());
  if(s.count!=0)ans++;
  st.insert(s);
}

  cout<<ans;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'count'
   20 |   if(s.count!=0)ans++;
      |        ^~~~~
a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   if(s.count!=0)ans++;
      |                 ^~~
      |                 abs
a.cc:24:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   cout<<ans;
      |         ^~~
      |         abs
Language: C++

#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//abc138C
int compare_int(const void *a, const void *b) {//sort
  return *(int*) a - *(int*) b;
}

int main(void) {
  int n, k, i, cou=0, tmp, com=0;
  char t;
  long long sum=0;
  scanf("%d", &n);
  int s[n];

  for(i=0; i < n; i++){
    s[i]=0;
    for(k=0; k < 10; k++){
      scanf(" %c", &t);
      //printf("%d ",t);
      s[i]+=pow(2, t - 97);

    }
    //printf("%d ",s[i]);
  }
  //printf("\n\n");
  qsort(s, n, sizeof(int), compare_int);//sort

  for(i=1; i < n; i++){
    if(s[i]==s[i-1])com++;
    else{
      for(k=0;k<com;k++)sum+=(long long)k+1;
      com=0;
    }
  }
  for(k=0;k<com;k++)(long long)sum+=k+1;


  printf("%lld",sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:21: error: lvalue required as left operand of assignment
   38 |   for(k=0;k<com;k++)(long long)sum+=k+1;
      |                     ^~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<string>S(N);
  for(int i=0;i<N;i++){
    cin>>S.at(i);
    sort(S.at(i).begin(),S.at(i).end());
  }
  sort(S.begin(),S.end());
  vector<long long>A;
  long long count=1;
  for(int i=0;i<N-1;i++){
    if(S.at(i)==S.at(i+1)){
      count=count+1;
      if(i==N-2){
        A.append(count);
      }
    }
    else{
      A.append(count);
      count=1;
    }
  }
  long long sum;
  for(int i=0;i<A.size();i++){
    sum=sum+(A.at(i)*(A.at(i)-1))/2;
  }
  cout<<sum<<endl;
}
    
      
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: error: 'class std::vector<long long int>' has no member named 'append'
   18 |         A.append(count);
      |           ^~~~~~
a.cc:22:9: error: 'class std::vector<long long int>' has no member named 'append'
   22 |       A.append(count);
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int64_t N;
  cin>>N;
  vector<string>S(N);
  for(int i=0;i<N;i++){
  string s;
    cin>>s;
    sort(s.begin(),s.end());
    S.at(i)=s;
  }map<string,int64_t>M;
  for(int64_t i=0;i<N;i++){
  if(!M.count(S.at(i))
     M[S.at(i)]=1;
     else
     M.at(S.at(i))++;
  }int64_t ans=0;
     for(auto p:M){
     auto k=p.first;
       auto v=p.second;
       ans+=(M[k]*(M[k]-1))/2;
     } cout<<ans<<endl;
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: expected ';' before 'M'
   14 |   if(!M.count(S.at(i))
      |                       ^
      |                       ;
   15 |      M[S.at(i)]=1;
      |      ~                 
a.cc:16:6: error: expected primary-expression before 'else'
   16 |      else
      |      ^~~~
a.cc:15:19: error: expected ')' before 'else'
   15 |      M[S.at(i)]=1;
      |                   ^
      |                   )
   16 |      else
      |      ~~~~          
a.cc:14:5: note: to match this '('
   14 |   if(!M.count(S.at(i))
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int64_t N;
  cin>>N;
  vector<string>S(N);
  for(int i=0;i<N;i++){
  string s;
    cin>>s;
    sort(s.begin(),s.end());
    S.at(i)=s;
  }map<string,int64_t>M;
  for(int64_t i=0;i<N;i++){
  if(M.count(S.at(i))
     M[S.at(i)]=1;
     else
     M.at(S.at(i))++;
  }int64_t ans=0;
     for(auto p:M){
     auto k=p.first;
       auto v=p.second;
       ans+=(M[k]*(M[k]-1))/2;
     } cout<<ans<<endl;
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before 'M'
   14 |   if(M.count(S.at(i))
      |                      ^
      |                      ;
   15 |      M[S.at(i)]=1;
      |      ~                
a.cc:16:6: error: expected primary-expression before 'else'
   16 |      else
      |      ^~~~
a.cc:15:19: error: expected ')' before 'else'
   15 |      M[S.at(i)]=1;
      |                   ^
      |                   )
   16 |      else
      |      ~~~~          
a.cc:14:5: note: to match this '('
   14 |   if(M.count(S.at(i))
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int64_t N;
  cin>>N;
  vector<string>S(N);
  for(int i=0;i<N;i++){
  string s;
    cin>>s;
    sort(s.begin(),s.end());
    S.at(i)=s;
  }map<string,int64_t>M;
  for(int64_t i=0;i<N;i++){
  if(M.count(S.at(i))
     M[S.at(i)]=1;
     else
     M.at(S.at(i))++;
  }int64_t ans=0;
     for(auto p:M){
     auto k=p.first;
       auto v=p.second;
       sum+=(M[k]*(M[k]-1))/2;
     } cout<<sum<<endl;
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected ';' before 'M'
   14 |   if(M.count(S.at(i))
      |                      ^
      |                      ;
   15 |      M[S.at(i)]=1;
      |      ~                
a.cc:16:6: error: expected primary-expression before 'else'
   16 |      else
      |      ^~~~
a.cc:15:19: error: expected ')' before 'else'
   15 |      M[S.at(i)]=1;
      |                   ^
      |                   )
   16 |      else
      |      ~~~~          
a.cc:14:5: note: to match this '('
   14 |   if(M.count(S.at(i))
      |     ^
a.cc:22:8: error: 'sum' was not declared in this scope
   22 |        sum+=(M[k]*(M[k]-1))/2;
      |        ^~~
a.cc:23:14: error: 'sum' was not declared in this scope
   23 |      } cout<<sum<<endl;
      |              ^~~
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  long long int a,c=0;cin>>a;
  string d
  map<string,long long int>b;
  rep(i,a){
    cin>>d;
    sort(d.begin(),d.end());
    if(b.count(d))b[d]++;
    else b[d]=1;
  }
  for(auto i=b.begin();i!=b.end;i++){
    c+=b[i]*(b[i]+1)/2;
  }
  cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected initializer before 'map'
    8 |   map<string,long long int>b;
      |   ^~~
a.cc:10:10: error: 'd' was not declared in this scope
   10 |     cin>>d;
      |          ^
a.cc:12:8: error: 'b' was not declared in this scope
   12 |     if(b.count(d))b[d]++;
      |        ^
a.cc:15:14: error: 'b' was not declared in this scope
   15 |   for(auto i=b.begin();i!=b.end;i++){
      |              ^
Language: C++

#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define rep(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  long long int a,c=0;cin>>a>>b;
  string d
  map<string,long long int>b;
  rep(i,a){
    cin>>d;
    sort(d.begin(),d.end());
    if(b.count(d))b[d]++;
    else b[d]=1;
  }
  for(auto i=b.begin();i!=b.end;i++){
    c+=b[i]*(b[i]+1)/2;
  }
  cout<<c;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:31: error: 'b' was not declared in this scope
    6 |   long long int a,c=0;cin>>a>>b;
      |                               ^
a.cc:8:3: error: expected initializer before 'map'
    8 |   map<string,long long int>b;
      |   ^~~
a.cc:10:10: error: 'd' was not declared in this scope
   10 |     cin>>d;
      |          ^
Language: C++

#include<iostream>
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  long N;
  cin>>N;
  vector <string> s[100003];
  for (int i=0; i<N; i++) cin>>s[i];
  for (int i=0; i<N; i++) sort(s[i].begin(),s[i].end());
  long counter=0;
  for( int i=0; i<N; i++){
for( int j=i;j<N;j++){
  
   if (s[i]==s[j]) counter++;
}}
  cout<<counter<<endl;
}
    
    
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector <string> s[100003];
      |   ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include<algorithm>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:9:17: error: expected primary-expression before '>' token
    9 |   vector <string> s[100003];
      |                 ^
a.cc:9:19: error: 's' was not declared in this scope
    9 |   vector <string> s[100003];
      |                   ^
Language: C++

#include <bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
  long N;
  cin>>N;
  vector <string> s;
  for (int i=0; i<N; i++) cin>>s[i];
  for (int i=0; i<N; i++) sort(s[i].begin(),s[i].end());
  long counter=0;
  for( int i=0; i<N; i++){
for( int j=i;j<N;j++){
  
  
  do{ if (s[i]==s[j]) counter++;
    }while(next_permutation(s[j].begin(),s[j],end()));
}}
}
    
    
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:18:50: error: no matching function for call to 'end()'
   18 |     }while(next_permutation(s[j].begin(),s[j],end()));
      |                                               ~~~^~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
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:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/valarray:1249:5: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
 1249 |     end(valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1249:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/valarray:1265:5: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/valarray:1265:5: note:   candidate expects 1 argument, 0 provided
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long ans = 0;
        Hashmap<String, Integer> map = new Hashmap<String, Integer>();
        for(int i = 0; i < n; i++){
            char[] c = sc.next().ToCharArray();
            Arrays.sort(c);
            String s = String.valueOf(c);
            if(map.containsKey(s)){
                map.put(s,map.get(s)+1);
            }else{
                map.put(s,1);
            }
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()){
		    ans += calcComb(entry.getValue());
		}
        System.out.println(ans);
    }

    static long calcComb(int n){
        long ret = (long)n;
        return ((ret*ret)-ret)/2;
    }
}



Compiler output:
Main.java:10: error: cannot find symbol
        Hashmap<String, Integer> map = new Hashmap<String, Integer>();
        ^
  symbol:   class Hashmap
  location: class Main
Main.java:10: error: cannot find symbol
        Hashmap<String, Integer> map = new Hashmap<String, Integer>();
                                           ^
  symbol:   class Hashmap
  location: class Main
Main.java:12: error: cannot find symbol
            char[] c = sc.next().ToCharArray();
                                ^
  symbol:   method ToCharArray()
  location: class String
3 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
 
int main(){
  int n;
  cin>>n;
  map<string,int>mp;
  rep(i,n){
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    mp[s]++;
  }
  long long ans=0;
  for(pair<string,int> &p:mp){
    int s=p.second;
    ans+=(long long)s*(s-1)/2;
  }
  cout<<ans<<endl;
}
  /*
  
  long long ans=0;
  
  
  rep(i,n){
    cnt+=(long long)(mp[s[i]]*(mp[s[i]]-1))/2;
  }*/
  

Compiler output:
a.cc: In function 'int main()':
a.cc:16:27: error: cannot bind non-const lvalue reference of type 'std::pair<std::__cxx11::basic_string<char>, int>&' to an rvalue of type 'std::pair<std::__cxx11::basic_string<char>, int>'
   16 |   for(pair<string,int> &p:mp){
      |                           ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:779:19: note:   after user-defined conversion: 'constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&) [with _U1 = const std::__cxx11::basic_string<char>; _U2 = int; typename std::enable_if<(std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ConstructiblePair<_U1, _U2>() && std::_PCC<((! std::is_same<_T1, _U1>::value) || (! std::is_same<_T2, _U2>::value)), _T1, _T2>::_ImplicitlyConvertiblePair<_U1, _U2>()), bool>::type <anonymous> = true; _T1 = std::__cxx11::basic_string<char>; _T2 = int]'
  779 |         constexpr pair(const pair<_U1, _U2>& __p)
      |                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
 
int main(){
  int n;
  cin>>n;
  vector<string>s(n);
  rep(i,n)cin>>s[i];
  rep(i,n)sort(s[i].begin(),s[i].end());
  rep(i,n)sort(s.begin(),s.end());
  long long cnt=0;
  map<string,int>mp;
  rep(i,n){
    mp[s[i]]++;
  }
  rep(i,n){
    cnt+=(mp[s[i]]*(mp[s[i]]-1))/2
  }
  /*set<string>st;
  set<string>sta;
  rep(i,n){
    if(!st.count(s[i])){
      st.insert(s[i]);
      
    }else{
      cnt++;
      sta.insert(s[i]);
    }
  }
  cnt+=sta.size();*/
  cout<<cnt<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:35: error: expected ';' before '}' token
   18 |     cnt+=(mp[s[i]]*(mp[s[i]]-1))/2
      |                                   ^
      |                                   ;
   19 |   }
      |   ~
Language: C++

from collections import Counter

n = int(input())
li = []
for i in range(n):
    s = list(input())
    s.sort()
    li.append("".join(s))

a = Counter(li)
ans = 0
for i in dict(a).values():
    ans += i*(i-1)//2
print(ans)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import Counter
      | ^~~~
Language: Java

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

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

        Map<String, Long> m = new TreeMap<>();

        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, 1L);
            }
        }
//        System.out.println(m);

        long ans = 0;

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


Compiler output:
Main.java:12: error: cannot find symbol
        Map<String, Long> m = new TreeMap<>();
                                  ^
  symbol:   class TreeMap
  location: class Main
1 error
Language: C++

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

typedef long long ll;

int main(){
    int N;
    cin >> N;
    string s;
    vector<vector<int>> num(N,vector<int>(N,0));
    map<string,int> count;

    for(int i=0;i<N;i++){
        cin >> s;
        sort(s.begin(), s.end());
        count[s]++;
    }

    int ans=0;
    for(auto p : count)
        int N = p.second;
        ans+= N*(N-1)/2;
    }

    cout << ans << endl;

}

Compiler output:
a.cc:25:5: error: 'cout' does not name a type
   25 |     cout << ans << endl;
      |     ^~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int tmp(const void* a,const void* b){
  return *(char*)a-*(char*)b;
}
int main(void){
  int n,i,num,ans,i;
  scanf("%d",&n);
  char a[n][10];
  for(i=;i<n;i++){
    scanf("%s",a[i]);
 
  qsort(a[i],10,sizeof(char),tmp);
  }
  qsort(a,n,sizeof(a[0]),tmp);
  for(i=0;i<n;i++){
    if(strcmp(s[i],s[i+1])==0){
      num++;
    }
    else{
      ans+=(num-1)*num/2;
      num=1;
    }
  }
  ans+=(num-1)*num/2;
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:19: error: redeclaration of 'i' with no linkage
    7 |   int n,i,num,ans,i;
      |                   ^
main.c:7:9: note: previous declaration of 'i' with type 'int'
    7 |   int n,i,num,ans,i;
      |         ^
main.c:10:9: error: expected expression before ';' token
   10 |   for(i=;i<n;i++){
      |         ^
main.c:13:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   13 |   qsort(a[i],10,sizeof(char),tmp);
      |   ^~~~~
main.c:17:15: error: 's' undeclared (first use in this function)
   17 |     if(strcmp(s[i],s[i+1])==0){
      |               ^
main.c:17:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int tmp(const void* a,const void* b){
  return *(char*)a-*(char*)b;
}
int main(void){
  int n,i,num,ans;
  scanf("%d",&n);
  char a[n][10];
  for(i=;i<n;i++){
    scanf("%s",a[i]);
 
  qsort(a[i],10,sizeof(char),tmp);
  }
  qsort(a,n,sizeof(a[0]),tmp);
  for(i=0;i<n;i++){
    if(strcmp(s[i],s[i+1])==0){
      num++;
    }
    else{
      ans+=(num-1)*num/2;
      num=1;
    }
  }
  ans+=(num-1)*num/2;
  printf("d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: expected expression before ';' token
    9 |   for(i=;i<n;i++){
      |         ^
main.c:12:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   12 |   qsort(a[i],10,sizeof(char),tmp);
      |   ^~~~~
main.c:16:8: error: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
   16 |     if(strcmp(s[i],s[i+1])==0){
      |        ^~~~~~
main.c:2:1: note: include '<string.h>' or provide a declaration of 'strcmp'
    1 | #include<stdio.h>
  +++ |+#include <string.h>
    2 | int tmp(const void* a,const void* b){
main.c:16:15: error: 's' undeclared (first use in this function)
   16 |     if(strcmp(s[i],s[i+1])==0){
      |               ^
main.c:16:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n;
  cin >> n;
  map<string, int> k;
  rep(i,n){
    string s;
    cin >> s;
    rep(i,10){
      rep(j,i){
        if(s[i]<s[j])swap(s[i],s[j]);
      }
    }
    k[s]+++;
  }
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: expected primary-expression before ';' token
   16 |     k[s]+++;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a, b;
  in(n);
  string s;
  vector<vector<ll>> c(n, vector<ll> (26, 0));
  char f;
  rep(i, n){
    in(s);
    f = 'a';
    rep(j, 26){
      rep(k, s.size()){
        if(s[k] == f)
          c[i][j]++;
      }
      f++;
    }
  }
  bool h;
  a = 0;
  rep(i, n){
    rep2(j, i + 1){
      h = true;
      rep(k, 26){
        if(c[i][k] != c[j][k])
          h = false;
      }
      if(h)
        a++;
    }
  }
  out(a);
  memi;
}

Compiler output:
a.cc:37:18: error: macro "rep2" requires 3 arguments, but only 2 given
   37 |     rep2(j, i + 1){
      |                  ^
a.cc:5:9: note: macro "rep2" defined here
    5 | #define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
      |         ^~~~
a.cc: In function 'int main()':
a.cc:37:5: error: 'rep2' was not declared in this scope
   37 |     rep2(j, i + 1){
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<string>s(n);
    for(int i=0;i<n;i++)cin >> s[n];
    int ans=0;
    for(int i=0;i<n;i++){
        sort(s[i].begin(),s[i].end());
        for(int r=0,r<i;r++){
            if(s[i]==s[r])ans++;
        }
    }
    cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: expected ';' before '<' token
   11 |         for(int r=0,r<i;r++){
      |                      ^
      |                      ;
a.cc:11:22: error: expected primary-expression before '<' token
Language: C++

#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#define int long long
using namespace std;

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

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

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

int main()
{
  int n; cin>>n;
  map<string,int> mp;
  for(int i = 0; i < n; i++)
  {
  string str; cin>>str;
    sort(str.being(),str.end());
  	mp[str]++;
  
  }
  int ans = 0;
  for(auto x : mp) ans += x.second * (x.second - 1);
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'being'
   11 |     sort(str.being(),str.end());
      |              ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main()
{
  int n; cin>>n;
  map<string,int> mp;
  for(int i = 0; i < n; i++)
  {
  string str; cin>>str;
    sort(str.being(),str.end());
  	mp[str]++;
  
  }
  int ans = 0;
  for(auto x : mp) ans += x.second * (x.second - 1);
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'map' was not declared in this scope
    7 |   map<string,int> mp;
      |   ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | using namespace std;
a.cc:7:13: error: expected primary-expression before ',' token
    7 |   map<string,int> mp;
      |             ^
a.cc:7:14: error: expected primary-expression before 'int'
    7 |   map<string,int> mp;
      |              ^~~
a.cc:11:14: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'being'
   11 |     sort(str.being(),str.end());
      |              ^~~~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(str.being(),str.end());
      |     ^~~~
      |     short
a.cc:12:9: error: 'mp' was not declared in this scope
   12 |         mp[str]++;
      |         ^~
a.cc:16:16: error: 'mp' was not declared in this scope
   16 |   for(auto x : mp) ans += x.second * (x.second - 1);
      |                ^~
Language: C++

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

using namespace std;

int main()
{
    int n;
    long long ans = 0, cnt = 1;

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

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

    for(int i = 1, i <= n; ++i) {
        if(s[i] == s[i - 1]) ++cnt;
        else {
            ans += cnt * (cnt - 1) / 2;
            cnt = 1;
        }
    }

    cout << ans << '\n';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected ';' before '<=' token
   22 |     for(int i = 1, i <= n; ++i) {
      |                     ^~~
      |                     ;
a.cc:22:22: error: expected primary-expression before '<=' token
   22 |     for(int i = 1, i <= n; ++i) {
      |                      ^~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
	long long n,cnt=1;
	long long ans=0;
    cin>>n;
    vector<string> s(n);
    rep(i,n)cin>>s[i];
    rep(k,n)sort(s[k].begin(),s[k].end());
    sort(s.begin(),s.end());
    s.push_back("");
    rep(l,n){
        if(s[i+1]==s[i])cnt++;
        else{
            ans+=cnt*(cnt-1)/2;
            cnt=1;
        }
    }
    cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'i' was not declared in this scope
   19 |         if(s[i+1]==s[i])cnt++;
      |              ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)

int main() {
	int n,cnt=1;
	long long ans=0;
    cin>>n;
    vector<string> s(n);
    rep(i,n)cin>>s[i];
    rep(k,n)sort(s[k].begin(),s[k].end());
    sort(s.begin(),s.end());
    s.push_back("");
    rep(l,n){
        if(s[i+1]==s[i])cnt++;
        else{
            ans+=cnt*(cnt-1)/2;
            cnt=1;
        }
    }
    cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'i' was not declared in this scope
   19 |         if(s[i+1]==s[i])cnt++;
      |              ^
Language: Java

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.Map;
class Main {
  public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int n = sc.nextInt();
   HashMap<String,Integer> ars = new HashMap<>();
   int a = 0;
   for(int i = 0; i < n; i++){
     char[] input = sc.next().toCharArray();
     Arrays.sort(input);
     String str = String.valueOf(input);
     int cnt=0;
     if(ars.containsKey(str)){
       cnt = ars.get(str);
       a += cnt;
     } 
     ars.put(str,);
   }
   System.out.println(a);
  }
}

Compiler output:
Main.java:20: error: illegal start of expression
     ars.put(str,);
                 ^
1 error
Language: Java

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.Map;
class Main {
  public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int n = sc.nextInt();
   HashMap<String,Integer> ars = new HashMap<>();
   int a = 0;
   for(int i = 0; i < n; i++){
     char[] input = sc.next().toCharArray();
     Array.sort(input);
     String str = String.valueOf(input);
     if(ars.contains(str)){
       int cnt = ars.get(str);
       a += cnt;
     } 
     ars.put(str,cnt+1);
   }
   System.out.println(a);
  }
}

Compiler output:
Main.java:13: error: cannot find symbol
     Array.sort(input);
     ^
  symbol:   variable Array
  location: class Main
Main.java:15: error: cannot find symbol
     if(ars.contains(str)){
           ^
  symbol:   method contains(String)
  location: variable ars of type HashMap<String,Integer>
Main.java:19: error: cannot find symbol
     ars.put(str,cnt+1);
                 ^
  symbol:   variable cnt
  location: class Main
3 errors
Language: Java

import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.Map;
class Main {
  public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int n = sc.nextInt();
   HashMap<String,Integer> ars = new HashMap<>();
   int a = 0
   for(int i = 0; i < n; i++){
     char[] input = sc.next().toCharArray();
     Array.sort(input);
     String str = String.valueOf(input);
     if(ars.contains(str)){
       int cnt = ars.get(str);
       a += cnt;
     } 
     ars.put(str,cnt+1);
   }
   System.out.println(a);
  }
}

Compiler output:
Main.java:10: error: ';' expected
   int a = 0
            ^
1 error