Language: C++

#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <string>
#include <map>
#include <unordered_map>
#include <bitset>
#include <numeric>


using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

const ll nmax=2*100000+1;

ll lis[9];

int main(){
    ll n,a,tmp,amin,amax;
    cin>>n;
    for(ll i=0;i<n;i++){
        cin>>a;
        for(ll j=0;j<8;j++){
            if(400*j<=a && a<400*(j+1)-1) lis[j]=1;
        }
        if(400*8<=a) lis[8]++;
    }

    amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
    amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
    if(lis[8]>0&&amin==0){
        amin=1;
    }
    cout<<amin<<" "<<amax<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:11: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |           ^
a.cc:37:16: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                ^
a.cc:37:21: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                     ^
a.cc:37:26: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                          ^
a.cc:37:31: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                               ^
a.cc:37:36: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                                    ^
a.cc:37:41: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                                         ^
a.cc:37:46: error: invalid types 'll {aka long long int}[int]' for array subscript
   37 |     amin=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7];
      |                                              ^
a.cc:38:11: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |           ^
a.cc:38:16: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                ^
a.cc:38:21: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                     ^
a.cc:38:26: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                          ^
a.cc:38:31: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                               ^
a.cc:38:36: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                    ^
a.cc:38:41: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                         ^
a.cc:38:46: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                              ^
a.cc:38:51: error: invalid types 'll {aka long long int}[int]' for array subscript
   38 |     amax=a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]+a[8];
      |                                                   ^