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

#include <bits/stdc++.h>
using namespace std;
int main(){
  string S; cin>>S;
  long long ans=(S.size()*(S.size()-1))/2
  for(int i=0:i<S.size()-1){
    if(S.at(i)!=S.at(i+1))break;
    else{
      ans--;
      for(int j=0;j<min(i,S.size()-i-1);j++){
        if(S.at(i-j-1)==S.at(i+j+2))ans--;
        else break;
      }
    }
  }
  for(int i=1;i<S.size()-1){
    if(S.at(i-1)!=S.at(i+1))break;
    else{
      ans--;
      for(int j=0;j<min(i-j-1,S.size()-i-1);j++){
        if(S.at(i-j-2)==S.at(i+j+2))ans--;
        else break;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected ',' or ';' before 'for'
    6 |   for(int i=0:i<S.size()-1){
      |   ^~~
a.cc:16:27: error: expected ';' before ')' token
   16 |   for(int i=1;i<S.size()-1){
      |                           ^
      |                           ;
a.cc:20:24: error: no matching function for call to 'min(int, std::__cxx11::basic_string<char>::size_type)'
   20 |       for(int j=0;j<min(i-j-1,S.size()-i-1);j++){
      |                     ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:20:24: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'})
   20 |       for(int j=0;j<min(i-j-1,S.size()-i-1);j++){
      |                     ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:20:24: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   20 |       for(int j=0;j<min(i-j-1,S.size()-i-1);j++){
      |                     ~~~^~~~~~~~~~~~~~~~~~~~
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define debug(var) do{cout << #var << " : "; view(var);}while(0)
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
template<class T> void view(T e) {cout << e << endl;}
template<class T> void view(const vector<T> &v) {for(const auto &e : v){cout << e << " ";} cout << endl;}
template<class T> void view(const vector<vector<T>> &vv) {for(const auto &v : vv){view(v);}}
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;

ll dp[200005][200005];

int main() {
    string s; cin >> s;
    int n = s.size();
    set<string> st;
    st.insert(s);
    for (int i = 0; i < n; i++) {
        for (int j = i+1; j < n; j++) {
            string tmp = s.substr(i,j-i+1);
            reverse(all(tmp));
            string x = s.substr(0,i) + tmp + s.substr(j+1);
            st.insert(x);
        }
    }
    int ans = st.size()
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:5: error: expected ',' or ';' before 'cout'
   39 |     cout << ans << endl;
      |     ^~~~
Language: C++

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

int main(){
  string S;
  cin>>S;
  int cnt=0;
  for(int i=0;i<S.size();i++){
    for(int j=i+1;j<S.size();j++){
      if(S.at(i) != S.at(j)) cnt++;
    }
  }
  cnt++;
  cout<<cnt<<endl;
  return 0;
}
  

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


	}

	std::cout << res << std::endl;
}


Compiler output:
a.cc:2:9: error: expected declaration before '}' token
    2 |         }
      |         ^
a.cc:4:14: error: 'cout' in namespace 'std' does not name a type
    4 |         std::cout << res << std::endl;
      |              ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:5:1: error: expected declaration before '}' token
    5 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9+7;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: conflicting declaration 'int ans'
   15 |     int ans = n*(n-1)*2;
      |         ^~~
a.cc:9:8: note: previous declaration as 'll ans'
    9 |     ll ans = 0;
      |        ^~~
Language: C++

//g++ -std=c++14 test.cpp -o test.out

//問題URL
//https://atcoder.jp/contests/agc019/tasks/agc019_b

//参考：
//https://oraclesqlpuzzle.ninja-web.net/kyoupro/kyoupro-10-019-b.html

//ポイント：
//A[i]とA[j]が同じ文字の時、
//それに内包される文字列を反転させたものと
//A[i],A[j]を含んだ文字列を反転させても被るので除外する
//例えば
//文字列eabceにおいてはabc,eabceどちらを反転させても
//同じecbaeができる

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

string S;

LL ans = 0;

void solve(){
	LL N = S.size();
	ans = N*(N-1)/2;
	vector<LL> alpha(26,0);
	for(int i=0;i<N;i++) alpha[S[i]-'a']++;
	for(int i=0;i<26;i++) ans -= alpha[i]*(alpha[i]-1)/2;
	a++;
}
 
int main(){
    cin >> S;
 
    solve();

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:50:9: error: 'a' was not declared in this scope
   50 |         a++;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b, c, n;
  string s;
  in(s);
  n = s.size();
  a = n * (n - 1) / 2;
  vector<ll> t(26, 0);
  char f = 'a';
  rep(i, 26){
    rep(j, n){
      if(f == s[j])
        t[i]++;
    }
    f++;
  }
  rep(i, 26){
    a -= c[i] * (c[i] - 1) / 2;
  }
  out(a);
  memi;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:11: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   33 |     a -= c[i] * (c[i] - 1) / 2;
      |           ^
a.cc:33:19: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
   33 |     a -= c[i] * (c[i] - 1) / 2;
      |                   ^
Language: C++

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

typedef long long ll;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const ll INF = 1<<21;
// static const ll MOD = 1e9 + 7;

bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) {
    return arg1.first > arg2.first;
}

int main(void) {
    string a;
    cin >> a;

    vector<int> abc(26);
    ll n = a.size();
    for(int i=0;i<n;i++) {
        abc.at(a.at(i)-'a')++;
    }

    ll ans;
    ans = n*(n-1)/2;
    for(int i=0;i<26;i++) {
        ans -= (ll)(abc.at(i)*(abc.at(i)-1)/2;
    }
    ans++;

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:46: error: expected ')' before ';' token
   28 |         ans -= (ll)(abc.at(i)*(abc.at(i)-1)/2;
      |                    ~                         ^
      |                                              )
Language: C++

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}

signed main() {
	string s;
	cin>>s;
	int ans=(1+s.size())*s.size()/2;
	ans-=s.size();
	rep(i,26){
		rep(j,s.size()){
			int cnt=0;
			if(s[j]=='a'+i){
				cnt++;
			}
		}
		ans-=cnt*(cnt-1)/2;
	}
	cout<<ans<<endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:85:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   85 |                 ans-=cnt*(cnt-1)/2;
      |                      ^~~
      |                      int
Language: C++

#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}

signed main() {
	string s;
	cin>>s;
	int ans=(1+s.size())*s.size()/2;
	ans-=s.size();
	rep(i,26){
		rep(j,s.size()){
			int cnt=0:
			if(s[j]=='a'+i){
				cnt++;
			}
		}
		ans-=cnt*(cnt-1)/2;
	}
	cout<<ans<<endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:80:34: error: expected ',' or ';' before ':' token
   80 |                         int cnt=0:
      |                                  ^
a.cc:85:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   85 |                 ans-=cnt*(cnt-1)/2;
      |                      ^~~
      |                      int
Language: C++

//  Created by conan1024hao in 2019.
//  Copyright © 2019 conan1024hao. All rights reserved.
//  専用ライブラリです、自由にコピーして構いません。
//  感谢看我的代码！Wechat:conan1024hao QQ:810396815
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define INF 10e16
#define MOD 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[8]={-1,0,1,0};
int dy[8]={0,-1,0,1};
char dir[4]={'u','l','d','r'};
ll cmp1(pair<ll,string>a,pair<ll,string> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}
//--------------------------------------------------------------------------

//---------------------------------------------------------------------------
int main(){//問題をちゃんと見ろ!!!!!!!!!!!!!!!!!      llか??????????        memset()!!!!!!!!!!!!
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    string s;cin>>s;
    ll n-s.length();
    ll ans=n*(n-1)/2;
    for(int i=0;i<n-1;i++){
        for(int j=i+1;j<n;j++){
            if(s[i]==s[j])ans--;
        }
    }
    cout<<ans<<endl;
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------


Compiler output:
a.cc: In function 'int main()':
a.cc:67:9: error: expected initializer before '-' token
   67 |     ll n-s.length();
      |         ^
a.cc:68:12: error: 'n' was not declared in this scope
   68 |     ll ans=n*(n-1)/2;
      |            ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
__attribute__((con
  structor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	string s; cin>>s;
  ll n = s.size();
  int cnt[26];
  rep(i,26) cnt[i]=0;
  rep(i,n) cnt[s[i]-'a']++;
  ll m = 0;
  rep(i,26) m += cnt[i]*(cnt[i]-1)/2;
  cout << n*(n-1)/2 + 1 - m << endl;

  return 0;
}


Compiler output:
a.cc:43:19: error: expected ')' before 'structor'
   43 | __attribute__((con
      |               ~   ^
      |                   )
   44 |   structor))
      |   ~~~~~~~~         
a.cc:43:19: error: expected ')' before 'structor'
   43 | __attribute__((con
      |              ~    ^
      |                   )
   44 |   structor))
      |   ~~~~~~~~         
a.cc:43:19: error: expected ')' before 'structor'
   43 | __attribute__((con
      |               ~   ^
      |                   )
   44 |   structor))
      |   ~~~~~~~~         
a.cc:43:19: error: expected ')' before 'structor'
   43 | __attribute__((con
      |              ~    ^
      |                   )
   44 |   structor))
      |   ~~~~~~~~         
a.cc:51:13: warning: 'con' attribute directive ignored [-Wattributes]
   51 | signed main(){
      |             ^
Language: C++

#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
#include<set>

using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;

#define MOD 1000000007



int main()
{
  string S;
  cin >> S;
  int N = S.size();

  ll ans = N*(N-1)/2;
  int count[26];
  REP(i,0,26){
    count[i] = 0;
  }
  REP(i,0,N){
    count[S[i] - 'a']++;
  }
  REP(i,0,26){
    ans -= count[i] * (count[i] - 1) / 2;
  }
  cout << ans+1 << endl;
}
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
#include<set>

using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;

#define MOD 1000000007



int main()
{
  string S;
  cin >> S;
  int N = S.size();

  ll ans = N*(N-1)/2;
  int count[26];
  REP(i,0,26){
    count[i] = 0;
  }
  REP(i,0,N){
    count[S[i] - 'a']++;
  }
  REP(i,0,26){
    ans -= count[i] * (count[i] - 1) / 2;
  }
  cout << ans+1 << endl;
}


Compiler output:
a.cc:66:5: error: redefinition of 'int main()'
   66 | int main()
      |     ^~~~
a.cc:24:5: note: 'int main()' previously defined here
   24 | int main()
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
char s[200001];
int num[300],ans;
main(){
	cin>>s+1;
	for (int i=1;i<=strlen (s+1);i++) 
	ans+=num[(int)s[i]],num[(int)s[i]]++;
	printf ("%d",strlen(s+1)*(strlen(s+1)-1)/2-ans+1;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:10:57: error: expected ')' before ';' token
   10 |         printf ("%d",strlen(s+1)*(strlen(s+1)-1)/2-ans+1;
      |                ~                                        ^
      |                                                         )
Language: Java

import java.io.*;
import java.util.*;

public class UniqueStrings {

	public static void main(String[] args) throws Exception{
		
//		BufferedReader br = new BufferedReader(new FileReader(input_file));
//		PrintWriter out = new PrintWriter(output_file);
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
//		String[] input = br.readLine().split(" ");
//		int tc = Integer.parseInt(input[0]);
		int tc = 1;
		for(int iter = 1; iter <= tc; iter++) {
			String str = br.readLine();
			int n = str.length();
			
			long ans = (n * 1l * (n - 1)) / 2 + 1;
			long[] cnt = new long[26];
			
			for(int i = 0; i < n; i++)
				cnt[(int)(str.charAt(i) - 'a')]++;
				
			for(int i = 0; i < 26; i++)
				ans -= (cnt[i] * (cnt[i] - 1)) / 2;
			out.println(ans);
		}
		
		out.close();
		
	}
	
	static void debug(Object... o) {
	    System.out.println(Arrays.deepToString(o));
	}
}


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

#include <bits/stdc++.h>

using namespace std;

#define lll long long int
#define mp make_pair
#define pb push_back

#define fl(i, n) for (i = 0; i < n; i++)
#define fl1(i, n) for (i = 1; i <= n; i++)
#define fla(i, n, a) for (i = a; i < n; i++)
#define flr(i, n) for (i = n - 1; i >= 0; i--)
#define fl1r(i, n) for (i = n; i >= 1; i--)
#define flar(i, n, a) for (i = n - 1; i >= a; i--)
#define mem(a, i) memset(a, i, sizeof(a))

typedef pair<int, int> pii;
typedef pair<lll, lll> pll;
typedef pair<lll, int> pli;
typedef map<lll, lll> mll;
typedef map<int, int> mii;
typedef vector<pll> vpll;
typedef vector<lll> vll;

#define gcd __gcd
#define debug(x) cout << "debug->" << #x << "::" << x << endl
#define debug2(x, y) cout << #x << " :: " << x << "\t" << #y << " :: " << y << endl
#define debug3(x, y, z) cout << #x << " :: " << x << "\t" << #y << " :: " << y << "\t" << #z << " :: " << z << endl
#define debug4(x, y, z, P) cout << #x << " :: " << x << "\t" << #y << " :: " << y << "\t" << #z << " :: " << z << "\t" << #P << " :: " << P << endl
#define debug5(x, y, z, P, O) cout << #x << " :: " << x << "\t" << #y << " :: " << y << "\t" << #z << " :: " << z << "\t" << #P << " :: " << P << "\t" << #O << " :: " << O << endl

#define boost                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL)
#define bb begin()
#define ee end()

#define MOD 1000000007
#define MAX 300001

vector<vector<bool>> vis(n, vector<bool>(n, false));
int main()
{
    string ss;
    cin >> ss;
    lll ans = 1, n = ss.size(), i, j;

    while (i < n - 1)
    {
        vis[i][i] = true;
        if (ss[i] == ss[i + 1])
            vis[i][i + 1] = true;
        else
            ans++;

        i++;
    }
    vis[i][i] = true;
    if (ans == 1)
        cout << ans << endl;
    else
    {
        for (int k = 2; k < n; k++)
        {
            for (i = 0; i < n - k; i++)
            {
                j = i + k;
                if (ss[i] == ss[j] && vis[i + 1][j - 1])
                    vis[i][j] = true;
                else
                    ans++;
            }
        }
        cout << ans << endl;
    }
}


Compiler output:
a.cc:42:26: error: 'n' was not declared in this scope; did you mean 'yn'?
   42 | vector<vector<bool>> vis(n, vector<bool>(n, false));
      |                          ^
      |                          yn
a.cc:42:42: error: 'n' was not declared in this scope; did you mean 'yn'?
   42 | vector<vector<bool>> vis(n, vector<bool>(n, false));
      |                                          ^
      |                                          yn
Language: C

#include <bits/stdc++.h>
#define in long long
using namespace std;
string s;
in ans=1;
in cnt[200011]={};
int main()
{
	cin >>s;
	for(in i=0;i<s.size();i++)
	{
		ans+=i-cnt[s[i]];
		cnt[s[i]]++;
	}
	cout<<ans<<endl;
	return 0;
}

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

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
using LL = long long;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumulate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no matching function for call to 'accumulate(std::vector<long long int>::iterator, std::vector<long long int>::iterator)'
   16 |   LL sum = accumulate(cnt.begin(),cnt.end());
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
using long long LL;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumulate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc:6:7: error: expected nested-name-specifier before 'long'
    6 | using long long LL;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'LL' was not declared in this scope
   12 |   LL n = s.size();
      |   ^~
a.cc:13:12: error: template argument 2 is invalid
   13 |   vector<LL> cnt(128);
      |            ^
a.cc:14:22: error: invalid types 'int[char]' for array subscript
   14 |   for(auto c:s) ++cnt[c];
      |                      ^
a.cc:15:15: error: 'begin' was not declared in this scope
   15 |   for(auto &x:cnt) x=x*(x-1)/2;
      |               ^~~
a.cc:15:15: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:15:15: error: 'end' was not declared in this scope
   15 |   for(auto &x:cnt) x=x*(x-1)/2;
      |               ^~~
a.cc:15:15: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:16:5: error: expected ';' before 'sum'
   16 |   LL sum = accumulate(cnt.begin(),cnt.end());
      |     ^~~~
      |     ;
a.cc:17:13: error: 'n' was not declared in this scope
   17 |   cout << 1+n*(n-1)/2-sum << endl;
      |             ^
a.cc:17:23: error: 'sum' was not declared in this scope
   17 |   cout << 1+n*(n-1)/2-sum << endl;
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
using long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumulate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'long'
    2 | using long long LL;
      |       ^~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'LL' was not declared in this scope
   12 |   LL n = s.size();
      |   ^~
a.cc:13:12: error: template argument 2 is invalid
   13 |   vector<LL> cnt(128);
      |            ^
a.cc:14:22: error: invalid types 'int[char]' for array subscript
   14 |   for(auto c:s) ++cnt[c];
      |                      ^
a.cc:15:15: error: 'begin' was not declared in this scope
   15 |   for(auto &x:cnt) x=x*(x-1)/2;
      |               ^~~
a.cc:15:15: note: suggested alternatives:
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/valarray:1238:5: note:   'std::begin'
 1238 |     begin(const valarray<_Tp>& __va) noexcept
      |     ^~~~~
In file included from /usr/include/c++/14/filesystem:53,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200:
/usr/include/c++/14/bits/fs_dir.h:608:3: note:   'std::filesystem::__cxx11::begin'
  608 |   begin(recursive_directory_iterator __iter) noexcept
      |   ^~~~~
a.cc:15:15: error: 'end' was not declared in this scope
   15 |   for(auto &x:cnt) x=x*(x-1)/2;
      |               ^~~
a.cc:15:15: note: suggested alternatives:
/usr/include/c++/14/valarray:1265:5: note:   'std::end'
 1265 |     end(const valarray<_Tp>& __va) noexcept
      |     ^~~
/usr/include/c++/14/bits/fs_dir.h:613:3: note:   'std::filesystem::__cxx11::end'
  613 |   end(recursive_directory_iterator) noexcept
      |   ^~~
a.cc:16:5: error: expected ';' before 'sum'
   16 |   LL sum = accumulate(cnt.begin(),cnt.end());
      |     ^~~~
      |     ;
a.cc:17:13: error: 'n' was not declared in this scope
   17 |   cout << 1+n*(n-1)/2-sum << endl;
      |             ^
a.cc:17:23: error: 'sum' was not declared in this scope
   17 |   cout << 1+n*(n-1)/2-sum << endl;
      |                       ^~~
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumulate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no matching function for call to 'accumulate(std::vector<long long int>::iterator, std::vector<long long int>::iterator)'
   16 |   LL sum = accumulate(cnt.begin(),cnt.end());
      |            ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   candidate expects 4 arguments, 2 provided
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumrate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'accumrate' was not declared in this scope
   16 |   LL sum = accumrate(cnt.begin(),cnt.end());
      |            ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
 
using namespace std;
 
int main(void)
{
  string s;
  cin >> s;
  LL n = s.size();
  vector<LL> cnt(128);
  for(auto c:s) ++cnt[c];
  for(auto &x:cnt) x=x*(x-1)/2;
  LL sum = accumlate(cnt.begin(),cnt.end());
  cout << 1+n*(n-1)/2-sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'accumlate' was not declared in this scope
   16 |   LL sum = accumlate(cnt.begin(),cnt.end());
      |            ^~~~~~~~~
Language: Java

import java.io.*;
public class Reverse {

	public static void main(String[] args) {
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		try {
			String line = reader.readLine();
			char c[] = line.toCharArray();
			char d[] = line.toCharArray();
			int count = 0;
			for(int i=0;i<line.length()-1;i++) {
				for(int k = i+1;k<line.length();k++) {
					char temp = d[i];
					d[i] = d[k];
					d[k] = temp;
					for(int j = 0;j<line.length();j++) {
						if(d[j] != c[j]) {
							count++;
							temp = d[i];
							d[i] = d[k];
							d[k] = temp;
							break;
						}
					}
				}
			}
			System.out.println(count+1);
			
			
		}catch(IOException e) {
			System.out.println(e);
		}
	}
}


Compiler output:
Main.java:2: error: class Reverse is public, should be declared in a file named Reverse.java
public class Reverse {
       ^
1 error
Language: C++

#include "/Users/daikikodama/Desktop/stdc++.h"
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    string a; cin>>a;
    vector<char> vec(a.size());
    rep(i,a.size())vec.at(i)=a.at(i);
    sort(all(vec));
    vec.push_back('*');
    vector<int> cnt;
    int cou=0;
    rep(i,vec.size()-1){
        cou++;
        if(vec.at(i)!=vec.at(i+1)){
            cnt.push_back(cou);
            cou=0;
        }
    }
    int ans=(a.size())*(a.size()-1)/2;
    cnt.push_back(cou);
    rep(i,cnt.size()){
        ans-=(cnt.at(i))*(cnt.at(i)-1)/2;
    }
    cout<<ans+1<<endl;
}

Compiler output:
a.cc:1:10: fatal error: /Users/daikikodama/Desktop/stdc++.h: No such file or directory
    1 | #include "/Users/daikikodama/Desktop/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "/Users/daikikodama/Desktop/stdc++.h"
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 1000000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(void){
    string a; cin>>a;
    int ans=(a.size())*(a.size()-1)/2;
    vector<char> vec(a.size());
    rep(i,a.size())vec.at(i)=a.at(i);
    sort(all(vec));
    vector<int> cnt;
    int cou=0;
    rep(i,a.size()-1){
        cou++;
        if(vec.at(i)!=vec.at(i+1)){
            cnt.push_back(cou);
            cou=0;
        }
    }
    cnt.push_back(cou);
    rep(i,cnt.size()){
        ans-=(cnt.at(i))*(cnt.at(i)-1)/2;
    }
    cout<<ans<<endl;
}

Compiler output:
a.cc:1:10: fatal error: /Users/daikikodama/Desktop/stdc++.h: No such file or directory
    1 | #include "/Users/daikikodama/Desktop/stdc++.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<string>
#include<vector>
using namespace std;
#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
template<class T> bool chmax(T & a, const T & b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } return false; }


int main() {
	string A; cin >> A;
	int n = A.size();

	int cnt[26] = {};
	for (auto c : A)cnt[c - 'a']++;
	int ans = n * (n - 1) / 2 + 1;
	rep(i, 0, 26)
		if (cnt[i] >= 2)
			ans -= cnt[i] * (cnt[i] - 1) / 2;
	cout << ans << endl;
	return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int n;
string s;
int main(){
    cin >> s;
    n = s.size();
    int num = n*(n-1)/2;
    map<char,int> mp;
    int cnt[26] = {};
    for(int i = 0; i < n; i++) cnt[s[i]-'a']++;
    for(char t = 'a'; t <= 'z'; t++){
        num -= cnt[i]*(cnt[i]-1)/2;
    }
    cout << num+1 << endl;
}

 

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long long int llint;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29)
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
int n;
string s;
int main(){
    cin >> s;
    n = s.size();
    num = n*(n-1)/2;
    map<char,int> mp;
    for(int i = 0; i < n; i++){
        mp[s[i]]++;
    }
    for(char t = 'a'; t <= 'z'; t++){
        num -= mp[t]*(mp[t]-1)/2;
    }
    cout << num << endl;
}

 

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'num' was not declared in this scope; did you mean 'enum'?
   21 |     num = n*(n-1)/2;
      |     ^~~
      |     enum
Language: C++

#include <stdio.h>
#include <string.h>
typedef long long ll;

int main(void) {
  l i, cnt[26], n, ans = 1;
  for(i = 0; i < 26; ++i) cnt[i] = 0;
  char s[1000000];
  scanf("%s", s);
  n = strlen(s);
  for(i = 0; i < n; ++i) cnt[s[i] - 'a']++;
  for(i = 0; i < n; ++i) {
    ans += n - cnt[s[i] - 'a'] - i;
    cnt[s[i] - 'a']--;
  }
  printf("%lld", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'l' was not declared in this scope; did you mean 'll'?
    6 |   l i, cnt[26], n, ans = 1;
      |   ^
      |   ll
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   for(i = 0; i < 26; ++i) cnt[i] = 0;
      |       ^
a.cc:7:27: error: 'cnt' was not declared in this scope; did you mean 'int'?
    7 |   for(i = 0; i < 26; ++i) cnt[i] = 0;
      |                           ^~~
      |                           int
a.cc:10:3: error: 'n' was not declared in this scope
   10 |   n = strlen(s);
      |   ^
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i = 0; i < n; ++i) cnt[s[i] - 'a']++;
      |       ^
a.cc:11:26: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |   for(i = 0; i < n; ++i) cnt[s[i] - 'a']++;
      |                          ^~~
      |                          int
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   for(i = 0; i < n; ++i) {
      |       ^
a.cc:13:5: error: 'ans' was not declared in this scope
   13 |     ans += n - cnt[s[i] - 'a'] - i;
      |     ^~~
a.cc:13:16: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |     ans += n - cnt[s[i] - 'a'] - i;
      |                ^~~
      |                int
a.cc:16:18: error: 'ans' was not declared in this scope
   16 |   printf("%lld", ans);
      |                  ^~~
Language: C++

#include <cstdio>
using namespace std;
const int maxn=200009;
int c[29];
long long ret;
char s[maxn];
int main()
{
	cin>>s;
	for(int i=0;s[i];i++)
	{
		ret-=c[s[i]-97];
		c[s[i]-97]++;
		ret+=i;
	}
	cout<<ret+1<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin>>s;
      |         ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | using namespace std;
a.cc:16:9: error: 'cout' was not declared in this scope
   16 |         cout<<ret+1<<endl;
      |         ^~~~
a.cc:16:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:22: error: 'endl' was not declared in this scope
   16 |         cout<<ret+1<<endl;
      |                      ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <cstdio>
  +++ |+#include <ostream>
    2 | using namespace std;
Language: Java

import java.util.*;

public class Main {

    int INF = Integer.MAX_VALUE;

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        String A = sc.next();
        char[] a = A.toCharArray();
        Arrays.sort(a);
        long c = 1;
        long ans = 0;
        for (int i = 1; i < (long) A.length(); i++) {
            if (a[i] != a[i - 1]) {
                ans += (c * (c - 1)) / 2;
                c = 1;
            } else {
                c++;
            }
        }
        ans += (c * (c - 1)) / 2;
        System.out.println(((long) A.length() * ((long) A.length() - 1)) / 2 - ans + 1);
    }

Compiler output:
Main.java:28: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
string a,b;
map<string,bool>n;
long long ans;
int main()
{
	cin>>a;
	for(int s=0;s<a.size())
	{
		for(int v=s+1;v<a.size();s++)
		{
			b=a;
			swap(b[s],v[s]);
			if(n[b]==0)ans++,n[b]=1;
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: expected ';' before ')' token
    9 |         for(int s=0;s<a.size())
      |                               ^
      |                               ;
a.cc:14:36: error: invalid types 'int[int]' for array subscript
   14 |                         swap(b[s],v[s]);
      |                                    ^
Language: C++

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

int main() {
  string A;
  int alpha[26];
  memset(alpha,0,sizeof(alpha));
  cin >> A;
  for (int i=0; i<A.length(); i++) {
    alpha[A[i]-'a']++;
  }
  int n=A.length();
  int ans=n*(n-1)/2;
  for (int i=0; i<26; i++) {
    ans-=alpha[i]*(alpha[i]-1)/2;
  }
  printf("%d\n",ans+1);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'memset' was not declared in this scope
    8 |   memset(alpha,0,sizeof(alpha));
      |   ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include <iostream>
using namespace std;
#define int long long

signed main() {
    string s;
    cin >> s;
    int ans = 1;
    map<char, int> mp;
    for(auto c: s) mp[c]++;
    for(auto p: mp) {
        ans += p.second * (s.size()-p.second);
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'map' was not declared in this scope
    9 |     map<char, int> mp;
      |     ^~~
a.cc:2:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    1 | #include <iostream>
  +++ |+#include <map>
    2 | using namespace std;
a.cc:9:9: error: expected primary-expression before 'char'
    9 |     map<char, int> mp;
      |         ^~~~
a.cc:10:20: error: 'mp' was not declared in this scope
   10 |     for(auto c: s) mp[c]++;
      |                    ^~
a.cc:11:17: error: 'mp' was not declared in this scope; did you mean 'p'?
   11 |     for(auto p: mp) {
      |                 ^~
      |                 p
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
	string a;
	cin>>a;
	//char n[10000];
	long long ap[26]={};
	for(int i=0;i<a.size();i++){
		ap[a[i]-'a']++;
	}
	int ans=0;
	for(int i=0;i<26;i++){
		ans+=ap[i]*(a.length()-ap[i]);
	}
	cout<<ans/2+1<<endl;
	return 0;
}
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
string A;
int ap[26] = {};
 
signed main() {
    cin >> A;
    for (int i = 0; i < A.length(); i++) {
        ap[A[i] - 'a']++;
    }
    int ans = 0;
    for (int i = 0; i < 26; i++) {
        ans += ap[i] * (A.length() - ap[i]);
    }
    cout << ans / 2 + 1 << endl;
    return 0;
}

Compiler output:
a.cc:27:8: error: redefinition of 'int main()'
   27 | signed main() {
      |        ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~
Language: C++


#include<cstdint>
#include<iostream>
#include<vector>
#include<memory>
#include<algorithm>
#include<utility>

using namespace std;

int64_t N;

int64_t Q, H, S, D;

char A[200001];

int main()
{
	cin >> A;

	int64_t ans = 1;

	for (int i = strlen(A)-1; i >= 0; --i) {
		for (int k = strlen(A) - 1; k > i; --k) {
			if (A[i] != A[k]) ++ans;
		}

	}
	cout << ans << endl;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:22: error: 'strlen' was not declared in this scope
   23 |         for (int i = strlen(A)-1; i >= 0; --i) {
      |                      ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<utility>
  +++ |+#include <cstring>
    8 |
Language: C++

#include <iostream>
using namespace std;

string s;
int broj[300];
long long sol;

int main(){
    cin >> s;
    sol = s.size() * (s.size() + 1) / 2;
    for(int i = 0; i < s.size(); i ++){
        broj[s[i]] ++;
    }
    for(int i = 0; i < s.size(); i ++){
        sol -= long long(broj[s[i]]) * (broj[s[i]] + 1) / 2;
        broj[s[i]] = 0;
    }
    cout << sol + 1;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected primary-expression before 'long'
   15 |         sol -= long long(broj[s[i]]) * (broj[s[i]] + 1) / 2;
      |                ^~~~
Language: C++

package main

import (
	"fmt"
)

func main() {
	var A string
	fmt.Scan(&A)
	s := []byte(A)
	var ans int
	var cnt [26]int
	for i := 0; i < len(s); i++ {
		ans += (i - cnt[s[i]-'a'])
		cnt[s[i]-'a']++
		// log.Println(ans)
	}
	fmt.Println(ans + 1)
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~