#include<iostream>
typedef long long ll;
using namespace std;
int main()
{
ll n,k,t;
ll count=0;
scanf("%lld %lld",&n,&k);
while(n--)
{
scanf("%lld",&t);
if(t%k==0)
count++;
}
printf("%lld\n",count);
return 0;
}
Now I can’t seem to understand why this code is producing a WRONG ANSWER as the result. I checked some successful submissions. The AC codes I viewed are almost the same. Then why does this code produce an error?
Yes thank you it did solve my problem. But like the edit mentions: why is the code getting compiled in the first place instead of showing a wrong answer?