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

Execution time - INTEST

$
0
0

Can someone please tell me how to decrease the execution time of my code? Currently it is 5.48 Following is my code :

#include <iostream>
using namespace std;

int main() {
int n,k,cnt=0,t;
scanf("%d%d",&n,&k);
while(n)
 {
 scanf("%d",&t);
 if(t%k==0)
   cnt++;
 n--;
 }
 printf("%d",cnt);
return 0;
}

Further, I have just started participating on codechef so can someone please guide me about what are the topics that one must know so that they can attempt the questions? Thanks a lot.


Viewing all articles
Browse latest Browse all 39796

Trending Articles



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