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

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long int
// #define lli long long int
#define ld long double
#define ff first
#define ss second
#define mp make_pair
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define eb emplace_back
#define pii pair<int, int>
#define endl '\n'
#define all(x) x.begin(),x.end()
#define f(i,j,l) for(i=j;i<l;i++)
#if !defined(ONLINE_JUDGE)
#include "debugging.h"
#endif
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// int const mod = 7340033;
int const mod = 1e9+7;
int power(int a,int b,int m){
    int res = 1;
    while(b){
        if(b&1){
            res = res*a;
            res %= m;
        }
        a=a*a;
        a%=m;
        b=b/2;
    }
    return res;
}
 
int inverse(int x){
    return power(x,mod-2,mod);
}

int const N = 1e7+5;
int const inf = 2e9;


void solve(){
    int i,j,l;
    int n;
    cin>>n;
    int a[n];
    int mn = inf;
    int ans = 0;
    for(i=0;i<n;i++){
        int x;cin>>x;
        if(mn > x) ans++;
        mn = min(mn, x);
    }
    cout<<ans<<endl;
}   

int32_t main(){
    IOS;	
    int t;
    t = 1;
    // pre_compute();
    // cin>>t;
    for(int tt=1;tt<=t;tt++){
        solve();
    }
    return 0;
}

/*

*/

Compiler output:
a.cc:20:10: fatal error: debugging.h: No such file or directory
   20 | #include "debugging.h"
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: Java

import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
a = na()

mn = 9999999999
ct = 0
for i in range(n):
    if mn > a[i]:
        ct += 1
        mn = a[i]
print(ct)


Compiler output:
Main.java:1: error: '.' expected
import sys
          ^
Main.java:3: error: ';' expected
stdin = sys.stdin
     ^
Main.java:7: error: illegal character: '#'
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces
                                        ^
3 errors
Language: C++

#include<bits/stdc++.h>

using namespaces std;  

int solvio1(int p){
     while (p >= 10) 
     p /= 10; 
     return p; 
} 
void solve(){ 
    int i,j,n;   
    cin >> n; 
    int tot[10][10] = {}; 
    for (i = 1; i <= n; i++) { 
        int pro1  = i % 10; 
        int pro = solvio1(i); 
        tot[pro][pro1]++; 
    } 
    int ans = 0; 
    for(i=0; i<10; i++)
    for(j=0;j<10;j++)
      ans = ans + tot[i][j] * tot[j][i];
      cout << ans << endl; 
} 

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

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namespaces'
    3 | using namespaces std;
      |       ^~~~~~~~~~
a.cc: In function 'void solve()':
a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   12 |     cin >> n;
      |     ^~~
      |     std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:23:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   23 |       cout << ans << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:23:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   23 |       cout << ans << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

//BISMILLAHIR RAHMANIR RAHIM
//SOTO MEAW
//SOTO SONDESH
#include<bits/stdc++.h>

#define ls ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define __ <<" "<<
#define loop(m,n) for(m=0;m<n;m++)
#define rloop(m,n) for(m=n-1;m>=0;m--)
#define case(z) "Case " << z++ << ": "
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define newline cout<<endl
#define quit return 0

using namespace std;

bool isprime(int n)
{
    for (int i = 2; i <= n/2; i++)
    {
        if (n % i == 0)
            return false;
    }
    return true;
}

void showmyDS(set<int> ds)
{
    set<int> ::iterator it;
    for (it=ds.begin();it!=ds.end();it++)
    {
        cout << *it << endl ;
    }
    cout << endl;
}
ll int index[1000001];
int main()
{
    ls
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //int t,l=1;cin>>t;while(l>0){
        int n;
        cin>>n;
        int num,k,i,j,l,r;
        int c[10][10]={0};
        for(i=1;i<=n;i++)
        {
            r=i%10;
            num=i;
            while(num!=0)
            {
                k=num%10;
                num/=10;
            }
            l=k;
            c[l][r]++;
        }
        ll int total = 0;
        loop(i,10){
            loop(j,10){
                total+=(c[i][j]*c[j][i]);
            }
        }
        cout<<total;
        newline;
    //t--;}

    quit;
}


Compiler output:
a.cc:38:21: error: 'long long int index [1000001]' redeclared as different kind of entity
   38 | ll int index[1000001];
      |                     ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:4:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
Language: C++

#include<iostream>
#include<string>
#include <boost/multiprecision/cpp_int.hpp>
typedef boost::multiprecision::cpp_int intt;
using namespace std;

int add(int a) {
    intt res = 0;
    string sa = to_string(a);
    int sal = (int)(sa.length());
    for (int i = 1; i <= a; i++) {
        string si = to_string(i);
        int sil = (int)(si.length());
        if (sa[0] == si[sil - 1] && sa[sal - 1] == si[0]) {
            res++;
            if (a != i) {
                res++;
            }
        }
    }
    return res;
}

int main() {
    int n;
    cin >> n;
    intt res = 0;
    for (int i = 1; i <= n; i++) {
        res += add(i);
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc:3:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    3 | #include <boost/multiprecision/cpp_int.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const ll INFL = 1e17;
const int MOD = 1e9+7;

P freq(int x){
    int a = x%10;
    int b;
    while(x){
        b = x;
        b /= 10;
    }
    return P(a,b);
}

int main(){
    int n;
    cin >> n;
    map<P,int> fr;

    for(int i=1; i<=n; i++){
        P p = freq(i);
        fr[p]++;
    }
    ll ans = 0;
    for(int i=1: i<=n; i++){
        P p = freq(i);
        P q(p.second,p.first);
        ans += fr[q]++;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: initializer in range-based 'for' loop
   30 |     for(int i=1: i<=n; i++){
      |              ^
a.cc:30:22: error: expected ')' before ';' token
   30 |     for(int i=1: i<=n; i++){
      |        ~             ^
      |                      )
a.cc:30:24: error: 'i' was not declared in this scope
   30 |     for(int i=1: i<=n; i++){
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const ll INFL = 1e17;
const int MOD = 1e9+7;

P freq(int x){
    int a = x%10;
    int b;
    while(x){
        b = x;
        b /= 10;
    }
    return P(a,b);
}

int main(){
    int n;
    cin >> n;
    map<P,int> fr;

    for(int i=1; i<=n; i++){
        P p = f(i);
        fr[p]++;
    }
    ll ans = 0;
    for(int i=1: i<=n; i++){
        P p = f(i);
        P q(p.second,p.first);
        ans += fr[q]++;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: 'f' was not declared in this scope
   26 |         P p = f(i);
      |               ^
a.cc:30:14: error: initializer in range-based 'for' loop
   30 |     for(int i=1: i<=n; i++){
      |              ^
a.cc:30:22: error: expected ')' before ';' token
   30 |     for(int i=1: i<=n; i++){
      |        ~             ^
      |                      )
a.cc:30:24: error: 'i' was not declared in this scope
   30 |     for(int i=1: i<=n; i++){
      |                        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
vector<int>hash[105];

int main(){
	int n;
	cin>>n;
	long long ret = 0;
	
	for(int i=1; i<=n; i++){
		if(i%10==0) continue;
		int curr = 1;
		while(curr*10<=i) curr*=10;
		int fir = i/curr;
		int sec = i%10;
		hash[fir*10+sec].push_back(i);
	}
	for(int i=1; i<=n; i++){
		if(i%10==0) continue;
		int curr = 1;
		while(curr*10<=i) curr*=10;
		int fir = i/curr;
		int sec = i%10;
		ret+=hash[sec*10+fir].size();

	}
	cout<<ret;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: reference to 'hash' is ambiguous
   16 |                 hash[fir*10+sec].push_back(i);
      |                 ^~~~
In file included from /usr/include/c++/14/string_view:50,
                 from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:12: note:                 'std::vector<int> hash [105]'
    3 | vector<int>hash[105];
      |            ^~~~
a.cc:24:22: error: reference to 'hash' is ambiguous
   24 |                 ret+=hash[sec*10+fir].size();
      |                      ^~~~
/usr/include/c++/14/bits/functional_hash.h:59:12: note: candidates are: 'template<class _Tp> struct std::hash'
   59 |     struct hash;
      |            ^~~~
a.cc:3:12: note:                 'std::vector<int> hash [105]'
    3 | vector<int>hash[105];
      |            ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;cin>>N;long long K=0;
  vector<vector<int>> V(9, vector<int>(9));
  for(int X=1;X<=N;X++){
    string S=to_string(X);
    V[(int)XS[0]-49][S[S.size()-1]-49]++;
  }
  for(int X=0;X<9;X++){
    for(int Y=0;Y<9;Y++){
      K+=V[X][Y]*V[Y][X];
    }
  }
  cout<<K<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'XS' was not declared in this scope; did you mean 'S'?
    9 |     V[(int)XS[0]-49][S[S.size()-1]-49]++;
      |            ^~
      |            S
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;cin>>N;long long K=0;
  vector<vector<int>> V(9, vector<int>(9));
  for(int X=1;X<=N;X++){
    string S=to_string(X);
    V[(int)X[0]-49][S[S.size()-1]-49]++;
  }
  for(int X=0;X<9;X++){
    for(int Y=0;Y<9;Y++){
      K+=V[X][Y]*V[Y][X];
    }
  }
  cout<<K<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: invalid types 'int[int]' for array subscript
    9 |     V[(int)X[0]-49][S[S.size()-1]-49]++;
      |             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  vector<int>A(200001);
  for(int i=1;i<200000;i++){
    A[i]=A[i-1];
    string S=to_string(i);
    if(S.at(S.size()-1)=='0')continue;
    if(S.at(0)==S.at(S.size()-1)){
      if(S.size()==1){A[i]++;continue;}
      else if(S.size()==2){A[i]+=2;continue;}
      else if(S.size()==3){A[i]+=2+S.at(1)-47;continue;}
      else if(S.size()==4){
        A[i]+=12;
        string T="  ";
        T.at(0)=S.at(1);
        T.at(1)=S.at(2);
        A[i]+=stoi(T)+1;
      }
      else if(S.size()==5){
        A[i]+=112;
        string T="   ";
        T.at(0)=S.at(1);
        T.at(1)=S.at(2);
        T.at(2)=S.at(3);
        A[i]+=stoi(T)+1;
      }
      else{
        A[i]+=1112;
        string T="    ";
        T.at(0)=S.at(1);
        T.at(1)=S.at(2);
        T.at(2)=S.at(3);
        T.at(3)=S.at(4);
        A[i]+=stoi(T)+1;
    }
    else if(S.at(0)<S.at(S.size()-1))A[i]+=pow(10,S.size()-3);
    else A[i]+=pow(10,S.size()-2);
  }
  int N; cin>>N;
  cout<<A[N]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: expected '}' before 'else'
   37 |     else if(S.at(0)<S.at(S.size()-1))A[i]+=pow(10,S.size()-3);
      |     ^~~~
a.cc:9:34: note: to match this '{'
    9 |     if(S.at(0)==S.at(S.size()-1)){
      |                                  ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define hell 1000000007
#define PI 3.14159265358979323846
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;

   // cin>>t;
    while(t--)
    {
        ll n,m,i,j;
        cin>>n;
        map<pair<char,char>,ll> mp;
        for(i=1;i<=n;i++)
        {
            string s=to_string(i);
            mp[{s[0],s.back()}]++;
        }

        ll ans=0;
        map<pair<char,char> ,ll>::iterator it;
        for(it=mp.begin();it!=mp.end();it++)
        {
            if(it->first.first==it->second.second)
                ans+=it->second*it->second;
            else
            ans+=it->second*(mp[{it->first.second,it->first.first}]);
        }
        cout<<ans;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:44: error: request for member 'second' in 'it.std::_Rb_tree_iterator<std::pair<const std::pair<char, char>, long long int> >::operator->()->std::pair<const std::pair<char, char>, long long int>::second', which is of non-class type 'long long int'
   31 |             if(it->first.first==it->second.second)
      |                                            ^~~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  map<string,int> mp;
  for(int i=1;i <= n;i++) {
    string s = to_string(i);
    char first = s[0];
    char second = s[s.length() - 1];
    s.clear();
    s += first;
    s += second;
    mp[s]++;
  }
  long long ans = 0;
  for(pair<string,int> p : mp) {
    string s = p.first;
    int freq = p.second;
    if(s[0] == s[1]) {
      ans += (long long) freq * freq;
    }
    else {
      swap(s[0],s[1]);
      ans += (long long) freq * map[s];
    }
  }
  cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:36: error: missing template arguments before '[' token
   26 |       ans += (long long) freq * map[s];
      |                                    ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  map<string,int> mp;
  for(int i=1;i <= n;i++) {
    string s = to_string(i);
    char first = s[0];
    char second = s[s.length() - 1];
    s.clear();
    s += first;
    s += second;
    mp[s]++;
  }
  long long ans = 0;
  for(pair<string,int> p : mp) {
    string s = p.first;
    int freq = p.second;
    if(s[0] == s[1]) {
      ans += (long long) * freq * freq;
    }
    else {
      swap(s[0],s[1]);
      ans += (long long) * freq * map[s];
    }
  }
  cout << ans << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:26: error: invalid type argument of unary '*' (have 'int')
   22 |       ans += (long long) * freq * freq;
      |                          ^~~~~~
a.cc:26:26: error: invalid type argument of unary '*' (have 'int')
   26 |       ans += (long long) * freq * map[s];
      |                          ^~~~~~
a.cc:26:38: error: missing template arguments before '[' token
   26 |       ans += (long long) * freq * map[s];
      |                                      ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> V;
typedef vector<vector<int>> Graph;

int main() {
    map<pair<int,int>> p;
    int n;
    cin >> n;
    for(int i = 11 ;i<=n;i++){
        string s = to_string(i);
        p[make_pair(s[0]-'0',s[s.size()-1]-'0')]++;
    }
    ll ans = 0;
    for(int i =1;i<10;i++){
        for(int j =i;j<10;j++){
            ans += p[make_pair(i,j)]*p[make_pair(j,i)];
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:21: error: wrong number of template arguments (1, should be at least 2)
   11 |     map<pair<int,int>> p;
      |                     ^~
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc:16:10: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>')
   16 |         p[make_pair(s[0]-'0',s[s.size()-1]-'0')]++;
      |          ^
a.cc:21:21: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>')
   21 |             ans += p[make_pair(i,j)]*p[make_pair(j,i)];
      |                     ^
a.cc:21:39: error: no match for 'operator[]' (operand types are 'int' and 'std::pair<int, int>')
   21 |             ans += p[make_pair(i,j)]*p[make_pair(j,i)];
      |                                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define all(x) x.begin(),x.end()
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define vi vector<int>
#define vstr vector<string>
#define vbool vector<bool>
#define vvi vector<vector<int> >
#define mii map<int,int>
#define pb push_back
#define pii pair<int,int>
#define vpair vector<pii > 
#define mkp make_pair
#define scan(a,n) for(int i =0 ; i<n ; i++) cin>>a[i]
#define print(a,n) for(int i = 0 ; i < n ; i++) {cout<<a[i]<<' ';}cout<<'\n'
#define mem(a,v) memset(a,v,sizeof(a))
#define loop(i,a,b) for (int i = a; i < b; i++)
#define loope(i,a,b) for (int i = a; i <= b; i++)
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PRECISION std::cout.unsetf ( std::ios::fixed );std::cout.precision(9)
#define PI 3.14159265
#define S second
#define F first
#define CHECK cout<<"CHEDEDWB"<<endl
int mod = 1e9+7;
int inf = 1e18;
int m_inf = INT_MIN;


void solve()
{
	int n;
	cin>>n;
	vector<vector<int>> c(10,vector<int>(10,0));
	for(int i = 1;i<=n;i++)
	{
		if(i%10==0)	continue;
		int l = i,r;
		while(l>9)	l /= 10;
		r = i%10;
		c[l-1][r-1]++;
	}
	int ans = 0;
	for(int i = 0;i<9;i++)
	{
		for(int j = 0;j<9;j++)
		{
			ans += c[i][j]*c[j][i];
		}
	}
	cout<<ans<<endl;
}

int main()
{
	FastIO; PRECISION;
	int t = 1;
	//cin>>t;
	while(t--)
		solve();
	return 0;
} 

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

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n;
    ll ans;
	cin >> n;
    int a[10][10];
    fr(i,10){
    	fr(j,10){
        	a[i][j]=0;
        }
    }
    for(int i=1;i<n+1;i++){
    	int j=i;
        if(i<10)a[j][j]++;
        else if(i<100)a[j/10][j%10];
        else if(i<1000)a[j/100][j%10];
        else if(i<10000)a[j/1000][j%10];
        else if(i<100000)a[j/10000][j%10];
        else if(i<1000000)a[j/100000][j%10];
    }
    fr(i,10){
    	fro(i,i,10){
        	ans+=a[i][j]*a[j][i]
        }
    }
      cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:27: error: 'j' was not declared in this scope
   31 |                 ans+=a[i][j]*a[j][i]
      |                           ^
Language: C++

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

P f(int x) {
    int a = x%10;
    int b = 0;
    while (x) {
        b = x;
        x /= 10;
    }
    return P(a,b);
}

int table[11][11];

int main() {
    int n;
    cin >> n;
    map<P,int> freq;
    for (int i, i <= n; ++i) {
        P p = f(i);
        freq[p]++;
    }
    ll ans = 0;
    for (int i, i <= n; ++i) {
        P p = f(i);
        P q(p.second, p.first);
        ans += freq[q];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: expected ';' before '<=' token
   23 |     for (int i, i <= n; ++i) {
      |                  ^~~
      |                  ;
a.cc:23:19: error: expected primary-expression before '<=' token
   23 |     for (int i, i <= n; ++i) {
      |                   ^~
a.cc:28:18: error: expected ';' before '<=' token
   28 |     for (int i, i <= n; ++i) {
      |                  ^~~
      |                  ;
a.cc:28:19: error: expected primary-expression before '<=' token
   28 |     for (int i, i <= n; ++i) {
      |                   ^~
Language: C++

#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
P az(int x){
  int a=x%10 ;
  int b=0;
  while(x>0){
    b=x ;
    x /= 10 ;
  }
  return P(a,b) ;
}
int main() {
  int n;
  cin>>n ;
  map< P,int > freq ;
  for(int i=0 ;i<=0 ;i++){
   freq[az(i)]++ ;
  }
    ll ans=0 ;
    for(int i=0 ;i<=n ;++i) {
    P p=f(i) ;
    P q(p.second,p,first) ;
    ans +=freq[q]  ;  
    }
    cout << ans <<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:9: error: 'f' was not declared in this scope
   29 |     P p=f(i) ;
      |         ^
a.cc:30:20: error: 'first' was not declared in this scope
   30 |     P q(p.second,p,first) ;
      |                    ^~~~~
Language: C++

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

int main() {
	int n;
	cin>>n;
	int freq[10][10];
	
	for(int i = 0 ; i < 10 ; i++){
            for(int j = 0 ; j < 10 ; j++){
                number[i][j] = 0;
            }
    }
	
	for(int i=1;i<=n;i++){
		int a=i%10;
		int b=0;
		
		while(i){
			b=i;
			i/=10;
		}
		
		freq[a][b]++;
	}
	
	ll ans=0;
	rep(i,10){
		rep(j,10)ans+=freq[i][j]*freq[j][i];
	}
	
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'number' was not declared in this scope
   13 |                 number[i][j] = 0;
      |                 ^~~~~~
Language: C++

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

int main() {
	int n;
	cin>>n;
	int freq[10][10];
	
	for(int i=1;i<=n;i++){
		int a=x%10;
		int b=0;
		
		while(x){
			b=x;
			x/=10;
		}
		
		freq[a][b]++;
	}
	
	ll ans=0;
	rep(i,10){
		rep(j,10)ans+=freq[i][j]*freq[j][i];
	}
	
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'x' was not declared in this scope
   12 |                 int a=x%10;
      |                       ^
Language: C++

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

int main() {
	int n;
	cin>>n;
	int freq[10][10];
	
	for(int i=1;i<=n;i++){
		int a=x%10;
		int b=0;
		
		while(x){
			b=x;
			x/=10;
		}
		
		freq[a][b]++;
	}
	
	ll ans=0;
	rep(i,10){
		rep(j,10)ans+=freq[i][j]*freq[j][i]
	}
	
	cout<<ans<<endl;
	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'x' was not declared in this scope
   12 |                 int a=x%10;
      |                       ^
a.cc:25:52: error: expected ';' before '}' token
   25 |                 rep(j,10)ans+=freq[i][j]*freq[j][i]
      |                                                    ^
      |                                                    ;
   26 |         }
      |         ~
Language: C++

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

P f(int x){
	int a=x%10;
	int b=0;
	
	while(x){
		b=x;
		x/=10;
	}
	return P(a,b);
}

int main() {
	int n;
	cin>>n;
	//pairと頻度と格納するmapを作成
	map<P,int> freq;
	for(int i=1;i<=n;i++){
		P p=f(i);
		freq[p]++;
	}
	
	ll ans=0;
	//対応するpairのfreqと掛け合わせるループ
	for(auto f:freq){
		int a=f.first.first;
		int b=f.first.second;
		ans+=freq[(b,a)]*f.second;
	}
	
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:26: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and 'int')
   33 |                 ans+=freq[(b,a)]*f.second;
      |                          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::pair<int, int>, int>::key_type&' {aka 'const std::pair<int, int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::pair<int, int>, int>::key_type&&' {aka 'std::pair<int, int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

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

P f(int x){
	int a=x%10;
	int b=0
	
	while(x){
		b=x;
		x/=10;
	}
	return P(a,b);
}

int main() {
	int n;
	cin>>n;
	//pairと頻度と格納するmapを作成
	map<P,int> freq;
	for(int i=1;i<=n;i++){
		P p=f(i);
		freq[p]++;
	}
	
	ll ans=0;
	//対応するpairのfreqと掛け合わせるループ
	for(auto f:freq){
		int a=f.first.first;
		int b=f.first.second;
		ans+=freq[(b,a)]*f.second
	}
	
	cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'P f(int)':
a.cc:11:9: error: expected ',' or ';' before 'while'
   11 |         while(x){
      |         ^~~~~
a.cc: In function 'int main()':
a.cc:33:26: error: no match for 'operator[]' (operand types are 'std::map<std::pair<int, int>, int>' and 'int')
   33 |                 ans+=freq[(b,a)]*f.second
      |                          ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'int' to 'const std::map<std::pair<int, int>, int>::key_type&' {aka 'const std::pair<int, int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<int, int>; _Tp = int; _Compare = std::less<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const std::pair<int, int>, int> >; mapped_type = int; key_type = std::pair<int, int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'int' to 'std::map<std::pair<int, int>, int>::key_type&&' {aka 'std::pair<int, int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FILL0(x) memset(x,0,sizeof(x))

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    comInit();

    int N;
    cin >> N;

    int comb[10][10];   
    FILL0(comb);
    rep(i, 10)
    {
        comb[0][i]=0;
    }

    rep(i, N)
    {
        string istr = to_string(i+1);
        comb[istr[0]- '0'][istr[istr.size()-1]-'0']++;
    }
    int ans=0;
    rep(i, 10)
    {
        rep(j, 10)
        {
            ans += comb[i][j]*comb[j][i];
        }
    }

    cout << ans << endl;
    


 

 

    return 0;
}
 

//cout << setprecision(13);
//next_permutation();
//__gcd();
//reverse();
//set ,tuple ,pair;
//bitset
//vector.find



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

#include <iostream>
using namespace std;
int main(){
  int N;
  cin >> N;
  int keta = 0;
  int count = 0;
  int s, t;
  string M;
  for(int i=1;i<10;++i) {
    for(int j=1;j<10;++j) {
      for(int k=1;k<=N;++k) {
        M = to_string(k);
        s = M.begin() - '0';
        t = M.end() - '0';
        if(i==s&&j==t) ++count;
        if(j==s&&i==t) ++count;
      }
    }
  }
  cout << count;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'int' in assignment
   14 |         s = M.begin() - '0';
      |             ~~~~~~~~~~^~~~~
      |                       |
      |                       __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >
a.cc:15:21: error: cannot convert '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'int' in assignment
   15 |         t = M.end() - '0';
      |             ~~~~~~~~^~~~~
      |                     |
      |                     __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll modpow(ll a, ll n) {
    ll res = 1;
    while(n > 0) {
        if(n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }

    return res;
}

ll comb(ll a, ll b) {
    ll ans = 1;

    for(ll i = a; i > a - b; i--) {
        ans = ans * i % mod;
    }
    for(ll i = 1; i <= b; i++) {
        ans = (ans * modpow(i, mod - 2)) % mod;
    }
    return ans;
}

int main() {
    int N;
    cin >> N;
    ll res = 0;
    vector<vector<ll>> num(10, vector<ll>(10,0));
    for(int i = 0; i <= N; i++) {
        vector<int> d;
        int nn = i;
        while(nn) {
            d.push_back(nn % 10);
            nn /= 10;
        }

        int a = d[0];
        int b = d.back();
        if(!a || !b) continue;
        ++num[a][b];
    }
    for(int a = 1; i < 10; a++) {
        for(int b = 1; b < 10; b++) {
            res += num[a][b] * num[b][a];
        }
    }

    cout << res << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:20: error: 'i' was not declared in this scope
   46 |     for(int a = 1; i < 10; a++) {
      |                    ^
Language: C++

n = int(input())

count_list = []
for i in range(10):
    count_list.append([0] * 10)

for i in range(1, n + 1):
    i_str = str(i)
    j = int(i_str[0])
    k = int(i_str[-1])
    count_list[j][k] += 1

ans = sum([count_list[i][j] * count_list[j][i] for i in range(1, 10) for j in range(1, 10)])
print(ans)

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

# -*- coding: utf-8 -*-

def main():
     n = int(input())
     matrix = [[0 for i in range(10)] for j in range(10)]
     ans = 0

     for i in range(1, n+1):
          s = str(i)
          first = int(s[0])
          end = int(s[-1])
          matrix[first][end] += 1
     # print(matrix)

     for i in range(1, 10):
          for j in range(1, 10):
               ans += matrix[i][j] * matrix[j][i]
               # print('{}, {}, {}'.format(i, j, ans))               
     print(ans)

def check(i, j):
     s = str(i)
     t = str(j)

     if s[0] == t[-1] and s[-1] == t[0]:
          return True
     else:
          return False

if __name__ == "__main__":
    main()


Compiler output:
a.cc:1:3: error: invalid preprocessing directive #-
    1 | # -*- coding: utf-8 -*-
      |   ^
a.cc:13:8: error: invalid preprocessing directive #print
   13 |      # print(matrix)
      |        ^~~~~
a.cc:18:18: error: invalid preprocessing directive #print
   18 |                # print('{}, {}, {}'.format(i, j, ans))
      |                  ^~~~~
a.cc:3:1: error: 'def' does not name a type
    3 | def main():
      | ^~~
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n;
    cin>>n;
    vector<vector<ll>> cnt(9,vector<ll>(9,0));
    rep(i,n){
        ll a,b;
        b=i%10;
        a=i;
        while(a/10>0) a/=10;
        cnt[a][b]++;
    }
    ll sum=0;
    rep(i,9){
        rep(j,9){
            sum+=c[i][j]*c[j][i];
        }
    }
    cout<<sum<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:18: error: 'c' was not declared in this scope
   23 |             sum+=c[i][j]*c[j][i];
      |                  ^
Language: C++

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

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


vector<long long int> calc(int K)
{
  vector<int> out(2);
  out[0] = K%10;
  while(K>9){
    K /= 10;
  }
  out[1] = K;
  return out;
}

int main(){
  int N; cin >> N;
  vector< vector<long long int> > count(10); REP(i,10){ count[i].resize(10); }
  rep(k,1,N+1){
    vector<long long int> tmp = calc(k);
    count[ tmp[0] ][ tmp[1] ] += 1;
  }
  
  long long int res = 0;
  REP(i,10){
    REP(j,10){
      res += count[i][j] * count[j][i];
    }
  }

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

Compiler output:
a.cc: In function 'std::vector<long long int> calc(int)':
a.cc:22:10: error: could not convert 'out' from 'vector<int>' to 'vector<long long int>'
   22 |   return out;
      |          ^~~
      |          |
      |          vector<int>
Language: C++

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

P p(int n) {
    int a=n;
    int b=n%10;
    while(a>9) {
      a/10;
  }
  return P(a,b);
}

int main() {
  int n;
  cin >> n;
  map<P,int> mp;
  for(int i=1; i<=n; i++) {
      mp[p(i)]++;
  }
  int ans=0;
  for(int i=1; i<=n; i++) {
      P pp=p(i);
      P q=(pp.second,pp.first);
      ans+=mp[q];
  }
  cout << ans << endl;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: conversion from 'int' to non-scalar type 'P' {aka 'std::pair<int, int>'} requested
   26 |       P q=(pp.second,pp.first);
      |                      ~~~^~~~~
Language: C++

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

P p(int n) {
    int a=n;
    int b=n%10;
    while(a>9) {
      a/10;
  }
  return P(a,b);
}

int main() {
  int n;
  cin >> n;
  map<P,int> mp;
  for(int i=1; i<=n; i++) {
      mp[p(i)]++;
  }
  int ans=0;
  for(int i=1; i<=n; i++) {
      P q=(p.second,p.first);
      ans+=mp[q(i)];
  }
  cout << ans << endl;


  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:14: error: request for member 'second' in 'p', which is of non-class type 'P(int)' {aka 'std::pair<int, int>(int)'}
   25 |       P q=(p.second,p.first);
      |              ^~~~~~
a.cc:25:23: error: request for member 'first' in 'p', which is of non-class type 'P(int)' {aka 'std::pair<int, int>(int)'}
   25 |       P q=(p.second,p.first);
      |                       ^~~~~
a.cc:26:16: error: no match for call to '(P {aka std::pair<int, int>}) (int&)'
   26 |       ans+=mp[q(i)];
      |               ~^~~
Language: C++

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

P p(int n) {
    int a=n;
    int b=%10;
    while(a>9) {
      a/10;
  }
  return P(a,b);
}

int main() {
  int n;
  cin >> n;
  map<P,int> mp;
  for(int i=1; i<=n; i++) {
      mp[p(i)]++;
  }
  int ans=0;
  for(int i=1; i<=n; i++) {
      P q=(p.second,p.first);
      ans+=mp[q(i)];
  }
  cout << ans << endl;


  return 0;
}

Compiler output:
a.cc: In function 'P p(int)':
a.cc:9:11: error: expected primary-expression before '%' token
    9 |     int b=%10;
      |           ^
a.cc: In function 'int main()':
a.cc:25:14: error: request for member 'second' in 'p', which is of non-class type 'P(int)' {aka 'std::pair<int, int>(int)'}
   25 |       P q=(p.second,p.first);
      |              ^~~~~~
a.cc:25:23: error: request for member 'first' in 'p', which is of non-class type 'P(int)' {aka 'std::pair<int, int>(int)'}
   25 |       P q=(p.second,p.first);
      |                       ^~~~~
a.cc:26:16: error: no match for call to '(P {aka std::pair<int, int>}) (int&)'
   26 |       ans+=mp[q(i)];
      |               ~^~~
Language: C++

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

typedef pair<int, int> P;

P f(int x)
{
	int a = x % 10;
	int b = 0;
	while (x)
	{
		b = x;
		x /= 10;
	}
	return P(a, b);
}
signed main(void)
{
	int n;
	map<P, int> frep;
	long long cnt;

	cin >> n;
	For(i, 1, n + 1)
	{
		P p = f(i);
		freq[p]++;
	}
	cnt = 0;
	For (i, 1, n + 1)
	{
		P p = f(i);
		P q(p.second, p.first);
		ans += freq[q];
	}
	cout << cnt << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:17: error: 'freq' was not declared in this scope; did you mean 'frep'?
   29 |                 freq[p]++;
      |                 ^~~~
      |                 frep
a.cc:36:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |                 ans += freq[q];
      |                 ^~~
      |                 abs
a.cc:36:24: error: 'freq' was not declared in this scope; did you mean 'frep'?
   36 |                 ans += freq[q];
      |                        ^~~~
      |                        frep
Language: C++

#include <bits/stdc++.h>

using namespace std;

map<int,int> a;

int main()
{
    int n,m,k,i;
    cin >> n;
    for(i = 1; i < n; i ++)
    {
        k = i % 10;
        m = i;
        while(m > 0) m /= 10;
        a[k*10+m] ++;
    }
    for(i = 1; i < n; i ++)
    {
        k = i % 10;
        m = i;
        while(m > 0) m /= 10;
        ans += a[k*10+m];
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |         ans += a[k*10+m];
      |         ^~~
      |         abs
a.cc:25:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

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

const int INF = 1001001001;
const int NV=100100;

typedef Long Long ll;
typedef pair<int,int> P;

P f(int x){
  int a=x%10;
  int b=0;
  while(x){
    b=x;
    x/=10;
  }
  return P(a,b);
}

int main() {
  int n;
  cin>>n;
  map<P,int> freq;
  for (int i=1; i<=n; i++){
    P p=f(i);
    freq[p]++;
  }
  ll ans=0;
  for (int i=1; i<=n; i++){
    P p=f(i);
    P q(p.second, p.first);
    ans+=freq[p]++;
  }
  cout<<ans<<endl;  
  return 0;
}


Compiler output:
a.cc:8:9: error: 'Long' does not name a type; did you mean 'long'?
    8 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc: In function 'int main()':
a.cc:29:3: error: 'll' was not declared in this scope
   29 |   ll ans=0;
      |   ^~
a.cc:33:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |     ans+=freq[p]++;
      |     ^~~
      |     abs
a.cc:35:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <iostream>
#include <utility> // for pair
#include <map>

std::pair<int, int> f(int n) {
  std::pair<int, int> p;
  p.first = n % 10;
  p.second = 0;
  while (n) {
    p.second = n;
    n /= 10;
  }
  return p;
}

void solve() {
  int n;
  std::map<std::pair<int, int>, int> freq;  //先頭がi, 末尾がjの整数の個数
  std::cin >> n;
  for (int i = 1; i <= n; ++i) 
    freq[f(i)] += 1;
  long long ans = 0;
  
  for (int i = 1; i <= n; ++i) {
    p = f(i);
    q = std::pair<int, int>(p.second, p.first);
    ans += freq[q];
  }
  std::cout << ans << std::endl;
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:25:5: error: 'p' was not declared in this scope
   25 |     p = f(i);
      |     ^
a.cc:26:5: error: 'q' was not declared in this scope
   26 |     q = std::pair<int, int>(p.second, p.first);
      |     ^
Language: C++

#include <iostream>
#include <utility> // for pair
#include <map>

std::pair<int, int> f(n) {
  std::pair<int, int> p;
  p.first = n % 10;
  p.second = 0;
  while (n) {
    p.second = n;
    n /= 10;
  }
  return p;
}

void solve() {
  int n;
  std::map<std::pair<int, int>, int> freq;  //先頭がi, 末尾がjの整数の個数
  std::cin >> n;
  for (int i = 1; i <= n; ++i) 
    freq[f(i)] += 1;
  long long ans = 0;
  
  for (int i = 1; i <= n; ++i) {
    p = f(i);
    q = std::pair<int, int>(p.second, p.first);
    ans += freq[q];
  }
  std::cout << ans << std::endl;
}

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

Compiler output:
a.cc:5:23: error: 'n' was not declared in this scope
    5 | std::pair<int, int> f(n) {
      |                       ^
a.cc:5:26: error: expected ',' or ';' before '{' token
    5 | std::pair<int, int> f(n) {
      |                          ^
a.cc: In function 'void solve()':
a.cc:21:11: error: no match for call to '(std::pair<int, int>) (int&)'
   21 |     freq[f(i)] += 1;
      |          ~^~~
a.cc:25:5: error: 'p' was not declared in this scope
   25 |     p = f(i);
      |     ^
a.cc:25:10: error: no match for call to '(std::pair<int, int>) (int&)'
   25 |     p = f(i);
      |         ~^~~
a.cc:26:5: error: 'q' was not declared in this scope
   26 |     q = std::pair<int, int>(p.second, p.first);
      |     ^
Language: C++

#include <iostream>
#include <utility> // for pair
#include <map>

std::pari<int, int> f(n) {
  std::pair<int, int> p;
  p.first = n % 10;
  p.second = 0;
  while (n) {
    p.second = n;
    n /= 10;
  }
  return p;
}

void solve() {
  int n;
  std::map<std::pair<int, int>, int> freq;  //先頭がi, 末尾がjの整数の個数
  std::cin >> n;
  for (int i = 1; i <= n; ++i) 
    freq[f(i)] += 1;
  long long ans = 0;
  
  for (int i = 1; i <= n; ++i) {
    p = f(i);
    q = std::pair<int, int>(p.second, p.first);
    ans += freq[q];
  }
  std::cout << ans << std::endl;
}

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

Compiler output:
a.cc:5:6: error: 'pari' in namespace 'std' does not name a template type; did you mean 'pair'?
    5 | std::pari<int, int> f(n) {
      |      ^~~~
      |      pair
a.cc: In function 'void solve()':
a.cc:21:10: error: 'f' was not declared in this scope
   21 |     freq[f(i)] += 1;
      |          ^
a.cc:25:5: error: 'p' was not declared in this scope
   25 |     p = f(i);
      |     ^
a.cc:25:9: error: 'f' was not declared in this scope
   25 |     p = f(i);
      |         ^
a.cc:26:5: error: 'q' was not declared in this scope
   26 |     q = std::pair<int, int>(p.second, p.first);
      |     ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int count[10][10];
    memset(count, 0, sizeof(count));
    for (int i = 1; i <= n; i++) {
        int last = i % 10;
        if (last == 0) {
            continue;
        }
        int first = to_string(i)[0] - '0';
        c[first][last]++;
    }
    int ans = 0;
    for (int i = 0; i < 10; i++) {
        for (int k = 0; k < 10; k++) {
            ans += c[i][k] * c[k][i];
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'c' was not declared in this scope
   18 |         c[first][last]++;
      |         ^
a.cc:23:20: error: 'c' was not declared in this scope
   23 |             ans += c[i][k] * c[k][i];
      |                    ^
Language: C++

#include <iostream>
using namespace std;
int main() {
	int N;
	cin >> N;
	int a[N];
	int b[N];
	int sum = 0;
	for (int i = 1; i < N; i++) {
		for (int j = 1; j < N; j++) {
			a[i] = i;
			b[j] = j;
		}
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if ((a[i] / 10 == b[j] % 10) || (a[i] % 10 == b[j] / 10) {
				sum++;
			}
		}
	}
	cout <<sum;
	return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:81: error: expected ')' before '{' token
   17 |                         if ((a[i] / 10 == b[j] % 10) || (a[i] % 10 == b[j] / 10) {
      |                            ~                                                    ^~
      |                                                                                 )
a.cc:20:17: error: expected primary-expression before '}' token
   20 |                 }
      |                 ^
a.cc:23:17: error: expected ';' before '}' token
   23 |         return 0
      |                 ^
      |                 ;
   24 | }
      | ~