Program to delete duplicates from a link list

Enormous Input Test | Codechef solution

Problem (Enormous Input Test | Codechef solution):-

The purpose of this problem is to verify whether the method you are using to read input data is sufficiently fast to handle problems branded with the enormous Input/Output warning. You are expected to be able to process at least 2.5MB of input data per second at runtime.

Input of Enormous Input Test | Codechef solution

The input begins with two positive integers n k (n, k<=107). The next n lines of input contain one positive integer ti, not greater than 109, each.

Output of Enormous Input Test | Codechef solution

Write a single integer to output, denoting how many integers ti are divisible by k.

Example

Input:
7 3
1
51
966369
7
9
999996
11

Output:
4

Code:-

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,k,t;
    cin>>n>>k;
    int count=0;
    while(n--)
    {
      cin>>t;
      if(t%k==0)
         count++;
    }
    cout<<count;
    return 0;
}

 

Recommended Post:-

codechef problems:-

 

 

Wipro :-

 

 

Infytq :-

 

 

Key Points;-

Hackerrank:-

C-tutorial:-

 

See more:-

 

 

Leave a Reply

Your email address will not be published.