Why can't I declare a value like long long int v[100000000]? There's no error while compiling but when I have to input my values it simply breaks...
I have the following code:
#include <iostream>
using namespace std;
int main ()
{
int n, i, poz, ok;
long long int a, v[10000000], aux;
cout << "v[0]= "; cin >> v[0];
cout << "n= "; cin >> n;
//cout << v[0] << " ";
for (i=1; i<n; i++)
{
v[i]=((v[i-1]%31337)*(31334%31337))%31337;
//cout << v[i] << " ";
}
//cout << endl;
a=v[n-1];
do
{
ok=0;
for (i=0; i<n-1; i++)
if (v[i]>v[i+1])
{
aux=v[i];
v[i]=v[i+1];
v[i+1]=aux;
ok=1;
}
}while (ok==1);
// for (i=0; i<n; i++)
//{
// cout << v[i] << " ";
//}
//cout << endl;
for (i=0; i<n; i++)
if (v[i]==a)
poz=i+1;
cout << poz;
return 0;
}
And I have to input the values: [11863, 1661427]. Any ideas what should I do to input those values?