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

 #include<bits/stdc++.h>
using namespace std;
 
int main() {
  int n, k=0,a, b;
  cin>>n;
  for(int i=1;i<=n;i++)
  {
  	for(int j=1; j<=n; j++)
    {
    	a = to_string(i);
        b = to_string(j);
        if (a[0]==b.back() && b[0]==a.back()) k++;
    }
  }
  cout<<k;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment
   11 |         a = to_string(i);
      |             ~~~~~~~~~^~~
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
a.cc:12:22: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in assignment
   12 |         b = to_string(j);
      |             ~~~~~~~~~^~~
      |                      |
      |                      std::string {aka std::__cxx11::basic_string<char>}
a.cc:13:14: error: invalid types 'int[int]' for array subscript
   13 |         if (a[0]==b.back() && b[0]==a.back()) k++;
      |              ^
a.cc:13:21: error: request for member 'back' in 'b', which is of non-class type 'int'
   13 |         if (a[0]==b.back() && b[0]==a.back()) k++;
      |                     ^~~~
a.cc:13:32: error: invalid types 'int[int]' for array subscript
   13 |         if (a[0]==b.back() && b[0]==a.back()) k++;
      |                                ^
a.cc:13:39: error: request for member 'back' in 'a', which is of non-class type 'int'
   13 |         if (a[0]==b.back() && b[0]==a.back()) k++;
      |                                       ^~~~
Language: C++

#<bits/stdc++.h>
using namespace std;
 
int main() {
  long long num;
  cin >> num; 
  long long a = 1,b = 0;
  int counter = 0;
  
  for (int i = 0; i < num; i++){
    if(a >= 10){
      b = (a % 10) * 10 + (a / 10);
      if(b <= num && b %10 != 0 && a%10 != 0){
        counter++;
      }
      if(a%10 == a/10){
        counter++;
      }
    } else {
      b = a;
      counter++;
      if(a * 10 + a < num){
        counter++;
      }
    }
    a++;
  }
  cout << counter << endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #<
    1 | #<bits/stdc++.h>
      |  ^
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin >> num;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #<bits/stdc++.h>
a.cc:28:3: error: 'cout' was not declared in this scope
   28 |   cout << counter << endl;
      |   ^~~~
a.cc:28:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:28:22: error: 'endl' was not declared in this scope
   28 |   cout << counter << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #<bits/stdc++.h>
Language: C++

#include <bits/stdc++.h>
using namespace std;
int keta(int n){
  int ans=0;
  while(n>0){
    ans++;
    n/=10;
  }
  return ans;
}
int main() {
  int n;
  cin>>n;
  int ans=0;
  for(int i=1;i<=n;i++){
    int a=i/pow(10,keta(i)-1);
    int b=i%10;
    int d=n/pow(10,keta(n)-1);
    int c=keta(n)-2;
    if(a!=0 && b!=0){
      if(a==b){
    if(a<=n) ans++;
  }
  if(10*b+a<=n) ans++;
    for(int i=1;i<=c;i++){
      if(i!=c) ans+=pow(10,i);
      else {
        if(d>b){
          ans+=pow(10,i);
        }
        else if(d==b){
          int aho=pow(10,keta(n));
          int hina=n%aho;
          ans+=hina/10;
        }
      }
    }
    }
  } 
  if(a==b){
    if(a<=n) ans++;
  }
  if(10*b+a<=n) ans++;
  cout<<ans<<endl;          
          
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:6: error: 'a' was not declared in this scope
   40 |   if(a==b){
      |      ^
a.cc:40:9: error: 'b' was not declared in this scope
   40 |   if(a==b){
      |         ^
a.cc:43:9: error: 'b' was not declared in this scope
   43 |   if(10*b+a<=n) ans++;
      |         ^
a.cc:43:11: error: 'a' was not declared in this scope
   43 |   if(10*b+a<=n) ans++;
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int keta(int n){
  int ans=0;
  while(n>0){
    ans++;
    n/=10;
  }
  return ans;
}
int main() {
  int n;
  cin>>n;
  int ans=0;
  for(int i=1;i<=n;i++){
    int a=i/pow(10,keta(i)-1);
    int b=i%10;
    int d=n/pow(10,keta(n)-1);
    int c=keta(n)-2;
    if(a!=0 && b!=0){
    for(int i=1;i<=c;i++){
      if(i!=c) ans+=pow(10,i);
      else {
        if(d>b){
          ans+=pow(10,i);
        }
        else if(d==b){
          int aho=pow(10,keta(n));
          int hina=n%aho;
          ans+=hina/10;
        }
      }
    }
    }
  } 
  if(a==b){
    if(a<=n) ans++;
  }
  if(10*b+a<=n) ans++;
  cout<<ans<<endl;          
          
}


Compiler output:
a.cc: In function 'int main()':
a.cc:36:6: error: 'a' was not declared in this scope
   36 |   if(a==b){
      |      ^
a.cc:36:9: error: 'b' was not declared in this scope
   36 |   if(a==b){
      |         ^
a.cc:39:9: error: 'b' was not declared in this scope
   39 |   if(10*b+a<=n) ans++;
      |         ^
a.cc:39:11: error: 'a' was not declared in this scope
   39 |   if(10*b+a<=n) ans++;
      |           ^
Language: C++

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

int main() {
  int n, a, b, count;
  count = 0;
  cin >> n;
  for(int i = 0; i < n; i++) {
    a = i;
    while(true) {
      if ((a / 10) > 10) {
        a /= 10;
        continue;
      }
      a %= 10;
      break;
    }
    for(int j = n; j >= i; j++) {
      b = j;
      while(true) {
        if ((b / 10) > 10) {
          b /= 10;
          continue;
        }
        b %= 10;
        break;
      }
      if (a == b) {
        count++;
      }
    }
  }
  cout << count << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:33:25: error: expected '}' at end of input
   33 |   cout << count << endl;
      |                         ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++


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

int main() {
  int N;
  cin >> N;
int sam=0;
int a1,a100,b1,b100;
for(int i=0;i<N;i++){
for(int j=0;j<=i;j++){
a1=i%10;
b1=j%10;
while(a100<10){
a100=a100/10;}
while(b100<10){
b100=b100/10;}
if(a1==b100&&b1==a100) 
{sam++;
 if(i!=j)sam++;
}
}}
cout <<sam;}
int small=200000000;
for(int i=0;i<N;i++)
{cin >>P[i];
 if(small>=P[i]){
		small=P[i];
		sam++;
		}
}
cout <<sam;}

Compiler output:
a.cc:25:1: error: expected unqualified-id before 'for'
   25 | for(int i=0;i<N;i++)
      | ^~~
a.cc:25:13: error: 'i' does not name a type
   25 | for(int i=0;i<N;i++)
      |             ^
a.cc:25:17: error: 'i' does not name a type
   25 | for(int i=0;i<N;i++)
      |                 ^
a.cc:32:1: error: 'cout' does not name a type
   32 | cout <<sam;}
      | ^~~~
a.cc:32:12: error: expected declaration before '}' token
   32 | cout <<sam;}
      |            ^
Language: C++

/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
// #include <map>
// #include <algorithm>

namespace AtCoder {
	using Str = std::vector<std::string>;
	using Num = std::vector<int>;
	using BigNum = std::vector<double>;

	class Ans {
	public:
		void showResult(void);
		void increment(void);
		void increment(double);
		void decrement(void);
		void decrement(double);
		double getResult(void);
	private:
		double result;
	};
	void Ans::showResult(void) {
		printf("%.0lf\n", this->result);
	}
	void AtCoder::Ans::increment(void) {
		this->result++;
	}
	void AtCoder::Ans::increment(double value) {
		this->result += value;
	}
	void AtCoder::Ans::decrement(void) {
		this->result--;
	}
	void AtCoder::Ans::decrement(double value) {
		this->result -= value;
	}
	double AtCoder::Ans::getResult(void) {
		return this->result;
	}

	void input(Str* str) {
		str->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				str->push_back(row);
				row = "";
			} else {
				row += buf[i];
			}
		}
		str->push_back(row);
	}
	void input(Num* num) {
		num->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				num->push_back(std::atoi(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		num->push_back(std::atoi(row.c_str()));
	}
	void input(BigNum* num) {
		num->clear();
		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				num->push_back(std::atof(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		num->push_back(std::atof(row.c_str()));
	}
	void exp(std::string* str,  Str* newStr) {
		std::string pre = *str;
		newStr->clear();
		for (unsigned int i = 0; i < pre.length(); i++) {
			newStr->push_back(pre.substr(i, 1));
		}
	}
}

int main(void) {

	AtCoder::Num s;
	AtCoder::input(&s);

	const int n = s[0];	

	AtCoder::Ans* ans = new AtCoder::Ans();

	if (10 > n) {
		ans->increment(n);
		ans->showResult();
		return 0;
	} else {
		for (int i = 1; i < n; i++) {
			for (int j = 1; j < n; j++) {
				AtCoder::Str tmpA, tmpB;
				AtCoder::exp(&std::to_string(i), &tmpA);
				AtCoder::exp(&std::to_string(j), &tmpB);
				if (tmpA[0] == tmpB[(tmpB.size() - 1)] &&
					tmpB[0] == tmpA[(tmpA.size() - 1)]) {
					ans->increment();
				}
			}
		}
	}

	ans->showResult();

	delete(ans);

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:114:61: error: taking address of rvalue [-fpermissive]
  114 |                                 AtCoder::exp(&std::to_string(i), &tmpA);
      |                                               ~~~~~~~~~~~~~~^~~
a.cc:115:61: error: taking address of rvalue [-fpermissive]
  115 |                                 AtCoder::exp(&std::to_string(j), &tmpB);
      |                                               ~~~~~~~~~~~~~~^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
int sam=0;
int a1,a100,b1,b100
for(int i=0;i<N;i++){
for(int j=0;j<=i;j++){
a1=i%10;
b1=j%10;
while(a100<10){
a100=a100/10;}
while(b100<10){
b100=b100/10;}
if(a1==b100&&b1==a100) 
{sam++;
 if(i!=j)sam++;
}
}}
cout <<sam;}

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

#include <bits/stdc++.h>
using namespace std;
int keta(int n){
  int ans=0;
  while(n>0){
    ans++;
    n/=10;
  }
  return ans;
}
int main() {
  int n;
  cin>>n;
  int ans=0;
  for(int i=1;i<=n;i++){
    int a=i/pow(10,keta(i)-1);
    int b=i%10;
    int d=n/pow(10,keta(n)-1);
    int c=keta(n)-2;
    if(a!=0 && b!=0){
    for(int i=1;i<=c;i++){
      if(i!=c) ans+=pow(10,i);
      else {
        if(d>b){
          ans+=pow(10,i);
        }
        else if(d==b){
          int hina=n%pow(10,keta(n));
          ans+=hina/10;
        }
      }
    }
    }
  }     
          
          
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   28 |           int hina=n%pow(10,keta(n));
      |                    ~^~~~~~~~~~~~~~~~
      |                    |    |
      |                    int  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include <bits/stdc++.h>
using namespace std;
int keta(int n){
  int ans=0;
  while(n>0){
    ans++;
    n/=10;
  }
  return ans;
}
int main() {
  int n;
  cin>>n;
  int ans=0;
  for(int i=1;i<=n;i++){
    int a=i/pow(10,keta(i)-1);
    int b=i%10;
    int d=n/pow(10,keta(n)-1);
    int c=keta(n)-2;
    if(a!=0 && b!=0){
    for(int i=1;i<=c;i++){
      if(i!=c) ans+=pow(10,i);
      else {
        if(d>b){
          ans+=pow(10,i);
        }
        else if(d==b){
          int hina=n%pow(10,keta(n));
          ans+=hina/10;
        }
      }
    }
    }
          
          
          
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:21: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   28 |           int hina=n%pow(10,keta(n));
      |                    ~^~~~~~~~~~~~~~~~
      |                    |    |
      |                    int  __gnu_cxx::__promote<double>::__type {aka double}
a.cc:37:2: error: expected '}' at end of input
   37 | }
      |  ^
a.cc:11:12: note: to match this '{'
   11 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
//max=({});
//条件式が真ならwhileの中身を回し続ける

int n;

int main() {
	cin >> n;
	int ans = 0;
	for (int i = 1;i <= n;++i) {
		top = i;
		under = i % 10;
		while (top > 10) {
			top /= 10;
		}
		for (int j = top;j <= n;j+=under*10) {
			topp = j;
			while (topp > 10) {
				topp /= 10;
			}
			if (topp == under) {
				ans++;
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'top' was not declared in this scope
   15 |                 top = i;
      |                 ^~~
a.cc:16:17: error: 'under' was not declared in this scope
   16 |                 under = i % 10;
      |                 ^~~~~
a.cc:21:25: error: 'topp' was not declared in this scope
   21 |                         topp = j;
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll dp[15][15];

int main(){
  ll n;
  cin >> n;
  for(ll i=1;i<=n;i++){
    ll front, last;
    last = i % 10;
    ll num = i;
    while(true){
      if(num <= 9){
        front = num;
        break;
      }else{
        num /= 10;
      }
    }
    dp[front][last] ++;
    ans += dp[last][front];
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   25 |     ans += dp[last][front];
      |     ^~~
      |     abs
a.cc:27:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
lon long int countdigit(long long int num)
{
long long int digit=0;
while(num>=1)
{
num=num/10;
digit++;
}
return digit;
}

int main()
{
long long int n;
cin>>n;
int count=0;
for(long long int i=0;i<n;i++)
{
for(long long int j=0;j<n;j++)
{
int t1=pow(10,countdigit(i));
int t2=pow(10,countdigit(j));
if(i%10==j%t2)
{
if(i%t1==j%10)
{
count++;
}
}
}}
cout<<count;
return 0;
}


Compiler output:
a.cc:3:1: error: 'lon' does not name a type; did you mean 'long'?
    3 | lon long int countdigit(long long int num)
      | ^~~
      | long
a.cc: In function 'int main()':
a.cc:23:15: error: 'countdigit' was not declared in this scope
   23 | int t1=pow(10,countdigit(i));
      |               ^~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int countdigit(long long int num)
{
int digit=0;
while(num>=1)
{
num=num/10;
digit++;
}
return digit;
}

int main()
{
long long int n;
cin>>n;
int count=0;
for(long long int i=0;i<n;i++);
{
for(long long int j=0;j<n;j++)
{
int t1=pow(10,countdigit(i));
int t2=pow(10,countdigit(j));
if(i%10==j%t2)
{
if(i%t1==j%10)
{
count++;
}
}
}}
cout<<count;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:26: error: 'i' was not declared in this scope
   23 | int t1=pow(10,countdigit(i));
      |                          ^
Language: C++

#include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int t;
        int counter = 1;
    	int resmin = arr[0];
    	cin>>t;
    	vector<int> arr(t);
    	for(int i =0;i<t;i++)
    		cin>>arr[i];
    	
    	for(int i =1;i<t;i++)
    	{
    		if(arr[i]<resmin)
    		{
    			counter++;
    			resmin=arr[i];
    		}
    	}
    	cout<<counter<<'\n';
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: 'arr' was not declared in this scope
    7 |         int resmin = arr[0];
      |                      ^~~
Language: C++

#include<bits/stdc++.h>
using namesapce std;
const int mod = 1e9 + 7;
int main(){
	int n,lm;
    cin>>n;
    vector<int> x(n);
    for(int i=0;i<n;++i){
    	cin>>x[i];
        if(i == 0) lm = x[i];
        else lm = lcm(lm,x[i]);
    }
    int ans = 0;
    for(int i=0;i<n;++i) ans += x[i] / lm,ans %= mod;
    cout<<ans%mod<<'\n';
    return 0;
}

Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
    2 | using namesapce std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |     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:7:5: error: 'vector' was not declared in this scope
    7 |     vector<int> x(n);
      |     ^~~~~~
a.cc:7:5: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/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:7:12: error: expected primary-expression before 'int'
    7 |     vector<int> x(n);
      |            ^~~
a.cc:9:14: error: 'x' was not declared in this scope
    9 |         cin>>x[i];
      |              ^
a.cc:11:19: error: 'lcm' was not declared in this scope; did you mean 'std::lcm'?
   11 |         else lm = lcm(lm,x[i]);
      |                   ^~~
      |                   std::lcm
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58:
/usr/include/c++/14/numeric:188:5: note: 'std::lcm' declared here
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:14:33: error: 'x' was not declared in this scope
   14 |     for(int i=0;i<n;++i) ans += x[i] / lm,ans %= mod;
      |                                 ^
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout<<ans%mod<<'\n';
      |     ^~~~
      |     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 <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>;

const int N = 10005, A = 1000005;
const int MOD = 1e9 + 7;

int n, a[N], b[N];

vector<int> factor(A);
vector<int> lcm(A);
map<int, int> mp[N];

void enum_prime() {
  rep(i, A) factor[i] = i;
  for (int i = 2; i < A; i++) {
    if (factor[i] != i) continue;
    for (int j = 2 * i; j < A; j += i) factor[j] = i;
  }
  return;
}

int modinv(int a) {
  int b = MOD, u = 1, v = 0;
  while (b) {
    int t = a / b;
    a -= t * b; swap(a, b);
    u -= t * v; swap(u, v);
  }
  u %= MOD;
  if (u < 0) u += MOD;
  return u;
}

int main() {
  cin >> n;
  rep(i, n) cin >> a[i];
  rep(i, n) b[i] = a[i];
  enum_prime();
  rep(i, n) {
    while (a[i] > 1) {
      int f = factor[a[i]];
      mp[i][f]++;
      a[i] /= f; 
    }
    for (auto itr = mp[i].begin(); itr != mp[i].end(); itr++) {
      lcm[itr->first] = max(lcm[itr->first], itr->second);
    }
  }
  int l = 1;
  rep(i, A) rep(j, lcm[i]) l = (ll)l * i % MOD;
  int ans = 0;
  rep(i, n) ans = (ans + (ll)l * modinv(b[i])) % MOD;
  if (ans < 0) ans += MOD;
  // printf("l = %d\n", l);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:7: error: reference to 'lcm' is ambiguous
   49 |       lcm[itr->first] = max(lcm[itr->first], itr->second);
      |       ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:13:13: note:                 'std::vector<int> lcm'
   13 | vector<int> lcm(A);
      |             ^~~
a.cc:49:29: error: reference to 'lcm' is ambiguous
   49 |       lcm[itr->first] = max(lcm[itr->first], itr->second);
      |                             ^~~
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:13:13: note:                 'std::vector<int> lcm'
   13 | vector<int> lcm(A);
      |             ^~~
a.cc:53:20: error: reference to 'lcm' is ambiguous
   53 |   rep(i, A) rep(j, lcm[i]) l = (ll)l * i % MOD;
      |                    ^~~
a.cc:2:39: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (int i = 0; i < (n); ++i)
      |                                       ^
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:13:13: note:                 'std::vector<int> lcm'
   13 | vector<int> lcm(A);
      |             ^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <numeric>
#include <unordered_map>
#include <vector>

using namespace std;

constexpr int64_t kMod = 1e9+7;
constexpr int64_t kMax = 1000001;

int divs[1000001];

void Divs(int mx) {
  for (int i = 0; i <= mx; ++i) divs[i] = i;
  for (int i = 2; i <= sqrt(mx); ++i) {
    if (divs[i] < i) continue;
    for (int j = i+i; j <= mx; j+=i) {
      divs[j] = i;
    }
  }
}

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

  vector<int64_t> nums(N);
  int64_t mx = 0;
  for (int n = 0; n < N; ++n) {
    cin >> nums[n];
	mx = max(mx, nums[n]);
  }
  Divs(mx);
  map<int, int> lcm;
  map<int, int>> cnts(N);
  for (int n = 0; n < N; ++n) {
    int64_t num = nums[n];
    while (num > 1) {
      int prd = 1;
      int d = divs[num];
      while (num % d == 0) {
        prd *= d;
        num /= d;
      }
      lcm[d] = max(lcm[d], prd);
      cnts[n][d] = prd;
    }
  }
  int64_t res = 0;
  for (int n = 0; n < N; ++n) {
    int64_t sum = 1;
    for (const auto& p : lcm) {
      if (cnts[n][p.first]) {
        sum *= p.second / cnts[n][p.first];
      } else {
        sum *= p.second;
      }
      sum %= kMod;
    }
    res += sum;
    res %= kMod;
  } 
  cout << res << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:3: error: 'map' was not declared in this scope
   38 |   map<int, int> lcm;
      |   ^~~
a.cc:9:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    8 | #include <vector>
  +++ |+#include <map>
    9 | 
a.cc:38:7: error: expected primary-expression before 'int'
   38 |   map<int, int> lcm;
      |       ^~~
a.cc:39:7: error: expected primary-expression before 'int'
   39 |   map<int, int>> cnts(N);
      |       ^~~
a.cc:49:10: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   49 |       lcm[d] = max(lcm[d], prd);
      |          ^
a.cc:49:23: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   49 |       lcm[d] = max(lcm[d], prd);
      |                       ^
a.cc:50:7: error: 'cnts' was not declared in this scope
   50 |       cnts[n][d] = prd;
      |       ^~~~
a.cc:56:26: error: unable to deduce 'auto&&' from 'std::lcm'
   56 |     for (const auto& p : lcm) {
      |                          ^~~
a.cc:56:26: note:   couldn't deduce template parameter 'auto'
a.cc:57:11: error: 'cnts' was not declared in this scope
   57 |       if (cnts[n][p.first]) {
      |           ^~~~
Language: Java

import java.util.Scanner;

public class AtCoder152_E {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();

		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}

		long num1 = a[0];
		long num2;
		for (int i = 1; i < n; i++) {
			num2 = a[i];
			num1 = calLCM(num1, num2);
		}

		long sum = 0;
		for (int i = 0; i < n; i++) {
			 sum += (num1 / a[i]);
		}

		int result = (int) (sum % (Math.pow(10, 9) + 7));

		System.out.println(result);

	}

	private static long calLCM(long a, long b) {
		long c = a * b;
		long tmp;
		while ((tmp = a % b) != 0) {
			a = b;
			b = tmp;
		}

		return c / b;
	}

}


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

#include<iostream>
#include<vector>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef boost::multiprecision::int_cpp ulli;

ulli gcd(ulli a, ulli b) {
    if (a > b) {
        ulli temp = a;
        a = b;
        b = temp;
    }
    if (b % a == 0) {
        return a;
    }
    else {
        return gcd(a, b % a);
    }
}

int main() {
    long int n;
    cin >> n;
    ulli ssk = 1;
    vector<ulli> v;
    for (long int i = 0; i < n; i++) {
        ulli temp;
        cin >> temp;
        v.push_back(temp);
        ssk *= temp / (gcd(temp, ssk));
    }
    ulli res = 0;
    for (long int i = 0; i < n; i++) {
        res += ssk / v.at(i);
        res %= 1000000007;
    }
    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<iostream>
#include<vector>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef boost::multiprecision::cpp_int ulli;

ulli gcd(ulli a, ulli b) {
    if (a > b) {
        ulli temp = a;
        a = b;
        b = temp;
    }
    if (b % a == 0) {
        return a;
    }
    else {
        return gcd(a, b % a);
    }
}

int main() {
    ulli n;
    cin >> n;
    ulli ssk = 1;
    vector<ulli> v;
    for (ulli i = 0; i < n; i++) {
        ulli temp;
        cin >> temp;
        v.push_back(temp);
        ssk *= temp / (gcd(temp, ssk));
    }
    ulli res = 0;
    for (ulli i = 0; i < n; i++) {
        res += ssk / v.at(i);
        res %= 1000000007;
    }
    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<iostream>
#include<vector>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef boost::multiprecision::cpp_int ulli;

ulli gcd(ulli a, ulli b) {
    if (a > b) {
        ulli temp = a;
        a = b;
        b = temp;
    }
    if (b % a == 0) {
        return a;
    }
    else {
        return gcd(a, b % a);
    }
}

int main() {
    ulli n;
    cin >> n;
    ulli ssk = 1;
    vector<ulli> v;
    for (ulli i = 0; i < n; i++) {
        ulli temp;
        cin >> temp;
        v.push_back(temp);
        ssk *= temp / (gcd(temp, ssk));
    }
    ulli res = 0;
    for (ulli i = 0; i < n; i++) {
        res += ssk / v[i];
        res %= 1000000007;
    }
    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 <boost/multiprecision/cpp_int.hpp>
#include<iostream>
#include<vector>
using namespace std;
typedef boost::multiprecision::cpp_int ulli;

ulli gcd(ulli a, ulli b) {
    if (a > b) {
        ulli temp = a;
        a = b;
        b = temp;
    }
    if (b % a == 0) {
        return a;
    }
    else {
        return gcd(a, b % a);
    }
}

int main() {
    ulli n;
    cin >> n;
    ulli ssk = 1;
    vector<ulli> v;
    ulli watta = 0;
    for (ulli i = 0; i < n; i++) {
        ulli temp;
        cin >> temp;
        v.push_back(temp);
        ssk *= temp / (gcd(temp, ssk));
    }
    ulli res = 0;
    for (ulli i = 0; i < n; i++) {
        res += ssk / v[i];
        res %= 1000000007;
    }
    cout << res << endl;
    return 0;
}


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

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

int gcd(ulli a, ulli b) {
    if (a > b) {
        ulli temp = a;
        a = b;
        b = temp;
    }
    if (b % a == 0) {
        return a;
    }
    else {
        return gcd(a, b % a);
    }
}

int main() {
    ulli n;
    cin >> n;
    ulli ssk = 1;
    vector<ulli> v;
    ulli watta = 0;
    for (ulli i = 0; i < n; i++) {
        ulli temp;
        cin >> temp;
        v.push_back(temp);
        ssk *= temp / (gcd(temp, ssk));
    }
    ulli res = 0;
    for (ulli i = 0; i < n; i++) {
        res += ssk / v[i];
        res %= 1000000007;
    }
    cout << res << endl;
    return 0;
}


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

#include<stdio.h>

int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a%b);
}
int lcm(int[] a, int n) {
  int res = 1, i;
  for (i = 0; i < n; i++) {
    res = res*a[i]/gcd(res, a[i]);
  }
  return res;
}

int main(){
  int n,
  scanf("%d",&n);
  int arr[n];
  for(int i=0;i<n;i++){
    scanf("%d",&arr[i])
  }
  int a=lcm(arr,n);
  int sum1=0;
  for(int i=0;i<n;i++){
   sum1+=a/arr[i]; 
  }
  printf("%d",sum1);
}

Compiler output:
main.c:7:15: error: expected ';', ',' or ')' before 'a'
    7 | int lcm(int[] a, int n) {
      |               ^
main.c: In function 'main':
main.c:17:9: error: expected declaration specifiers or '...' before string constant
   17 |   scanf("%d",&n);
      |         ^~~~
main.c:17:14: error: expected declaration specifiers or '...' before '&' token
   17 |   scanf("%d",&n);
      |              ^
main.c:20:24: error: expected ';' before '}' token
   20 |     scanf("%d",&arr[i])
      |                        ^
      |                        ;
   21 |   }
      |   ~                     
main.c:22:9: error: implicit declaration of function 'lcm' [-Wimplicit-function-declaration]
   22 |   int a=lcm(arr,n);
      |         ^~~
Language: C++

n = int(input())
a = list(map(int, input().split()))

mod = 1000000007

lcm = {}
ps = []
for i in range(n): 
    ai = a[i]
    p = 2
    ps.append({})
    while p * p <= ai:
        if ai % p == 0:
            ps[i][p] = 0
            while ai % p == 0:
                ps[i][p] += 1
                ai //= p
            lcm[p] = max(lcm.get(p, 0), ps[i][p])
        p += 1
    if ai > 1:
        ps[i][ai] = 1
        lcm[ai] = max(lcm.get(ai, 0), ps[i][ai])

ret = 0
for i in range(n):
    prod = 1
    for p in lcm:
        k = lcm[p] - ps[i].get(p, 0)
        prod = (prod * (p ** k)) % mod
    ret = (ret + prod) % mod

print(ret)
        


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:7:1: error: 'ps' does not name a type
    7 | ps = []
      | ^~
a.cc:11:17: error: expected unqualified-id before ')' token
   11 |     ps.append({})
      |                 ^
Language: C++

#include <bits/stdc++.h>
#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define PRINT(x) cout << (x) << "\n"
using namespace std;
using ll = long long; using pint = pair<int, int>; using pll = pair<ll, ll>;
const long long MOD = 1000000007;

auto factorization(long long N){
    map<long long, long long> mp;
    long long n = N;
    for(long long i = 2; i * i <= N; i++){
        while(n % i == 0){
            mp[i]++;
            n /= i;
        }
    }
    if(n > 1) mp[n]++;
    return mp;
}

ll N, A[10001];
map<ll, ll> M[10001], B;
ll P[100001][64];

signed main(){
    cin >> N;
    REP(i, N) cin >> A[i];
    REP(i, N){
        M[i] = factorization(A[i]);
    }
    REP(i, N){
        for(auto p : M[i]){
            B[p.first] = max(B[p.first], p.second);
        }
    }
    ll ans = 0;
    for(auto p : B){
        P[p.first][0] = 1;
        REP(i, p.second) P[p.first][i + 1] = (P[p.first][i] * p.first) % MOD;
    }
    REP(i, N){
        ll b = 1;
        for(auto p : B){
            b = (b * P[p.first][p.second - M[i][p.first]);
        }
        ans = (ans + b) % MOD;
    }
    PRINT(ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:57: error: expected ']' before ')' token
   46 |             b = (b * P[p.first][p.second - M[i][p.first]);
      |                                                         ^
      |                                                         ]
Language: C++

// ░░░░░░░░( •̪●)░░░░░░░░░░░░░░░░░░░░░░░░
// ░░░░░░███████ ]▄▄▄▄▄▄▄▄▃░░░▃░░░░ ▃░
// ▂▄▅█████████▅▄▃▂░░░░░░░░░░░░░░░░░
// [███████████████████].░░░░░░░░░░░░░░
// ◥⊙▲⊙▲⊙▲⊙▲⊙▲⊙▲⊙◤...░░░░░░░░░░░░

//PointBlank's code (⌐■_■)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
 
ll power(ll x, ll y); 
#define repp(I, A, B) for(int I = A; I <= B; I++)
#define rep(I, A, B) for(int I = A; I < B; I++)
#define rrep(I, B, A) for(int I = B; I >= A; I--)
#define pb emplace_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define LB lower_bound
#define UB upper_bound
#define MP make_pair
#define mem(A, B) memset(A, B, sizeof(A));
#define mem0(A) memset(A, 0, sizeof(A));
#define quickio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define bitcount(n) __builtin_popcountll(n)
#define in_edges(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B), v[B].pb(A);}
#define in_edges2(M) repp(I, 1, M){int A, B; cin >> A >> B; v[A].pb(B);}
#define in_edges3(M) repp(I, 1, M){int A, B, C; cin >> A >> B >> C; v[A].pb(B, C), v[B].pb(A, C);}
#define endl "\n"

const ll MOD = 1000000007;

ll hsh[1000006];
vector<ll> fc[1000006];

int main() //PointBlank's code ¯\_(ツ)_/¯
{
    quickio
    ll n;
    cin >> n;
    vector<ll> v(n);
    for(auto &i : v) cin >> i;
    set<ll> st;

    for(auto i : v){
        ll x = i, c;
        repp(j, 2, sqrt(i)){
            c = 0;
            while(x % j == 0) c++, x /= j;
            hsh[j] = max(hsh[j], c);
            if(c) fc[j].pb(c);
        }
        if(x > 1) hsh[x] = max(hsh[x], 1ll), fc[x].pb(1);
    }

    ll res = 0;
    repp(i, 1, 1000000) if(hsh[i]){
        for(auto j : f[i]) res = (res + power(i, hsh[i] - j)) % MOD;
    }

    cout << res;
}

ll power(ll x, ll y)
{ 
    ll res = 1; x %= MOD;
    while(y > 0){if(y & 1) res = (res*x) % MOD; y = y>>1, x = (x*x) % MOD;} 
    return res; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:22: error: 'f' was not declared in this scope
   63 |         for(auto j : f[i]) res = (res + power(i, hsh[i] - j)) % MOD;
      |                      ^
Language: C++

import math
n = int(input())
a = list(map(int, input().split()))

def lcm(a,b):
    return a * b // math.gcd(a,b)

p = 1000000007

k = 1
for i in range(n):
    k = lcm(k,a[i])

ans = 0
for i in range(n):
    ans += (k // a[i]) % p
    ans %= p

print(ans)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<stdio.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#define rep(i,N) for(int i=0;i<(int)N;i++)
const int MOD=1e9+7,MAX=1e6,Primes[168]=
{2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,
 73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,
 179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,
 283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,
 419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,
 547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,
 661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,
 811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,
 947,953,967,971,977,983,991,997};
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
struct T{int fact[1000001],inv[1000001];};
struct T MODINV;
static inline int MPow(int a,int b){return b?1l*MPow(1l*a*a%MOD,b>>1)*(b&1?a:1)%MOD:1;}
static inline void init(void)
{
  MODINV.fact[0]=1;rep(i,MAX)MODINV.fact[i+1]=1l*MODINV.fact[i]*(i+1)%MOD;
  MODINV.inv[MAX]=MPow(MODINV.fact[MAX],MOD-2);
  rep(i,MAX)MODINV.inv[MAX-1-i]=1l*MODINV.inv[MAX-i]*(MAX-i)%MOD;
}
static inline void Radix32(int *a,const int sz)
{
  int x,shift=0,elem[256],temp[sz];
  while(shift<32)
  {
    int bucket[256]={0};
    rep(i,sz){x=(a[i]>>shift)&255;bucket[x]++;temp[i]=a[i];}
    elem[0]=0;rep(i,255)elem[i+1]=elem[i]+bucket[i];
    rep(i,sz){x=(temp[i]>>shift)&255;a[elem[x]]=temp[i];elem[x]++;}
    shift+=8;
  }
}
int main(void)
{
  int N=IN(),A=0,invsum=0,k=0,lcm=1,x=0,temp[10000],box[168]={};init();
  rep(i,N)
  {
    A=IN();invsum=(invsum+1l*MODINV.fact[A-1]*MODINV.inv[A]%MOD)%MOD;
    rep(j,168){x=0;while(A%Primes[j]==0){A/=Primes[j];if(box[j]<++x)box[j]=x;}}
    if(A!=1){temp[k++]=A;}
  }
  Radix32(temp,k);
  rep(i,168){rep(j,box[i]){lcm=1l*lcm*P.Primes[i]%MOD;}}
  x=-1;rep(i,k){if(x!=temp[i]){lcm=1l*lcm*temp[i]%MOD;x=temp[i];}}
  x=1l*lcm*invsum%MOD;return printf("%d\n",x),0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:39: error: 'P' was not declared in this scope
   52 |   rep(i,168){rep(j,box[i]){lcm=1l*lcm*P.Primes[i]%MOD;}}
      |                                       ^
Language: C++

#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define range(i,l,h) for(int i=l;i<h;i++)
#define endl '\n'
#define I INT_MAX
#define L INT_MIN
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
using std::ios;
constexpr int MOD=1e9+7;
constexpr int mod=998244353;
map<int,int> lcm;
map<int,int> factors[10005];

ll fastpow(int a,int n)
{
  ll ans=1;
  while(n)
  {
    if(n&1)
    {
      ans*=a;
      ans%=MOD;
      n--;
    }
    a*=a;
    a%=MOD;
    n/=2;
  }
  return ans%MOD;
}

void take_lcm(map<int,int> factors)
{
  for(auto i:factors)
  {
    lcm[i.first]=max(lcm[i.first],i.second);
  }
}

void factorise(int a,int id)
{
  int num=a;
  for(int i=2;i*i<=a;i++)
  {
    if(a%i==0)
    {
      while(a%i==0)
      {
        a/=i;
        factors[id][i]++;
      }
    }
  }
  if(a!=1)
    factors[id][a]++;

  take_lcm(factors[id]);
}


int main() 
{
  fastio;
  int n;
  cin>>n;
  vi a(n);
  range(i,0,n)
  {  
    cin>>a[i];
      factorise(a[i],i);
  }
  ll ans=0;
  for(int i=0;i<n;i++)
  {
    ll p=1;
    for(auto j:lcm)
    {
      p*=fastpow(j.first,j.second-factors[i][j.first]);
      p%=MOD;
    }
    ans+=p;
    ans%=MOD;
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'void take_lcm(std::map<int, int>)':
a.cc:40:5: error: reference to 'lcm' is ambiguous
   40 |     lcm[i.first]=max(lcm[i.first],i.second);
      |     ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:15:14: note:                 'std::map<int, int> lcm'
   15 | map<int,int> lcm;
      |              ^~~
a.cc:40:22: error: reference to 'lcm' is ambiguous
   40 |     lcm[i.first]=max(lcm[i.first],i.second);
      |                      ^~~
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:15:14: note:                 'std::map<int, int> lcm'
   15 | map<int,int> lcm;
      |              ^~~
a.cc: In function 'int main()':
a.cc:80:16: error: reference to 'lcm' is ambiguous
   80 |     for(auto j:lcm)
      |                ^~~
/usr/include/c++/14/numeric:188:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:15:14: note:                 'std::map<int, int> lcm'
   15 | map<int,int> lcm;
      |              ^~~
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define debug(x) cerr<<#x<<": "<<(x)<<endl
#define INF      (int)1e9
#define EPS      (double)1e-9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
typedef pair<int,int> pii;
template<class Type> void line(const Type &a){int cnt=0;for(const auto &elem:a){if(cnt++)cerr<<' ';cerr<<elem;}cerr<<endl;}

/*素因数分解*/
template<class Type>
map<Type,int> prime_factor(Type n){
	map<Type,int> res;//自然数nの約数firstがsecond個ある.
	for(Type i=2;i*i<=n;++i){
		while(n%i==0){
			res[i]++;
			n/=i;
		}
	}
	if(n!=1) res[n]=1;
	return res;
}

template<class Type_k,class Type_p>
Type_p mod_pow(long long n,Type_k k,Type_p p){//n^k(mod p).
	if(k==0) return 1;
	long long res=mod_pow(n*n%p,k/2,p);
	if(k&1) res=res*n%p;
	return res;
}

//解説参考.
int main(){
	int n;
	cin>>n;
	
	vi a(n);
	REP(i,n) cin>>a[i];
	
	map<int,int> mp;
	vector<map<int,int> > res(n);
	REP(i,n){
		res[i]=prime_factor(a[i]);
		for(auto elem:res[i]) chmax(mp[elem.first],elem.second);
	}
	
	llong ans=0LL;
	REP(i,n){
		llong b=1LL;
		for(auto elem:mp) b=b*mod_pow(elem.first,elem.second-res[i][elem.first],MOD)%MOD;
		//debug(b);
		ans=(ans+b)%MOD;
	}
	
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:39: error: 'chmax' was not declared in this scope
   50 |                 for(auto elem:res[i]) chmax(mp[elem.first],elem.second);
      |                                       ^~~~~
Language: C++

#include<stdio.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#define rep(i,N) for(int i=0;i<(int)N;i++)
const int mod=1e9+7;
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline int MPow(int a,int b){return b?1l*MPow(1l*a*a%mod,b>>1)*(b&1?a:1)%mod:1;}
const int M=mod-2;
typedef struct Template{
  int mnPrime[2000001];
  int Primes[2000001];
  int size_;
}template;
int main(void){
  int n=IN();
  long inv_sum = 0;
  int Count[2000001]={};
  template P={{0}};
  P.mnPrime[0]= 1;P.mnPrime[1]= 1;P.size_=0;
  for(int even = 2, odd = 3; odd <=2e6; even += 2, odd += 2){
    P.mnPrime[even]= 2;
    P.mnPrime[odd]= odd;
  }
  if(!(n& 1))P.mnPrime[n]= 2;
  P.Primes[P.size_++]= 2;
  for(int x = 3; x <=2e6; x += 2){
    if(P.mnPrime[x]== x)P.Primes[P.size_++]= x;
    for(int y = 0; y <P.size_ && P.Primes[y]<=P.mnPrime[x] && x*P.Primes[y]<=2e6; ++y)
      P.mnPrime[x*P.Primes[y]]=P.Primes[y];
  }
  for(int k= 0;k <n; ++k){
    int a = IN();
    inv_sum +=1l*MPow(a,M); if(inv_sum >=1l*mod) inv_sum -= mod;
    while(a - 1){
      int fac = P.mnPrime[a];
      int cnt = 1; a /= fac;
      while(a % fac == 0) a /= fac, cnt++;
      if(Count[fac] < cnt) Count[fac] = cnt; 
    }
  }
  long lcm = 1;
  for(int i=0;i<n;++i)if(Count[P.Primes[i]])lcm=1l*lcm*MPow(P.Primes[i],Count[P.Primes[i]])%mod;
  long res =1l*lcm * inv_sum % mod;
  return printf("%ld\n",res),0;
}


Compiler output:
a.cc:18:2: error: expected ';' after struct definition
   18 | }template;
      |  ^
      |  ;
a.cc:14:1: warning: 'typedef' was ignored in this declaration
   14 | typedef struct Template{
      | ^~~~~~~
a.cc:18:10: error: expected unqualified-id before ';' token
   18 | }template;
      |          ^
a.cc: In function 'int main()':
a.cc:23:3: error: expected primary-expression before 'template'
   23 |   template P={{0}};
      |   ^~~~~~~~
a.cc:24:3: error: 'P' was not declared in this scope
   24 |   P.mnPrime[0]= 1;P.mnPrime[1]= 1;P.size_=0;
      |   ^
Language: C++

#include<stdio.h>
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#pragma GCC target("avx")
#define rep(i,N) for(int i=0;i<(int)N;i++)
const int mod=1e9+7;
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline int MPow(int a,int b){return b?1l*MPow(1l*a*a%MOD,b>>1)*(b&1?a:1)%MOD:1;}
const int M=mod-2;
typedef struct Template{
  int mnPrime[2000001];
  int Primes[2000001];
  int size_;
}template;
int main(void){
  int n=IN();
  long inv_sum = 0;
  int Count[2000001]={};
  template P={{0}};
  P.mnPrime[0]= 1;P.mnPrime[1]= 1;P.size_=0;
  for(int even = 2, odd = 3; odd <=2e6; even += 2, odd += 2){
    P.mnPrime[even]= 2;
    P.mnPrime[odd]= odd;
  }
  if(!(n& 1))P.mnPrime[n]= 2;
  P.Primes[P.size_++]= 2;
  for(int x = 3; x <=2e6; x += 2){
    if(P.mnPrime[x]== x)P.Primes[P.size_++]= x;
    for(int y = 0; y <P.size_ && P.Primes[y]<=P.mnPrime[x] && x*P.Primes[y]<=2e6; ++y)
      P.mnPrime[x*P.Primes[y]]=P.Primes[y];
  }
  //int t=10;while(t--)printf("%d\n",P.Primes[9-t]);
  for(int k= 0;k <n; ++k){
    int a = IN();
    inv_sum +=1l*MPow(a,M); if(inv_sum >=1l*mod) inv_sum -= mod;
    while(a - 1){
      int fac = P.mnPrime[a];
      int cnt = 1; a /= fac;
      while(a % fac == 0) a /= fac, cnt++;
      if(Count[fac] < cnt) Count[fac] = cnt; 
    }
  }
  long lcm = 1;
  for(int i=0;i<n;++i)if(Count[P.Primes[i]])lcm=1l*lcm*MPow(P.Primes[i],Count[P.Primes[i]])%mod;
  long res =1l*lcm * inv_sum % mod;
  return printf("%ld\n",res),0;
}

Compiler output:
a.cc: In function 'int MPow(int, int)':
a.cc:12:61: error: 'MOD' was not declared in this scope
   12 | static inline int MPow(int a,int b){return b?1l*MPow(1l*a*a%MOD,b>>1)*(b&1?a:1)%MOD:1;}
      |                                                             ^~~
a.cc: At global scope:
a.cc:18:2: error: expected ';' after struct definition
   18 | }template;
      |  ^
      |  ;
a.cc:14:1: warning: 'typedef' was ignored in this declaration
   14 | typedef struct Template{
      | ^~~~~~~
a.cc:18:10: error: expected unqualified-id before ';' token
   18 | }template;
      |          ^
a.cc: In function 'int main()':
a.cc:23:3: error: expected primary-expression before 'template'
   23 |   template P={{0}};
      |   ^~~~~~~~
a.cc:24:3: error: 'P' was not declared in this scope
   24 |   P.mnPrime[0]= 1;P.mnPrime[1]= 1;P.size_=0;
      |   ^
Language: C++

import math
import sys


def lcm(a, b):
  return a * b // math.gcd(a, b)


input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
LCM = 1
ans = 0
MOD = 1000000007
for x in A:
  LCM = lcm(LCM, x)
for x in A:
  ans += LCM // x
  ans %= MOD

print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'