i’m new to coding and this is my first time dealing with enormous input.I always exceed the time limit.
#include
using namespace std;
int main()
{
unsigned long int a,b,c,d,e;
d=0;
cin>>a>>b;
for(c=0;c<a;c++)
{
cin>>e;
if((e%b)==0)
{
d++;
}
}
cout<<d<<"\n";
return(0);
}
Because cin
and cout
are too slow.