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

#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n; ++i)
#define ALL(a) (a).begin(),(a).end()

//comb　nCk
#define MAX 510000
#define MOD 1000000007
ll fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    vector<string> s(n);
    rep(i, n){
        cin >> s[i];
        sort(ALL(s[i]));
    }
    sort(ALL(s));
    
    ll ans = 0;
    COMinit();
    for(int i = 1; i < n; ++i){
        int c = 1;
        while(s[i] == s[i-1]){
            c++, i++;
            if(i >= n)break;
        if(c > 1)ans += COM(c, 2);
    }
    printf("%lld",ans);
}

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

#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <tuple>

#define INF INT_MAX>>1 
#define SIZE 100010
#define MOD 1000000007;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep2(i, from, to) for(int i=(from); i<(int)(to); i++)
#define repr(i, n) for(int i=(n-1); 0<=i; i--)
#define repr2(i, from, to) for(int i=(from-1); (int)(to)<=i; i--)
#define ALL(obj) (obj).begin(), (obj).end()
typedef long long ll;
typedef int long long;

using namespace std;

struct Point { int x, y; };
struct Edge { int to, cost; };
struct Node { int from, to, cost; };

int dx[] ={-1, 0, 0, 1};
int dy[] ={0, -1, 1, 0};

int gcd(int a, int b){ return a % b == 0 ? b : gcd(b, a%b); }
int lcm(int a, int b){ return a * b/ gcd(a, b); }
int extgcd(int a, int b, int& x, int& y){
	int d = a;
	if(b != 0){
		d = extgcd(b, a%b, y, x);
		y -= (a/b) * x;
	} else{
		x = 1; y = 0;
	}
	return d;
}
int combination(int n, int r){
	if(r == 0 || n <= r) return (1);
	else if(r == 1) return (n);
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

class UnionFind {
public:
	vector <ll> par; // 親
	vector <ll> rank; // 木の深さ

	void init(ll n) {
		par.resize(n);
		rank.assign(n, 1LL);  // resize だとなぜか初期化されなかった
		for(ll i = 0; i < n; ++i) par[i] = i; // 初期では親は自分自身
	}

	ll findRoot(ll x) {
		if(par[x] == x) return x;
		else return par[x] = findRoot(par[x]);
	}

	void unite(ll x, ll y) {
		x = findRoot(x);
		y = findRoot(y);
		if(x == y) return;
		if(rank[x] < rank[y]) swap(x, y);
		rank[x] += rank[y];
		par[y] = x;
		return;
	}

	bool issame(ll x, ll y){
		return findRoot(x) == findRoot(y);
	}

	ll size(ll x) {
		return rank[findRoot(x)];
	}
};

signed main(void){
	int n; cin >> n;
	vector<string> str(n);
	rep(i, n){
		cin >> str[i];
		sort(str[i].begin(), str[i].end());
	}
	sort(str.begin(), str.end());

	ll ans = 0;
	int tmp = 1;
	rep2(i, 1, n){
		if(str[i-1] == str[i]) tmp++;
		else{
			if(tmp != 1){
				ans += combination(tmp, 2) % MOD;
				tmp = 1;
			}
		}
	}
	if(tmp != 1) ans += combination(tmp, 2) % MOD;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:26:18: error: declaration does not declare anything [-fpermissive]
   26 | typedef int long long;
      |                  ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <tuple>

#define INF INT_MAX>>1 
#define SIZE 100010
#define MOD 1000000007;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep2(i, from, to) for(int i=(from); i<(int)(to); i++)
#define repr(i, n) for(int i=(n-1); 0<=i; i--)
#define repr2(i, from, to) for(int i=(from-1); (int)(to)<=i; i--)
#define ALL(obj) (obj).begin(), (obj).end()
typedef long long ll;
typedef int long long;

using namespace std;

struct Point { int x, y; };
struct Edge { int to, cost; };
struct Node { int from, to, cost; };

int dx[] ={-1, 0, 0, 1};
int dy[] ={0, -1, 1, 0};

int gcd(int a, int b){ return a % b == 0 ? b : gcd(b, a%b); }
int lcm(int a, int b){ return a * b/ gcd(a, b); }
int extgcd(int a, int b, int& x, int& y){
	int d = a;
	if(b != 0){
		d = extgcd(b, a%b, y, x);
		y -= (a/b) * x;
	} else{
		x = 1; y = 0;
	}
	return d;
}
int combination(int n, int r){
	if(r == 0 || n <= r) return (1);
	else if(r == 1) return (n);
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

class UnionFind {
public:
	vector <ll> par; // 親
	vector <ll> rank; // 木の深さ

	void init(ll n) {
		par.resize(n);
		rank.assign(n, 1LL);  // resize だとなぜか初期化されなかった
		for(ll i = 0; i < n; ++i) par[i] = i; // 初期では親は自分自身
	}

	ll findRoot(ll x) {
		if(par[x] == x) return x;
		else return par[x] = findRoot(par[x]);
	}

	void unite(ll x, ll y) {
		x = findRoot(x);
		y = findRoot(y);
		if(x == y) return;
		if(rank[x] < rank[y]) swap(x, y);
		rank[x] += rank[y];
		par[y] = x;
		return;
	}

	bool issame(ll x, ll y){
		return findRoot(x) == findRoot(y);
	}

	ll size(ll x) {
		return rank[findRoot(x)];
	}
};

unsigned main(void){
	int n; cin >> n;
	vector<string> str(n);
	rep(i, n){
		cin >> str[i];
		sort(str[i].begin(), str[i].end());
	}
	sort(str.begin(), str.end());

	ll ans = 0;
	int tmp = 1;
	rep2(i, 1, n){
		if(str[i-1] == str[i]) tmp++;
		else{
			if(tmp != 1){
				ans += combination(tmp, 2) % MOD;
				tmp = 1;
			}
		}
	}
	if(tmp != 1) ans += combination(tmp, 2) % MOD;
	cout << ans << endl;
}

Compiler output:
a.cc:26:18: error: declaration does not declare anything [-fpermissive]
   26 | typedef int long long;
      |                  ^~~~
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <tuple>

#define INF INT_MAX>>1 
#define SIZE 100010
#define MOD 1000000007;
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep2(i, from, to) for(int i=(from); i<(int)(to); i++)
#define repr(i, n) for(int i=(n-1); 0<=i; i--)
#define repr2(i, from, to) for(int i=(from-1); (int)(to)<=i; i--)
#define ALL(obj) (obj).begin(), (obj).end()
typedef long long ll;
typedef int long long;

using namespace std;

struct Point { int x, y; };
struct Edge { int to, cost; };
struct Node { int from, to, cost; };

int dx[] ={-1, 0, 0, 1};
int dy[] ={0, -1, 1, 0};

int gcd(int a, int b){ return a % b == 0 ? b : gcd(b, a%b); }
int lcm(int a, int b){ return a * b/ gcd(a, b); }
int extgcd(int a, int b, int& x, int& y){
	int d = a;
	if(b != 0){
		d = extgcd(b, a%b, y, x);
		y -= (a/b) * x;
	} else{
		x = 1; y = 0;
	}
	return d;
}
int combination(int n, int r){
	if(r == 0 || n <= r) return (1);
	else if(r == 1) return (n);
	return (combination(n - 1, r - 1) + combination(n - 1, r));
}

class UnionFind {
public:
	vector <ll> par; // 親
	vector <ll> rank; // 木の深さ

	void init(ll n) {
		par.resize(n);
		rank.assign(n, 1LL);  // resize だとなぜか初期化されなかった
		for(ll i = 0; i < n; ++i) par[i] = i; // 初期では親は自分自身
	}

	ll findRoot(ll x) {
		if(par[x] == x) return x;
		else return par[x] = findRoot(par[x]);
	}

	void unite(ll x, ll y) {
		x = findRoot(x);
		y = findRoot(y);
		if(x == y) return;
		if(rank[x] < rank[y]) swap(x, y);
		rank[x] += rank[y];
		par[y] = x;
		return;
	}

	bool issame(ll x, ll y){
		return findRoot(x) == findRoot(y);
	}

	ll size(ll x) {
		return rank[findRoot(x)];
	}
};

unsigned main(void){
	int n; cin >> n;
	vector<string> str(n);
	rep(i, n){
		cin >> str[i];
		sort(str[i].begin(), str[i].end());
	}
	sort(str.begin(), str.end());

	ll ans = 0;
	int tmp = 1;
	rep2(i, 1, n){
		if(str[i-1] == str[i]) tmp++;
		else{
			if(tmp != 1){
				ans += combination(tmp, 2) % MOD;
				tmp = 1;
			}
		}
	}
	if(tmp != 1) ans += combination(tmp, 2) % MOD;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:26:18: error: declaration does not declare anything [-fpermissive]
   26 | typedef int long long;
      |                  ^~~~
cc1plus: error: '::main' must return 'int'
Language: C++

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

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

  for(i=0; i<n-1; i++){
    for(j=i+1; j<n; j++){
      if(s[i]==s[j]) count++;
  }
  cout << count << endl;

  return 0;
}

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

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

public class SUb{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        HashMap<String,Long> map =  new HashMap<>();
        
        for(int i = 0; i < a; i++){
            String s = sc.next();
            char[] c = s.toCharArray();
            Arrays.sort(c);
            s = new String(c);
            if(map.containsKey(s)){
                map.put(s, map.get(s) + 1);
            }else{
                map.put(s, (long)1);
            }
        }

        long count = 0;
        for(Long l: map.values()){
            count = count + (l * (l -1) / 2);
        }
        
        System.out.print(count);
    }
}

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

import java.util.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	String[] s = new String[n];
      	String[][] k = new String[n][10];
      	int answer = 0;
      	for(int i = 0 ; i < n ; i ++){
        	s[i] = scan.next();
          	k = s[i].split("");
          	Arrays.sort(k[i]);
        }
      	for(int i = 0; i < n-1; i ++){
        	for(int j = i; j < n; j ++){
            	if(k[i] == k[j]){
                	answer++ ;
                }
            }
        }
      	System.out.print(answer);
    }
}

Compiler output:
Main.java:12: error: incompatible types: String[] cannot be converted to String[][]
          	k = s[i].split("");
          	              ^
1 error
Language: Java

import java.util.*;

public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int n = scan.nextInt();
      	String[] s = new String[n];
      	String[][] k = new String[n][10];
      	int answer = 0;
      	for(int i = 0 ; i < n ; i ++){
        	s[i] = scan.next();
          	k[i][10] = s[i].split("");
          	Arrays.sort(k);
        }
      	for(int i = 0; i < n-1; i ++){
        	for(int j = i; j < n; j ++){
            	if(k[i] == k[j]){
                	answer++ ;
                }
            }
        }
      	System.out.print(answer);
    }
}

Compiler output:
Main.java:12: error: incompatible types: String[] cannot be converted to String
          	k[i][10] = s[i].split("");
          	                     ^
1 error
Language: C

#include<map>
#include<iostream>

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

using ll = long long;
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());
        mp[s]++;
    }
    ll ans = 0;
    for (auto& p : mp) {
        int s = p.second;
        ans += (ll)s*(s-1)/2;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
main.c:1:9: fatal error: map: No such file or directory
    1 | #include<map>
      |         ^~~~~
compilation terminated.
Language: C++

#include<map>
#include<iostream>

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

using ll = long long;
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());
        mp[s]++;
    }
    ll ans = 0;
    for (auto& p : mp) {
        int s = p.second;
        ans += (ll)s*(s-1)/2;
    }
    cout << ans << endl;
    return 0;
}

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

#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i = 0;i<n;i++){
        cin >> s[i];
        sort(s[i].begin(),s[i].end());
    }
    sort(s.begin(),s.end());
    long ans = 0;
    int cnt = 1;
    for(int i = 0;i<n-1;i++){
        if(s[i]==s[i+1]) cnt++;
        else{
            ans+=cnt*(cnt+1)/2;
            cnt=1;
        }
    }
    cout << ans << endl;
}

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

#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
//main
signed main(){
  int N;cin>>N;
  map<string,int> m;
  while(N--){
    string s;cin>>s;
    sort(s.begin(),s.end());
    m[s]++;
  }
  int ans=0;
  for(auto p:s)ans+=p.second*(p.second-1)/2;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 's' was not declared in this scope
   19 |   for(auto p:s)ans+=p.second*(p.second-1)/2;
      |              ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int n,i,j,ans,sum,num[100005];
char s[100005][15],tmp[100005][15];

int main()
{
	scanf("%d\n",&n);
	for(i=0;i<n;i++)
	{
		gets(s[i]);
		sort(s[i],s[i]+strlen(s[i]));
	}
	for(i=0;i<n;i++)
	{
		int flag=1;
		for(j=0;j<sum;j++)
			if(!strcmp(tmp[j],s[i]))
			{
				flag=0;
				break;
			}
		if(flag)
		{
			strcpy(tmp[sum],s[i]);
			num[sum]=1;
			sum++;
		}
		else num[j]++;
	}
	for(i=0;i<sum;i++)
		ans+=(num[i]*num[i]-1)/2;
	printf("%d",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   13 |                 gets(s[i]);
      |                 ^~~~
      |                 getw
Language: C++

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

int main(){
    int N; cin >> N;
    int ans1, ans2;
    vector<string> s(N);
    
    for(int i=0; i<N; i++){
        cin >> s[i];
    }

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

    for(int i=1; i<N; i++){
        for(int j=1; j<N; j++){
            if(s[i] != s[j]) ans++;
        }
    }

    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:30: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   19 |             if(s[i] != s[j]) ans++;
      |                              ^~~
      |                              ans2
a.cc:23:13: error: 'ans' was not declared in this scope; did you mean 'ans2'?
   23 |     cout << ans << endl;
      |             ^~~
      |             ans2
Language: C++

n = int(input())
ans = 0
dict = {}
for _ in range(n):
    s = sorted(list(input()))
    if dict[s] == NULL:
        dict[s] = 0
    ans += dict[s]
    dict[s] += 1
print(ans)

Compiler output:
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<bits/stdc++.h>

using namespace std;

#define ll long long
#define rep(i,n) for(int i=1;i<=(n);i++)
#define rep0(i,n) for(int i=0;i<(n);i++)
#define pii pair<int,int>
#define mp make_pair

const ll INF=1e9+7;
ll hash(string s){
	ll ha=0;
	rep0(i,s.size()){
		ha+=(s[i]*39)%139763;
	}
	return ha;
}
ll c(int a){
	return a*(a-1)/2;
}
vector<int> v;
int n;
ll g;
string s[100001];
int has[139764];
int main(){
	/*freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);*/
	cin>>n;
	rep(i,n){
		cin>>s[i];
		ll ha=hash(s[i]);
		has[ha]++;
		if(has[ha]==2){
			v.push_back(ha);
		}
	}
	rep0(i,v.size()){
		g+=c(has[v[i]]);
//		cout<<has[v[i]]<<' ';
	}
	cout<<g;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:23: error: reference to 'hash' is ambiguous
   33 |                 ll ha=hash(s[i]);
      |                       ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:12:4: note:                 'long long int hash(std::string)'
   12 | ll hash(string s){
      |    ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#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 fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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

Compiler output:
a.cc: In function 'int main()':
a.cc:24:7: error: 'anto' was not declared in this scope; did you mean 'auto'?
   24 |   for(anto& p:m){
      |       ^~~~
      |       auto
a.cc:24:14: error: found ':' in nested-name-specifier, expected '::'
   24 |   for(anto& p:m){
      |              ^
      |              ::
a.cc:24:13: error: 'p' has not been declared
   24 |   for(anto& p:m){
      |             ^
a.cc:29:1: error: expected primary-expression before '}' token
   29 | }
      | ^
a.cc:28:19: error: expected ')' before '}' token
   28 |   cout<<ans<<endl;
      |                   ^
      |                   )
   29 | }
      | ~                  
a.cc:24:6: note: to match this '('
   24 |   for(anto& p:m){
      |      ^
a.cc:29:1: error: expected primary-expression before '}' token
   29 | }
      | ^
Language: C++

#include<iostream>
#include<map>
#define rep(i,n) for(int i(0);i<n;++i)
using namespace std;
typedef long long ll;
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;
        ans += (ll)s*(s-2)/2;
    }
    
    cout << ans << endl;
    return 0;
}


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

#include <bits/stdc++.h>
std::map <string,int> mp;
std::string s;
long long ans=0;
int main(){
	int n; std::cin>>n;
	while (std::cin >> s, std::sort (s.begin(),s.end()), n--){ ans+=mp[s]++; }
	std::cout<<ans;
}

Compiler output:
a.cc:2:11: error: 'string' was not declared in this scope
    2 | std::map <string,int> mp;
      |           ^~~~~~
a.cc:2:11: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/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:2:21: error: template argument 1 is invalid
    2 | std::map <string,int> mp;
      |                     ^
a.cc:2:21: error: template argument 3 is invalid
a.cc:2:21: error: template argument 4 is invalid
a.cc: In function 'int main()':
a.cc:7:75: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
    7 |         while (std::cin >> s, std::sort (s.begin(),s.end()), n--){ ans+=mp[s]++; }
      |                                                                           ^
Language: C++

#include <bits/stdc++.h>
map <string,int> mp;
string s;
long long ans=0;
int main(){
	int n; std::cin>>n;
	while (std::cin >> s, std::sort (s.begin(),s.end()), n--){ ans+=mp[s]++; }
	std::cout<<ans;
}

Compiler output:
a.cc:2:1: error: 'map' does not name a type
    2 | map <string,int> mp;
      | ^~~
a.cc:3:1: error: 'string' does not name a type; did you mean 'stdin'?
    3 | string s;
      | ^~~~~~
      | stdin
a.cc: In function 'int main()':
a.cc:7:28: error: 's' was not declared in this scope
    7 |         while (std::cin >> s, std::sort (s.begin(),s.end()), n--){ ans+=mp[s]++; }
      |                            ^
a.cc:7:73: error: 'mp' was not declared in this scope
    7 |         while (std::cin >> s, std::sort (s.begin(),s.end()), n--){ ans+=mp[s]++; }
      |                                                                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
map<string,int>mapp;
bool cmp(char a,char b){
	return a<b;
}
int sum[100005];
int main(){
	int n,cnt=0
	long long ans=0;
	char s[12];
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%s",s);
		sort(s,s+10,cmp);
		if(mapp.count(s))ans+=sum[mapp[s]];
		else mapp[s]=++cnt;
		sum[mapp[s]]++;
	}
	printf("%lld",ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ',' or ';' before 'long'
   10 |         long long ans=0;
      |         ^~~~
a.cc:16:34: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |                 if(mapp.count(s))ans+=sum[mapp[s]];
      |                                  ^~~
      |                                  abs
a.cc:20:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |         printf("%lld",ans);
      |                       ^~~
      |                       abs
Language: C++

#include <string>
#include <iostream>
#include <chrono>
#include <numeric>
#include <map>

using namespace std;
const int nChar = 10;
typedef long long ll;

int main(void)
{
    uint32_t N = 0;
	cin >> N;
	map<string, ll> agrmMap;
 
    for(int idx = 0; idx < N; ++idx) {
        // auto pt1 = chrono::high_resolution_clock::now();
        string str; cin >> str;
		sort(str.begin(), str.end());
		if(agrmMap.find(str) != agrmMap.end()) {
			agrmMap[str]++;
		} else {
			agrmMap[str] = 1;
		}
        // auto pt2 = chrono::high_resolution_clock::now();
        // chrono::duration<double> elapsed = pt2 - pt1;
        // printf("elapsed time ( %d ) = %f [usec]\n", idx, elapsed.count()*1e+6);
    }
	ll nAnagram = 0;
	for(auto& mapPtr : agrmMap) {
		ll count = mapPtr.second;
		nAnagram += count * (count - 1) / 2;
	}
    cout << nAnagram << endl;
    return 0;
}

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

#include <string>
#include <iostream>
#include <chrono>
#include <numeric>
#include <map>

using namespace std;
const int nChar = 10;
typedef long long ll;

int main(void)
{
    uint32_t N = 0;
    scanf("%d", &N);
 
	map<string, ll> agrmMap;
 
    for(int idx = 0; idx < N; ++idx) {
        // auto pt1 = chrono::high_resolution_clock::now();
        string str; cin >> str;
		sort(str.begin(), str.end());
		if(agrmMap.find(str) != agrmMap.end()) {
			agrmMap[str]++;
		} else {
			agrmMap[str] = 1;
		}
        // auto pt2 = chrono::high_resolution_clock::now();
        // chrono::duration<double> elapsed = pt2 - pt1;
        // printf("elapsed time ( %d ) = %f [usec]\n", idx, elapsed.count()*1e+6);
    }
	ll nAnagram = 0;
	for(auto& mapPtr : agrmMap) {
		ll count = mapPtr.second;
		nAnagram += count * (count - 1) / 2;
	}
    printf("%llu\n", nAnagram);
    return 0;
}

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

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

int main(){
  int N, count; cin >> N;
  count = 0;
  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(int i = 0; i < N; i++){
      mp[s[i]]++;
      for(auto itr = mp.begin(); itr != mp.end(); itr++){
        count += itr->second*(itr->second - 1) / 2
      }
    }
          
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:51: error: expected ';' before '}' token
   18 |         count += itr->second*(itr->second - 1) / 2
      |                                                   ^
      |                                                   ;
   19 |       }
      |       ~
Language: C++

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

int main(){
  int N, count; cin >> N;
  count = 0;
  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(int i = 0; i < N; i++){
      mp[s[i]]++;
      for(auto itr = mp.begin; itr != mp.end; itr++){
        count += itr->second*(itr->second - 1) / 2
      }
    }
          
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:25: error: unable to deduce 'auto' from 'mp.std::map<std::__cxx11::basic_string<char>, int>::begin'
   17 |       for(auto itr = mp.begin; itr != mp.end; itr++){
      |                      ~~~^~~~~
a.cc:17:25: note:   couldn't deduce template parameter 'auto'
   17 |       for(auto itr = mp.begin; itr != mp.end; itr++){
      |                         ^~~~~
Language: C++

#include <bits/stdc++.h>
 using namespace std;
 
 
int main()
{
    long int n;
    cin >> n;
    vector<string> a(n);
    string x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        sort(x.begin(), x.end())
        a[i] = x;
    }
    sort(a.begin(), a.end())
 
    long int ans = 0;
    long int c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }
    ans += (c * (c - 1)) / 2;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ';' before 'a'
   14 |         sort(x.begin(), x.end())
      |                                 ^
      |                                 ;
   15 |         a[i] = x;
      |         ~                        
a.cc:17:29: error: expected ';' before 'long'
   17 |     sort(a.begin(), a.end())
      |                             ^
      |                             ;
   18 | 
   19 |     long int ans = 0;
      |     ~~~~                     
a.cc:27:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |             ans += (c * (c - 1)) / 2;
      |             ^~~
      |             abs
a.cc:31:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   31 |     ans += (c * (c - 1)) / 2;
      |     ^~~
      |     abs
Language: C++

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

int main()
{
    long int n;
    cin >> n;
    vector<string> a(n);
    string x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        sort(all(x));
        a[i] = x;
    }
    sort(all(a));
 
    long int ans = 0;
    long int c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }
    ans += (c * (c - 1)) / 2;
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   13 |         sort(all(x));
      |              ^~~
      |              std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
a.cc:16:10: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   16 |     sort(all(a));
      |          ^~~
      |          std::filesystem::perms::all
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
#define all(obj) obj.begin(), obj.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
 
using namespace std;
 
typedef unsigned long long ull;
typedef  int long long  ll;
constexpr ll bigNum = 1000000007;
 
signed main()
{
    fast;
    //ここから本体
    int n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; i++)
    {
        string x;
        cin >> x;
        sort(all(x));
        a[i] = x;
    }
    sort(all(a));
 
    ll ans = 0;
    ll c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }

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

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
#define all(obj) obj.begin(), obj.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
 
using namespace std;
 
typedef unsigned long long ull;
typedef  long long int ll;
constexpr ll bigNum = 1000000007;
 
signed main()
{
    fast;
    //ここから本体
    int n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; i++)
    {
        string x;
        cin >> x;
        sort(all(x));
        a[i] = x;
    }
    sort(all(a));
 
    ll ans = 0;
    ll c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }

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

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++) //for文マクロ
#define all(obj) obj.begin(), obj.end()
#define fast                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
 
using namespace std;
 
typedef unsigned long long ull;
typedef int long long ll;
constexpr ll bigNum = 1000000007;
 
signed main()
{
    fast;
    //ここから本体
    int n;
    cin >> n;
    vector<string> a(n);
    for (int i = 0; i < n; i++)
    {
        string x;
        cin >> x;
        sort(all(x));
        a[i] = x;
    }
    sort(all(a));
 
    ll ans = 0;
    ll c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }

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


#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <unordered_map>

using namespace std;
void func_C() {
	int N;
	unordered_map<string, int> dict;
	string s;

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> s;
		sort(s.begin(), s.end());
		dict[s]++;
	}
	int res = 0;
	for (auto itr = dict.begin(); itr != dict.end(); itr++) {
		res += itr->second - 1;
	}
	cout << res << endl;
}

int main()
{
	func_C();
	return 0;
}

Compiler output:
a.cc: In function 'void func_C()':
a.cc:18:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |                 sort(s.begin(), s.end());
      |                 ^~~~
      |                 sqrt
Language: C++

import math

def calc_comb(n):
    k = 2
    if n <= 1 :
        return 0
    elif n ==2 :
        return 1
    return math.factorial(n)/(math.factorial(n-k) * math.factorial(k))

n = int(raw_input(""))

smap = {}
tmp = ""
for i in range(0, n):
    tmp = raw_input("")
    tmp_s = ''.join(sorted(tmp))
    if smap.get(tmp_s, None) != None:
        smap[tmp_s] += 1
    else:
        smap[tmp_s] = 1
count = 0
for s, num in smap.items():
    #print num
    count += calc_comb(num)
print count


Compiler output:
a.cc:17:13: error: empty character constant
   17 |     tmp_s = ''.join(sorted(tmp))
      |             ^~
a.cc:24:6: error: invalid preprocessing directive #print
   24 |     #print num
      |      ^~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:1: error: 'tmp' does not name a type
   14 | tmp = ""
      | ^~~
Language: C++

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

int main(int argc, char const *argv[]){
    int n;
    cin >> n;

    map<string,int> anagram;
        string word;
        cin >> word;
        sort(word.begin(),word.end());
        anagram[word]++;
    }

    long int sum = 0;
    for (const auto& [key, value] : anagram) {
        sum += value*(value-1)/2;
    }

    cout << sum << endl;

    return 0;
}


Compiler output:
a.cc:20:5: error: expected unqualified-id before 'for'
   20 |     for (const auto& [key, value] : anagram) {
      |     ^~~
a.cc:24:5: error: 'cout' does not name a type
   24 |     cout << sum << endl;
      |     ^~~~
a.cc:26:5: error: expected unqualified-id before 'return'
   26 |     return 0;
      |     ^~~~~~
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)













#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;

int main(){
    int n;
    char s[11];
    scanf("%d", &n);
    int128_t k[26];
    k[0] = 1;
    for(int i = 1; i < 26; i++){
        k[i] = k[i - 1] * 11;
    }
    unordered_map<int128_t, ll> mp;
    ll ans = 0;
    for(int i = 0; i < n; i++){
        scanf("%s", s);
        int128_t x = 0;
        for(int j = 0; j < 10; j++){
            x += k[s[j] - 'a'];
        }
        ans += mp[x]++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc:45:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
   45 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
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 s;
  	cin >> s;
    sort(s.begin(), s.end());
  	mp[s]++;
  }
  
  long long ans = 0;
  
  for(int p.second : mp) {
  	long long s = p.second;
  	ans += s*(s-1)/2;
  }
  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: expected ';' before '.' token
   18 |   for(int p.second : mp) {
      |            ^
      |            ;
a.cc:18:12: error: expected primary-expression before '.' token
a.cc:18:20: error: found ':' in nested-name-specifier, expected '::'
   18 |   for(int p.second : mp) {
      |                    ^
      |                    ::
a.cc:18:13: error: request for member 'second' in non-class type '<type error>'
   18 |   for(int p.second : mp) {
      |             ^~~~~~
a.cc:18:24: error: expected ';' before ')' token
   18 |   for(int p.second : mp) {
      |                        ^
      |                        ;
a.cc:19:25: error: request for member 'second' in 'p', which is of non-class type 'int'
   19 |         long long s = p.second;
      |                         ^~~~~~
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 s;
  	cin >> s;
    sort(s.begin(), s.end());
  	mp[s]++;
  }
  
  long long ans = 0;
  
  for(int p : mp) {
  	long long s = p;
  	ans += s*(s-1)/2;
  }
  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: cannot convert 'std::pair<const std::__cxx11::basic_string<char>, int>' to 'int' in initialization
   18 |   for(int p : mp) {
      |               ^~
Language: C++

from collections import Counter

num = int(input())
range_arr = range(num)

strs = [[] for i in range_arr]
for i in range_arr:
    strs[i] = input()

def conv(str):
    str_arr = list(str)
    str_arr.sort()
    return ''.join(str_arr)

new_strs = list(map(lambda v: conv(v), strs))

_sum = 0
counter = Counter()
for tmp_str in new_strs:
    _sum += counter[tmp_str]
    counter[tmp_str] += 1

print(_sum)


Compiler output:
a.cc:13:12: error: empty character constant
   13 |     return ''.join(str_arr)
      |            ^~
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import Counter
      | ^~~~
Language: C++

#include <bits/stdc++.h>
#define int long long
#define boost() ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cout << fixed; cout << setprecision(15); srand(time(NULL))
#define a(x) x.begin(), x.end()
using namespace std;

vector <string> s;
int n;

signed main () {
  cin >> n;
  for (int i = 0; i < n; i++) {
    string cur
    cin >> cur;
    sort(all(cur));
    s.push_back(cur);
  }
  sort(all(s));
  int res = 0;
  int i = 0, j = 0;
  while (i < n && j < n) {
    while (s[i] == s[j]) j++;
    int x = j - i;
    res += (x * (x - 1)) / 2;
    i = j;
  }
  cout << res << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: expected initializer before 'cin'
   14 |     cin >> cur;
      |     ^~~
a.cc:15:14: error: 'cur' was not declared in this scope
   15 |     sort(all(cur));
      |              ^~~
a.cc:15:10: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   15 |     sort(all(cur));
      |          ^~~
      |          std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
a.cc:18:8: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   18 |   sort(all(s));
      |        ^~~
      |        std::filesystem::perms::all
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C

#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll ara[2000];
ll fact(ll n,ll r)
{
ll ret;
    if(n<r){return 0;}
    else{
        ret=(n%2==0)?((n/2)*(n-1)):n*(n-1)/2;
    }
return ret;
}
int main()
{
    ll i,j,n,k,ts=1,sd,nm;
    ll nsx,nsy,ndx,ndy;
    ll T;
    scanf("%lld\n",&T);
    string str;
    char ara[11],vh;
    memset(ara,0,sizeof(ara));
    vector<ll>v;
    vector<string> vc;
    map<string,ll>m;
    for(i=1;i<=T;i++){
        //getline(cin,str);
        scanf("%s",ara);
        scanf("%c",&vh);
        int in=0;
        /*for(j=0;j<str.size();j++){
            in=in+str[j];
        }*/
        sort(ara,ara+10);
        str=ara;

        if(m[str]==0){vc.push_back(str); }m[str]++;
        //ara[in]++;
        //cout<<in<<'\n'<<str<<'\n';

    }
    ll cnt=0;
    for(i=0;i<vc.size();i++){

        cnt=cnt+fact(m[vc[i] ],2);

    }
    printf("%lld\n",cnt);
 


    return 0;
}

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

        #include <iostream>
        #include <string>
        #include <unordered_map>
        #include <algorithm>
         
        using namespace std;
         
        int main() {
          int 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 result = 0;
          for (auto &e : mp) {
            int v = e.second;
            result += (long long)(v * (v - 1) / 2);
          }
         
          cout << result << "\n";
         
          return 0;
        }

    #include <iostream>
    #include <string>
    #include <unordered_map>
    #include <algorithm>
     
    using namespace std;
     
    int main() {
      int 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 result = 0;
      for (auto &e : mp) {
        int v = e.second;
        result += (long long)(v * (v - 1) / 2);
      }
     
      cout << result << endl;
     
      return 0;
    }

提出情報

Compiler output:
a.cc:38:9: error: redefinition of 'int main()'
   38 |     int main() {
      |         ^~~~
a.cc:8:13: note: 'int main()' previously defined here
    8 |         int main() {
      |             ^~~~
a.cc:61:1: error: '\U000063d0\U000051fa\U000060c5\U00005831' does not name a type
   61 | 提出情報
      | ^~~~~~~~
Language: C++

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

using namespace std;

int main() {
  int 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 result = 0;
  for (auto &e : mp) {
    int v = e.second;
    result += (long long)(v * (v - 1) / 2);
  }

  cout << result << "\n";

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'unordered_map' was not declared in this scope
   11 |   unordered_map<string, int> mp;
      |   ^~~~~~~~~~~~~
a.cc:5:1: note: 'std::unordered_map' is defined in header '<unordered_map>'; this is probably fixable by adding '#include <unordered_map>'
    4 | #include <algorithm>
  +++ |+#include <unordered_map>
    5 | 
a.cc:11:23: error: expected primary-expression before ',' token
   11 |   unordered_map<string, int> mp;
      |                       ^
a.cc:11:25: error: expected primary-expression before 'int'
   11 |   unordered_map<string, int> mp;
      |                         ^~~
a.cc:17:5: error: 'mp' was not declared in this scope
   17 |     mp[s]++;
      |     ^~
a.cc:21:18: error: 'mp' was not declared in this scope
   21 |   for (auto &e : mp) {
      |                  ^~
Language: C++

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

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

     for(pair<string,long long> : strcnt){
         ans += p.second * (p.second-1)/2;
     }
     cout << ans << endl;
     return 0;


    
    //  for(int i = 0; i < N; i++ ){
    //     for(int j = i+1; j < N; j++){
    //     bool flag = true;
    //     for(int k = 0; k < 10; k++){
    //     if(s[i][k] != s[j][k]){
    //     flag = false;
    //     break;
    //     }
    //     }
    //          if(flag == true){
    //              ans++;
    //          }
    //      }
    //  }
    // cout << ans << endl;
    // return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:33: error: expected unqualified-id before ':' token
   17 |      for(pair<string,long long> : strcnt){
      |                                 ^
a.cc:18:17: error: 'p' was not declared in this scope
   18 |          ans += p.second * (p.second-1)/2;
      |                 ^
Language: C++

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

using namespace std;

int main() {
  int n;
  map<int, int> counts;
  cin >> n;

  string s;
  for (int i=0; i<n; i++) {
    cin >> s;
    int sum = 0;
    for (char c : s) {
      sum += c - 'a';
    }
    counts[sum]++;
  }

  long long result = 0;
  for (auto &e : counts) {
    result += (long long)e * (e - 1) / 2;
  }

  cout << result;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: invalid cast from type 'std::pair<const int, int>' to type 'long long int'
   24 |     result += (long long)e * (e - 1) / 2;
      |               ^~~~~~~~~~~~
a.cc:24:33: error: no match for 'operator-' (operand types are 'std::pair<const int, int>' and 'int')
   24 |     result += (long long)e * (e - 1) / 2;
      |                               ~ ^ ~
      |                               |   |
      |                               |   int
      |                               std::pair<const int, int>
In file included from /usr/include/c++/14/string:48,
                 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/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:24:35: note:   'std::pair<const int, int>' is not derived from 'const std::reverse_iterator<_Iterator>'
   24 |     result += (long long)e * (e - 1) / 2;
      |                                   ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:24:35: note:   'std::pair<const int, int>' is not derived from 'const std::move_iterator<_IteratorL>'
   24 |     result += (long long)e * (e - 1) / 2;
      |                                   ^