criyle/codenet-compile-errors huggingface dataset:
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++){
      for(int k=0;k<26;k++){
      if(a.at(i).at(k)==a.at(j).at(k)){
        continue;
      else
        break;
      }
        cout+=1;
      }
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:78:7: error: expected '}' before 'else'
   78 |       else
      |       ^~~~
a.cc:76:39: note: to match this '{'
   76 |       if(a.at(i).at(k)==a.at(j).at(k)){
      |                                       ^
a.cc:81:13: error: no match for 'operator+=' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int')
   81 |         cout+=1;
      |         ~~~~^~~
a.cc: At global scope:
a.cc:85:3: error: 'cout' does not name a type
   85 |   cout << count << endl;
      |   ^~~~
a.cc:86:1: error: expected declaration before '}' token
   86 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n;
int count=0;
vector<int> v;
cin >> n;
for(int i=0;i<n;i++){
cin >> v(i);
sort(v.begin(),v.end());
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n+1;i++){
if(v(i)==v(j))
count++;
}
}
cout << count;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: no match for call to '(std::vector<int>) (int&)'
   11 | cin >> v(i);
      |        ~^~~
a.cc:16:5: error: no match for call to '(std::vector<int>) (int&)'
   16 | if(v(i)==v(j))
      |    ~^~~
a.cc:16:11: error: no match for call to '(std::vector<int>) (int&)'
   16 | if(v(i)==v(j))
      |          ~^~~
Language: Java

#include<iostream>
using namespace std;
 
int main(void) {
    int result = 0;
    int n;
    cin >> n;
    char strs[n][10];
    for(int i = 0; i < n; i++) {
        cin >> strs[i];
    }
    
    int count[n][26];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 26; j++) {
            count[i][j] = 0;
        }
    }
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < 10; j++){
            count[i][strs[i][j] - 'a']++;
        }

    }
    bool flg = true;
    for(int i = 0; i < n - 1; i++) {
        for(int j = i + 1; j < n; j++) {
            for(int k = 0; k < 26 && flg; k++) {
                if(count[i][k] != count[j][k] && flg) {
                    flg = false;
                }
            }
            if(flg) {
                result++;
            }
            flg = true;
        }
    }
    cout << result << endl;
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:7: error: not a statement
    cin >> n;
        ^
Main.java:8: error: not a statement
    char strs[n][10];
              ^
Main.java:10: error: not a statement
        cin >> strs[i];
            ^
Main.java:13: error: not a statement
    int count[n][26];
              ^
Main.java:39: error: not a statement
    cout << result << endl;
                   ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
int main(void) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:4: error: <identifier> expected
int main(void) {
             ^
Main.java:8: error: ';' expected
    char strs[n][10];
               ^
Main.java:13: error: ';' expected
    int count[n][26];
               ^
11 errors
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    Map<Map<Character, Integer>, Integer> mm = new HashMap<>();
    for (int i = 0; i < N; i++) {
      String a = sc.next();
      Map<Character, Integer> m = new HashMap<>();
      for (char c : a.toCharArray()) {
        m.put(c, m.getOrDefault(c, 0) + 1);
      }
      mm.put(m, mm.getOrDefault(m, 0) + 1);
    }
    /*
    long ans = 0;
    for (int v : mm.values()) {
      if (v >= 2) {
        ans += sum(v-1);
      }
    }*/
    
    System.out.println(ans);
  }


  private static HashMap<Integer, Long> cache = new HashMap<>();
  private static long sum(int v) {
    if (v == 1) {
      return 1;
    }
    Long cached = cache.get(v);
    if (cached != null) {
      return cached;
    }
    long value = v + sum(v-1);
    cache.put(v, value);
    return value;
  }
}

Compiler output:
Main.java:24: error: cannot find symbol
    System.out.println(ans);
                       ^
  symbol:   variable ans
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
   
   int counter=0;
   long n;
   cin>>n;
   int sum[n];
   
   string ax[n];
    for(int i=0;i<n;i++){
    cin>>ax[i];
    sum[i]=0;
    }
   for(int i=0;i<n;i++)
   {
      for(int k=0;k<10;k++ )
       sum[i]  += (int)ax[k];
   }
   
   for(int i=0;i<n;i++){
       for(int j=1;j<n;j++){
       if(ax[i]==ax[j])
       counter++;}}
       cout<<counter;
}

   




Compiler output:
a.cc: In function 'int main()':
a.cc:20:19: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   20 |        sum[i]  += (int)ax[k];
      |                   ^~~~~~~~~~
Language: C++

#include <iostream> 
#include <algorithm> 
#include <unordered_map> 
#include <vector> 
// #include <bits/stdc++.h>
using namespace std; 

// int binomialCoeff(int n, int k)  {
//     int res = 1;  
//     if ( k > n - k )  
//         k = n - k;  
//     for (int i = 0; i < k; ++i)  {
//         res *= (n - i);  
//         res /= (i + 1);  
//     }  
//     return res;  
// }  

int printAnagram(unordered_map<string, 
                              vector<string> >& store){
    int ans=0;
    unordered_map<string, vector<string> >::iterator it; 
    for (it = store.begin(); it != store.end(); it++){
        if((it->second).size()==2)
            ans++;
        else if((it->second).size()>2){
            ans += ((it->second).size()*it->second).size()-1)/2);
        }
    }
    return ans;       
}
int storeInMap(vector<string>& vec){
    unordered_map<string, vector<string> > store; 
    for (int i = 0; i < vec.size(); i++) { 
  
        string tempString(vec[i]); 
        sort(tempString.begin(), tempString.end()); 
        if (store.find(tempString) == store.end()) { 
            vector<string> temp_vec; 
            temp_vec.push_back(vec[i]); 
            store.insert(make_pair(tempString, temp_vec)); 
        } 
  
        else { 
            vector<string> temp_vec(store[tempString]); 
            temp_vec.push_back(vec[i]); 
            store[tempString] = temp_vec; 
        } 
    }
    return printAnagram(store); 
} 

int main(){
    int N;
    cin>>N;
    int n=N;
    vector<string> v;
    while(n--){
        string s;
        cin>>s;
        v.push_back(s);
    }
    cout<<storeInMap(v)<<endl;
}

Compiler output:
a.cc: In function 'int printAnagram(std::unordered_map<std::__cxx11::basic_string<char>, std::vector<std::__cxx11::basic_string<char> > >&)':
a.cc:27:40: error: no match for 'operator*' (operand types are 'std::vector<std::__cxx11::basic_string<char> >::size_type' {aka 'long unsigned int'} and 'std::vector<std::__cxx11::basic_string<char> >')
   27 |             ans += ((it->second).size()*it->second).size()-1)/2);
      |                     ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
      |                                      |      |
      |                                      |      std::vector<std::__cxx11::basic_string<char> >
      |                                      std::vector<std::__cxx11::basic_string<char> >::size_type {aka long unsigned int}
Language: C++

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


int main()
{
	int num;

	std::cin >> num;

	std::vector<std::string> str;
	str.resize(num);

	for (int i = 0; i != num; ++i)
	{
		std::cin >> str[i];
		std::sort(str[i].begin(), str[i].end());
	}
	std::sort(str.begin(), str.end());

	int fitNum = 0;

	for (int i = 0; i != num; ++i)
	{
		for (int j = i + 1; j < num; ++j)
		{
			if (strcmp(str[i].c_str(), str[j].c_str()) == 0)
			{
				fitNum++;
			}
		}
	}

	std::cout << fitNum << std::endl;

	return 0;
}

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

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

using namespace std;

string sort_str(string s){

  int n = (int)s.length();

  for(int i = 0; i < n ; ++i){
    for(int j = n - 1; j > i; --j){
      if(s[j] < s[j - 1]){
        char temp = s[j];
        s[j] = s[j - 1];
        s[j - 1] = temp;
      }
    }
  }

  return s;
}

int main(){
  int n;
  long long res = 0;
  cin >> n;
  vector<string> v;
  string in_str;
  for(int i = 0; i < n; ++i){
    cin >> in_str;
    v.push_back(sort_str(in_str));
  }

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

  int count = 1;
  for(int i = 0; i < n - 1; ++i){
    if(v[i] == v[i+1]){
      ++count;
      if(i == n - 2){
        res += count * (count - 1) / 2;
      }
    }else{
      res += count * (count - 1) / 2;
      //count reset
      count = 1;
    }
  }

  cout << res << endl;
  return 0;
}


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

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
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;
        }
      }
    }
  }
  int x=0;
  long int sum=0;
  vector<string> s1;
g
  for(int i=0; i<n;i++){
    vector<string>::iterator cIter = find( s1.begin(),s1.end() ,s[i]);
    if( cIter != s1.end() ){
      sum++;
    }else{s1.push_back(s[i]);}
  }
  cout <<sum;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
   
   int alphabet2 [26];
   int counter=0;
   long n;
   cin>>n;
   int sum[n];
   
   string ax[n];
    for(int i=0;i<n;i++){
    cin>>ax[i];
    sum[i]=0;
    }
   for(int i=0;i<n;i++)
   {
       sum[i]  += (int)ax[i];
   }
   
   for(int i=0;i<n;i++){
       for(int j=1;j<n;j++){
       if(ax[i]==ax[j])
       counter++}}
       cout<<counter;
}

   
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:19: error: invalid cast from type 'std::string' {aka 'std::__cxx11::basic_string<char>'} to type 'int'
   19 |        sum[i]  += (int)ax[i];
      |                   ^~~~~~~~~~
a.cc:25:17: error: expected ';' before '}' token
   25 |        counter++}}
      |                 ^
      |                 ;
a.cc: At global scope:
a.cc:30:1: error: expected declaration before '}' token
   30 | }
      | ^
Language: C++

#include <iostream>
using namespace std;

int conp(char[],char[]);

int main(void)
{
    int n;
    cin >> n;
    char s[n][11];
    int out =0;

    for(int i=0;i<n; i++)
    {
        for(int j=i+1;j<n;j++)
        {
            out += conp(s[i],s[j]);
        }
    }

    cout << out;
    return 0;
}

int conp(char s1[11],char s2[11])
{
    int s1_c,s2_c;
    int i,j;

    if(s1.length()!=s2.length())
    {
        return 0;
    }
    else
    {
        for(i=0;i<10;i++)
        {
            s1_c+=s1[i];
            s2_c+=s2[i];
        }
        if(s1_c==s2_c)
        {
            return 1;
        }
    }
    
}

Compiler output:
a.cc: In function 'int conp(char*, char*)':
a.cc:30:11: error: request for member 'length' in 's1', which is of non-class type 'char*'
   30 |     if(s1.length()!=s2.length())
      |           ^~~~~~
a.cc:30:24: error: request for member 'length' in 's2', which is of non-class type 'char*'
   30 |     if(s1.length()!=s2.length())
      |                        ^~~~~~
a.cc:47:1: warning: control reaches end of non-void function [-Wreturn-type]
   47 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	string a[n];
	float b[n]={0},x[1220]={0},ans=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		for(int j=0;j<10;j++)b[i]+=a[i][j];
	}
	for(int i=1;i<n;i++){
		for(int j=i-1;j>-1;j--){
			if(b[i]==b[j]){
				x[b[i]]+=1;
	  			ans+=x[b[i]];
	  			break;
			}
		}
	}
	cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: invalid types 'float [1220][float]' for array subscript
   16 |                                 x[b[i]]+=1;
      |                                  ^
a.cc:17:39: error: invalid types 'float [1220][float]' for array subscript
   17 |                                 ans+=x[b[i]];
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int_64t main() {
   int n; cin >> n;
   vector <string> v(n);
   for(int i = 0; i < n; i++) {
       string s; cin >> s;
       v[i] = s;
       sort(v[i].begin(), v[i].end());
   }
   sort(v.begin(), v.end());
   vector <int> pairs; int l = 0; int r = 0; int cnt = 0;
        while(l <= r && r < n) {
           // cout << l << " " << r << endl;
            if(v[l] == v[r]) {
                r++;
                cnt++;
            } else {
                l = r;
                pairs.push_back(cnt);
                cnt = 0;
            }
        }
        if(cnt != 0) {
            pairs.push_back(cnt);
        }
        unsigned long long res = 0;
        if(n == 1) {
            cout << 1 << endl;
            return 0;
        }
    for(auto i : pairs) {
        res += (i * (i - 1)) / 2;
    }
    cout << res << endl;
  
}


Compiler output:
a.cc:3:1: error: 'int_64t' does not name a type; did you mean 'int64_t'?
    3 | int_64t main() {
      | ^~~~~~~
      | int64_t
Language: Java

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

public class Main {
  public static void main (String[] args) {
    Scanner in = new Scanner(System.in);
    
    while (in.hasNext()) {
      int N = in.nextInt();
      char[][] s = new char[N][10];
      
      for (int i = 0; i < s.length; ++i) {
        s[i] = in.next().toCharArray();
        
        Arrays.sort(s[i]);
      }
      
      HashMap<String, Integer> appearTimes = new HashMap<String, Integer>();
      long count = 0;
      for (int i = s.length - 1; i >= 0; --i) {
        String si = new String(s[i]);
        
        if (appearTimes.containsKey(si)) {
          times += appearTimes.get(si);
          count += times;
          appearTimes.put(si, times + 1);
        } else {
          appearTimes.put(si, 1);
        }
      }
      
      System.out.println(count);
    }
  }
}

Compiler output:
Main.java:25: error: cannot find symbol
          times += appearTimes.get(si);
          ^
  symbol:   variable times
  location: class Main
Main.java:26: error: cannot find symbol
          count += times;
                   ^
  symbol:   variable times
  location: class Main
Main.java:27: error: cannot find symbol
          appearTimes.put(si, times + 1);
                              ^
  symbol:   variable times
  location: class Main
3 errors
Language: C++

#include <iostream>
using namespace std;
int main() {
    long count;
    cin >> count;
    if(count>=2 && count <=10000000){
    long result=0;
    string strBox[count-1];
    for(long i = 0;i<count;i++)
    {
        cin >> strBox[i];
        sort(strBox[i].begin(),strBox[i].end());
    }
    for(long i =0;i<count;i++)
    {
        for(long j = i+1;j<count;j++)
        {
            if(strBox[i]==strBox[j])
            {
                result++;
            }
        }
    }
    cout << result;
    }else{
        cout<< "error"<<endl;
    }
    return  0;
        
}

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

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n;
	cin>>n;
	string a[n];
	float b[n]={0},x[1220]={0},ans=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		for(int j=0;j<10;j++)b[i]+=a[i][j];
	}
	for(int i=1;i<n;i++){
		for(int j=i-1;j>-1;j--){
			if(b[i]==b[j]){
				x[b[i]]++;
	  			ans+=x[b[i]];
	  			break;
			}
		}
	}
	cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:34: error: invalid types 'float [1220][float]' for array subscript
   16 |                                 x[b[i]]++;
      |                                  ^
a.cc:17:39: error: invalid types 'float [1220][float]' for array subscript
   17 |                                 ans+=x[b[i]];
      |                                       ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


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);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
  int n = inputValue();
  ll count;
  string[] s[n];
  int b[n][26];
  rep(i,n)
  {
    cin >> s[i];
  };
  rep(i,n)
  {
    rep(j,10)
    {
b[i][s[i][j]-97] += 1;
    };
  };
  rep(i,n - 1)
  {
    repd(j,i + 1,n)
    {
		rep(k,26)
        {
          if(b[i][k] != b[j][k])
          {
            goto NEXTp;
          };
        }
      count++;
      NEXTp:
    };
  };
  cout << count;
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:54:9: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   54 |   string[] s[n];
      |         ^~
a.cc:54:9: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:54:9: error: empty structured binding declaration
a.cc:54:12: error: expected initializer before 's'
   54 |   string[] s[n];
      |            ^
a.cc:58:12: error: 's' was not declared in this scope
   58 |     cin >> s[i];
      |            ^
a.cc:64:6: error: 's' was not declared in this scope
   64 | b[i][s[i][j]-97] += 1;
      |      ^
a.cc:80:5: warning: label at end of compound statement only available with '-std=c++2b' or '-std=gnu++2b' [-Wc++23-extensions]
   80 |     };
      |     ^
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];
  }
  for (int i=0; i<N; i++){
    sort(S[i].begin(), S[i].end());
  }

  // vector<vector<int>> alph_cnt(N, vector<int>(26, 0));
  //
  // for (int i=0; i<N; i++){
  //   for (int j=0; j<10; j++){
  //     int k = S[i][j] - 'a';
  //     alph_cnt[i][k]++;
  //   }
  // }
  // int ans=0;
  // for (int i=0; i<N; i++){
  //   for (int j=i+1; j<N; j++){
  //     if (equal(alph_cnt[i].cbegin(), alph_cnt[i].cend(), alph_cnt[j].cbegin())){
  //       ans++;
  //     }
  //   }
  // }
  int ans = 0;
  for (int i=0; i<N; i++){
    for (int j=i+1; j<N; j++){
      if (S[i] == S[j])){
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:24: error: expected primary-expression before ')' token
   34 |       if (S[i] == S[j])){
      |                        ^
Language: Java

import java.util.*;

public class MyClass {
    public static void main(String args[]) {
        Scanner s  = new Scanner(System.in);
        int n, i, x, count;
        String str="";
        char arr[];
        n = s.nextInt();
        HashMap<String, Integer> hm = new HashMap<String, Integer>();
        for(i=0; i<n; i++){
            str = s.next();
            arr = str.toCharArray();
            Arrays.sort(arr);
            str  = new String(arr);
            if(hm.containsKey(str))
                hm.put(str, hm.get(str)+1);
            else
                hm.put(str, 1);
        }
        
        count = 0;
        Iterator itr = hm.entrySet().iterator();
        while(itr.hasNext()){
            Map.Entry me = (Map.Entry)itr.next();
            x = (int)me.getValue();
            count += (x*(x-1))/2;
        }
      System.out.println("" + count);
    }
}

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

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


public class main 
{

public static void main(String[] args) {

	Scanner sc =new Scanner(System.in);
	int n,i,j;
	long sum=0;
	
	
	n=sc.nextInt();
	String[] s=new String[n];
	
	for(i=0;i<n;i++)
	{	
		s[i]=sc.next();
		char[] c = s[i].toCharArray();
		Arrays.sort(c);
		s[i] = new String(c);
	}
	
	for(i=0;i<n-1;i++)
		for(j=i+1;j<n;j++)
		if(s[i].equals(s[j]))
			sum++;
	
	System.out.println(sum);
	}
}


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

alphas = [chr(i).lower() for i in range(65, 65+26)]

n = int(input())

same_count = 0
sorted_list = []
for index in range(n):
  s = input()
  sorted_s = ''.join(sorted(s))
  same_count += sorted_list.count(sorted_s)

  sorted_list.append(sorted_s)
print(same_count)

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
alphas = [chr(i).lower() for i in range(65, 65+26)]
^
Main.java:9: error: empty character literal
  sorted_s = ''.join(sorted(s))
             ^
2 errors
Language: C++

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


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

    auto create_map = [](std::string str) {
        double num = 0;
        for (auto && c : std::set<char>(str.begin(), str.end())) {
            num += std::count(str.begin(), str.end(), c) * std::pow(10.0, (int)(c - 'a'));
        }
        return num;
    };

    std::vector<double> analogy_list;
    for (int i = 0; i < N; i++) {
        std::string str;
        std::cin >> str;
        analogy_list.emplace_back(create_map(str));
    }

    std::vector<bool> flag(N, false);
    long long int count = 0;
    for (int i = 0; i < N; i++) {
        if (flag[i]) {
            continue;
        }
        flag[i] = true;
        long long int dup = 1;
        for (int j = i + 1; j < N; j++) {
            if (std::abs(analogy_list[i] - analogy_list[j]) < 1.0e-5) {
                flag[j] = true;
                dup++;
            }
        }
        // std::cout << dup << std::endl;
        count += dup * (dup - 1) / 2;
    }
    
    std::cout << count << std::endl;
}


Compiler output:
a.cc: In lambda function:
a.cc:15:31: error: 'set' is not a member of 'std'
   15 |         for (auto && c : std::set<char>(str.begin(), str.end())) {
      |                               ^~~
a.cc:7:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    6 | #include <cmath>
  +++ |+#include <set>
    7 | 
a.cc:15:35: error: expected primary-expression before 'char'
   15 |         for (auto && c : std::set<char>(str.begin(), str.end())) {
      |                                   ^~~~
a.cc:15:35: error: expected ')' before 'char'
   15 |         for (auto && c : std::set<char>(str.begin(), str.end())) {
      |             ~                     ^~~~
      |                                   )
a.cc:15:39: error: expected unqualified-id before '>' token
   15 |         for (auto && c : std::set<char>(str.begin(), str.end())) {
      |                                       ^
Language: C++

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

	cin >> n;

	vector<string> s(n);


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

	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (s[i] == s[j])
				cnt++;
		}

	}

	cout << cnt << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> n;
      |         ^~~
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<string> s(n);
      |         ^~~~~~
a.cc:7:16: error: 'string' was not declared in this scope
    7 |         vector<string> s(n);
      |                ^~~~~~
a.cc:7:24: error: 's' was not declared in this scope
    7 |         vector<string> s(n);
      |                        ^
a.cc:11:24: error: expected primary-expression before 'char'
   11 |                 vector<char> c(10);
      |                        ^~~~
a.cc:13:32: error: 'c' was not declared in this scope
   13 |                         cin >> c[j];
      |                                ^
a.cc:15:22: error: 'c' was not declared in this scope
   15 |                 sort(c.begin(), c.end());
      |                      ^
a.cc:15:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |                 sort(c.begin(), c.end());
      |                 ^~~~
      |                 short
a.cc:16:23: error: expected ';' before '_s'
   16 |                 string _s(c.begin(), c.end());
      |                       ^~~
      |                       ;
a.cc:17:24: error: '_s' was not declared in this scope
   17 |                 s[i] = _s;
      |                        ^~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << cnt << endl;
      |         ^~~~
a.cc:28:24: error: 'endl' was not declared in this scope
   28 |         cout << cnt << endl;
      |                        ^~~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
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;
        }
      }
    }
  }
  int x=0;
  long int sum=0;
  vector<string> s1;

  for(int i=0; i<n;i++){
    vector<string>::iterator cIter = find( s1.begin(),s1.end() ,s[i]);
    if( cIter != s1.end() ){
      sum++;
    }else{s1.push_back(s[i]);}
  }
  cout <<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:42: error: no matching function for call to 'find(std::vector<std::__cxx11::basic_string<char> >::iterator, std::vector<std::__cxx11::basic_string<char> >::iterator, std::string&)'
   31 |     vector<string>::iterator cIter = find( s1.begin(),s1.end() ,s[i]);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:31:42: note:   '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >' is not derived from 'std::istreambuf_iterator<_CharT>'
   31 |     vector<string>::iterator cIter = find( s1.begin(),s1.end() ,s[i]);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
#include <string>
 
int main (){
  int n,t;
  cin >> n;
  //const char* a[n][10];
  int i,j;
  std::string s[10];
  for (i = 0;i<n;i++){
    cin >> s[i];
    for(j =0;j<i;j++){
      if(!(a[j].compare(a[j+1])));
        t++;
    }
  }
  cout << t;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:12: error: 'a' was not declared in this scope
   14 |       if(!(a[j].compare(a[j+1])));
      |            ^
Language: C++

using namespace std;
#include <string>
 
int main (){
  int n,t;
  cin >> n;
  //const char* a[n][10];
  int i,j;
  std::string s[10];
  for (i = 0;i<n;i++){
    cin >> s[i];
    for(j =0;j<i;j++){
      if(!(a[j].compare(a[j+1]);)
        t++;
    }
  }
  cout << t;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> n;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <string>
  +++ |+#include <iostream>
    3 | 
a.cc:13:12: error: 'a' was not declared in this scope
   13 |       if(!(a[j].compare(a[j+1]);)
      |            ^
a.cc:13:32: error: expected ')' before ';' token
   13 |       if(!(a[j].compare(a[j+1]);)
      |           ~                    ^
      |                                )
a.cc:13:32: error: expected ')' before ';' token
   13 |       if(!(a[j].compare(a[j+1]);)
      |         ~                      ^
      |                                )
a.cc:13:33: error: expected primary-expression before ')' token
   13 |       if(!(a[j].compare(a[j+1]);)
      |                                 ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << t;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<stdio.h>

int main(void){
    long n,i,k,l,m,ana;
    scanf("%ld", &n);
    char s[n][10];
    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 = n-i; k < n; i++)
        {
            if(i==k)
                continue;
            for ( l = 0; l < 10; l++)
            {
                for ( m = 0; m < 10; m++)
                {
                    if(s[i][l] == s[k][m])
                        ana++;
                }
            }
        }
    }
    
    printf("%ld\n", ana);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   10 |             s[i][k] = "\0";
      |                       ^~~~
      |                       |
      |                       const char*
Language: C++

#include<stdio.h>

int main(void){
    long n,i,k,l,m,ana;
    scanf("%ld", n);
    char s[n][10];
    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 = n-i; k < n; i++)
        {
            if(i==k)
                continue;
            for ( l = 0; l < 10; l++)
            {
                for ( m = 0; m < 10; m++)
                {
                    if(s[i][l] == s[k][m])
                        ana++;
                }
            }
        }
    }
    
    printf("%ld\n", ana);
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: invalid conversion from 'const char*' to 'char' [-fpermissive]
   10 |             s[i][k] = "\0";
      |                       ^~~~
      |                       |
      |                       const char*
Language: C

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



int 
main(){
	long long X,K;
	static char s[100010][20];
	static int  key[100010][256];
	static int  check_same[100010];
	scanf("%lld",&N);
	long long i,j;
	for(i=0;i<N;i++){
		scanf("%s",s[i]);
		int j;
		for(j=0;j<10;j++){
			key[i][s[i][j]]++;
			//printf("(%c,%d),",s[i][j],key[i][s[i][j]]);
		}
	}
	
	long long d;
	int cnt=0,sum=0;
	for(i=0;i<N-1;i++){
		if(check_same[i]==0){
			for(j=i+1;j<N;j++){
			for(d='a';d<='z';d++){
				//printf("(%d %d)",key[i][d],key[j][d]);
				if(key[i][d]!=key[j][d]){
					//printf("\n");
					break;
				}
		
				if(d=='z'){
					cnt++;
					check_same[i] =1;
				}
			}
			}
			if(cnt){
				//printf("%d\n",cnt);
				sum += cnt;//*(cnt-1)/2;
				
			}
			cnt=0;
		}
	}
	
	printf("%d\n",sum);
 return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:23: error: 'N' undeclared (first use in this function)
   14 |         scanf("%lld",&N);
      |                       ^
main.c:14:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<string.h>
int total(int);
#define A 100000
int main(void){
  int i,j,N;
  long long int count=0;;
  char t;
  char S[A][11]={'\0'};
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",S[i]);
    for(j=0;j<k;j++){
      for(k=j+1;k<10;k++){
        if(S[i][j]>S[i][k]){
          t=S[i][j];
          S[i][j]=S[i][k];
          S[i][k]=t;
        }
      }
    }
  }
  for(j=0;j<k;j++){
    for(k=j+1;k<N;k++){
      if(strcmp(S[j],S[k])==0){
        count++;
      }
    }
  }
  printf("%lld\n",count);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:15: error: 'k' undeclared (first use in this function)
   13 |     for(j=0;j<k;j++){
      |               ^
main.c:13:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int n;
int count=0;
string s[];
cin >> n;
for(int i=0;i<n;i++){
cin >> s[i];
sort(s[i]);
}
for(int i=0;i<n;i++){
for(int j=0;j<n;i++){
if(i!=j && s[i]==s[j])
count++;
}
}
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: array size missing in 's'
    8 | string s[];
      |        ^
a.cc:12:5: error: no matching function for call to 'sort(std::string&)'
   12 | sort(s[i]);
      | ~~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/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 <iostream>
#include <cstring>
using namespace std;
const long long M=50331653;
long long ans;
int n;
long long hash[M+1];
int pow(long long a,long long b,long long x)
{
	long long res=0;
	while(b)
	{
		if(b&1)
			res=(res+a)%x;
		a*=2;
		a%=x;
		b>>=1;
	}
	return res; 
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		long long num=0;
		for(int j=1;j<=10;j++)
		{
			char ch;
			cin>>ch;
			num+=pow(11,ch-'A'+1,M);
			num%=M;
		}
		ans+=hash[num];
		hash[num]++;
	}
	cout<<ans<<endl;
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: reference to 'hash' is ambiguous
   34 |                 ans+=hash[num];
      |                      ^~~~
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/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:7:11: note:                 'long long int hash [50331654]'
    7 | long long hash[M+1];
      |           ^~~~
a.cc:35:17: error: reference to 'hash' is ambiguous
   35 |                 hash[num]++;
      |                 ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:7:11: note:                 'long long int hash [50331654]'
    7 | long long hash[M+1];
      |           ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
char ch[100100][12];
int hash[100100];
const int mod=998244353;
int a=233;
map<int,int> mp;
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%s",ch[i]+1); 
		int len=strlen(ch[i]+1); 
		sort(ch[i]+1,ch[i]+1+len);
	}
	int anss=0;
	for(int i=1;i<=n;i++){
		int leni=strlen(ch[i]+1);
		for(int j=1;j<=leni;j++){
			hash[i]=(hash[i]*a+ch[i][j])%mod;
		}
		mp[hash[i]]++;
		anss=anss+mp[hash[i]]-1;
	}
	
	printf("%d",anss);
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: reference to 'hash' is ambiguous
   21 |                         hash[i]=(hash[i]*a+ch[i][j])%mod;
      |                         ^~~~
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:5: note:                 'int hash [100100]'
    4 | int hash[100100];
      |     ^~~~
a.cc:21:34: error: reference to 'hash' is ambiguous
   21 |                         hash[i]=(hash[i]*a+ch[i][j])%mod;
      |                                  ^~~~
/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:5: note:                 'int hash [100100]'
    4 | int hash[100100];
      |     ^~~~
a.cc:23:20: error: reference to 'hash' is ambiguous
   23 |                 mp[hash[i]]++;
      |                    ^~~~
/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:5: note:                 'int hash [100100]'
    4 | int hash[100100];
      |     ^~~~
a.cc:24:30: error: reference to 'hash' is ambiguous
   24 |                 anss=anss+mp[hash[i]]-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:5: note:                 'int hash [100100]'
    4 | int hash[100100];
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100005];
char ch[20];
map<string, int>m;
map<string, int>::iterator it;
int main(void)
{
	int n
	long long sum = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> ch;
		sort(ch, ch + 10);
		ch[10] = '\0';
		if (!m.count(ch))
		{
			m[ch] = 0;
		}
		m[ch] += 1;
	}
	for (it = m.begin(); it != m.end(); it++)
	{
		int k = it->second;
		for (int i = 0; i < k; i++)
		{
			sum += i;
		}
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected initializer before 'long'
   10 |         long long sum = 0;
      |         ^~~~
a.cc:11:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |         cin >> n;
      |                ^
      |                yn
a.cc:28:25: error: 'sum' was not declared in this scope
   28 |                         sum += i;
      |                         ^~~
a.cc:31:17: error: 'sum' was not declared in this scope
   31 |         cout << sum << endl;
      |                 ^~~
Language: C++

from collections import defaultdict

d = defaultdict(int)
c = 0

for _ in range(int(input())):
    s = list(input())
    s.sort()
    s1 = ''
    for i in s:
        s1 += i
    s = s1

    if s in d:
        c += d[s]
        d[s] += 1
    else:
        d[s] += 1

print(c)

Compiler output:
a.cc:9:10: error: empty character constant
    9 |     s1 = ''
      |          ^~
a.cc:1:1: error: 'from' does not name a type
    1 | from collections import defaultdict
      | ^~~~
Language: C++

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

int main(){
	int n;
	cin >> n;
	vector<int>cnt_array;
	vector<string>s(n);
	for(int i = 0; i < n; i++){
		string s_temp;
		cin >> s_temp;
		sort(s_temp.begin(), s_temp.end());
		s[i] = s_temp;
	}
	sort(s.begin(), s.end());
	
	int cnt = 1;
	for(int i = 0; i < n-1; i++){
		if(s[i] == s[i+1] && i != n-2){
			cnt += 1;
		}else{
			cnt_array.push_back(cnt);
			cnt = 1;
		}
		if(s[i] == s[i+1] && i == n-2){
			cnt += 1;
			cnt_array.push_back(cnt);
		}
	}

	//for(int i = 0; i < n; i++)cout << s[i]<<endl;

	//for(int i = 0; i < cnt_array.size(); i++){
	//	cout << cnt_array[i]<<endl;
	//}


	ll int ans = 0;
	for(int i = 0; i < cnt_array.size(); i++){
		ans += (cnt_array[i]*(cnt_array[i]-1))/2;
	}
	cout << ans << endl;

	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:9: error: two or more data types in declaration of 'ans'
   39 |         ll int ans = 0;
      |         ^~
a.cc:41:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   41 |                 ans += (cnt_array[i]*(cnt_array[i]-1))/2;
      |                 ^~~
      |                 abs
a.cc:43:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a[100005];
char ch[20];
map<string, int>m;
map<string, int>::iterator it;
int main(void)
{
	int n
	long long sum = 0;
	cin >> n;
	for (int i = 0; i < n; i++)
	{

		cin >> ch;

		sort(ch, ch + 10);

		ch[10] = '\0';

		if (!m.count(ch))

		{

			m[ch] = 0;

		}

		m[ch] += 1;

	}

	for (it = m.begin(); it != m.end(); it++)

	{

		int k = it->second;

		for (int i = 0; i < k; i++)

		{

			sum += i;

		}

	}

	cout << sum << endl;

	return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected initializer before 'long'
   10 |         long long sum = 0;
      |         ^~~~
a.cc:11:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |         cin >> n;
      |                ^
      |                yn
a.cc:43:25: error: 'sum' was not declared in this scope
   43 |                         sum += i;
      |                         ^~~
a.cc:49:17: error: 'sum' was not declared in this scope
   49 |         cout << sum << endl;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; ++i)
#define REPP(i, n) for(int i = 1; i <= n; ++i)
#define REPR(i, n) for(int i = n-1; i >= 0; --i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define ALL(v) v.begin(), v.end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const ll INF = 1000000000;

int main() {
    int n; cin >> n;
    map<string,ll> s;
    REP(i,n) {
        string str; cin >> str;
        sort(ALL(str));
        s[str] ++;
    }
    ll ans = 0;
    for(auto x : s) {
        if(x.second == 2) ans ++;
        ekse if(x.second == 3) ans += 3;
        else if(x.second>3) ans += x.second + x.second*(x.second-3)/2;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'ekse' was not declared in this scope
   25 |         ekse if(x.second == 3) ans += 3;
      |         ^~~~
a.cc:26:9: error: 'else' without a previous 'if'
   26 |         else if(x.second>3) ans += x.second + x.second*(x.second-3)/2;
      |         ^~~~