How to define an array for this problem to store and check big numbers.
The numbers in the mentioned problem don’t exceed 10^9 , so long int should work for you . Just make an array of long int . You could also have a look at successful submissions made in C++ for this problem .
Maybe try to answer the question: “Why you use a when n is up to 10^7?”
Also just had a look at the problem again , you don’t really need to store the numbers . Just read each number , see if it is divisible by k , increment the counter or do nothing and move forward . so you process each number as you read , so you don’t need to make an “array” .