codechef

CodeChef and Challenge-style programming in the context of (my) career growth

I've recently stumbled upon a site called CodeChef; I must admit that it has peaked my interest. I'm wondering if spending time doing these puzzles (after all, that is what they are), are worth the time for a professional software developer? I'm defining software developer in the context of my current career track. Right now, I develop...

Can I make this C++ code faster without making it much more complex?

Hi all, here's a problem I've solved from a programming problem website(codechef.com in case anyone doesn't want to see this solution before trying themselves). This solved the problem in about 5.43 seconds with the test data, others have solved this same problem with the same test data in 0.14 seconds but with much more complex code. ...

Codechef practice question help needed - find trailing zeros in a factorial

I have been working on this for 24 hours now, trying to optimize it. The question is how to find the number of trailing zeroes in factorial of a number in range of 10000000 and 10 million test cases in about 8 secs. The code is as follows: #include<iostream> using namespace std; int count5(int a){ int b=0; for(int i=a;i>0;i=...

c++ compile error in codechef.com

I am trying to submit the solution of Adding Least Common Multiples(July contest) in codechef.com. But After submission I have got an error /sources/tested.cpp:1: error: expected unqualified-id before numeric constant what is it mean? I did not get any error when I compiled in eclipse(helios) using mingw32-g++ ...

Codechef python runtime error

I always get a runtime error using python for submission on codechef. Can some one please help. Tried answering other questions too.. same error Works fine on my comp though!(I use python 2.6.5 on my comp. Answer is checked with python 2.5) This is an easy level question where i get Runtime error http://www.codechef.com/problems/FCTRL/ ...