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

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	long longx;
	cin >> x;
	long long arr[x];
	int count = 0;
	string y;
	for (int i = 0 ; i < x ; i++)
	{
		arr[i] = 1;
		cin >> y;
		for (int j = 0 ; j < y.size() ; j++)
		{
			arr[i] *= y[j];
		}
	}
	for (int i = 0 ; i < x ; i++)
	{
		for (int j = i + 1 ; j < x ; j++)
		{
			if (arr[i] == arr[j])
			{
				count++;
			}
		}
	}
	cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'x' was not declared in this scope
    7 |         cin >> x;
      |                ^
a.cc:13:17: error: 'arr' was not declared in this scope
   13 |                 arr[i] = 1;
      |                 ^~~
a.cc:24:29: error: 'arr' was not declared in this scope
   24 |                         if (arr[i] == arr[j])
      |                             ^~~
Language: C++

#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long ll;
typedef long double ld;
ll main()
{
  cout<<fixed<<setprecision(10);
  ll count=0;
  ll N;
  cin >> N;
  vector<vector<char>> s(N, vector<char>(10));
  for(ll i=0; i<N; ++i){
    for (ll j=0; j<10; ++j) cin >> s.at(i).at(j);
    sort(s.at(i).begin(),s.at(i).end());
  }
  sort(s.begin(),s.end());
  vector<ll> same;
  ll hoge=0;
  for(ll i=0; i<N-1; ++i){
    if(s.at(i)==s.at(i+1)) ++hoge;
    else {
      same.push_back(hoge);
      hoge=0;
    }
  }
  if(hoge!=0) same.push_back(hoge);
  for(ll i=0; i<same.size(); ++i){
    if(same[i]!=0) for(ll j=1; j<=same[i]; ++j) count += j;
  }
  cout << count << endl;
}


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

#include <bits/stdc++.h>
#define INF 2e9
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  cout<<fixed<<setprecision(10);
  int count=0;
  int N;
  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.at(i).at(j);
    sort(s.at(i).begin(),s.at(i).end());
  }
  sort(s.begin(),s.end());
  for(int i=0; i<N-1; ++i){
    if(s.at(i)==s.at(i+1){
      for(int j=i+1; j<N; ++j){
        if(s.at(i)==s.at(j)) ++count;
        else break;
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: expected ')' before '{' token
   19 |     if(s.at(i)==s.at(i+1){
      |       ~                  ^
      |                          )
a.cc:25:3: error: expected primary-expression before '}' token
   25 |   }
      |   ^
Language: C++

  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());
  long long count = 0;
  long long count2 = 0;
  
  for (int i = 1; i < N;i++) {
    if (s.at(i-1) == s.at(i)) count2++;
    else {
      count += (count2 + 1) * count2 / 2;
      count2 = 0;
    }
  }
  
  count += (count2 + 1) * count2 / 2;
      
  
  cout << count << endl;
}

Compiler output:
a.cc:1:3: error: 'cin' does not name a type
    1 |   cin >> N;
      |   ^~~
a.cc:2:3: error: 'vector' does not name a type
    2 |   vector<string> s(N);
      |   ^~~~~~
a.cc:3:3: error: expected unqualified-id before 'for'
    3 |   for (int i = 0; i < N; i++) {
      |   ^~~
a.cc:3:19: error: 'i' does not name a type
    3 |   for (int i = 0; i < N; i++) {
      |                   ^
a.cc:3:26: error: 'i' does not name a type
    3 |   for (int i = 0; i < N; i++) {
      |                          ^
a.cc:7:7: error: expected constructor, destructor, or type conversion before '(' token
    7 |   sort(s.begin(),s.end());
      |       ^
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for (int i = 1; i < N;i++) {
      |   ^~~
a.cc:11:19: error: 'i' does not name a type
   11 |   for (int i = 1; i < N;i++) {
      |                   ^
a.cc:11:25: error: 'i' does not name a type
   11 |   for (int i = 1; i < N;i++) {
      |                         ^
a.cc:19:3: error: 'count' does not name a type
   19 |   count += (count2 + 1) * count2 / 2;
      |   ^~~~~
a.cc:22:3: error: 'cout' does not name a type
   22 |   cout << count << endl;
      |   ^~~~
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
using namespace std;
char s[100001];
int main(){
int n,i,j;
long long ans=0;
scanf("%d",&n);
for(i=0;i<n;i++){
cin>>s[i];
sort(&s[i][0],&s[i][9]);
}
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(strcmp(s[i],s[j])==0)
ans++;
}
}
printf("%lld\n",ans);
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid types 'char[int]' for array subscript
   14 | sort(&s[i][0],&s[i][9]);
      |           ^
a.cc:14:20: error: invalid types 'char[int]' for array subscript
   14 | sort(&s[i][0],&s[i][9]);
      |                    ^
a.cc:18:14: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   18 | if(strcmp(s[i],s[j])==0)
      |           ~~~^
      |              |
      |              char
In file included from a.cc:4:
/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)
      |                    ~~~~~~~~~~~~^~~~
a.cc:18:19: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
   18 | if(strcmp(s[i],s[j])==0)
      |                ~~~^
      |                   |
      |                   char
/usr/include/string.h:156:50: note:   initializing argument 2 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;long a=0;cin>>n;
  vector<vector<char>>s(n,vector<char>(10));
  for(int i=0;i<n;i++){
    string t;cin>>t;
    for(int j=0;j<10;j++)s.at(i).at(j)=t.at(j);
    sort(s.at(i).begin(),s.at(i).end());
  }
  sort(s.begin(),s.end());
  int k=0;vector<int>p(1);p.at(0)=1;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      if(s.at(i)==s.at(j))p.at(k)++;
      else{p.push_back(1);k++;}
    }
  }
  for(int i=0;i<p.size();i++){long x=p.at(i)*(p.at(i)-1)/2;a+=x}
  cout<<a<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:64: error: expected ';' before '}' token
   19 |   for(int i=0;i<p.size();i++){long x=p.at(i)*(p.at(i)-1)/2;a+=x}
      |                                                                ^
      |                                                                ;
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s[100001];
  for(int i=0; i<n;){
    cin >> s[i];
    sort(s.front(), s.back());
  }
  int ans = 0;
  for(int i=0; i<n-1; i++){
    for(int j=i=1; j<n; j++){
      if(s[i]==s[j]){
        ans ++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: request for member 'front' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.front(), s.back());
      |            ^~~~~
a.cc:11:23: error: request for member 'back' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.front(), s.back());
      |                       ^~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: request for member 'begin' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.begin(), s.end());
      |            ^~~~~
a.cc:11:23: error: request for member 'end' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.begin(), s.end());
      |                       ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: request for member 'begin' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.begin(), s.end());
      |            ^~~~~
a.cc:11:23: error: request for member 'end' in 's', which is of non-class type 'std::string [100001]' {aka 'std::__cxx11::basic_string<char> [100001]'}
   11 |     sort(s.begin(), s.end());
      |                       ^~~
a.cc:14:26: error: expected primary-expression before ')' token
   14 |   for(int i=0; i<n-1; i==){
      |                          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

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

  ll ans=0;
  for (auto& p: m) {
    ll s = p.second
    ans += s*(s-1)/2;
  }
  printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: expected ',' or ';' before 'ans'
   20 |     ans += s*(s-1)/2;
      |     ^~~
Language: C++

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

using namespace std;

string T;
multiset<string> S;
std::vector<std::vector<long long>> comb(int n, int r);

int main(){

    int n;

    cin >> n;

    for(int i=0;i<n;i++){
        cin >> T;
        sort(T.begin(),T.end());
        S.insert(T);
    }

    int ans=0,cnt=0;
    string tmp="00";
    for(multiset<string>::iterator si=S.begin();si!=S.end();si++){
        if(tmp!= *si){
            ans+=comb(cnt+1,2);
            cnt=0;
            tmp= *si;
        }
        else if(tmp== *si) cnt++;
    }

    cout << ans << endl;

    return 0;

}

std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:16: error: no match for 'operator+=' (operand types are 'int' and 'std::vector<std::vector<long long int> >')
   29 |             ans+=comb(cnt+1,2);
      |             ~~~^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

    vector<string> names;
    int n;
    cin >> n;
    for(int i=0; i < n; i++)
    {
        string s;
        cin >> s;
        sort(s.begin(),s.end());
        names.push_back(s);
    }
    sort(names.begin(),names.end());
    int start = 0;
    long long ans = 0;
    for(int i = 1; i < n; i++)
    {
        if(names[start] != names[i])
        {
            long long diff = (i-start);
            ans +=   diff * (diff-1)/2 ;
            start = i;
        }
    }
    long long diff = (i-start);
    ans +=   diff * (diff-1)/2 ;
    cout << ans;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'i' was not declared in this scope
   30 |     long long diff = (i-start);
      |                       ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: no matching function for call to 'sort(std::__cxx11::basic_string<char>::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator)'
   15 |     sort(a[i].begin(),a.end());
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:15:9: note:   deduced conflicting types for parameter '_RAIter' ('__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' and '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >')
   15 |     sort(a[i].begin(),a.end());
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int n;
  cin >> n;
  string s[n];
  int i;
  for(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 = 0;
  for(i=1;i<n;i++){
    if(s[i] == s[i-1]) {
      cnt ++;
      ans += cnt;
    }else{
      cnt = 0;
    }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}
   14 |   sort(s.begin(), s.end());
      |          ^~~~~
a.cc:14:21: error: request for member 'end' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}
   14 |   sort(s.begin(), s.end());
      |                     ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ')' before 's'
   13 |     sort(s.begin()s.end());
      |         ~         ^
      |                   )
a.cc:13:9: error: no matching function for call to 'sort(std::__cxx11::basic_string<char>::iterator)'
   13 |     sort(s.begin()s.end());
      |     ~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 1 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 1 provided
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int> cal(string s)
{
	vector<int> vec(26);
	for(int i=0;i<s.length();i++)
	{
		vec[s[i]-'a']++;
	}
	return vec;
}
bool same(vector<int> vec,vector<int> b)
{
	for(int i=0;i<=25;i++) if(vec[i]!=b[i]) return false;
	return true;
}
int main()
{
	int n;cin>>n;string s;
	map< vector<int> ,int > mp;ll ans=0;
	for(int i=0;i<n;i++)
	{
		cin>>s;
		vector<int> cmp=cal(s);
		if(mp.count(cmp))
		{
			//mp[cm]
			ans+=mp[cmp];
			mp[cmp]++;
		}
		else mp[cmp]=1;
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: 'll' was not declared in this scope
   20 |         map< vector<int> ,int > mp;ll ans=0;
      |                                    ^~
a.cc:28:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |                         ans+=mp[cmp];
      |                         ^~~
      |                         abs
a.cc:33:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C

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

int cmp(const void *a,const void *b){ 
    if(*(char*)a < *(char*)b){
        return -1;
    }
    else if(*(char*)a == *(char*)b){
        return 0;
    }
    return 1;
}

int cmp_str(const void *a,const void *b){
    return strcmp((char *)a, (char *)b);
}

int main(void){
    int i, j, n;
	int a=0, count=10;
	long long ans=0;
    scanf("%d",&n);
    char str[n][20];
    for(i=0;i<n;i++){
        scanf("%s",str[i]);
		qsort(str[i], 10, sizeof(char), cmp);
    }

    qsort(str, n, sizeof(str[0]), cmp_str);i
/*	for(i=0;i<n;i++){
		printf("%s\n",str[i]);
	}	*/
    for(i=0;i<n-1;i++){
        for(j=0;j<10;j++){
			if(str[i][j]==str[i+1][j]){
				count++;
			}
			else{
//				printf("%d %d %d\n",i ,j ,count);
				a = a + count/10;
//				printf("%d\n",a);
				ans = ans + (a*(a-1))/2;	//nC2
				count = 10;
				a = 0;
//				printf("%d\n",ans);
				break;
			}
        }
    }
	a = a + count/10;
	ans = ans + (a*(a-1))/2;	//nC2
	printf("%ld\n",ans);
    return 0; 
}


Compiler output:
main.c: In function 'main':
main.c:30:45: error: expected ';' before 'for'
   30 |     qsort(str, n, sizeof(str[0]), cmp_str);i
      |                                             ^
      |                                             ;
......
   34 |     for(i=0;i<n-1;i++){
      |     ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n; cin >> n;
  map<string,ll> mp;
  for(int i=0;i<n;i++){
    string s; cin >> s;
    sort(s.begin(),s.end());
    mp[s]++;
  }
  llres=0;
  for(auto v : mp){
    if(v.second!=1)res+=v.second*(v.second-1)/2;
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'llres' was not declared in this scope
   12 |   llres=0;
      |   ^~~~~
a.cc:14:20: error: 'res' was not declared in this scope
   14 |     if(v.second!=1)res+=v.second*(v.second-1)/2;
      |                    ^~~
a.cc:16:11: error: 'res' was not declared in this scope
   16 |   cout << res << endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>

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

using namespace std;
using lint = long long;

/*
bool checkAnagram(string str1, string str2)
{
    int alp1[26] = {0};
    int alp2[26] = {0};
    for(int i = 0; i < str1.size(); i++){
        alp1[str1[i]-'a']++;
        alp2[str2[i]-'a']++;
    }
    bool flag = true;
    for(int i = 0; i < 26; i++){
        if(alp)
    }
}
*/

lint comb(lint n, lint r)
{
    int num = 1;
    if(n < r) return 0;
    for(int i = 1; i <= r; i++){
        num = num * (n - i + 1) / i;
    }
    return num;
    
}
int main(void)
{
    int N;
    cin >> N;
    vector<vector<char> > vch(N, vector<char>(10));
    rep(i, N) rep(j, 10) cin >> vch[i][j];
    vector<string> vstr(N);
    rep(i, N){
        sort(vch[i].begin(), vch[i].end());
        string str(vch[i].begin(), vch[i].end());
        vstr[i] = str;
    }
    sort(vstr.begin(), vstr.end());
    lint ans = 0;
    lint cnt = 0;
    vstr.push_back("");
    for(int i = 0; i < N; i++){
        cnt++;
        if(vstr[i+1] != vstr[i]){
            ans += comb(cnt, 2);
            cnt = 0;
        }
    }
    cout << ans << endl;
    return 0;
}1

Compiler output:
a.cc:59:2: error: expected unqualified-id before numeric constant
   59 | }1
      |  ^
Language: C

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


int str_cmp(const void *a,const void *b){
  return strcmp((char *)a,(char *)b);
}

int main(void){
  int n;
  int i,j,k;
  scanf("%d",&n);
  char s[n][11];
  int checker;
  int ans=0;
  for(i=0;i<n;i++){
    scanf("%s",s[i]);
    qsort(s[i],10,sizeof(char),str_cmp);//(int (*)(const void *,const void *))
  }
  qsort(s,10,sizeof(char),str_cmp)
  /*for(i=0;i<n;i++){

    //printf("s[%d]:%s\n",i,s[i]);
  }*/
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      checker=0;
      for(k=0;k<10;k++){
        if(s[i][k]!=s[j][k]){
          checker=1;
          break;
        }
      }
      if(checker==0)
      ans++;

      //printf("checker=%d",checker);


    }
  }
  printf("%d",ans);

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:21:35: error: expected ';' before 'for'
   21 |   qsort(s,10,sizeof(char),str_cmp)
      |                                   ^
      |                                   ;
......
   26 |   for(i=0;i<n;i++){
      |   ~~~
Language: C++

n = int(input())
s_list = [input() for i in range(n)]
lists = []

for i, v in enumerate(s_list):
    lists.append(set(list(v)))

t = 0
for i in range(n):
    for j in range(i+1,n):
        if lists[i].issubset(lists[j]):
            t += 1

print(t)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define INF INT_MAX
#define MOD 1000000007
#define fcout cout << fixed << setprecision(15)
typedef long long ll;
typedef pair<int, int> P;
int gcd(int a,int b){return b?gcd(b,a%b):a;};
int lcm(int a,int b){return a * b / gcd(a, b);};
int mod(int a,int b){return (a+b-1)/b;};
int month[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
template<class T>inline bool chmax(T& a,T b){if(a < b){a=b;return true;}return false;};
template<class T>inline bool chmin(T& a,T b){if(a > b){a=b;return true;}return false;};



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

  int n;
  cin >> n;
  string s[n];
  rep(i, n) {
    cin >> s[i];
    sort(all(s));
    int ans = 0;
    rep(i, n) {
      ans += upper_bound(s, s + n, s[i]) - lower_bound(s, s + n, s[i]) - 1;
    }
    cout << ans / 2 << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:20: error: request for member 'begin' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}
    4 | #define all(x) (x).begin(),(x).end()
      |                    ^~~~~
a.cc:31:10: note: in expansion of macro 'all'
   31 |     sort(all(s));
      |          ^~~
a.cc:4:32: error: request for member 'end' in 's', which is of non-class type 'std::string [n]' {aka 'std::__cxx11::basic_string<char> [n]'}
    4 | #define all(x) (x).begin(),(x).end()
      |                                ^~~
a.cc:31:10: note: in expansion of macro 'all'
   31 |     sort(all(s));
      |          ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define MOD 1000000007
#define NINF -1e17

int main(){
  int n;
  cin >> n;
  vector<string> str(n);
  rep(i,n){
    cin >> s.at(i);
    sort(s.at(i).begin(),s.at(i).end());
  }
  sort(s.begin(),s.end());
  string s = "&";
  long cnt = 0;
  long ans = 0;
  rep(i,n+1){
    if(i == n){
      ans += (cnt-1)*cnt/2;
      break;
    }
    if(s.at(i) == s) cnt++;
    else{
      ans += (cnt-1)*cnt/2;
    }
    s = s.at(i);
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 's' was not declared in this scope
   20 |     cin >> s.at(i);
      |            ^
a.cc:23:8: error: 's' was not declared in this scope
   23 |   sort(s.begin(),s.end());
      |        ^
Language: C++

from sys import stdin
count = 0
N = int(input())
str_lst = [None for _ in range(N)]
for i in range(N):
    str_lst[i] = list(input())
    str_lst[i].sort()
for i in range(N-1):
    for j in range(i+1, N):
        if str_lst[i] == str_lst[j]:
            count += 1
print(count)


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll= long long;
using vi= vector<int>;
using vvi= vector<vi>;
using vd= vector<double>;
using vc= vector<char>;
using vs= vector<string>;
#define REP(i,x,n) for(int i=x; i<n; i++)
#define rep(i,n) REP(i,0,n)
#define all(x) x.begin(), x.end()

int main(){
  int n,ans=0;
  cin >> n;
  vs s(n);

  rep(i,n){
    sort(all(s));
  }
  rep(i,n){
    rep(j,n){
      if(i!=j && s[i]==a[j]){
        ans++;
      }
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:24: error: 'a' was not declared in this scope
   23 |       if(i!=j && s[i]==a[j]){
      |                        ^
Language: Java

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

        String[] texts = new String[n];
        for (int i = 0; i < n; i++) {
            texts[i] = std.next();
        }

        String[] sortedTexts = new String[n];

        for (int i = 0; i < n; i++) {
            String text = texts[i];
            List<String> textList = Arrays.asList(text.split(""));
            Collections.sort(textList);
            String sorted = String.join("",textList);
            sortedTexts[i] = sorted;
        }


        long count = 0;

        count = count / 2;

        System.out.println(count);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner std = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner std = new Scanner(System.in);
                          ^
  symbol:   class Scanner
  location: class Main
Main.java:15: error: cannot find symbol
            List<String> textList = Arrays.asList(text.split(""));
            ^
  symbol:   class List
  location: class Main
Main.java:15: error: cannot find symbol
            List<String> textList = Arrays.asList(text.split(""));
                                    ^
  symbol:   variable Arrays
  location: class Main
Main.java:16: error: cannot find symbol
            Collections.sort(textList);
            ^
  symbol:   variable Collections
  location: class Main
5 errors
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] s = new String[n];
        int[] sum = new int[n];
        int ans = 0;
        for(int i = 0;i < n;i++){
            s[i] = sc.next();
        }
        for(int i = 0;i < n-1;i++){
            int[] c = s[i].getBytes();
            for(int j = 0;j < s[i].length();j++){
                sum[i] += c[j];
            }
        }
        for(int i = 0;i < n;i++){
            for(int j = i;j < n;j++){
                if(sum[i] == sum[j]){
                    ans++;
                }
            }
        }

        System.out.println(ans);
    }
}

Compiler output:
Main.java:14: error: incompatible types: byte[] cannot be converted to int[]
            int[] c = s[i].getBytes();
                                   ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<string>
#include<vector>
#include<map>
#include<algorithm>
using namespace std;
int main(){
  long long n;
  long long cnt =0;
  cin>>n;
  map<string,long long> mp;
  while(cnt<n){
    string s;
    cin>>s;
    vector<char> ch(10);
    for(int i=0;i<(int)s.size();i++){
      ch[i]=s[i];
    }
    sort(ch.begin(),ch.end());
    for(int i=0;i<(int)s.size();i++){
      s[i]=ch[i];
    }
    if((bool)mp.contains(s)){
      mp[s]++;
      ans+=mp[s];
    }else{
      mp[s]=0;
    }
    cnt++;
  }
  cout<<ans<<endl;
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:17: error: 'class std::map<std::__cxx11::basic_string<char>, long long int>' has no member named 'contains'
   24 |     if((bool)mp.contains(s)){
      |                 ^~~~~~~~
a.cc:26:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |       ans+=mp[s];
      |       ^~~
      |       abs
a.cc:32:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
#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(string s : mp){
  ll k = s.second;
  ans += k*(k-1)/2;
  }
  cout <<  ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: conversion from 'std::pair<const std::__cxx11::basic_string<char>, int>' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   19 |   for(string s : mp){
      |                  ^~
a.cc:20:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'second'
   20 |   ll k = s.second;
      |            ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
#include <cmath>
#include <vector>
#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(string s : mp){
  ll k = s.second;
  ans += k*(k-1)/2;
  }
  cout <<  ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: conversion from 'std::pair<const std::__cxx11::basic_string<char>, int>' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   23 |   for(string s : mp){
      |                  ^~
a.cc:24:12: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'second'
   24 |   ll k = s.second;
      |            ^~~~~~
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <climits>
#include <map>
#include <set>
const int mod = 1e9 + 7;
const int inf = 1 << 20;
const long long INF = 1LL << 60;
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
using namespace std;

int main()
{
    int n;
    cin >> n;
    map<string,ll> m;
    ll ans = 0;
    for(int i = 0 ; i < n; i++){
        string s;
        cin >> s;
        sort(s.begin(),s.end());
        m[s]++;
    }
    for(auto i:m){
        ans += i.second * (i.second-1) /2;
    }
    cout << ans << 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;
using S = set<long long>;
using D = deque<long long>;
using L = vector<long long>;
using M = map<int,long long>;
using A = vector<vector<long long>>;
using Q = priority_queue<long long>;

#define sorted(vector) sort(vector.begin(),vector.end())
#define vmin(vector) *min_element(vector.begin(),vector.end())
#define vmax(vector) *max_element(vector.begin(),vector.end())
#define vsum(vector) accumulate(vector.begin(),vector.end(),0)
#define vcount(vector,a) count(vector.begin(), vector.end(),a)
#define bisect_left(vector,a) (lower_bound(vector.begin(),vector.end(),a)-vector.begin())
#define bisect_right(vector,a) (upper_bound(vector.begin(),vector.end(),a)-vector.begin())
#define vfind(vector,a) find(vector.begin(), vector.end(), a) != vector.end() //遅いからあんまり使うな
//存在確認はmap!!!!!!!!!!!!!
//__gcd(a,b)はコンパイラがGCC時のみ

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>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
const int INF=1001001001;
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:18:11: error: 'p' was not declared in this scope
   18 |     int s=p.second;
      |           ^
Language: C++

#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn = 1e5+5;
int n;
struct mystruct{
 char ch[12];
}a[maxn];
bool cmp(char a,char b)
{
 return a<b;
}
bool cmp2(struct mystruct a,struct mystruct b)
{
	return strcmp(a.ch,b.ch) < 0 ? true:false;
}
int sum = 0;
int index = 0; 
int main(void)
{
 scanf("%d",&n);
 for(int i = 0;i<n;i++) scanf("%s",a[i].ch);
 sort(a,a+n,cmp2);
 for(int i = 0;i<n;i++) sort(a[i].ch,a[i].ch+10,cmp);
 for(int i = 1;i<n-1;i++)
 {
  if(strcmp(a[i].ch,a[i-1].ch) == 0) {
  	sum++;
  	index += 1;
  	if(index != 1&&strcmp(a[i].ch,a[i+1].ch) == 0) sum+=1;
  }
  index = 0;
 }
 printf("%d",sum);
 return 0; 
} 

Compiler output:
a.cc:20:5: error: 'int index' redeclared as different kind of entity
   20 | int index = 0;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:3:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:31:18: error: overloaded function with no contextual type information
   31 |         index += 1;
      |                  ^
a.cc:32:18: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
   32 |         if(index != 1&&strcmp(a[i].ch,a[i+1].ch) == 0) sum+=1;
      |            ~~~~~~^~~~
a.cc:34:11: error: overloaded function with no contextual type information
   34 |   index = 0;
      |           ^
Language: Java

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

public class mytest {
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        
        int n=sc.nextInt();
        String str;
        long arr[]=new long[n];
        int num=0;
        for(int i=0;i<n;i++) {
        	str=sc.next();
        	for(int j=0;j<str.length();j++) {
        		num+=(int)str.charAt(j)%5*2%10*4;
        	}
        	arr[i]=num;
        	num=0;
        }
        
        Arrays.sort(arr);
        int sum=0;
        for(int i=0;i<arr.length;i++) {
        	for(int j=i+1;j<arr.length;j++) {
        		if(arr[j]>arr[i]) {
        			break;
        		}
        		if(arr[i]==arr[j]) {
        			sum++;
        		}
        	}
        }
//        for(long i:arr) {
//        	System.out.println(i);
//        }
        
        System.out.println(sum);
    }
}

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


import java.util.Scanner;

public class Main{
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        
        int n=sc.nextInt();
        String str;
        long arr[]=new long[n];
        int num=0;
        for(int i=0;i<n;i++) {
        	str=sc.next();
        	for(int j=0;j<str.length();j++) {
        		num+=(int)str.charAt(j)%5*2%10*4;
        	}
        	arr[i]=num;
        	num=0;
        }
        
        Arrays.sort(arr);
        int sum=0;
        for(int i=0;i<arr.length;i++) {
        	for(int j=i+1;j<arr.length;j++) {
        		if(arr[j]>arr[i]) {
        			break;
        		}
        		if(arr[i]==arr[j]) {
        			sum++;
        		}
        	}
        }
//        for(long i:arr) {
//        	System.out.println(i);
//        }
        
        System.out.println(sum);
    }
}

Compiler output:
Main.java:21: error: cannot find symbol
        Arrays.sort(arr);
        ^
  symbol:   variable Arrays
  location: class Main
1 error
Language: Java

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

public class mytest {
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        
        int n=sc.nextInt();
        String str;
        long arr[]=new long[n];
        int num=0;
        for(int i=0;i<n;i++) {
        	str=sc.next();
        	for(int j=0;j<str.length();j++) {
        		num+=(int)str.charAt(j)%5*2%10*4;
        	}
        	arr[i]=num;
        	num=0;
        }
        
        //Arrays.sort(arr);
        int sum=0;
        for(int i=0;i<arr.length;i++) {
        	for(int j=i+1;j<arr.length;j++) {
//        		if(arr[j]>arr[i]) {
//        			break;
//        		}
        		if(arr[i]==arr[j]) {
        			sum++;
        		}
        	}
        }
//        for(long i:arr) {
//        	System.out.println(i);
//        }
        
        System.out.println(sum);
    }
}

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

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

public class mytest {
    public static void main(String args[]) {
        Scanner sc=new Scanner(System.in);
        
        int n=sc.nextInt();
        String str;
        long arr[]=new long[n];
        int num=0;
        for(int i=0;i<n;i++) {
        	str=sc.next();
        	for(int j=0;j<str.length();j++) {
        		num+=(int)str.charAt(j)%5*2%10;
        	}
        	arr[i]=num;
        	num=0;
        }
        
        //Arrays.sort(arr);
        int sum=0;
        for(int i=0;i<arr.length;i++) {
        	for(int j=i+1;j<arr.length;j++) {
//        		if(arr[j]>arr[i]) {
//        			break;
//        		}
        		if(arr[i]==arr[j]) {
        			sum++;
        		}
        	}
        }
//        for(long i:arr) {
//        	System.out.println(i);
//        }
        
        System.out.println(sum);
    }
}

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

n = gets.to_i

s = n.times.map{gets.split("").sort*""}
h = Hash.new(0)
ans = 0
s.each{|t|
  ans += h[t]
  h[t] += 1
}

p ans


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
n = gets.to_i
^
1 error
Language: C++

#include <stdio.h>
#include <vector>
#include <iostream>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<vs> vvs;

typedef vector<pair<int, int> > vpi;


int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    ll n, i;
    cin >> n;
    map<vi, ll> mp;
    for (i=0;i<n;i++){
        string si;
        cin >> si;
        vi cnt(26);
        for (char c:si) cnt[c-'a']++;
        mp[cnt]++;
    }
    ll cnt=0;
    for (auto pair:mp){
        if (pair.second > 1){
            cnt += (pair.second * (pair.second - 1) / 2);
        }
    }
    cout << cnt << endl;
    return 0:
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:13: error: expected ';' before ':' token
   39 |     return 0:
      |             ^
      |             ;
a.cc:39:13: error: expected primary-expression before ':' token
Language: C++

N = int(input())
S = dict()
for i in range(N):
    r = 0
    s = input()
    s = "".join(sorted(s))
    if s not in S:
        S[s] = 1
    else:
        S[s] += 1
res = 0
for s in S:
    if S[s] > 1:
        res += (S[s]-1)*S[s] // 2
print(res)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int anagram(string s, string b) {
	sort(all(s));
  	sort(all(b));
  	for (int i =0; i<10; i++)
      if (s[i] != b[i]) return 0;
  return 1;
}
int main() {
	int n, cnt=0;
  cin >> n;
  vector<string> v(n);
  for (int i=0; i<n; i++) {
  	cin >> v[i];
  	for (int j=i-1; j>0; j--) cnt += anagram(v[i], v[j]);
  }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int anagram(std::string, std::string)':
a.cc:4:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
    4 |         sort(all(s));
      |              ^~~
      |              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,
      |       ^~~
Language: C++

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

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

Compiler output:
a.cc:25:9: error: 'Long' does not name a type; did you mean 'long'?
   25 | typedef Long long ll;
      |         ^~~~
      |         long
a.cc: In function 'int main()':
a.cc:31:28: error: expected initializer before ':' token
   31 |     map <string,int > score:
      |                            ^
a.cc:32:17: error: 'i' was not declared in this scope
   32 |     for(int i=0;i<N;i++)cin>>s[i];
      |                 ^
a.cc:36:17: error: expected initializer before '++' token
   36 |         map[key]++;
      |                 ^~
a.cc:36:17: error: expected ';' before '++' token
a.cc:38:19: error: 'score' was not declared in this scope
   38 |     for(auto& p : score){
      |                   ^~~~~
a.cc:40:17: error: 'll' was not declared in this scope
   40 |         ans += (ll)s*(s-1)/2
      |                 ^~
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        Map<String,Long> map = new HashMap<>();
        long ans = 0;
        for(int i = 0;i<n;i++){
            char[] tmp = sc.next().toCharArray();
            Arrays.sort(tmp);
            String key = String.valueOf(tmp);
            if(map.get(key) != null){
                ans += map.get(key);
                map.put(key,map.get(key) + 1);
            }else{
                map.put(key,1);
            }
        }
        System.out.println(ans);
    }
}

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

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

using namespace std;

int main(int argc, char const *argv[])
{
    int d=1000000;
    map<string,int> arl;
long　long ans=0;
    cin>>d;

    for (int i = 0; i < d; i++)
    {
        string S;
        cin>>S;
      sort(S.begin(),S.end());

    arl[S]++;

    ans+=arl[S]-1;
        
        
    }
    cout<<ans<<endl;


}


Compiler output:
a.cc:11:1: error: extended character 　 is not valid in an identifier
   11 | long　long ans=0;
      | ^
a.cc: In function 'int main(int, const char**)':
a.cc:11:1: error: 'long\U00003000long' was not declared in this scope
   11 | long　long ans=0;
      | ^~~~~~~~~~
a.cc:22:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   22 |     ans+=arl[S]-1;
      |     ^~~
      |     abs
a.cc:26:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |     cout<<ans<<endl;
      |           ^~~
      |           abs