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

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

string sort_chars(string s){
    const char* c = s.c_str();
    char r[11];
    strcpy(r, c);
    sort(r, r+sizeof(r));

    string str(r, 11);
    return str;
}


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

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

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

    int cnt = 0;
    int i = 0;
    while (i < N){
        string tmp = s[i];
        int j = i + 1;
        while(true){
            // cout << j << " broke" << endl;
            if (s[j] == tmp){
                j++;
                cnt++;
            }
            else{
                break;
            }
        }
        i++;
    }
    cout << cnt << endl;
    
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
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[i];
    sort(s[i].begin(), s[i].end());
  }
  
  int cnt = 0;
  vector<int> res<N>;
  sort(s.begin(), s.end());
  for (int i = 0; i < N-1; i++) {
    if (s[i] == s[i+1]) {
      res[i] = 0;
      cnt++;
    }
    else {
      res[i] = cnt;
      cnt = 0;
    }
  }

  int ans = 0;
  for (int i = 0; i < N-1; i++) {
    ans += res[i]*(res[i]+1)/2;
  }

  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected initializer before '<' token
   14 |   vector<int> res<N>;
      |                  ^
a.cc:18:7: error: 'res' was not declared in this scope
   18 |       res[i] = 0;
      |       ^~~
a.cc:22:7: error: 'res' was not declared in this scope
   22 |       res[i] = cnt;
      |       ^~~
a.cc:29:12: error: 'res' was not declared in this scope
   29 |     ans += res[i]*(res[i]+1)/2;
      |            ^~~
Language: C++

#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
#define SPEED ios::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(12)
#define erase(i) erase(i, 1)
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}
template<typename T> void remove(std::vector<T>& vector, unsigned int index){vector.erase(vector.begin() + index);}
//priority_queue<int, vi, greater<int> > que;//昇順

using namespace std;

const int mod=1e9+7;

signed kumiawase(int n)
{
    return n*(n-1)/2;
}

signed main(){
    SPEED;
    int n;
    cin >> n;
    vector<string> str(n);
    rep(i,n)cin >> str[i];
    rep(i,n)SORT(str[i]);
    SORT(str);

    int ans = 0;
    string now = str[0];
    int renzoku = 1;
    for(int i = 1; i < n; ++i)
    {
        if(now = str[i])++renzoku;
        else
        {
            ans += kumiawase(renzoku);
            now = str[i];
            renzoku = 1;
        }
    }
    ans += kumiawase(renzoku);

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:16: error: could not convert 'now.std::__cxx11::basic_string<char>::operator=((*(const std::__cxx11::basic_string<char>*)(& str.std::vector<std::__cxx11::basic_string<char> >::operator[](((std::vector<std::__cxx11::basic_string<char> >::size_type)i)))))' from 'std::__cxx11::basic_string<char>' to 'bool'
   50 |         if(now = str[i])++renzoku;
Language: C++

# include <bits/stdc++.h>
# define NO_OF_CHARS 256
using namespace std;
 
int r=0;
//If the given strings are anagrams, returns true else false
bool areAnagram(string s1, string s2)
{
    // Build count arrays for s1 and s2
    int s1_count[NO_OF_CHARS] = {0};
    int s2_count[NO_OF_CHARS] = {0};
    int i;
 
    // For each character in input strings, increment count in
    // the corresponding count array
    for (i = 0; s1[i] && s2[i];  i++)
    {
        s1_count[s1[i]]++;
        s2_count[s2[i]]++;
    }
 
    // If any of the two operands is non-zero, then condition becomes true.
    //If any string has more characters ie, s1 is "bfdd" and s2 is "bfd".
    //If the below condition is not present, the function says above s1 and s2 are anagrams
    //but, it is not true
    if (s1[i] || s2[i])
      return false;
 
    // Compare count arrays
    for (i = 0; i < NO_OF_CHARS; i++)
        if (s1_count[i] != s2_count[i])
            return false;
 
    return true;
}
// This function prints all anagram pairs in a given array of strings
void printAnagramPairs(string arr[], int n)
{
    cout<<"Anagram pairs are "<<endl;
    for (int i = 0; i < n; i++)
        for (int j = i+1; j < n; j++)
            if (areAnagram(arr[i], arr[j]))
                r=r+1;
  cout<<r;
}

 

int main()
{
 long long n1;
  cin>>n1;
    string arr[n];
  for(int i=0; i<n1; i++)
  {
    cin>>arr[i];
  }
    int n = sizeof(arr)/sizeof(arr[1]);
    printAnagramPairs(arr, n);
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:16: error: 'n' was not declared in this scope; did you mean 'n1'?
   53 |     string arr[n];
      |                ^
      |                n1
a.cc:56:10: error: 'arr' was not declared in this scope
   56 |     cin>>arr[i];
      |          ^~~
a.cc:58:20: error: 'arr' was not declared in this scope
   58 |     int n = sizeof(arr)/sizeof(arr[1]);
      |                    ^~~
Language: C

#include <stdio.h>
#include <string.h>

int main(){
  int i,j,k,N,cnt=0;
  scanf("%d",&N);
  int tmp ;
  
  char a[N][11];
  for(i=0;i<N;i++){
    scanf("%s",a[i]);
  }
  for(i=0;i<N;i++){
    for(j=0;j<9;j++){
      for(k=j+1;k<10;k++){
        if(a[i][j] > a[i][k]){
            tmp=a[i][k];
            a[i][k]=a[i][j];
            a[i][j]=tmp;          
        }
      }
    }
  }
  for(i=0;i<N-1;i++){
    for(j=i+1;j<N;j++){
      if(strcmp(a[i],a[j])==0){
        cnt++;
      }
    }
  }
  
  printf("%d\n",cnt);

Compiler output:
main.c: In function 'main':
main.c:32:3: error: expected declaration or statement at end of input
   32 |   printf("%d\n",cnt);
      |   ^~~~~~
Language: C++

#include<algorithm>
using namespace std;
 
int main(){
	int n,count = 0;
  	cin >> n;
  	vector<string> s(n);
  	vector<string> temp(10);
  	for(int i = 0;i<n;i++){
      	cin >> s.at(i);
    	for(int j = 0;j<10;j++){
        	temp(j) = (s.at(i)).substr(j); 
        }
      	sort(temp.begin(),temp.end());
      	s.at(i) = temp(0)+temp(1)+temp(2)+temp(3)+temp(4)+temp(5)+temp(6)+temp(7)+temp(8)+temp(9);
    }
  	for(int i = 0;i<n;i++){
    	for(int j = i+1;j<n-i;j++){
        	if(s.at(i) == s.at(j)){
            	++count;
            }
        }
    }
  	cout << count << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
    6 |         cin >> n;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include<algorithm>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<string> s(n);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<algorithm>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:16: error: 'string' was not declared in this scope
    7 |         vector<string> s(n);
      |                ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include<algorithm>
  +++ |+#include <string>
    2 | using namespace std;
a.cc:7:24: error: 's' was not declared in this scope
    7 |         vector<string> s(n);
      |                        ^
a.cc:8:24: error: 'temp' was not declared in this scope; did you mean 'mktemp'?
    8 |         vector<string> temp(10);
      |                        ^~~~
      |                        mktemp
a.cc:24:9: error: 'cout' was not declared in this scope
   24 |         cout << count << endl;
      |         ^~~~
a.cc:24:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:24:26: error: 'endl' was not declared in this scope
   24 |         cout << count << endl;
      |                          ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include<algorithm>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main()
{
  string s[100000];
  int n,i,j,count=0;
  cin>>n;
  for(i=0;i<n;i++)
    cin>>s[i];
  for(i=0;i<n;i++)
  {
    sort(s[i].begin(), s[i].end()); 
  }
  for(i=0;i<n;i++)
  {
    for(j=i+1;j<n;j++)
    {
      int s=strcmp(s[i],s[j])
        if(s==0)
          count++;
    }
  }
  printf("%d",count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |       int s=strcmp(s[i],s[j])
      |                     ^
a.cc:19:26: error: invalid types 'int[int]' for array subscript
   19 |       int s=strcmp(s[i],s[j])
      |                          ^
Language: C++

#include <vector>
#include <algorithm>
#include <array>
#include <iostream>
#include <unordered_map>

using namespace std;

typedef array<uint8_t, 26> histogram;
typedef unordered_map<__int128, vector<int>> fp_t;

__int128 calc_hist(const string& str, histogram& hist) {
  fill( &hist[0], &hist[26], 0);
  for (int i = 0; i < 10; ++i) {
    char c = str[i];
    ++hist[c-'a'];
  }
  __int128 rv = 0;
  for (int j = 0; j < 26; ++j) {
    rv *= 10;
    rv += hist[j];
  }
  return rv;
}

int main()
{
  int N;
  cin >> N;
  vector<string> strs(N);
  vector<histogram> hists(N);
  vector<__int128> hashes(N);
  fp_t fingerprints;
  for (int i = 0; i < N; ++i) {
    cin >> strs[i];
    hashes[i] = calc_hist(strs[i], hists[i]);
    if (fingerprints.count(hashes[i]) > 0) {
      fingerprints[hashes[i]].push_back(i);
    } else {
      fingerprints[hashes[i]] = vector<int> { i};
    }
  }
  int num_anagrams = 0;
  struct foo {
    const vector<__int128>& hashes;
    foo( const vector<__int128>& h): hashes( h) {
    }
    bool operator()(int lhs, int rhs) {
      return hashes[lhs] < hashes[rhs];
    }
  } cmp_hashes(hashes);
  for (auto pf = fingerprints.begin(); pf != fingerprints.end(); ++ pf) {
    auto v = pf->second;
    sort(v.begin(), v.end(), cmp_hashes);
  }
  for (auto pf = fingerprints.begin(); pf != fingerprints.end(); ++ pf) {
    auto v = pf->second;
    for (unsigned j = 0; j < v.size(); ++j) {
      int lhs = v[j];
      for (unsigned i = j + 1; i < v.size(); ++i) {
        int rhs = v[i];
        if (hashes[lhs] == hashes[rhs]) {
          ++num_anagrams;
        } else {
          break;
        }
      }
    }
  }
  cout << num_anagrams << endl;
  return 0;
}

Compiler output:
a.cc:9:15: error: 'uint8_t' was not declared in this scope
    9 | typedef array<uint8_t, 26> histogram;
      |               ^~~~~~~
a.cc:6:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    5 | #include <unordered_map>
  +++ |+#include <cstdint>
    6 | 
a.cc:9:26: error: template argument 1 is invalid
    9 | typedef array<uint8_t, 26> histogram;
      |                          ^
a.cc: In function '__int128 calc_hist(const std::string&, histogram&)':
a.cc:13:14: error: invalid types 'histogram {aka int}[int]' for array subscript
   13 |   fill( &hist[0], &hist[26], 0);
      |              ^
a.cc:13:24: error: invalid types 'histogram {aka int}[int]' for array subscript
   13 |   fill( &hist[0], &hist[26], 0);
      |                        ^
a.cc:16:11: error: invalid types 'histogram {aka int}[int]' for array subscript
   16 |     ++hist[c-'a'];
      |           ^
a.cc:21:15: error: invalid types 'histogram {aka int}[int]' for array subscript
   21 |     rv += hist[j];
      |               ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    REP(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    REP(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

int main()
{
	int N = inputValue();
	char s[100001][10];
	char dic[100001][26];
	int diccnt[100001];
	memset(diccnt, 0, 100000*sizeof(int));
	int dicN = 0;
	vector<char*> vecDic;
	REP(i, N){
		cin >> s[i];
		
		char cmpA[26];
		memset(cmpA, 0, 26);
		REP(x, 10){
			int idx = s[i][x] - 'a';
			cmpA[idx]++;
		}
		bool exist = false;
		vector<char*>::iterator itr = vecDic.begin();
		while(vecDic.end()){
			if(memcmp(*itr, cmpA, 26)==0){
				diccnt[idx]++;
				exist = true;
				break;
			}
			itr++;
		}
		if(!exist){
			vecDic.push_back(cmpA);
			diccnt[dicN]++;
			dicN++;
		}
	};
	ll ans = 0;
	REP(i, dicN){
		ans += diccnt[i] * (diccnt[i] - 1) / 2;
	};
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:33: error: could not convert 'vecDic.std::vector<char*>::end()' from 'std::vector<char*>::iterator' to 'bool'
   50 |                 while(vecDic.end()){
      |                       ~~~~~~~~~~^~
      |                                 |
      |                                 std::vector<char*>::iterator
a.cc:52:40: error: 'idx' was not declared in this scope
   52 |                                 diccnt[idx]++;
      |                                        ^~~
Language: C++

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

int main(){
  using namespace std;
  int n;
  cin >> n;
  vector<vector<int> > bagc(n,vector<int>('z'-'a',0));
  for(int i = 0;i < n;i++){
    string str;
    cin >> str;
    for(auto c : str){
      bagc[i][c - 'a']++;
    }
  }
  long ans = 0;
  vector<vector<int> > bagc_uniq = bagc;
  {
    auto res = std::unique(bagc_uniq.begin(),bagc_uniq.end());
    bagc_uniq.erase(res,bagc_uniq.end());
  }
  for(auto bagc_i : bagc_uniq){
    long cbc = count(bagc,bagc_i);
    ans += cbc * (cbc - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	
	cin>>n;char s[n][10];int a[n][10];
	
	for(int i=0;i<n;i++)
	{
		getchar();
		cin>>s[i];
	}
	for(int i=0;i<n;i++)
	for(int j=0;j<10;j++)
	{
		a[i][j]=s[i][j]-'0';
	}
	for(int i=0;i<n;i++)
	sort(a[i],a[i]+10);
	for(int i=0;i<n;i++)
	{
	
	for(int j=0;j<10;j++)
	{
		s[i][j]=a[i][j]+'0';
		
	}
	
	s[i][9]='\0';
}
	for(int i=0;i<n;i++)
//	cout<<s[i]<<endl;
	int sum=0;
	for(int i=0;i<n;i++)
	{
		
		for(int j=i+1;j<n;j++)
		{
         if(strcmp(s[i],s[j])==0)
         sum++;
        }
   }
	if(sum==0)
	cout<<0;
	else
	cout<<sum;	
	
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: 'sum' was not declared in this scope
   41 |          sum++;
      |          ^~~
a.cc:44:12: error: 'sum' was not declared in this scope
   44 |         if(sum==0)
      |            ^~~
Language: C++

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


int main(void)
{
  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());

  int64_t ans=0;
  inte64_t re=1;
  for (int i=0;i<n-1;i++){
     if(s.at(i)==s.at(i+1)){
      re++;
     }else{
       ans+=re*(re-1)/2;
       re=1;
     }
  }
  ans+=re*(re-1)/2;

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'inte64_t' was not declared in this scope; did you mean 'int64_t'?
   19 |   inte64_t re=1;
      |   ^~~~~~~~
      |   int64_t
a.cc:22:7: error: 're' was not declared in this scope
   22 |       re++;
      |       ^~
a.cc:24:13: error: 're' was not declared in this scope
   24 |        ans+=re*(re-1)/2;
      |             ^~
a.cc:28:8: error: 're' was not declared in this scope
   28 |   ans+=re*(re-1)/2;
      |        ^~
Language: C++

#include<string>
#include<algorithm>
#include<iostream>
using namespace std;
 
int main(){
    int n;
    cin >> n;
 
    char a[n][10];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 10; j++){
            cin >> a[i][j];
        }
    }
 
    for(int i = 0; i < n; i++){
        sort(a[i], a[i] + 10);
    }
 
    string s[n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 10; j++){
            s[i] += a[i][j];
        }
        //cout << s[i] << endl;
    }
 
    sort(s, s + n);
 
    long long ans = 0;
    int flag = 0;
 
    for(int i = 0; i < n - 1; i++){
        for(int j = i + 1; j < n; j++){
            if(s[i] == s[j]){
                ans++;
            }else{
				break;
        }
    }
 
    cout << ans << endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:2: error: expected '}' at end of input
   45 | }
      |  ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
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);

  vector<vector<int>> a(N,vector<int>(26,0));
  for(int i=0;i<N;i++){
    for(int j=0;j<10;j++){
    if(s.at(i).at(j)=='a')
      a.at(i).at(0)+=1;
    if(s.at(i).at(j)=='b')
      a.at(i).at(1)+=1;
    if(s.at(i).at(j)=='c')
      a.at(i).at(2)+=1;
    if(s.at(i).at(j)=='d')
      a.at(i).at(3)+=1;
    if(s.at(i).at(j)=='e')
      a.at(i).at(4)+=1;
    if(s.at(i).at(j)=='f')
      a.at(i).at(5)+=1;
    if(s.at(i).at(j)=='g')
      a.at(i).at(6)+=1;
    if(s.at(i).at(j)=='h')
      a.at(i).at(7)+=1;
    if(s.at(i).at(j)=='i')
      a.at(i).at(8)+=1;
    if(s.at(i).at(j)=='j')
      a.at(i).at(9)+=1;
    if(s.at(i).at(j)=='k')
      a.at(i).at(10)+=1;
    if(s.at(i).at(j)=='l')
      a.at(i).at(11)+=1;
    if(s.at(i).at(j)=='m')
      a.at(i).at(12)+=1;
    if(s.at(i).at(j)=='n')
      a.at(i).at(13)+=1;
    if(s.at(i).at(j)=='o')
      a.at(i).at(14)+=1;
    if(s.at(i).at(j)=='p')
      a.at(i).at(15)+=1;
    if(s.at(i).at(j)=='q')
      a.at(i).at(16)+=1;
    if(s.at(i).at(j)=='r')
      a.at(i).at(17)+=1;
    if(s.at(i).at(j)=='s')
      a.at(i).at(18)+=1;
    if(s.at(i).at(j)=='t')
      a.at(i).at(19)+=1;
    if(s.at(i).at(j)=='u')
      a.at(i).at(20)+=1;
    if(s.at(i).at(j)=='v')
      a.at(i).at(21)+=1;
    if(s.at(i).at(j)=='w')
      a.at(i).at(22)+=1;
    if(s.at(i).at(j)=='x')
      a.at(i).at(23)+=1;
    if(s.at(i).at(j)=='y')
      a.at(i).at(24)+=1;
    if(s.at(i).at(j)=='z')
      a.at(i).at(25)+=1;
    }
  }
  
  int count=0;

  for(int i=1;i<N;i++){
    for(int j=0;j<i;j++){
      if(a.at(i).at(0)!=a.at(j).at(0)){
        break;
      else if(a.at(i)==a.at(j))
        count+=1;
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:77:7: error: expected '}' before 'else'
   77 |       else if(a.at(i)==a.at(j))
      |       ^~~~
a.cc:75:39: note: to match this '{'
   75 |       if(a.at(i).at(0)!=a.at(j).at(0)){
      |                                       ^
a.cc: At global scope:
a.cc:82:3: error: 'cout' does not name a type
   82 |   cout << count << endl;
      |   ^~~~
a.cc:83:1: error: expected declaration before '}' token
   83 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll main(){
  ll n;
  cin>>n;
  vector<string> s(n+1);
  for(ll i=0;i<n;i++){
    cin>>s[i];
    sort(s[i].begin(),s[i].end());
  }
  s[n]="wwwwwwwwwww";
  sort(s.begin(),s.end());
  string memo=s[0];
  ll count=1,ans=0;
  for(ll i=1;i<n+1;i++){
    //cout<<s[i]<<endl;
    if(s[i]==memo)count++;
    else {
      ll memo2=1;
      if(count>1){
      	memo2=(count*(count-1))/2;
        ans+=memo2;
      }
      //cout<<ans<<endl;
      memo=s[i];
      count=1;
    }
   }
  cout<<ans<<endl;
}


Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | ll main(){
      | ^~
Language: C++

int main()
{
	int N;
	cin >> N;
	vector<string> s(N);

	for(int i = 0; i < N; i++) {
		cin >> s.at(i);
	}

	vector<vector<int>> A(N,vector<int>(26,0));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 10; j++) {
			switch (s.at(i).at(j)) {
			case 'a':
				A.at(i).at(0)++;
			case 'b':
				A.at(i).at(1)++;
			case 'c':
				A.at(i).at(2)++;
			case 'd':
				A.at(i).at(3)++;
			case 'e':
				A.at(i).at(4)++;
			case 'f':
				A.at(i).at(5)++;
			case 'g':
				A.at(i).at(6)++;
			case 'h':
				A.at(i).at(7)++;
			case 'i':
				A.at(i).at(8)++;
			case 'j':
				A.at(i).at(9)++;
			case 'k':
				A.at(i).at(10)++;
			case 'l':
				A.at(i).at(11)++;
			case 'm':
				A.at(i).at(12)++;
			case 'n':
				A.at(i).at(13)++;
			case 'o':
				A.at(i).at(14)++;
			case 'p':
				A.at(i).at(15)++;
			case 'q':
				A.at(i).at(16)++;
			case 'r':
				A.at(i).at(17)++;
			case 's':
				A.at(i).at(18)++;
			case 't':
				A.at(i).at(19)++;
			case 'u':
				A.at(i).at(20)++;
			case 'v':
				A.at(i).at(21)++;
			case 'w':
				A.at(i).at(22)++;
			case 'x':
				A.at(i).at(23)++;
			case 'y':
				A.at(i).at(24)++;
			case 'z':
				A.at(i).at(25)++;
			}
		}
	}

	int ANS = 0;
	for (int i = 0; i < N - 1; i++) {
		for (int j = i+1; j < N; j++) {
			if (std::equal(A.at(i).cbegin(), A.at(i).cend(), A.at(j).cbegin())) {
				ANS++;
			}
		}
	}
	
	cout << ANS << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
    4 |         cin >> N;
      |         ^~~
a.cc:5:9: error: 'vector' was not declared in this scope
    5 |         vector<string> s(N);
      |         ^~~~~~
a.cc:5:16: error: 'string' was not declared in this scope
    5 |         vector<string> s(N);
      |                ^~~~~~
a.cc:5:24: error: 's' was not declared in this scope
    5 |         vector<string> s(N);
      |                        ^
a.cc:11:23: error: expected primary-expression before 'int'
   11 |         vector<vector<int>> A(N,vector<int>(26,0));
      |                       ^~~
a.cc:16:33: error: 'A' was not declared in this scope
   16 |                                 A.at(i).at(0)++;
      |                                 ^
a.cc:74:34: error: 'equal' is not a member of 'std'
   74 |                         if (std::equal(A.at(i).cbegin(), A.at(i).cend(), A.at(j).cbegin())) {
      |                                  ^~~~~
a.cc:74:40: error: 'A' was not declared in this scope
   74 |                         if (std::equal(A.at(i).cbegin(), A.at(i).cend(), A.at(j).cbegin())) {
      |                                        ^
a.cc:80:9: error: 'cout' was not declared in this scope
   80 |         cout << ANS << endl;
      |         ^~~~
a.cc:80:24: error: 'endl' was not declared in this scope
   80 |         cout << ANS << endl;
      |                        ^~~~
Language: C++

#include<bits/stdc++.h>
#include<string.h>
using namespace std;
int main()
{
  string s[100000];
  int n,i,j,count=0;
  cin>>n;
  for(i=0;i<n;i++)
    cin>>s[i];
  for(i=0;i<n;i++)
  {
    sort(s[i].begin(), s[i].end()); 
  }
  for(i=0;i<n;i++)
  {
    for(j=i+1;j<n;j++)
    {
      int s=strcmp(s[i],s[j])
        if(s==1)
          count++;
    }
  }
  printf("%d",count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: invalid types 'int[int]' for array subscript
   19 |       int s=strcmp(s[i],s[j])
      |                     ^
a.cc:19:26: error: invalid types 'int[int]' for array subscript
   19 |       int s=strcmp(s[i],s[j])
      |                          ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>
#include <iomanip>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

namespace {  // 名前なし名前空間
	// gcd, lcm は C++17 でstdに標準入りしたので言語のバージョンに注意
	// 最大公約数
	ll gcd(ll a, ll b) {
		if (b == 0) return a;
		return gcd(b, a % b);
	}

	// 最小公倍数
	ll lcm(ll a, ll b) {
		return a / gcd(a, b) * b;
	}

	// 素因数分解 pair.firstで素数、pair.secondで対応する指数
	vector<pair<long long, long long> > prime_factorize(long long n) {
		vector<pair<long long, long long> > res;
		for (long long p = 2; p * p <= n; ++p) {
			if (n % p != 0) continue;
			int num = 0;
			while (n % p == 0) { ++num; n /= p; }
			res.push_back(make_pair(p, num));
		}
		if (n != 1) res.push_back(make_pair(n, 1));
		return res;
	}

	const int MAX = 210000;

	//二項係数を求める前処理 テーブルを作る　O(n)
	// facは階乗
	long long 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 ABC137Cmain() {

	int n;
	cin >> n;
	COMinit();
	vector<string> s(n);
	rep(i, n) cin >> s[i];

	rep(i, n) {
		sort(allof(s[i]));
	}
	sort(allof(s));

	vector<ll> num(n, 0);

	rep(i, n) {
		Rep(j, i + 1, n) {
			bool same = true;
			rep(k, 10) {
				if (s[i][k] != s[j][k]) {
					same = false;
					break;
				}
			}
			if (same) num[i]++;
			else break;
		}
		i += num[i];
	}

	ll ans = 0;

	rep(i, n) {
		ans += COM(num[i] + 1LL, 2LL);
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

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

int main(int argc, char const *argv[]) {
  int n;
  vector<string> v;
  string str;
  int i, j, ans=0;
  cin >> n;

  for (i=0; i < n; i++) {
    cin >> str;
    v.push_back(str);
  }

  for (i=0; i < n; i++) {
    sort(v[i].begin(), v[i].end());
    for (j=i+1; j < n; j++) {
      sort(v[j].begin(), v[j].end());
      if (!strcmp(v[i], v[j])) {
        ans++;
      }
    }
  }

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


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:20:18: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   20 |       if (!strcmp(v[i], v[j])) {
      |            ~~~~~~^~~~~~~~~~~~
      |                  |
      |                  __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool isAnagram1(string s, string t){
    if(s=="" || t=="") return false;
    if(s.length() != t.length()) return false;

    //sort(s,s+s.length);//如果s是字符数组，就这样调用
    sort(&s[0], &s[0]+s.length());
    sort(&t[0], &t[0]+t.length());
    if(s == t) return true;
    else return false;
}
int main(){
int n,sum=0;
char a[100000];
  cin>>n;
  for(int i=1;i<=n;i++){
  cin>>a[i];
  for(int j=1;j<i-1;j++)
  {if(isAnagram1(a[i],a[j]))
  {sum++;}
  }
  }
  cout<<sum;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:21: error: could not convert 'a[i]' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   20 |   {if(isAnagram1(a[i],a[j]))
      |                  ~~~^
      |                     |
      |                     char
Language: C++

#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define inf 1e+9
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

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

    ll n,k,aa=0;
	cin >> n;
	ll ans[n+1];
	rep(i,n+1){
		ans[i] = 0;
	}
	vector<string> name(n+1);
	rep(i,n){
		cin >> name[i+1];	
		sort(name[i+1].begin(),name[i+1].end());
		rep(j,i){
			if(strcmp(name[i+1],name[j+1])==0){
				aa++;
			}
		}
	}
	// rep(i,n){
	// 	cin >> name[i+1];
	// 	sort(name[i+1].begin(),name[i+1].end());
	// 	for(ll j=i-1;j>=0;j--){
	// 		if(name[i+1]==name[j+1]){
	// 			ans[j+1]++;
	// 			ans[i+1] += ans[j+1];
	// 			ans[j+1] = 0;
	// 			//cout << i+1<< j+1;
	// 			break;
	// 		}
	// 	}
	// }
	//printf("\n");
	
	// rep(i,n+1){
	// 	aa += ans[i];
	// 	//cout << name[i] << endl;
	// }
	// if(aa==n){
	// 	cout << "0" << endl;
	// }
	
	cout << aa << endl;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:34: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   53 |                         if(strcmp(name[i+1],name[j+1])==0){
      |                            ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:14:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

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

int main() {
  int n, s = 0;
  cin >> n;
  vector<vector<char>> v(n, vector<char>(10));
  for (int i = 0; i < n; i++){
    string p;
    cin >> p;
    for (int j = 0; j < 10; j++){
      v.at(i).at(j) = p.at(j);
    }
    sort(v.at(i).begin(), v.at(i).end());
  }
  
  sort(v.begin(), v.end())
  for (int i = 0; i < n - 1; i++){
    int j = i+1;
    while(v.at(i) == v.at(j)){
      s++;
      j++;
    }
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before 'for'
   17 |   sort(v.begin(), v.end())
      |                           ^
      |                           ;
   18 |   for (int i = 0; i < n - 1; i++){
      |   ~~~                      
a.cc:18:19: error: 'i' was not declared in this scope
   18 |   for (int i = 0; i < n - 1; i++){
      |                   ^
Language: C++

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

int main() {
  int n, s = 0;
  cin >> n;
  vector<vector<char>> v(n, vector<char>(10));
  for (int i = 0; i < n; i++){
    string p;
    cin >> p;
    for (int j = 0; j < 10; j++){
      v.at(i).at(j) = p.at(j);
    }
    sort(v.at(i).begin(), v.at(i).end());
  }
  
  sort(v.begin(), v.end())
  for (int i = 0; i < n - 1; i++){
    int j = i+1;
    while(v.at(i) == v.at(j)){
      s++;
      j++
    }
  }
  cout << s << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: expected ';' before 'for'
   17 |   sort(v.begin(), v.end())
      |                           ^
      |                           ;
   18 |   for (int i = 0; i < n - 1; i++){
      |   ~~~                      
a.cc:18:19: error: 'i' was not declared in this scope
   18 |   for (int i = 0; i < n - 1; i++){
      |                   ^
Language: C++

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

using namespace std;

int alfa1[26], alfa2[26];

void re() {
    for (int i = 0; i < 26; i++) {
        alfa1[i] = 0;
        alfa2[i] = 0;
    }
}

int alphabet_pos(const char c) {
    if ('a' <= c && c <= 'z') return (c - 'a');
    return -1;
}

int ana(string x, string y) {
    re();
    for (int i = 0; i < 10; i++) {
        alfa1[alphabet_pos(x.c_str()[i])] = alfa1[alphabet_pos(x.c_str()[i])] + 1;
        alfa2[alphabet_pos(y.c_str()[i])] = alfa2[alphabet_pos(y.c_str()[i])] + 1;
    }
    for (int i = 0; i < 26; i++) {
        //cout << alfa1[i];
        if (alfa1[i] != alfa2[i]) {
            return 0;
        }
    }
    return 1;
}

int main() {
    int n;
    cin >> n;
    vector<string> s;
    string temp;
    char c[10];
    for (int i = 0; i < n; i++) {
        cin >> temp;
        for (int j = 0; j < 10; j++) {
            c[j] = temp[j];
        }
        sort(c, c + 10);
        string temp2(c, 10);

        s.push_back(temp2);
    }
    
    int ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (strcmp(s[i].c_str(), s[j].c_str()) == 0) {
                ans++;
            }
        }
    }
    cout << ans;


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:59:17: error: 'strcmp' was not declared in this scope
   59 |             if (strcmp(s[i].c_str(), s[j].c_str()) == 0) {
      |                 ^~~~~~
a.cc:6:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <algorithm>
  +++ |+#include <cstring>
    6 | #include <string>
Language: C++

#include <stdio.h>

int main(void){
  int N;
  scanf("%d",&N);
  int* s = (int*)malloc(N*sizeof(int));
  char c;
  scanf("%c",&c);
  for(int i = 0;i < N;i++){
    s[i] = 0;
    for(int j = 0;j < 10;j++){
      scanf("%c",&c);
      s[i] += c;
    }
    scanf("%c",&c);
  }
  int count = 0;
  for(int i = 0;i < N;i++){
    for(int j = i+1;j < N;j++){
      if(s[i] == s[j]){
        count++;

      }
    }
  }
  printf("%d\n",count);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 'malloc' was not declared in this scope
    6 |   int* s = (int*)malloc(N*sizeof(int));
      |                  ^~~~~~
a.cc:2:1: note: 'malloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
    1 | #include <stdio.h>
  +++ |+#include <cstdlib>
    2 |
Language: C

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
  int n;
  cin >>n;
  string s[n];
  for(int i=0; i<n; i++){
    cin >>s[i];
  }

  for(int k=0; k <n;k++){
    for(int i =0; i<10;i++){
      for(int j = 10-1; j>i; j--){
        if(s[k][j]<s[k][j-1]){
          char temp=s[k][j];
          s[k][j]=s[k][j-1];
          s[k][j-1]=temp;
        }
      }
    }
  }
  long int sum=0;
  vector<string> s1;
  for(int i=0; i<n;i++){
    s1.push_back(s[i]);
  }
  sort(s1.begin(), s1.end());
  long int x=0;
  for(int i =0; i<n-1; i++){
    if(s1[i]==s1[i+1]){
      x++;
    }else{
      sum += x*(x+1)/2;
      x=0;
    }
  }
  sum += x*(x+1)/2;
  cout <<sum;
}


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

int main(void){
    int n;
    long long ans=0;
    cin>>n;
    string s[n];
    for(int i=0;i<n;i++){
        cin>>s[i];
        sort (s[i].begin(),s[i].end());
    }
    sort(s,s+n);
    int x=0;
    for(int i=1;i<n;i++){
        if(s[i-1]==s[i]){
            x++;
            if(i==n-1){
                ans+=(x*(x+1))/2;
                break;
            }
        }
        else{
            ans+=(x*(x+1))/2;
            x=0;
        }
    }
    
    cout<<ans;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>n;
      |     ^~~
a.cc:5:5: error: 'string' was not declared in this scope
    5 |     string s[n];
      |     ^~~~~~
a.cc:7:14: error: 's' was not declared in this scope
    7 |         cin>>s[i];
      |              ^
a.cc:8:9: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |         sort (s[i].begin(),s[i].end());
      |         ^~~~
      |         short
a.cc:10:10: error: 's' was not declared in this scope
   10 |     sort(s,s+n);
      |          ^
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(s,s+n);
      |     ^~~~
      |     short
a.cc:26:5: error: 'cout' was not declared in this scope
   26 |     cout<<ans;
      |     ^~~~
Language: C++

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

long long hash(string s){
	long long res=0;
	for(int i=0;i<s.length();i++)
		res += s[i]-int('a')+1;
	return res*s.length();
}

main(){
	int n,a[100010],index=0;
	long long ans=0,k;
	string s;
	map<long long,long long> mp;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s;
		k = hash(s);
		if(mp[k] == 0)
			a[++index] = k;
		mp[k]++;
	}
	for(int i=1;i<=k;i++)
		ans += mp[a[i]]*(mp[a[i]]-1)/2;
	cout<<ans<<endl;
}

Compiler output:
a.cc:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:21: error: reference to 'hash' is ambiguous
   19 |                 k = hash(s);
      |                     ^~~~
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:4:11: note:                 'long long int hash(std::string)'
    4 | long long hash(string s){
      |           ^~~~
Language: C++

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

int main() {
	int N;
	long long answer=0;
	cin>>N;
 
  	char data[N][10], tmp[10];
 
  	for (int i = 0; i < N; i++) {
      		cin>>data[i];
      		sort(data[i], data[i]+10);
    }

    for (int i = 0; i < N; i++) {
    	for (int j = i+1; j < N; j++) {
      		if(strncmp(data[i],data[j],10)==0) answer++;
    	}
    }
    cout<<answer<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'strncmp' was not declared in this scope
   21 |                 if(strncmp(data[i],data[j],10)==0) answer++;
      |                    ^~~~~~~
a.cc:4:1: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #include <string>
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(void) {
	int N;
	int count = 0;
	cin >> N;
	vector<vector<char>>s(N, vector<char>(10));
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 10; j++) {
			cin >> s[i][j];
		}
	}
	for (int i = 0; i < N; i++) {
		sort(s[i].begin(), s[i].end());
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1; j < N; j++) {
			if (s[i][1] == s[j][1]) {
				if (s[i] == s[j]) {
					count++;
				}
			}
			else {
				break;
			}
		}
	}
  cout<<count
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:14: error: expected ';' before '}' token
   33 |   cout<<count
      |              ^
      |              ;
   34 | }
      | ~
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);
  }
  int count=0;
  for(int i=0;i<N;i++){
    
    }
  }
  cout<<count;
}

Compiler output:
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout<<count;
      |   ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s[100000];
  int n,i,j,count=0;
  cin>>n;
  for(i=0;i<n;i++)
    cin>>s[i];
  for(i=0;i<n;i++)
  {
    string[i]= sort(s[i].begin(), s[i].end()); 
  }
  for(i=0;i<n;i++)
  {
    for(j=i+1;j<n;j++)
    {
      if(strcmp(s[i],s[j]))
        count++;
    }
  }
  printf("%d",count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   12 |     string[i]= sort(s[i].begin(), s[i].end());
      |           ^~~
a.cc:12:11: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:23: error: use of 'i' before deduction of 'auto'
   12 |     string[i]= sort(s[i].begin(), s[i].end());
      |                       ^
a.cc:12:37: error: use of 'i' before deduction of 'auto'
   12 |     string[i]= sort(s[i].begin(), s[i].end());
      |                                     ^
a.cc:18:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'const char*'
   18 |       if(strcmp(s[i],s[j]))
      |                 ~~~^
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
Language: C++

#include<stdio.h>
#include<string.h>

int main(void){
    int n,i,k;
    int ana;
    scanf("%ld", &n);
    char s[n][10];
    char temp;
    for ( i = 0; i < n; i++)
    {
        for ( k = 0; k < 10; k++)
            s[i][k] = '\0';
    }
    
    for ( i = 0; i < n; i++)
        scanf("%s", s[i]);
    for ( i = 0; i < n; i++)
        for ( k = 0; k < 10; k++)
            for ( l = 9; l > 10-k; i--)            
                if ( s[i][l] < s[i][k] )
                {
                    temp = s[i][l];
                    s[i][l] = s[i][k];
                    s[i][k] = temp;
                    temp = '\0';
                }
    for ( i = 0; i < n-1; i++)
        for ( k = i+1; k < n; k++)
            if (!strcmp(s[i], s[k]))
                ana++;
    printf("%ld\n", ana);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: 'l' was not declared in this scope
   20 |             for ( l = 9; l > 10-k; i--)
      |                   ^
Language: C++

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

long long hash(string s){
	int res=0;
	for(int i=0;i<s.length();i++)
		res += s[i]-int('a')+1;
	return res*s.length();
}

main(){
	int n,a[100010],index=0,k;
	long long ans=0;
	string s;
	map<long long,long long> mp;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>s;
		k = hash(s);
		if(mp[k] == 0)
			a[++index] = k;
		mp[k]++;
	}
	for(int i=1;i<=k;i++)
		ans += mp[a[i]]*(mp[a[i]]-1)/2;
	cout<<ans<<endl;
}

Compiler output:
a.cc:11:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:19:21: error: reference to 'hash' is ambiguous
   19 |                 k = hash(s);
      |                     ^~~~
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:4:11: note:                 'long long int hash(std::string)'
    4 | long long hash(string s){
      |           ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s[100000];
  int n,i,j,count=0;
  cin>>n;
  for(i=0;i<n;i++)
    cin>>string[i];
  for(i=0;i<n;i++)
  {
    string[i]= sort(string[i].begin(), string[i].end()); 
  }
  for(i=0;i<n;i++)
  {
    for(j=i+1;j<n;j++)
    {
      if(strcmp(string[i],string[j]))
        count++;
    }
  }
  printf("%d",count);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:16: error: expected primary-expression before '[' token
    9 |     cin>>string[i];
      |                ^
a.cc:12:11: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   12 |     string[i]= sort(string[i].begin(), string[i].end());
      |           ^~~
a.cc:12:11: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:12:27: error: expected primary-expression before '[' token
   12 |     string[i]= sort(string[i].begin(), string[i].end());
      |                           ^
a.cc:12:28: error: use of 'i' before deduction of 'auto'
   12 |     string[i]= sort(string[i].begin(), string[i].end());
      |                            ^
a.cc:12:46: error: expected primary-expression before '[' token
   12 |     string[i]= sort(string[i].begin(), string[i].end());
      |                                              ^
a.cc:12:47: error: use of 'i' before deduction of 'auto'
   12 |     string[i]= sort(string[i].begin(), string[i].end());
      |                                               ^
a.cc:18:23: error: expected primary-expression before '[' token
   18 |       if(strcmp(string[i],string[j]))
      |                       ^
a.cc:18:33: error: expected primary-expression before '[' token
   18 |       if(strcmp(string[i],string[j]))
      |                                 ^