Language: C++

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

int n;

ll gcd(ll x, ll y){
    if(x < y) swap(x,y);
    while( y > 0 ){
        ll r = x%y;
        x = y;
        y = r;
    }
    return x;
}
ll lcm(ll x, ll y){
    ll aa = gcd(x,y) ;
    ll bb = x/aa;
    ll cc = bb*y;
    return cc;
}

int main(){
    cin >> n;
    ll ans = 1;
    bool same = true;
    for(int i =0;i < n;i++){
        ll t[n];
        cin >>t[i];
        if( (i > 0) && t[i] != t[i-1]) same = false;
        ans = lcm(ans, t);
    }
    if(same){
        ans = 1;
        ans *= n;
        ans %= (1e9 + 7);
        cout<< ans <<endl;
        return 0;
    }
    ll ans2;
    for(int i =0; i<n;i++){
        ans2+ = ans/t[i];
    }
    ans %= (1e9 + 7);
    cout<< ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: no matching function for call to 'lcm(long long int&, long long int [n])'
   32 |         ans = lcm(ans, t);
      |               ~~~^~~~~~~~
a.cc:17:4: note: candidate: 'long long int lcm(long long int, long long int)' (near match)
   17 | ll lcm(ll x, ll y){
      |    ^~~
a.cc:17:4: note:   conversion of argument 2 would be ill-formed:
a.cc:32:24: error: invalid conversion from 'long long int*' to 'long long int' [-fpermissive]
   32 |         ans = lcm(ans, t);
      |                        ^
      |                        |
      |                        long long int*
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: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/14/numeric:188:5: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/type_traits: In substitution of 'template<class ... _Tp> using std::common_type_t = typename std::common_type::type [with _Tp = {long long int, long long int*}]':
/usr/include/c++/14/numeric:188:5:   required by substitution of 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn) [with _Mn = long long int; _Nn = long long int*]'
a.cc:32:18:   required from here
   32 |         ans = lcm(ans, t);
      |               ~~~^~~~~~~~
/usr/include/c++/14/type_traits:2719:11: error: no type named 'type' in 'struct std::common_type<long long int, long long int*>'
 2719 |     using common_type_t = typename common_type<_Tp...>::type;
      |           ^~~~~~~~~~~~~
a.cc:37:13: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   37 |         ans %= (1e9 + 7);
      |         ~~~~^~~~~~~~~~~~
a.cc:37:13: note:   in evaluation of 'operator%=(long long int, double)'
a.cc:43:15: error: expected primary-expression before '=' token
   43 |         ans2+ = ans/t[i];
      |               ^
a.cc:43:21: error: 't' was not declared in this scope
   43 |         ans2+ = ans/t[i];
      |                     ^
a.cc:45:9: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
   45 |     ans %= (1e9 + 7);
      |     ~~~~^~~~~~~~~~~~
a.cc:45:9: note:   in evaluation of 'operator%=(long long int, double)'