criyle/codenet-compile-errors huggingface dataset:
Language: Java

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

public class topcoder1 {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
     	 static final int MOD = 1000000007; 
		int n=sc.nextInt();
		double[] arr=new double[n];
		for(int i=0;i<n;i++)
		{
			arr[i]=sc.nextDouble();
		}
		
		Arrays.sort(arr);
		int count=0;
		for(int i=0;i<n-1;i++)
		{
			double prod=1;
			for(int j=i+1;j<n;j++)
			{
				prod=arr[i]*arr[j]%MOD;
				
				if(prod%1==0)
				{
					count++;
				}
			}
		}
		System.out.println(count);
		
		
	}
}


Compiler output:
Main.java:8: error: illegal start of expression
     	 static final int MOD = 1000000007; 
     	 ^
Main.java:11: error: illegal start of type
		for(int i=0;i<n;i++)
		^
Main.java:11: error: > or ',' expected
		for(int i=0;i<n;i++)
		               ^
Main.java:11: error: <identifier> expected
		for(int i=0;i<n;i++)
		                 ^
Main.java:16: error: <identifier> expected
		Arrays.sort(arr);
		           ^
Main.java:16: error: <identifier> expected
		Arrays.sort(arr);
		               ^
Main.java:18: error: illegal start of type
		for(int i=0;i<n-1;i++)
		^
Main.java:18: error: > or ',' expected
		for(int i=0;i<n-1;i++)
		               ^
Main.java:18: error: <identifier> expected
		for(int i=0;i<n-1;i++)
		                   ^
Main.java:31: error: <identifier> expected
		System.out.println(count);
		                  ^
Main.java:31: error: <identifier> expected
		System.out.println(count);
		                        ^
Main.java:35: error: class, interface, enum, or record expected
}
^
12 errors
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<conio.h>
#include<math.h> 
#include<time.h>
#include<windows.h>
#include<fstream>
using namespace std;
int main()
{
	double p[100000];
	int n;
	int x[100];
	int l=0;
	int a=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%lf",&p[i]);
	}
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			for(double k=1.0;k<10000;k++)
			{
				if(k==(p[i]*p[j]))
				{
					++a;
					printf("%lf %lf\n",p[i],p[j]);
					
				}
				
			}
		}
	}
	printf("%d",a);
	return 0; 
}

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

#include <bits/stdc++.h>

using namespace std;

#define int long long
#double long double

void solve() {
    int n;
    cin >> n;
    double a[n];
    for (int i = 0; i < n; ++i) cin >> a[i];
    map <pair <short int, short int>, int> hv;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        double tv = a[i];
        short int cnt = 0;
        while ((int) tv != tv) {
            tv *= 10;
            ++cnt;
        }
        short int c2 = 0, c5 = 0;
        int tv1 = (int) tv;
        while (tv1 % 2 == 0) {
            tv1 /= 2;
            ++c2;
        }
        while (tv1 % 5 == 0) {
            tv1 /= 5;
            ++c5;
        }
        for (int j = cnt - c2; j < 50; ++j) {
            for (int k = cnt - c5; k < 50; ++k) {
                ans += hv[{j, k}];
            }
        }
        ++hv[{c2 - cnt, c5 - cnt}];
    }
    cout << ans;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    solve();
    return 0;
}


Compiler output:
a.cc:6:2: error: invalid preprocessing directive #double
    6 | #double long double
      |  ^~~~~~
a.cc: In function 'void solve()':
a.cc:5:13: error: 'long' and 'short' specified together
    5 | #define int long long
      |             ^~~~
a.cc:13:22: note: in expansion of macro 'int'
   13 |     map <pair <short int, short int>, int> hv;
      |                      ^~~
a.cc:5:13: error: 'long' and 'short' specified together
    5 | #define int long long
      |             ^~~~
a.cc:13:33: note: in expansion of macro 'int'
   13 |     map <pair <short int, short int>, int> hv;
      |                                 ^~~
a.cc:5:13: error: 'long' and 'short' specified together
    5 | #define int long long
      |             ^~~~
a.cc:17:15: note: in expansion of macro 'int'
   17 |         short int cnt = 0;
      |               ^~~
a.cc:5:13: error: 'long' and 'short' specified together
    5 | #define int long long
      |             ^~~~
a.cc:22:15: note: in expansion of macro 'int'
   22 |         short int c2 = 0, c5 = 0;
      |               ^~~
a.cc:5:13: error: 'long' and 'short' specified together
    5 | #define int long long
      |             ^~~~
a.cc:22:15: note: in expansion of macro 'int'
   22 |         short int c2 = 0, c5 = 0;
      |               ^~~
Language: C++

#include<bits/stdc++.h>
using namespce std;
int main()
{
   int t,i,j,k,l;
  cin>>t;
  int arr[t];
  for(int a=0;a<t;a++)
  {
    cin>>arr[a];
  }
  for(k=0;k<t;t++)
  {
    for(i=0;i<t;i+1)
    {
      for(j=1;j<t;j+2)
      {
        if(i<j)
        {
          l=a[i]*a[j];
        }
        else
        {
          break;
        }
      }
    }
    cout<<l;
  }
    return 0;
}
    
         


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespce'
    2 | using namespce std;
      |       ^~~~~~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>t;
      |   ^~~
      |   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:20:13: error: 'a' was not declared in this scope
   20 |           l=a[i]*a[j];
      |             ^
a.cc:28:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   28 |     cout<<l;
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C

#include <stdio.h>
#include <math.h>
int main(void)
{
int n,i,j,count=0;
double a[100][200],num;
scanf("%d",&n);
for(i=0;i<n;i++){
  for(j=0;j<n;j++){
  scanf("%lf",&a[i][j]);
  }
}
for(i=0;i<n;i++){
  for(j=0;j<n;j++){
    num=a[i][j]*a[i+1][j+1];
  }
}
    if((ceil(num) != floor(num))
       count++;
       printf("%d",count);
       return 0;
       }
    
  
  


Compiler output:
main.c: In function 'main':
main.c:18:33: error: expected ')' before 'count'
   18 |     if((ceil(num) != floor(num))
      |       ~                         ^
      |                                 )
   19 |        count++;
      |        ~~~~~                     
main.c:22:8: error: expected expression before '}' token
   22 |        }
      |        ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector <double> A (N);
  for (int i=0; i<N; i++) {
    cin >> A.at(i);
  }
  int count=0;
  for (int i=0;i<N-1;i++) {
    for (int j=i+1;j<N;j++) {
      if (eil(A.at(i)*A.at(j))==floor(A.at(i)*A.at(j))) {
        count++;
      }
    }
  }
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'eil' was not declared in this scope; did you mean 'ceil'?
   14 |       if (eil(A.at(i)*A.at(j))==floor(A.at(i)*A.at(j))) {
      |           ^~~
      |           ceil
Language: C++

n = int(input())
a = [float(input())for i in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i + 1, n):
        if (a[i] * a[j]).is_integer():
            ans += 1
print(ans)


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

#include <stdio.h>
#include <math.h>
int main(void)
{
int n,i,j,count=0;
double a[100][200],num;
scanf("%d",&n);
for(i=0;i<n;i++){
  for(j=0;j<n;j++){
  scanf("%lf",&a[i][j]);
  }
}
for(i=0;i<n;i++){
  for(j=0;j<n;j++){
    num=a[i][j]*a[i+1][j+1];
  }
}
    if((ceil(x) != floor(x))
       count++;
       printf("%d",count);
       return 0;
       }
    
  
  

Compiler output:
main.c: In function 'main':
main.c:18:14: error: 'x' undeclared (first use in this function)
   18 |     if((ceil(x) != floor(x))
      |              ^
main.c:18:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:18:29: error: expected ')' before 'count'
   18 |     if((ceil(x) != floor(x))
      |       ~                     ^
      |                             )
   19 |        count++;
      |        ~~~~~                 
main.c:22:8: error: expected expression before '}' token
   22 |        }
      |        ^
Language: C++

#include<bits/stdc++.H>
using namespace std;
int main(){
    int n;
    cin>>n;
    long double a[n];
    for(int i = 0;i<n;i++){
        cin>>a[i];
    }
    int count = 0;
    for(int i = 0;i<n-1;i++){
        for(int j = i+1;j<n;j++){
            if(a[i]*a[j] == int(a[i]*a[j]){
                count++;
//                cout<<a[i]<<" "<<a[j]<<endl;
            }
        }
    }
    cout<<count;
    return 0;
}

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

import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    double a[];
    for(int i = 0;i < n;i++){
      a[i] = sc.nextDouble();
    }
    
    int count = 0;
    for(int j=0;j<n;j++){
     for(int k=0;k<n;k++){
       double A = a[j]*a[k];
       int B = a[j]*a[k];
       if(A - B = 0){
        count++;
       }
     }
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:17: error: incompatible types: possible lossy conversion from double to int
       int B = a[j]*a[k];
                   ^
Main.java:18: error: unexpected type
       if(A - B = 0){
            ^
  required: variable
  found:    value
2 errors
Language: C++

#include<bits/stdc++.h>
using namespace std;
double a[100010];
inline long long read(){
	long long x=0,f=1;char ch=getchar();
	while(!isdigit(ch)){if(ch=='-') f=-1;ch=getchar();}
	while(isdigit(ch)){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
int main(){
  long long n=read(),ans=0;
  for(long long i=1;i<=n;i++)scanf(" %c", &a[i]);
  for(int i=1;i<=n;i++){
  	for(int j=1;j<=n;j++){
  		if(a[i]*a[j]%1==0)ans++;
	  }
  }
  printf("%lld\n",ans);
  fflush(stdout);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:29: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   15 |                 if(a[i]*a[j]%1==0)ans++;
      |                    ~~~~~~~~~^~
      |                        |     |
      |                        |     int
      |                        double
Language: Java

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

public class topcoder1 {
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		double[] arr=new double[n];
		for(int i=0;i<n;i++)
		{
			arr[i]=sc.nextDouble();
		}
		/*for(int i=0;i<n;i++)
		{
			System.out.println(arr[i]);
		}*/
		Arrays.sort(arr);
		int count=0;
		for(int i=0;i<n-1;i++)
		{
			double prod=1;
			for(int j=i+1;j<n;j++)
			{
				prod=arr[i]*arr[j];
				
				if(prod%1==0)
				{
					count++;
				}
			}
		}
		System.out.println(count);
		
		
	}
}


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

import java.util.*;
 
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    double a[] = new double();
    for(int i = 0;i < n;i++){
      a[i] = sc.nextDouble();
    }
    
    int count = 0;
    for(int j=0;j<n;j++){
     for(int k=0;k<n;k++){
       double A = a[j]*a[k];
       int B = a[j]*a[k];
       if(A - B = 0){
        count++;
       }
     }
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:8: error: '[' expected
    double a[] = new double();
                           ^
Main.java:8: error: -> expected
    double a[] = new double();
                             ^
2 errors
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define vl vector<ll>
#define ii pair<ll,ll>
#define vii vector<ii>
#define pb push_back
#define F first
#define S second
using namespace std;
bool isi(ld x)
{
    if(ceil(x)==x)
        return true;
    return false;
}
int main()
{
ll t,i,n,j,z;
cin >> n;
vector<ld> arr(n+1);
map<ld,ll> mp;
for(i=0;i<n;i++)
{
    cin >> arr[i];
    mp[arr[i]]=i;
}
ll co=0;
for(auto it : mp)
{
    for(auto ir : mp)
    {
        if(it.S!=ir.S)
        {
        if(isi((it.F)*(ir.F))
           co++;
        }
    }
}
co/=2;
cout << co;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:30: error: expected ';' before 'co'
   35 |         if(isi((it.F)*(ir.F))
      |                              ^
      |                              ;
   36 |            co++;
      |            ~~                 
a.cc:37:9: error: expected primary-expression before '}' token
   37 |         }
      |         ^
a.cc:36:17: error: expected ')' before '}' token
   36 |            co++;
      |                 ^
      |                 )
   37 |         }
      |         ~        
a.cc:35:11: note: to match this '('
   35 |         if(isi((it.F)*(ir.F))
      |           ^
a.cc:37:9: error: expected primary-expression before '}' token
   37 |         }
      |         ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    
    int n = sc.nextInt();
    double a[] = new double[];
    for(int i = 0;i < n;i++){
      a[i] = sc.nextDouble();
    }
    
    int count = 0;
    for(int j=0;j<n;j++){
     for(int k=0;k<n;k++){
       double A = a[j]*a[k];
       int B = a[j]*a[k];
       if(A - B = 0){
        count++;
       }
     }
    }
    System.out.println(count);
  }
}

Compiler output:
Main.java:8: error: array dimension missing
    double a[] = new double[];
                             ^
1 error
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define vl vector<ll>
#define ii pair<ll,ll>
#define vii vector<ii>
#define pb push_back
#define F first
#define S second
using namespace std;
bool isi(ld x)
{
    if(ceil(x)==x)
        return true;
    return false;
}
int main()
{
ll t,i,n,j,z;
cin >> n;
vector<ld> arr(n+1);
map<ld,ll> mp;
for(i=0;i<n;i++)
{
    cin >> arr[i];
    mp[arr[i]]=i;
}
ll co=0;
for(auto it : mp)
{
    for(auto ir : mp)
    {
        if(it.S!=ir.S)
        {
        if(isi((it.F)*(ir.F))
           co++;
         }
    }
}
co/=2;
cout << co;

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:30: error: expected ';' before 'co'
   35 |         if(isi((it.F)*(ir.F))
      |                              ^
      |                              ;
   36 |            co++;
      |            ~~                 
a.cc:37:10: error: expected primary-expression before '}' token
   37 |          }
      |          ^
a.cc:36:17: error: expected ')' before '}' token
   36 |            co++;
      |                 ^
      |                 )
   37 |          }
      |          ~       
a.cc:35:11: note: to match this '('
   35 |         if(isi((it.F)*(ir.F))
      |           ^
a.cc:37:10: error: expected primary-expression before '}' token
   37 |          }
      |          ^
Language: C++

#include<bits/stdc++.H>
using namespace std;
int main(){
    int n;
    cin>>n;
    long double a[n];
    for(int i = 0;i<n;i++){
        cin>>a[i];
    }
    int count = 0;
    for(int i = 0;i<n-1;i++){
        for(int j = i+1;j<n;j++){
            long double x = a[i]*a[j];
            if(x == int(x)){
                count++;
//                cout<<a[i]<<" "<<a[j]<<endl;
            }
        }
    }
    cout<<count;
    return 0;
}

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

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

bool calc(double x ,double y) {
	if(floor(x) == x && floor(y) == y)
		return true;

	else
		return false;
}


int main() {
	int count,ans = 0;



	vector<double> Map;
	double in_num = 0;

	cin >> count;
	for(int i = 0; i < count; ++ i) {
		cin >> in_num;
		Map.push_back(in_num);
		
		if(i != 0)
			if(calc(Map.at(x),Map.at(x - 1)) == true)
				ans++;
	}

	cout << ans << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:40: error: 'x' was not declared in this scope
   27 |                         if(calc(Map.at(x),Map.at(x - 1)) == true)
      |                                        ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N;#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int N;
    cin >> N;
    
    vector<double> num(N);
    
    for (int i = 0; i < N; i++){
        cin >> num.at(i);
    }
    
    int count = 0;
    double mul = 0;
    for(int j = 0; j < N; j++){
        for(int k = 0; k < N; k++){
            if(j != k){
                mul = num.at(j) * num.at(k);
                if(floor(mul) == mul) count++;
            }
        }
    }
    
    cout << count/2 << endl;
}

    cin >> N;
    
    vector<int> num(N);
    
    for (int i = 0; i < N; i++){
        cin >> num.at(i);
    }
    
    int count = 0;
    double mul = 0;
    for(int j = 0; j < N; j++){
        for(int k = 0; k < N; k++){
            if(j != k){
                mul = num.at(j) * num.at(k);
                if(floor(mul) == mul) count++;
            }
        }
    }
    
    cout << count/2 << endl;
}

Compiler output:
a.cc:6:11: error: stray '#' in program
    6 |     int N;#include <iostream>
      |           ^
a.cc: In function 'int main()':
a.cc:6:12: error: 'include' was not declared in this scope
    6 |     int N;#include <iostream>
      |            ^~~~~~~
a.cc:6:29: error: expected primary-expression before '>' token
    6 |     int N;#include <iostream>
      |                             ^
a.cc:8:1: error: expected primary-expression before 'using'
    8 | using namespace std;
      | ^~~~~
a.cc:9:15: error: a function-definition is not allowed here before '{' token
    9 | int main(void){
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, O = 0;
  vector<double> A(N);
  for (int i = 0; i < N; i++) {cin >> A.at(i);}
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (i >= j) {continue;}
      else if (A.at(i) * A.at(j) % 1 == 0) {O++;}
    }
  }
  cout << O << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:34: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'int' to binary 'operator%'
   10 |       else if (A.at(i) * A.at(j) % 1 == 0) {O++;}
      |                ~~~~~~~~~~~~~~~~~ ^ ~
      |                        |           |
      |                        |           int
      |                        __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++

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

int main(){
  int N;
  cin >> N;
  int sum = 0;
  double A =0;
  
  vector<int>vec(N);
  for(int i=0; i<N;i++){
    cin >> vec.at(i);
  }
  
  for(int j=0; j<N;j++){
    for(int k=j+1; k<N;k++){
      A = vec.at(j) * vec.at(k);
      if (A%1 == 0){
        sum++;
      }
    }
  }
  cout << sum << endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:18:12: error: invalid operands of types 'double' and 'int' to binary 'operator%'
   18 |       if (A%1 == 0){
      |           ~^~
      |           | |
      |           | int
      |           double
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  vector<double> vec(n);
  for(int i=0;i<n;i++){
    cin >>  vec.at(i);
  }
  for(int i=0;i<n-1;i++){
    for(int k=i+i;k<n;k++){
      if(vec.at(i)*vec.at(k)%1.000000000000000000==0.000000000000000000){
        count++;
      }
    }
  }
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'double' to binary 'operator%'
   13 |       if(vec.at(i)*vec.at(k)%1.000000000000000000==0.000000000000000000){
      |          ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |          |
      |                   |          double
      |                   __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  vector<double> vec(n);
  for(int i=0;i<n;i++){
    cin >>  vec.at(i);
  }
  for(int i=0;i<n-1;i++){
    for(int k=i+i;k<n;k++){
      if(vec.at(i)*vec.at(k)%1.000000000000000000==0){
        count++;
      }
    }
  }
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'double' to binary 'operator%'
   13 |       if(vec.at(i)*vec.at(k)%1.000000000000000000==0){
      |          ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |                   |          |
      |                   |          double
      |                   __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: Java

import java.util.Scanner;

public class IntegerProduct {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	double[] arr = new double[n];
	for (int i = 0; i < arr.length; i++) {
		arr[i] = sc.nextDouble();
	}
	System.out.println(solve(arr, n));
}

private static long solve(double[] arr, int n) {
	// TODO Auto-generated method stub
	long res = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (i < j) {
				double num = arr[i] * arr[j];
				if (num % 1 == 0 && String.valueOf(num).contains(".")) {
						System.out.println(num);
						res++;
					}	
				}
			}
		}
		return res;
	}

}


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

#include <stdio.h>

int main()
{
  int N, i, j, count;
  scanf("%d", &N);
  
  float[N] list;
  for (i = 0;i < N;i ++) {
    scanf("%f", &list[i]);
  }
  
  int mul_int;
  float mul_float;
  for (i = 0;i < N-1;i ++) {
    for (j = i+1;j < N;j ++) {
      mul_int = list[i] * list[j];
      mul_float = list[i] * list[j];
      if ((mul_int - mul_float) == 0) {
        count ++;
      }
    }
  }
  
  printf("%d", count);
}

Compiler output:
main.c: In function 'main':
main.c:8:8: error: expected identifier or '(' before '[' token
    8 |   float[N] list;
      |        ^
main.c:10:18: error: 'list' undeclared (first use in this function)
   10 |     scanf("%f", &list[i]);
      |                  ^~~~
main.c:10:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  vector<double> vec(n);
  for(int i=0;i<n;i++){
    cin >>  vec.at(i);
  }
  for(int i=0;i<n-1;i++){
    for(int k=i+i;k<n;k++){
      if(vec.at(i)*vec.at(k)%1==0){
        count++;
      }
    }
  }
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:29: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'int' to binary 'operator%'
   13 |       if(vec.at(i)*vec.at(k)%1==0){
      |          ~~~~~~~~~~~~~~~~~~~^~
      |                   |          |
      |                   |          int
      |                   __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  vector<double> vec(n);
  for(int i=0;i<n;i++){
    cin >>  vec.at(i);
  }
  for(int i=0;i<n-1;i++){
    for(int k=i+i;k<n;k++){
      if(vec.at(i)*vec.at(k)%==0){
        count++;
      }
    }
  }
  cout << count;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expected primary-expression before '=' token
   13 |       if(vec.at(i)*vec.at(k)%==0){
      |                               ^
Language: C++

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

int main(){
  int n,count=0;
  cin >> n;
  vector<double> vec(n);
  for(int i=0;i<n;i++){
    cin >>  vec.at(i);
  }
  for(int i=0;i<n-1;i++){
    for(int k=i+i;k<n;k++){
      if(vec.at(i)*vec.at(k)%==0){
        count++;
      }
    }
  }
  cout << count;
  return 0;
}

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

import java.util.*;

public class a {

	static Scanner in = new Scanner(System.in);
	
	public static void main(String[] args) {
		
		int n = in.nextInt();
		List<Double> tab = new ArrayList<>();
		
		for(int i = 0; i < n; i++) {
			tab.add(in.nextDouble());
		}
		
		int ans = 0;
		
		for(int i = 0; i < n; i++) {
			for(int j = i+1; j < n; j++) {
				if(Math.ceil(tab.get(i)*tab.get(j)) == Math.floor(tab.get(i)*tab.get(j))) {
					ans++;
				}
			}
		}
		System.out.println(ans);	
	}
}

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

#include <iostream>

using namespace std;

int main(){
  	int N;
  	cin >> N;
  	vector<double> a(N);
  	int counter=0;
  	for(int i=0;i<N;i++){
      	cin >> a[i];
      	for(int j=0;j<i;j++){
          	if(a[i]*a[j]==int(a[i]*a[j])) counter++;
        }
    }
  	cout << counter;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vector' was not declared in this scope
    8 |         vector<double> a(N);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:8:16: error: expected primary-expression before 'double'
    8 |         vector<double> a(N);
      |                ^~~~~~
a.cc:11:16: error: 'a' was not declared in this scope
   11 |         cin >> a[i];
      |                ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector <double> A (N);
  for (int i=0; i<N; i++) {
    cin >> A.at(i);
  }
  int count=0;
  for (int i=0;i<N-1;i++) {
    for (int j=i+1;j<N;j++) {
      if (A.at(i)*A.at(j)%1.0==0) {
        count++;
      }
    }
  }
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'double' to binary 'operator%'
   14 |       if (A.at(i)*A.at(j)%1.0==0) {
      |           ~~~~~~~~~~~~~~~^~~~
      |                  |        |
      |                  |        double
      |                  __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++


n=int(input())
co=0
ss=[]
def gcd(aa,bb):
    if(aa==0):
        return bb
    else:
        return gcd(bb%aa,aa)

co=[0 for i in range(10001)]
ans=[]
pre=[[] for i in range(10001)]
for i in range(1,10001):
    for j in range(1,101):
        if(j*j>i):
            continue
        if(i%j==0):
            pre[i].append(j)
            if(j*j!=i):
                pre[i].append(i//j)
co2=0
for i in range(n):
    s=input()
    if('.' not in s):
        x=int(s)
        for j in pre[x]:
            co[j]+=1
        co2+=1
    else:
        x,y=s.split(".")
        nu=int(x)
        nu*=(10**len(y))
        nu+=int(y)
        de=10**len(y)
        gg=gcd(nu,de)
        nu//=gg
        de//=gg
        ans.append([nu,de])
fin=0
if(co2>1):
    fin+=(co2*(co2-1))//2
for i in ans:
   # print(i[0],i[1])
    if(i[1]>len(co)):
        continue
    fin+=co[i[1]]
print(fin)
    


Compiler output:
a.cc:44:6: error: invalid preprocessing directive #print
   44 |    # print(i[0],i[1])
      |      ^~~~~
a.cc:2:1: error: 'n' does not name a type
    2 | n=int(input())
      | ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector <double> A (N);
  for (int i=0; i<N; i++) {
    cin >> A.at(i);
  }
  int count=0;
  for (int i=0;i<N-1;i++) {
    for (int j=i+1;j<N;j++) {
      if (A.at(i)*A.at(j)%1==0) {
        count++;
      }
    }
  }
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'int' to binary 'operator%'
   14 |       if (A.at(i)*A.at(j)%1==0) {
      |           ~~~~~~~~~~~~~~~^~
      |                  |        |
      |                  |        int
      |                  __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++

#include<bits\stdc++.h>
using namespace std;
int main(){
  #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
  #endif
  int n,tot(0);cin>>n;
  long double arr[n];
  cout<<fixed<<setprecision(18);
  for(auto &z : arr)cin>>z;
  for(int i=0;i<n-1;i++){
    for(int j=i+1;j<n;j++){
      if(int(arr[i]*arr[j])==arr[i]*arr[j])
        tot++;
    }
  }
  cout<<tot<<endl;
}

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

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

int main() {
  int N;
  cin>>N;
  vector <double> A (N);
  for (int i=0; i<N; i++) {
    cin A.at(i);
  }
  int count=0;
  for (int i=0;i<N-1;i++) {
    for (int j=i+1;j<N;j++) {
      if (A.at(i)*A.at(j)%1==0) {
        count++;
      }
    }
  }
  cout << count <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected ';' before 'A'
    9 |     cin A.at(i);
      |        ^~
      |        ;
a.cc:14:26: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'} and 'int' to binary 'operator%'
   14 |       if (A.at(i)*A.at(j)%1==0) {
      |           ~~~~~~~~~~~~~~~^~
      |                  |        |
      |                  |        int
      |                  __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type {aka double}
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<long double>data(n);
  for(int i=0;i<n;++i){
    cin>>data[i];
  }
  int ans=0;
  for(int i=0;i<n-1;++i){
    for(int j=i+1;j<n;++j){
      long double u=a[i]*a[j];
      if(u-round(u)<0.000000000001){
        ++ans;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:21: error: 'a' was not declared in this scope
   14 |       long double u=a[i]*a[j];
      |                     ^
a.cc:15:12: error: 'round' was not declared in this scope
   15 |       if(u-round(u)<0.000000000001){
      |            ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define ldb double
template<typename T>ckmn(T&a,T b){a=min(a,b);}
template<typename T>ckmx(T&a,T b){a=max(a,b);}
void rd(int&x){scanf("%i",&x);}
void rd(ll&x){scanf("%lld",&x);}
void rd(char*x){scanf("%s",x);}
void rd(ldb&x){scanf("%lf",&x);}
void rd(string&x){scanf("%s",&x);}
template<typename T1,typename T2>void rd(pair<T1,T2>&x){rd(x.first);rd(x.second);}
template<typename T>void rd(vector<T>&x){for(T&i:x)rd(i);}
template<typename T,typename...A>rd(T&x,A&...args){rd(x);rd(args...);}
template<typename T>rd(){T x;rd(x);return x;}
int ri(){int x;rd(x);return x;}
template<typename T>vector<T> rv(int n){vector<T> x(n);rd(x);return x;}
const int base=1e9;
int main(){
	int n=ri();
	vector<ldb> v=rv<ldb>(n);
	vector<ll> a;
	for(auto i:v)a.pb(round(i*base));
	map<pii,int> cnt;
	for(ll i:a){
		//printf("%lld ",i);
		int t=0,f=0;
		while(i%2==0)i/=2,t++;
		while(i%5==0)i/=5,f++;
		cnt[{t,f}]++;
		//printf("%i %i\n",t,f);
	}
	ll ans=0;
	for(auto it:cnt){
		for(auto jt:cnt){
			if(it.first<jt.first){
				if(it.first.first+jt.first.first>=18&&it.first.second+jt.first.second>=18){
					ans+=(ll)it.second*jt.second;
				}
			}else if(it.first==jt.first){
				if(it.first.first+jt.first.first>=18&&it.first.second+jt.first.second>=18){
					ans+=(ll)it.second*(jt.second-1)/2;
				}
			}
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Compiler output:
a.cc:9:21: error: ISO C++ forbids declaration of 'ckmn' with no type [-fpermissive]
    9 | template<typename T>ckmn(T&a,T b){a=min(a,b);}
      |                     ^~~~
a.cc: In function 'int ckmn(T&, T)':
a.cc:9:46: warning: no return statement in function returning non-void [-Wreturn-type]
    9 | template<typename T>ckmn(T&a,T b){a=min(a,b);}
      |                                              ^
a.cc: At global scope:
a.cc:10:21: error: ISO C++ forbids declaration of 'ckmx' with no type [-fpermissive]
   10 | template<typename T>ckmx(T&a,T b){a=max(a,b);}
      |                     ^~~~
a.cc: In function 'int ckmx(T&, T)':
a.cc:10:46: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | template<typename T>ckmx(T&a,T b){a=max(a,b);}
      |                                              ^
a.cc: At global scope:
a.cc:18:34: error: ISO C++ forbids declaration of 'rd' with no type [-fpermissive]
   18 | template<typename T,typename...A>rd(T&x,A&...args){rd(x);rd(args...);}
      |                                  ^~
a.cc: In function 'int rd(T&, A& ...)':
a.cc:18:70: warning: no return statement in function returning non-void [-Wreturn-type]
   18 | template<typename T,typename...A>rd(T&x,A&...args){rd(x);rd(args...);}
      |                                                                      ^
a.cc: At global scope:
a.cc:19:21: error: ISO C++ forbids declaration of 'rd' with no type [-fpermissive]
   19 | template<typename T>rd(){T x;rd(x);return x;}
      |                     ^~
Language: C++

#include<iostream>
#include<vector>
int main(){
  int n;
  cin>>n;
  vector<long double>data(n);
  for(int i=0;i<n;++i){
    cin>>data[i];
  }
  int ans=0;
  for(int i=0;i<n-1;++i){
    for(int j=i+1;j<n;++j){
      long double u=a[i]*a[j];
      if(u-round(u)<0.000000000001){
        ++ans;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>n;
      |   ^~~
      |   std::cin
In file included 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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<long double>data(n);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'long'
    6 |   vector<long double>data(n);
      |          ^~~~
a.cc:8:10: error: 'data' was not declared in this scope; did you mean 'std::data'?
    8 |     cin>>data[i];
      |          ^~~~
      |          std::data
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/bits/range_access.h:344:5: note: 'std::data' declared here
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
a.cc:13:21: error: 'a' was not declared in this scope
   13 |       long double u=a[i]*a[j];
      |                     ^
a.cc:14:12: error: 'round' was not declared in this scope
   14 |       if(u-round(u)<0.000000000001){
      |            ^~~~~
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   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:19:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<double> ds(N);
  for(int i = 0; i < N; i++) cin >> ds[i];
  
  double tmp;
  int cnt = 0;
  for(int i = 0; i < N - 1; i++) {
    for(int j = i + 1; j < N; j++) {
      tmp = ds[i] * ds[j];
      if(tmp == ceil(tmp)) cnt++;
    }
  }
  
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<double> ds(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'double'
    7 |   vector<double> ds(N);
      |          ^~~~~~
a.cc:8:37: error: 'ds' was not declared in this scope
    8 |   for(int i = 0; i < N; i++) cin >> ds[i];
      |                                     ^~
a.cc:14:13: error: 'ds' was not declared in this scope
   14 |       tmp = ds[i] * ds[j];
      |             ^~
a.cc:15:17: error: 'ceil' was not declared in this scope
   15 |       if(tmp == ceil(tmp)) cnt++;
      |                 ^~~~
Language: C

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


int main(){
    int num = 0;
    scanf("%d", &num);
    float array[num];

    for(int i = 0; i < num; i++) {
        scanf("%f", &array[i]);
    }

    int pairs = 0;

    for(int i = 0; i < num -1, i++){
        for(int j = i + 1; j < num; j++){
            if(j*i % 1 == 0) pairs++;
        }
    }

    printf("%d", pairs);

}

Compiler output:
main.c: In function 'main':
main.c:16:35: error: expected ';' before ')' token
   16 |     for(int i = 0; i < num -1, i++){
      |                                   ^
      |                                   ;
Language: C

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

int num = 0;
scanf("%d", &num);
float array[num];

for(int i = 0; i < num; i++) {
    scanf("%f", &array[i]);
}

int pairs = 0;

for(int i = 0; i < num -1, i++){
    for(int j = i + 1; j < num; j++){
        if(j*i % 1 == 0) pairs++;
    }
}

printf("%d", pairs);

Compiler output:
main.c:5:7: error: expected declaration specifiers or '...' before string constant
    5 | scanf("%d", &num);
      |       ^~~~
main.c:5:13: error: expected declaration specifiers or '...' before '&' token
    5 | scanf("%d", &num);
      |             ^
main.c:6:7: error: variably modified 'array' at file scope
    6 | float array[num];
      |       ^~~~~
main.c:8:1: error: expected identifier or '(' before 'for'
    8 | for(int i = 0; i < num; i++) {
      | ^~~
main.c:8:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    8 | for(int i = 0; i < num; i++) {
      |                  ^
main.c:8:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    8 | for(int i = 0; i < num; i++) {
      |                          ^~
main.c:14:1: error: expected identifier or '(' before 'for'
   14 | for(int i = 0; i < num -1, i++){
      | ^~~
main.c:14:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   14 | for(int i = 0; i < num -1, i++){
      |                  ^
main.c:20:8: error: expected declaration specifiers or '...' before string constant
   20 | printf("%d", pairs);
      |        ^~~~
main.c:20:14: error: expected declaration specifiers or '...' before 'pairs'
   20 | printf("%d", pairs);
      |              ^~~~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
using ll = long long;

const int MAX = 5e7;

int children[MAX][26], cnt[MAX], it = 0;

int get_child(int s, int k) {
	auto& c = children[s][k];
	if (!c)
		c = it++;
	return c;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int n;
	std::cin >> n;
	std::vector<std::string> g(n);
	for (auto& x : g)
		std::cin >> x;
	std::sort(g.rbegin(), g.rend(), [&](auto a, auto b) { return a.size() < b.size(); });
	ll ans = 0;
	int root = it++;
	for (int i = 0; i < n; ++i) {
		std::vector<int> m{0};
		for (auto c : g[i])
			m.push_back(m.back() | (1 << (c - 'a')));
		int s = root;
		for (auto c : std::string(g[i].rbegin(), g[i].rend())) {
			for (int k = 0; k < 26; ++k)
				if (((1 << k) & m.back()) && k != c - 'a')
					cnt[get_child(s, k)]++;
			s = get_child(s, c - 'a');
			cnt[s]++;
			m.pop_back();
		}
		ans += cnt[s] - 1;
	}
	std::cout << ans << '\n';
}


Compiler output:
/tmp/ccoEjzPG.o: in function `get_child(int, int)':
a.cc:(.text+0x4e): relocation truncated to fit: R_X86_64_PC32 against symbol `it' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `it' defined in .bss section in /tmp/ccoEjzPG.o
/tmp/ccoEjzPG.o: in function `main':
a.cc:(.text+0x1cc): relocation truncated to fit: R_X86_64_PC32 against symbol `it' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x1d5): relocation truncated to fit: R_X86_64_PC32 against symbol `it' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x45d): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x474): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x4af): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x4c9): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccoEjzPG.o
a.cc:(.text+0x52e): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccoEjzPG.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<cstring>
using namespace std;
struct Trie{
    int next[26];
    int type;
}T[1001005];
int dp[100005][26],val[1000005];
int le;
void Insert(string s){
    int p=0,len=s.size();
    for (int i=len-1;i>=0;i--){
        int r=s[i]-'a';
        if(T[p].next[r]<=0){
            T[le].type=r;
            T[p].next[r]=le++;
        }
        p=T[p].next[r];
        T[p].cnt++;  
    }
	val[p]++;
}
void dfs(int x){
	for(int i=0,v;i<26;i++){
		v=T[x].next[i];
		if(v<=0) continue;
		dfs(v);
		val[x]+=val[v];
		for(int j=0;j<26;j++){
			dp[x][j]+=dp[v][j];
		}
	}
	dp[x][T[x].type]=val[x];
}
long long ans,xx;
void query(string s){
    int p=0,len=s.size();
    xx=0;
    for (int i=len-1;i>=1;i--) {
        int r=s[i]-'a';
        if(T[p].next[r]<=0) {
            return;
        }
        p=T[p].next[r];
    }
   	for(int i=0,v;i<26;i++){
   		v=T[p].next[i];
   		if(v<=0) continue;
   		xx+=dp[v][s[0]-'a'];
	}
	ans+=xx;
}
string s[1000005];
int n;
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    le=1;
    cin>>n;
    for(int i=1;i<=n;i++){
    	cin>>s[i];
    	Insert(s[i]);
	}
	dfs(0);
    for(int i=1;i<=n;i++){
    	query(s[i]);
	}
	cout<<ans-n;
	return 0;
}


Compiler output:
a.cc: In function 'void Insert(std::string)':
a.cc:19:14: error: 'struct Trie' has no member named 'cnt'
   19 |         T[p].cnt++;
      |              ^~~
Language: C

#include<iostream>
#include<cstring>
using namespace std;
struct Trie{
    int next[26];
    int cnt;
    int type;
}T[1000005];
int dp[100005][26],val[1000005];
int le;
void Insert(string s){
    int p=0,len=s.size();
    for (int i=len-1;i>=0;i--){
        int r=s[i]-'a';
        if(T[p].next[r]<=0){
            T[le].type=r;
            T[p].next[r]=le++;
        }
        p=T[p].next[r];
        T[p].cnt++;  
    }
	val[p]++;
}
void dfs(int x){
	for(int i=0,v;i<26;i++){
		v=T[x].next[i];
		if(v<=0) continue;
		dfs(v);
		val[x]+=val[v];
		for(int j=0;j<26;j++){
			dp[x][j]+=dp[v][j];
		}
	}
	dp[x][T[x].type]=val[x];
}
long long xx;
long long query(string s){
    int p=0,len=s.size();
    xx=0;
    for (int i=len-1;i>=1;i--) {
        int r=s[i]-'a';
        if(T[p].next[r]<=0) {
            return 0;
        }
        p=T[p].next[r];
    }
   	for(int i=0,v;i<26;i++){
   		v=T[p].next[i];
   		if(v<=0) continue;
   		xx+=dp[v][s[0]-'a'];
	}
	return xx;
}
string s[1000005];
int n;
long long ans;
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    le=1;
    cin>>n;
    for(int i=1;i<=n;i++){
    	cin>>s[i];
    	Insert(s[i]);
	}
	dfs(0);
    for(int i=1;i<=n;i++){
    	ans+=query(s[i]);
	}
	cout<<ans-n;
	return 0;
}


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

#include<iostream>
#include<cstring>
using namespace std;
struct Trie{
    int next[27];
    int cnt;
    int type;
}T[1000005];
int dp[100005][27],val[1000005];
int le;
void Insert(string s){
    int p=0,len=s.size();
    for (int i=len-1;i>=0;i--){
        int r=s[i]-'a';
        if(T[p].next[r]<=0){
            T[le].init();
            T[le].type=r;
            T[p].next[r]=le++;
        }
        p=T[p].next[r];
        T[p].cnt++;  
    }
	val[p]++;
}
void dfs(int x){
	for(int i=0,v;i<26;i++){
		v=T[x].next[i];
		if(v<=0) continue;
		dfs(v);
		val[x]+=val[v];
		for(int j=0;j<26;j++){
			dp[x][j]+=dp[v][j];
		}
	}
	dp[x][T[x].type]=val[x];
}
long long xx;
long long query(string s){
    int p=0,len=s.size();
    xx=0;
    for (int i=len-1;i>=1;i--) {
        int r=s[i]-'a';
        if(T[p].next[r]<=0) {
            return 0;
        }
        p=T[p].next[r];
    }
   	for(int i=0,v;i<26;i++){
   		v=T[p].next[i];
   		if(v<=0) continue;
   		xx+=dp[v][s[0]-'a'];
	}
	return xx;
}
string s[1000005];
int n;
long long ans;
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    le=1;
    cin>>n;
    for(int i=1;i<=n;i++){
    	cin>>s[i];
    	Insert(s[i]);
	}
	dfs(0);
    for(int i=1;i<=n;i++){
    	ans+=query(s[i]);
	}
	cout<<ans-n;
	return 0;
}


Compiler output:
a.cc: In function 'void Insert(std::string)':
a.cc:16:19: error: 'struct Trie' has no member named 'init'
   16 |             T[le].init();
      |                   ^~~~