I'm trying to solve a problem and I'm using C++ to do so.
The first bit of my code is:
typedef long long ll;
...
ll M; std::cin >> M;
int clen[M];
clen[0] = 0;
clen[1] = 1;
for (ll i = 2; i < M; i++)
{
...
The problem is to use M = 1000000 (1e6), but this does not work. In particular, the first value of M where the program does not work as expected is 517988. It works for 517987 and presumably for all smaller numbers. I can only assume that the problem is with making my array, since the program should print things for i = 2 and so on, but instead it just waits for a bit and then ends.