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

#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

typedef long long llint;

int main(void) {
  vector<int> cnt(26, 0);
  static char s[222222];
  scanf("%s", s);
  int len = strlen(s);
  REP(i, len) cnt[s[i]-'a']++;

  llint ret = 0;
  REP(i, 26) ret += cnt[i] * (len - cnt[i]);
  ret /= 2;
  ret++;
  
  printf("%lld\n", ret);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'vector' was not declared in this scope
   16 |   vector<int> cnt(26, 0);
      |   ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <iostream>
  +++ |+#include <vector>
    5 | 
a.cc:16:10: error: expected primary-expression before 'int'
   16 |   vector<int> cnt(26, 0);
      |          ^~~
a.cc:20:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |   REP(i, len) cnt[s[i]-'a']++;
      |               ^~~
      |               int
a.cc:23:21: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |   REP(i, 26) ret += cnt[i] * (len - cnt[i]);
      |                     ^~~
      |                     int
Language: C++

s = input()
n = len(s)
f = lambda x: x * (x - 1) // 2
ans = f(n)
for i in range(26):
    ans -= f(s.count(chr(ord('a') + i)))
print(ans)

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

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string str;
    cin >> str;
    int a=str.length();
ll ans= ((a-1)*a)/2;
ans++;
ll A[26]={0}
for(int i=0;i<a;i++)
        A[str[i]-'a']++;
for(int i=0;i<26;i++)
    ans-=((A[i]-1)*(A[i]))/2;


cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:1: error: expected ',' or ';' before 'for'
   15 | for(int i=0;i<a;i++)
      | ^~~
a.cc:15:13: error: 'i' was not declared in this scope
   15 | for(int i=0;i<a;i++)
      |             ^
Language: C++

#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cassert>
#include <cmath>
#include <sstream>
#include <complex>
#include <stack>
#include <unordered_map>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<unsigned, unsigned> uu;
typedef pair<ll, ll> l4;


#define pb push_back
#define mp make_pair

const int maxn = 2e5+1;
ll cnt[300]={0};
char a[maxn];

int main()
{
    gets(a);
    ll len = strlen(a);
    ll ans = len*(len-1)/2+1;
    for (int i = 0; i < len; ++i)
        cnt[a[i]] += 1;
    for (char c = 'a'; c <= 'z'; ++c)
        ans -= cnt[c]*(cnt[c]-1)/2;
    printf("%lld\n", ans);
    
}

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

#include <cstdio>
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n, i, m, k;
	char a[200000] = {};
	char j;

	scanf("%s", &a[0]);

	n = strlen(a);

	k = n * (n - 1) / 2 + 1;

	for (j = 'a'; j <= 'z'; j++) {
		m = 0;
		for (i = 0; i < n; i++) {
			if (a[i] == j) {
				m++;
			}
		}
		k -= m * (m - 1) / 2;
	}

	printf("%d\n", k);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: 'strlen' was not declared in this scope
   16 |         n = strlen(a);
      |             ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 |
Language: C++

#include <string>
#include <algorithm>

using namespace std;

int main()
{
	int n, i, m, k;
	char a[200000] = {};
	char j;

	scanf("%s", &a[0]);

	n = strlen(a);

	k = n * (n - 1) / 2 + 1;

	for (j = 'a'; j <= 'z'; j++) {
		m = 0;
		for (i = 0; i < n; i++) {
			if (a[i] == j) {
				m++;
			}
		}
		k -= m * (m - 1) / 2;
	}

	printf("%d\n", k);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: 'strlen' was not declared in this scope
   14 |         n = strlen(a);
      |             ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <algorithm>
  +++ |+#include <cstring>
    3 |
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String A = sc.next();
    long n = A.length();
    HashMap<String, Long> map = new HashMap<String, Long>();
    for(char c = 'a'; c <= 'z'; c++) {
      String s = String.valueOf(c);
      map.put(s, 0);
    }
    for(int i = 0; i < n; i++) {
      String s = String.valueOf(A.charAt(i));
      map.put(s, map.get(s) + 1);
    }
    long e = 0;
    for(char c = 'a'; c <= 'z'; c++) {
      String s = String.valueOf(c);
      long m = map.get(s);
      e += ((m * (m - 1)) / 2);
    }
    long ans = 1 + ((n * (n - 1)) / 2) - e;
    System.out.println(ans);
  }
}

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

#include<bits/stdc++.h>
using namespace std;
int chrs[30]={};
int main(){
string s;
cin>>s;
for(int i=0;i<s.size();i++){
chrs[s[i]-'a']++;
}
int ans = s.size() * (s.size()+1) /2 +1;
for (int I =0;I<27;I++)
ans  -= chrs[i] * (chrs[i]+1)/2;
cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'i' was not declared in this scope
   12 | ans  -= chrs[i] * (chrs[i]+1)/2;
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long int main()
{
	string s;
	cin>>s;
	long long int a[26]={0};
	for(long long int i=0;i<s.length();i++)
	{
		a[s[i]-97]++;
	}
	long long int sum=0;
	for(long long int i=0;i<26;i++)
	{
		sum=sum+(a[i]*(a[i]-1)/2);
	}
	long long int x=s.length();
	cout<<x*(x-1)/2 -sum +1;
	return 0;
}

Compiler output:
a.cc:3:11: error: '::main' must return 'int'
    3 | long long int main()
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespce std;
int main()
{
	string s;
	cin>>s;
	int a[26]={0};
	for(int i=0;i<s.length();i++)
	{
		a[s[i]-97]++;
	}
	int sum=0;
	for(int i=0;i<26;i++)
	{
		sum=sum+(a[i]*(a[i]-1)/2);
	}
	int x=s.length();
	cout<<x*(x-1)/2 -sum;
	return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'string' was not declared in this scope
    5 |         string s;
      |         ^~~~~~
a.cc:5:9: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin>>s;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:14: error: 's' was not declared in this scope
    6 |         cin>>s;
      |              ^
a.cc:18:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   18 |         cout<<x*(x-1)/2 -sum;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <bitset>
typedef unsigned long long int ll;
const ll INF = 876543210987654321;
const int MOD = 1000000007;
#define REP(i,n) for(int i=0;i<n;++i)
#define pd(x) cout<<x<<endl
using namespace std;
//vector<vector<int>>(h, vector<int>(w, f));


int main() {
	string s;
	cin >> s;
	ll a[30 = {};
	ll n = s.size();
	for (int i = 0; s[i]; ++i) {
		a[s[i] - 'a']++;

	}
	ll ans = n*(n - 1) / 2;
	for (int i = 0; i < 26; ++i) {
		if (a[i] > 1)ans -= a[i] * (a[i] - 1) / 2;
	}
	cout << ans+1 << endl;
	int aa;
	cin >> aa;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: lvalue required as left operand of assignment
   25 |         ll a[30 = {};
      |              ^~
a.cc:25:21: error: expected ']' before ';' token
   25 |         ll a[30 = {};
      |                     ^
      |                     ]
a.cc:28:17: error: 'a' was not declared in this scope
   28 |                 a[s[i] - 'a']++;
      |                 ^
a.cc:33:21: error: 'a' was not declared in this scope
   33 |                 if (a[i] > 1)ans -= a[i] * (a[i] - 1) / 2;
      |                     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double

ll ans;
string s;

int main() {
	cin >> s;

	ans = s.size()*(s.size()-1)/2 + 1;

	for(int i = 0; i < s.size(); i++) charCnt[s[i]]++;

	for(auto x: charCnt) ans -= x.second*(x.second-1)/2;

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:43: error: 'charCnt' was not declared in this scope; did you mean 'char8_t'?
   16 |         for(int i = 0; i < s.size(); i++) charCnt[s[i]]++;
      |                                           ^~~~~~~
      |                                           char8_t
a.cc:18:21: error: 'charCnt' was not declared in this scope; did you mean 'char8_t'?
   18 |         for(auto x: charCnt) ans -= x.second*(x.second-1)/2;
      |                     ^~~~~~~
      |                     char8_t
Language: C++

#include <iostream>
#include <cstring>
using namespace std;
char s[200010];
int l,time=0,c[26],a[26],sum=26;
int main()
{
    int r=0;
    long long sum=0;
    char z[26];
    cin>>s;
    l=strlen(s);
    memset(c,0,sizeof(c));
    for(int i=0;i<l;i++)
    {
        int x=s[i]-'a';
        c[x]++;
    }
    for(int i=0;i<=25;i++)
    {
        if(x!=0) a[r++]=c[i];
    }
    for(int i=0;i<r;i++)
    {
        int sum1=0;
        for(int j=0;j<r;j++)
        {
            if(j==i)continue;
            sum1+=a[j];
        }
        sum+=sum1*a[i];
    }
    cout<<sum<<endl;
}

Compiler output:
a.cc:5:7: error: 'int time' redeclared as different kind of entity
    5 | int l,time=0,c[26],a[26],sum=26;
      |       ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 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/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:21:12: error: 'x' was not declared in this scope
   21 |         if(x!=0) a[r++]=c[i];
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cout<<"!"<<endl
#define SHOW(a,b) cout<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cout<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;
typedef tuple<int,int,int> tiii;
#define mt make_tuple


int main(){
  ll ans = 0; string str; cin >> str;
  map<char,ll> table;
  rep(i,str.size())
    t[str[i]]++;
  for(int i = 'a'; i <= 'z'; i++)
    for(int j = i +1; j <= 'z'; j++)
      ans += map[i] * map[j];
  cout << ans +1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:5: error: 't' was not declared in this scope
   33 |     t[str[i]]++;
      |     ^
a.cc:36:17: error: missing template arguments before '[' token
   36 |       ans += map[i] * map[j];
      |                 ^
a.cc:36:26: error: missing template arguments before '[' token
   36 |       ans += map[i] * map[j];
      |                          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;  
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define rep(i,n) for(ll i=0;i<(n);i++)  
#define pii pair<int,int>
#define piii pair<int,pii>
#define mp make_pair
#define pb push_back  
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second  
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-5;
const double PI = M_PI;  
#define DEB cout<<"!"<<endl
#define SHOW(a,b) cout<<(a)<<" "<<(b)<<endl
#define SHOWARRAY(ar,i,j) REP(a,i)REP(b,j)cout<<ar[a][b]<<((b==j-1)?((a==i-1)?("\n\n"):("\n")):(" "))
  
#define DIV 1000000007
typedef vector<ll> Array;
typedef vector<Array> matrix;
typedef tuple<int,int,int> tiii;
#define mt make_tuple


int main(){
  ll ans = 0; string str; cin >> str;7
  map<char,ll> table;
  rep(i,str.size())
    t[str[i]]++;
  for(int i = 'a'; i <= 'z'; i++)
    for(int j = i +1; j <= 'z'; j++)
      ans += map[i] * map[j];
  cout << ans +1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:39: error: expected ';' before 'map'
   30 |   ll ans = 0; string str; cin >> str;7
      |                                       ^
      |                                       ;
   31 |   map<char,ll> table;
      |   ~~~                                  
a.cc:33:5: error: 't' was not declared in this scope
   33 |     t[str[i]]++;
      |     ^
a.cc:36:17: error: missing template arguments before '[' token
   36 |       ans += map[i] * map[j];
      |                 ^
a.cc:36:26: error: missing template arguments before '[' token
   36 |       ans += map[i] * map[j];
      |                          ^
Language: C++

#include <deque>
const bool DEBUG = false;
typedef long long int ll;
const ll INF = 876543210987654321;
const int MOD = 1000000007;
#define REP(i,n) for(int i=0;i<n;++i)
using namespace std;
//vector<vector<int>>(h, vector<int>(w, f));


int main() {
	string s;

	cin >> s;
	int ans = 1;
	int n = s.length();
	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;

	int aa;
	cin >> aa;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'string' was not declared in this scope
   12 |         string s;
      |         ^~~~~~
a.cc:2:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
    1 | #include <deque>
  +++ |+#include <string>
    2 | const bool DEBUG = false;
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |         cin >> s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <deque>
  +++ |+#include <iostream>
    2 | const bool DEBUG = false;
a.cc:14:16: error: 's' was not declared in this scope
   14 |         cin >> s;
      |                ^
a.cc:23:9: error: 'cout' was not declared in this scope
   23 |         cout << ans << endl;
      |         ^~~~
a.cc:23:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:24: error: 'endl' was not declared in this scope
   23 |         cout << ans << endl;
      |                        ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <deque>
  +++ |+#include <ostream>
    2 | const bool DEBUG = false;
Language: C++

#include<cstdio>
#include<iostream>
#include<cmath>
#include<cstring>
#include <bits/stdc++.h>
#include<vetcor>
#include<map>
#include<algorithm>
#include<set>
#include<queue>
#include<stack>
using namespace std;

typedef long long ll;
 
const int N = 200005;

char s[N];
ll cnt[1000];
int n;
ll ans = 1;
 
int main()
{
 
	scanf("%s", s);
	n = strlen(s);
	for (int i = 0; i < n; i++) {
		ans += i - cnt[s[i]];
		cnt[s[i]]++;
	}
	printf("%lld\n", ans);
 
	return 0;
}

Compiler output:
a.cc:6:9: fatal error: vetcor: No such file or directory
    6 | #include<vetcor>
      |         ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include<list>
#include<iomanip>
#include<cmath>
#include<queue>
#include <functional>
#include<stdio.h>
#include<assert.h>
#include<stack>
#include<sstream>
#include <cstdlib>
#include<map>
#include<algorithm>
#include<iostream>
#include<set>
#include<utility>
#include<memory.h>
#include<string>
#include<vector>
#include<numeric>
using namespace std;
#define ll  long long
#define pb push_back
#define sz(v)               ((int)((v).size()))
#define all(x)          (x).begin(),(x).end()
#define REP(i, v)       for(int i=0;i<sz(v);i++)
typedef pair<int,int> pii;
#define ios std::ios_base::sync_with_stdio(false);
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <utility>
#include <cstring>
#include <cassert>
#include <cmath>
#include <stack>
#include <queue>

using namespace std;

const int MAXN = 205000;

int len;
char s[MAXN];
char f[26];
int main()
{
	gets(s);
	len = strlen(s);
	ll tot = len * (len - 1) / 2LL;
	ll bad = 0;
	for(int i = 0 ; i < len ; ++i)
	{
		bad += f[s[i] - 'a'];
		f[s[i] - 'a']++;
	}
	cout << 1 + tot - bad << "\n";


}


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

#include<iostream>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<string>
#include<vector>
#include<cstdio>
#include<cstring>
#include<map>
#include<set>
#include<fstream>
#include<sstream>
#include<queue>
#include<iterator>
#include<stack>

using namespace std;

#define st first
#define nd second
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REV(a) reverse(a.begin(),a.end())
#define SORT(a) sort(a.begin(),a.end())
#define inf (int)1e9
#define linf (long long)1e18

typedef long long ll;
typedef short int si;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<pli> vpli;

string s;
priority_queue<string> ans;
int main() {
	cin>>s;
	ans.push("");
	for(int i=0;i<s.size();i++){
		string a;
		a=s.substr(0,i+1);
		char c=s[i];
    priority_queue<string> use;
    while(!use.empty()) use.pop();
		for(int j=0;j<ans.size();j++){

			string b;
			b=ans.top();
			b=b+c;
			ans.pop();
			use.push(b);
		}
		ans=use;
		for(int j=0;j<i;j++){
			string b,c;
			b=c=a.substr(j,i-j+1);
			REV(c);
			if(b==c)continue;
			ans.push(a.substr(0,j)+c);
		}

	}
	ans.push(s);
	ll q=1;
	s=ans.top();
	ans.pop();
	while(!ans.empty()){
		 f(ans.top()!=s){
		 q++;
		 s=ans.top();
		}
		ans.pop();
	}
	cout<<q<<endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:18: error: 'f' was not declared in this scope
   69 |                  f(ans.top()!=s){
      |                  ^
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String A = sc.next();
    StringBuilder sb = new StringBuilder();
        sb.append("#");
        for (char c: A.toCharArray())sb.append(c+"#"); //ダミー文字を突っ込む
        char[] s = sb.toString().toCharArray();
        long N = s.length;
        long max = 0;
        
        long[] rad = new long[N];
        for (int i=0, j=0; i<N;) {
            while(0 <= i-j && i+j < N && s[i-j]==s[i+j]) j++; //rad[i]を素直に求める
            rad[i] = j;
            max = Math.max(max, j); // 最大値は記憶しておく
            // 計算しなくても求められる部分を走査
            int k;
            for (k=1; 0 <= i-k && i+k < N && rad[i-k] < rad[i]-k; k++) {
                rad[i+k] = rad[i-k];
            }
            i+=k; // 次のinteresting position
            j = Math.max(j-k, 0); // interesting position は rad[i]-kと同じか長い回文を持つので考慮させる
        }
    long kaibun = 0;
    for(int i = 0; i < N; i++) {
      kaibun += rad[i];
    }
    long ans = 1 + ((n - 1) * n) / 2 - kaibun;
    System.out.println(ans);
  }
}

Compiler output:
Main.java:14: error: incompatible types: possible lossy conversion from long to int
        long[] rad = new long[N];
                              ^
Main.java:31: error: cannot find symbol
    long ans = 1 + ((n - 1) * n) / 2 - kaibun;
                     ^
  symbol:   variable n
  location: class Main
Main.java:31: error: cannot find symbol
    long ans = 1 + ((n - 1) * n) / 2 - kaibun;
                              ^
  symbol:   variable n
  location: class Main
3 errors
Language: C++

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

using namespace std;

#define DEBUG(x) cout << #x << ": " << x << endl;
#define MOD 1000000007
s
int main() {

  set<long long> hashs;
  std::hash<std::string> hash_fn;
  string A;
  cin >> A;
  int length = A.size();
  hashs.insert(hash_fn(A));

  for(int i = 0; i < length; i++) {
    for(int j = 0; j < length; j++) {
      string tmp = A;
      tmp.replace(i, 1, A[j]));
      tmp.replace(j, 1, A[i]);
      // DEBUG(tmp);
      // DEBUG(hash_fn(tmp));
      hashs.insert(hash_fn(tmp));
    }
  }

  cout << hashs.size() << endl;
}


Compiler output:
a.cc:11:1: error: 's' does not name a type
   11 | s
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string.h>
using namespace std;
#define LL long long

char ss[26]={"abcdefghijklmnopqrstuvwxyz"};
char s[200005];
int main()
{
    while (~scanf("%s",s))
    {
        int ans=0;
        int len= strlen(s);
        int d[26];
        memset(d,0,sizeof(d));
        for(int i = len-1;i >= 1; i--)
            ans+=i;
        ans++;
        for(int i = 0;i < len; i++)
        {
            for(int j = 0;j < 26; j++)
            {
                if(s[i]==ss[j])
                    d[j]++;
            }
        }
        for(int j = 0;j < 26; j++)
        {
            for(int k = d[j]-1;k >= 1; k--)
            {
                ans-=k;
            }
        }

        
        printf("%d\n",ans);
        memset(s,0,sizeof(s));
    }
    
}

Compiler output:
a.cc:7:14: error: initializer-string for 'char [26]' is too long [-fpermissive]
    7 | char ss[26]={"abcdefghijklmnopqrstuvwxyz"};
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: Java

import java.util.Scanner;

public class Main {

    private final static Scanner sc = new Scanner(System.in);

    /**
     * 本処理を実行します。
     */
    public static void execute() {
        String a = nextString();
        int start = 0;
        int pattern = 1;        // 何もしないがあるので1は確定

        while (start < a.length() - 1) {
            for (int i = start + 1; i < a.length(); i++) {
                String sub = a.substring(start, i + 1);
                String reverseSub = reverse(sub);

                if (reverseSub.equals(sub)) {
                    continue;
                } else {
                    pattern++;
                }
            }

            start++;
        }

        out(pattern);
    }

    public static String reverse(String s) {
        StringBuilder sb = new StringBuilder(s.length());
        for (int i = s.length() - 1 ; i >= 0; i--) {
            sb.append(s.charAt(i));
        }

        return sb.toString();
    }

    /**
     * 次の標準入力をintで受け取ります。
     * @return 標準入力値(int)
     */
    public static int nextInt() {
        return sc.nextInt();
    }

    /**
     * 次の標準入力をStringで受け取ります。
     * @return 標準入力値(String)
     */
    public static String nextString() {
        return sc.next();
    }

    /**
     * 次の標準入力を指定回数分intで受け取ります。
     * @param n 取得回数
     * @return 取得した標準入力値の配列(int)
     */
    public static int[] nextInts(int n) {
        int[] arr = new int[n];

        for (int i = 0; i < n; i++) {
            arr[i] = nextInt();
        }

        return arr;
    }

    /**
     * 標準出力にオブジェクトを出力します。
     * @param o 出力対象
     */
    public static void out(Object o) {
        System.out.println(o);
    }

    public static void main(String[] args) {
        execute();
    }

Compiler output:
Main.java:83: error: reached end of file while parsing
    }
     ^
1 error
Language: Java

import java.util.*;
import java.io.*;
public class Main {
    void solve(BufferedReader in) throws Exception {
        String ss = in.readLine();
        int n = ss.length();
        int[] s = new int[n];
        for(int i = 0; i<n; i++) s[i] = ss.charAt(i) - 'a';
        int[][] dp = new int[26][n];
        dp[s[0]][0] = 1;
        for(int i = 1; i<n; i++) {
            for(int c = 0; c<26; c++) dp[c][i] = dp[c][i-1];
            dp[s[i]][i]++;
        }
        int[] sum = new int[26];
        for(int i = 0; i<26; i++) sum[i] = dp[i][n-1];
        int f = 0;
        for(int i = 0; i<n; i++) {
            f += sum[s[i]] - dp[s[i]][i] + 1;
        }
        System.out.println(n*(n+1)/2 + 1 - f);
    }
    int toInt(String s) {return Integer.parseInt(s);}
    int[] toInts(String s) {
        String[] a = s.split(" ");
        int[] o = new int[a.length];
        for(int i = 0; i<a.length; i++) o[i] = toInt(a[i]);
        return o;
    }
    void e(Object o) {
        System.err.println(o);
    }
    public static void main(String[] args) throws Exception{
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        (new B()).solve(in);
    }
}


Compiler output:
Main.java:35: error: cannot find symbol
        (new B()).solve(in);
             ^
  symbol:   class B
  location: class Main
1 error
Language: C

#include <cstdio>
#include <cstring>
using namespace std;

const int N=2000010;
char s[N];
int a[N];
int main(){
    scanf("%s",s);
    int n=strlen(s);
    long long mmh=1LL*n*(n+1)/2;
    for (int i=0;i<n;i++){
    	a[s[i]]++;
    	mmh-=a[s[i]];
	}
    printf("%lld\n",mmh);
}

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

#include <stdio.h>
#include <string.h>
int const N=2000010;
char s[N];
int a[N];
int main(){
    scanf("%s",s);
    int n=strlen(s);
    long long mmh=1LL*n*(n+1)/2;
    for (int i=0;i<n;i++){
        a[s[i]]++;
        mmh-=a[s[i]];
    }
    printf("%lld\n",mmh);
}

Compiler output:
main.c:4:6: error: variably modified 's' at file scope
    4 | char s[N];
      |      ^
main.c:5:5: error: variably modified 'a' at file scope
    5 | int a[N];
      |     ^
Language: C++

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

int main()
{
    char s[200000];
    memset(s,0,sizeof(s));
    int len;
    //int n;
    //cin>>n;
    //len=n;
    for (long long int i=0;i<n;i++)
    {
        /*scanf("%c",&s[i]);*/
		
		if (scanf("%c",&s[i])!=EOF)
		{}
		else
		{
		    len=i;
		    break;
		}
    }
    long long int num;
    //cin>>s;
    
    num=len*(len-1)/2;
    int p,q;
    if (len==1)
    {cout<<num<<endl;return 0;}
    if (s[0]==s[1])
        num--;
    for (int now=1;now<=len-1;now++)
    {
        if (s[now]==s[now+1])
		{
		    p=now,q=now+1;
		    while (s[p]==s[q]&&(p>=0)&&(q<len))
		    {
		        num--;
		        p=p-1;q=q+1;
		    }
		    //cout<<num<<endl;
		}
		if (s[now-1]==s[now+1])
		{
		    p=now-1,q=now+1;
		    while (s[p]==s[q]&&(p>=0)&&(q<len))
		    {
		        num--;
		        p=p-1;q=q+1;
		        //cout<<" "<<num<<endl; 
		    }
		}
	}
	cout<<num<<endl;
	return 0;
}

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

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cstring>
#include <cstdio>

using namespace std;

void runCase();

const int N = 400005;
char s[N];

void runCase()
{
	scanf("%s",s);
	long long olen = strlen(s);
	long long res = 0;
	long long cnt[26] = {0};
	for(int i = 0; i < olen; i++) cnt[s[i]-'a']++;
	for(int i = 0; i < 26; i++) {
		res += cnt[i]*(cnt[i]+1)/2;
	}
	res = 1LL * olen * (olen+1) / 2 - res + 1;
	cout << res << endl;
}

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


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

/**************************************************************************************
    Palindrome tree. Useful structure to deal with palindromes in strings. O(N)
    This code counts number of palindrome substrings of the string.
    Based on problem 1750 from informatics.mccme.ru:
    http://informatics.mccme.ru/moodle/mod/statements/view.php?chapterid=1750
**************************************************************************************/

#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <utility>
#include <cstring>
#include <cassert>
#include <cmath>
#include <stack>
#include <queue>

using namespace std;

const int MAXN = 205000;

struct node {
    int next[26];
    int len;
    int sufflink;
    int num;
};

int len;
char s[MAXN];
node tree[MAXN]; 
int num;            // node 1 - root with len -1, node 2 - root with len 0
int suff;           // max suffix palindrome
long long ans;

bool addLetter(int pos) {
    int cur = suff, curlen = 0;
    int let = s[pos] - 'a';

    while (true) {
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos])     
            break;  
        cur = tree[cur].sufflink;
    }       
    if (tree[cur].next[let]) {  
        suff = tree[cur].next[let];
        return false;
    }

    num++;
    suff = num;
    tree[num].len = tree[cur].len + 2;
    tree[cur].next[let] = num;

    if (tree[num].len == 1) {
        tree[num].sufflink = 2;
        tree[num].num = 1;
        return true;
    }

    while (true) {
        cur = tree[cur].sufflink;
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos]) {
            tree[num].sufflink = tree[cur].next[let];
            break;
        }       
    }           

    tree[num].num = 1 + tree[tree[num].sufflink].num;

    return true;
}

void initTree() {
    num = 2; suff = 2;
    tree[1].len = -1; tree[1].sufflink = 1;
    tree[2].len = 0; tree[2].sufflink = 1;
}

int main() {
    //assert(freopen("input.txt", "r", stdin));
    //assert(freopen("output.txt", "w", stdout));

    gets(s);
    len = strlen(s);

    initTree();

    for (int i = 0; i < len; i++) {
        addLetter(i);
        ans += tree[suff].num;
    }

    cout << (len*(len+1))/2-ans+1 << endl;

    return 0;
}

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

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef long long LL;
#define REP(i,N) for (int i=0; i<N; i++)

int main() {
  long ans;
  string A, B = "abcdefghijklmnopqrstuvwxyz";
  cin >> A;
  ans = 1 + N * (N-1) / 2;
  for (int i = 0; i < B.length(); i++) {
    long rotateNoChange = 0;
    for (int j = 0; j < A.length(); j++) {
      if (A[j] == B[i]) rotateNoChange++;
    }
    if (rotateNoChange > 0) ans -= rotateNoChange*(rotateNoChange-1)/2;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:13: error: 'N' was not declared in this scope
   18 |   ans = 1 + N * (N-1) / 2;
      |             ^
Language: C++

/**************************************************************************************
    Palindrome tree. Useful structure to deal with palindromes in strings. O(N)
    This code counts number of palindrome substrings of the string.
    Based on problem 1750 from informatics.mccme.ru:
    http://informatics.mccme.ru/moodle/mod/statements/view.php?chapterid=1750
**************************************************************************************/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <utility>
#include <cstring>
#include <cassert>
#include <cmath>
#include <stack>
#include <queue>

using namespace std;

const int MAXN = 105000;

struct node {
    int next[26];
    int len;
    int sufflink;
    int num;
};

int len;
char s[MAXN];
node tree[MAXN]; 
int num;            // node 1 - root with len -1, node 2 - root with len 0
int suff;           // max suffix palindrome
long long ans;

bool addLetter(int pos) {
    int cur = suff, curlen = 0;
    int let = s[pos] - 'a';

    while (true) {
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos])     
            break;  
        cur = tree[cur].sufflink;
    }       
    if (tree[cur].next[let]) {  
        suff = tree[cur].next[let];
        return false;
    }

    num++;
    suff = num;
    tree[num].len = tree[cur].len + 2;
    tree[cur].next[let] = num;

    if (tree[num].len == 1) {
        tree[num].sufflink = 2;
        tree[num].num = 1;
        return true;
    }

    while (true) {
        cur = tree[cur].sufflink;
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos]) {
            tree[num].sufflink = tree[cur].next[let];
            break;
        }       
    }           

    tree[num].num = 1 + tree[tree[num].sufflink].num;

    return true;
}

void initTree() {
    num = 2; suff = 2;
    tree[1].len = -1; tree[1].sufflink = 1;
    tree[2].len = 0; tree[2].sufflink = 1;
}

int main() {
    //assert(freopen("input.txt", "r", stdin));
    //assert(freopen("output.txt", "w", stdout));

    gets(s);
    len = strlen(s);

    initTree();

    for (int i = 0; i < len; i++) {
        addLetter(i);
        ans += tree[suff].num;
    }

    cout << (len*(len+1))/2-ans+1 << endl;

    return 0;
}

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

#include <iostream>
#include <set>
#include <string>
using namespace std;
string getRever(const string &A,int I,int J)
{
	string A1;
	char b[200000+1];
	int i;
	int strLen = A.size();
	char *p=(char*)A.c_str();
	memcpy(b,p,I);
	int j=I;
	for (i=J;i>=I;i--){
		b[j++]=A[i];
	}
	memcpy(b+j,p+J+1,strLen-J-1);
	b[strLen]='\0';
	A1=b;
	return A1;
}
int main(int argc, char* argv[])
{
	string A;
	cin>>A;
	int strLen=A.size();
	int i,j;
	char ch=A[0];
	bool bSame=true;
	for (i=0;i<strLen;i++){
		if (A[i] != ch){
			bSame=false;
		}
	}
	if (bSame){
		cout<<1<<endl;
		return 0;
	}
	string A1;
	set<string> setStr;
	for (i=0;i<strLen-1;i++){
		for (j=i+1;j<strLen;j++){
			A1=getRever(A,i,j);
			setStr.insert(A1);
		}
	}
	cout<<setStr.size()<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string getRever(const std::string&, int, int)':
a.cc:12:9: error: 'memcpy' was not declared in this scope
   12 |         memcpy(b,p,I);
      |         ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <set>
  +++ |+#include <cstring>
    3 | #include <string>
Language: C++

#include<iostream>
#include<vector>
#include<math.h>
#include<map>
#include<stdio.h>
#include<queue>
#include<algorithm>
#include<functional>
#include<string>
using namespace std;
#define INF int(1e9)
#define MP make_pair
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,a) for(LL  i=0;i<(a);++i)
typedef pair<int, int> P;
typedef pair<pair<P, P>, P>PP;
char a[200001];
LL tori[200001], ans;
LL bunkai[30];
int main()
{
	scanf("%s", a);
	FOR(i, 2, strlen(a) + 1)
	{
		tori[i] = i * (i - 1) / 2;
	}
	REP(i,strlen(a))
	{
		bunkai[a[i] - 'a']++;
	}
	REP(i, 'z' - 'a')
	{
		ans -= tori[bunkai[i]];
	}
	ans += tori[strlen(a)];
	ans++;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: 'strlen' was not declared in this scope
   24 |         FOR(i, 2, strlen(a) + 1)
      |                   ^~~~~~
a.cc:14:36: note: in definition of macro 'FOR'
   14 | #define FOR(i,a,b) for(LL i=(a);i<(b);++i)
      |                                    ^
a.cc:9:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<functional>
  +++ |+#include <cstring>
    9 | #include<string>
a.cc:28:15: error: 'strlen' was not declared in this scope
   28 |         REP(i,strlen(a))
      |               ^~~~~~
a.cc:15:33: note: in definition of macro 'REP'
   15 | #define REP(i,a) for(LL  i=0;i<(a);++i)
      |                                 ^
a.cc:28:15: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   28 |         REP(i,strlen(a))
      |               ^~~~~~
a.cc:15:33: note: in definition of macro 'REP'
   15 | #define REP(i,a) for(LL  i=0;i<(a);++i)
      |                                 ^
a.cc:36:21: error: 'strlen' was not declared in this scope
   36 |         ans += tori[strlen(a)];
      |                     ^~~~~~
a.cc:36:21: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 1000000000000000000
#define int long long int
#define mod 1000000007
int F[200001];

int Mul(int a, int b){
    return ((a % mod) * (b % mod)) % mod;
}

int fact(void){
    F[0] = 1;
    F[1] = 1;
    for( int i = 2; i < 200000; i++){
        F[i] = mul(i ,F[i-1]);
    }
}
int square(int x){
    return (x * x) % mod;
}

int power(int x, int y){
    if( y == 0) return 1;
    else if( y == 1) return x % mod;
    else if( y % 2 == 0) return square(power(x, y/2)) % mod;
    else return square(power(x, y/2)) * x % mod;
}

int Div(int a, int b){
    return Mul(a, power(b, mod-2));
}

int C(int n, int r){
    if( n < r) return 0;
    int ret;
    ret = Div(F[n],Mul(F[n-r],F[r]));
    return ret;
}

signed main(void)
{
    fact();
    string A;
    int count[26] = {0};
    cin >> A;
    for( int j = 0; j < 26; j++){
        for( int i = 0; i < A.length(); i++){
            if(A[i] == 'a' + j) count[j]++;
        }
    }
    int ans = C(A.length(),2);
    //dump(ans);
    for( int j = 0; j < 26; j++){
        ans -= C(count[j],2);
    }
    cout << ans + 1;
    return 0;
}

Compiler output:
a.cc: In function 'long long int fact()':
a.cc:18:16: error: 'mul' was not declared in this scope; did you mean 'Mul'?
   18 |         F[i] = mul(i ,F[i-1]);
      |                ^~~
      |                Mul
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 1000000000000000000
#define int long long int
#define mod 1000000007
int F[200001];

int mul(int a, int b){
    return ((a % mod) * (b % mod)) % mod;
}

int fact(void){
    F[0] = 1;
    F[1] = 1;
    for( int i = 2; i < 200000; i++){
        F[i] = mul(i ,F[i-1]);
    }
}
int square(int x){
    return (x * x) % mod;
}

int power(int x, int y){
    if( y == 0) return 1;
    else if( y == 1) return x % mod;
    else if( y % 2 == 0) return square(power(x, y/2)) % mod;
    else return square(power(x, y/2)) * x % mod;
}

int div(int a, int b){
    return mul(a, power(b, mod-2));
}

int C(int n, int r){
    if( n < r) return 0;
    int ret;
    ret = div(F[n],mul(F[n-r],F[r]));
    return ret;
}

signed main(void)
{
    fact();
    string A;
    int count[26] = {0};
    cin >> A;
    for( int j = 0; j < 26; j++){
        for( int i = 0; i < A.length(); i++){
            if(A[i] == 'a' + j) count[j]++;
        }
    }
    int ans = C(A.length(),2);
    //dump(ans);
    for( int j = 0; j < 26; j++){
        ans -= C(count[j],2);
    }
    cout << ans + 1;
    return 0;
}

Compiler output:
a.cc: In function 'long long int fact()':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'long long int C(long long int, long long int)':
a.cc:39:14: error: call of overloaded 'div(long long int&, long long int)' is ambiguous
   39 |     ret = div(F[n],mul(F[n-r],F[r]));
      |           ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: candidate: 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc:32:5: note: candidate: 'long long int div(long long int, long long int)'
   32 | int div(int a, int b){
      |     ^~~
/usr/include/c++/14/cstdlib:219:3: note: candidate: 'lldiv_t __gnu_cxx::div(long long int, long long int)'
  219 |   div(long long __n, long long __d)
      |   ^~~
/usr/include/c++/14/cstdlib:181:3: note: candidate: 'ldiv_t std::div(long int, long int)'
  181 |   div(long __i, long __j) _GLIBCXX_NOTHROW { return ldiv(__i, __j); }
      |   ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 1000000000000000000
#define int long long int
#define mod 1000000007
int F[200001];

int mul(int a, int b){
    return ((a % mod) * (b % mod)) % mod;
}

int fact(void){
    F[0] = 1;
    F[1] = 1;
    for( int i = 2; i < 200000; i++){
        F[i] = mul(i ,F[i-1]);
    }
}
int square(int x){
    return (x * x) % mod;
}

int power(int x, int y){
    if( y == 0) return 1;
    else if( y == 1) return x % mod;
    else if( y % 2 == 0) return square(power(x, y/2)) % mod;
    else return square(power(x, y/2)) * x % mod;
}

int div(int a, int b){
    return mul(a, power(b, mod-2));
}

int C(int n, int r){
    if( n < r) return 0;
    int ret = div(F[n],mul(F[n-r],F[r]));
    return ret;
}

signed main(void)
{
    fact();
    string A;
    int count[26] = {0};
    cin >> A;
    for( int j = 0; j < 26; j++){
        for( int i = 0; i < A.length(); i++){
            if(A[i] == 'a' + j) count[j]++;
        }
    }
    int ans = C(A.length(),2);
    //dump(ans);
    for( int j = 0; j < 26; j++){
        ans -= C(count[j],2);
    }
    cout << ans + 1;
    return 0;
}

Compiler output:
a.cc: In function 'long long int fact()':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
a.cc: In function 'long long int C(long long int, long long int)':
a.cc:38:18: error: call of overloaded 'div(long long int&, long long int)' is ambiguous
   38 |     int ret = div(F[n],mul(F[n-r],F[r]));
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: candidate: 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc:32:5: note: candidate: 'long long int div(long long int, long long int)'
   32 | int div(int a, int b){
      |     ^~~
/usr/include/c++/14/cstdlib:219:3: note: candidate: 'lldiv_t __gnu_cxx::div(long long int, long long int)'
  219 |   div(long long __n, long long __d)
      |   ^~~
/usr/include/c++/14/cstdlib:181:3: note: candidate: 'ldiv_t std::div(long int, long int)'
  181 |   div(long __i, long __j) _GLIBCXX_NOTHROW { return ldiv(__i, __j); }
      |   ^~~
Language: C++

#include <queue>
#include <cstdio>
#include <set>
#include <string>
#include <stack>
#include <cmath>
#include <climits>
#include <map>
#include <cstdlib>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#define  LL long long
#define  ULL unsigned long long
using namespace std;

char s[220000];

int main() {

    gets(s);
    int n = strlen(s);
    map<char, int> M;
    LL ans = 0;
    for(int i = 0; i < n; i++)
        ans += i-M[s[i]], M[s[i]]++;
    cout<<ans+1<<endl;
    return 0;
}


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

#include <iostream>
#include <vector>
#include <set>
 
using namespace std;
 
int main(){
	string a;
	cin >> a;
	
	int res = 0;
	
	for(int i = 0;i < a.size();i++){
		for(int j = i+1;j < a.size();j++){
			res++;
		}
	}
	
	cout << res << endl;
	
	return 0;
}

Compiler output:
a.cc:4:1: error: extended character   is not valid in an identifier
    4 |  
      | ^
a.cc:6:1: error: extended character   is not valid in an identifier
    6 |  
      | ^
a.cc:4:1: error: '\U000000a0' does not name a type
    4 |  
      | ^
a.cc:6:1: error: '\U000000a0' does not name a type
    6 |  
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <set>

using namespace std;

int main(){
	string a;
	cin >> a;
	
	res = 0;
	
	for(int i = 0;i < a.size();i++){
		for(int j = i+1;j < a.size();j++){
			res++;
		}
	}
	
	cout << res << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'res' was not declared in this scope
   11 |         res = 0;
      |         ^~~