You are not logged in. Please login at www.codechef.com to post your questions!

×

FCTRL : wrong answer but running properly on my system

#include<stdio.h>
int main()
{
  int i,n,b=5,c,m=0;
  long long a;
  scanf("%d",&n); 
  for(i=0;i<n;i++)
  {
  b=5;
  scanf("%ld",&a);
  while(b<a){
     c=a/b;
    b*=5;
    m+=c;
    }
   printf("%d\n",m);
   m=0;
}
 return 0;
}

asked 27 Oct '14, 03:09

sarfu21's gravatar image

0★sarfu21
1
accept rate: 0%

edited 27 Oct '14, 15:44

topcoder_7's gravatar image

2★topcoder_7
2.9k3153


You are missing the cases which are powers of 5 such as 25,125,625... Accepted Submission:http://www.codechef.com/viewsolution/5228425

link

answered 27 Oct '14, 04:30

ads_123's gravatar image

3★ads_123
81114
accept rate: 10%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×856
×45

question asked: 27 Oct '14, 03:09

question was seen: 701 times

last updated: 27 Oct '14, 15:44