Code Chef :: Enormous input test

 #include <iostream>

int main() {
    int n;
    int k;
    std::cin >> n;
    std::cin >> k;
    int tot{};
    for (int i = 0; i<n ; i++)
    {
        long long int t ;
        std::cin >> t ;
        if (t%k == 0)
        {
            tot++ ;
            }
        else
        {
            tot = tot ;
        }
    }
    std::cout << tot ;

    return 0;
}

Comments

Popular posts from this blog

CodeChef::CSUB

How Recursion Works?

CodeChef::TREE2