{
class EnormousInput
{
public static void Main(string[] args)
{
string[] input = System.Console.ReadLine().Split(' ');
int number = System.Int32.Parse(input[0]);
int divisor = System.Int32.Parse(input[1]);
int[] data = new int[number];
int i = 0;
int counter = 0;
for (i = 0; i < number; ++i)
data[i] = System.Int32.Parse(System.Console.ReadLine());
for (i = 0; i < number; ++i)
if (data[i] % divisor == 0)
++counter;
System.Console.WriteLine(counter);
}
}
}
Comments


Don't use array, storing all
Don't use array, storing all the numbers at first and processing them..takes a lot of time.As and when u read the input,check whether the number is divisble by the 'divisor' (divisor in ur program)...and increment the count..Finally after reading & processing all the numbers..print the count...hope this resolves ur TLE problem...
I wrote this program in C++
I wrote this program in C++ using exactly same logic,but it gives time exceeded error.Please help me.