Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

INTEST ->> time limit exceeded ----- how to shorten time duration taken to run this program?

$
0
0

//Problem code :: INTEST

#include<iostream>
using namespace std;

int main()

{

    int a,i=0,sum=0;

    long k,temp;

    cin>>a>>k;

    while(i<a)

    {

        cin>>temp;

        if(temp%k==0)

        sum=sum+1;

                i++;

    }

    cout<<sum << endl;
}

Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>