Language: C++

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

int max_int_2(array &arr){
    int tmp = max(array);
    int l1, l2;
    // count (val == tmp)
    int count=0;
    for(int i=0; i<N; ++i){
        if(array[i]==tmp){
            array[i] = 0;
            ++count;
        }
    }
    if(count>1){
        return tmp;
    }else{
        max_int2(array)
    }
}

int main(){
    unsigned int N;
    cin >> N;
    array<int, N> arr;
    for(int i=0; i<N; i++){
        cin >> arr[i];
    }
    int l1 = max_int_2(array);
    int l2 = max_int_2(array)
    cout << l1 * l2;
    return 0;
}

Compiler output:
a.cc:5:15: error: missing template argument list after 'std::array'; template placeholder not permitted in parameter
    5 | int max_int_2(array &arr){
      |               ^~~~~
      |                    <>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/string:51,
                 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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: 'template<class _Tp, long unsigned int _Nm> struct std::array' declared here
   99 |     struct array;
      |            ^~~~~
a.cc: In function 'int max_int_2(...)':
a.cc:6:24: error: missing template arguments before ')' token
    6 |     int tmp = max(array);
      |                        ^
a.cc:10:20: error: 'N' was not declared in this scope
   10 |     for(int i=0; i<N; ++i){
      |                    ^
a.cc:11:17: error: expected unqualified-id before '[' token
   11 |         if(array[i]==tmp){
      |                 ^
a.cc:12:24: error: conversion from 'int' to non-scalar type 'std::array<int, 1>' requested
   12 |             array[i] = 0;
      |                        ^
a.cc:19:23: error: missing template arguments before ')' token
   19 |         max_int2(array)
      |                       ^
a.cc:19:9: error: 'max_int2' was not declared in this scope; did you mean 'max_int_2'?
   19 |         max_int2(array)
      |         ^~~~~~~~
      |         max_int_2
a.cc: In function 'int main()':
a.cc:26:17: error: the value of 'N' is not usable in a constant expression
   26 |     array<int, N> arr;
      |                 ^
a.cc:24:18: note: 'unsigned int N' is not const
   24 |     unsigned int N;
      |                  ^
a.cc:26:17: note: in template argument for type 'long unsigned int'
   26 |     array<int, N> arr;
      |                 ^
a.cc:28:19: error: invalid types 'int[int]' for array subscript
   28 |         cin >> arr[i];
      |                   ^
a.cc:30:29: error: missing template arguments before ')' token
   30 |     int l1 = max_int_2(array);
      |                             ^
a.cc:31:29: error: missing template arguments before ')' token
   31 |     int l2 = max_int_2(array)
      |                             ^
a.cc: In function 'int max_int_2(...)':
a.cc:21:1: warning: control reaches end of non-void function [-Wreturn-type]
   21 | }
      | ^