on the last test of an exercise it says "caught fatal signal 11"....my first thought was that the number of elements is too high bc it says the maximum "n" is 9 digits, but if I add another 0 to the vector (like "1000001" instead of "100001") it gives me the "caught fatal signal 11" on every test (because the vector elements number is too high).... so i don t know what to do
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("pozmax.in");
ofstream g("pozmax.out");
double v[100001];
int i, n, dif, difmax, k,maxi;
int main()
{
f>> n;
maxi=-99999999;
for (i = 1; i <= n; i++)
f>> v[i];
for (i = 1; i < n; i++)
if(v[i]>maxi)
maxi=v[i];
for (i = 1; i <= n; i++)
if(v[i]==maxi)
{k=i;
break;}
g<<k<<" ";
for (i = 1; i <= n; i++)
if(v[i]==maxi)
k=i;
g<< k;
f.close();
g.close();
return 0;
}