CodeChef
  • PRACTICE
    • Easy
    • Medium
    • Hard
    • Challenge
    • Peer
  • COMPETE
  • DISCUSS
    • Wiki
    • Forums
    • Blog
    • Twitter
  • COMMUNITY
    • CodeChef Meetups
    • Campus Chapters
    • Host Your Contest
    • User Groups
    • CodeChef TechTalks
  • HELP
    • Frequently Asked Questions
    • FAQ for Problem Setters
    • Ranks
    • Tutorials
  • ABOUT
    • About CodeChef
    • Team CodeChef
    • Press Room
    • CEO's Corner
    • About Directi

Programmer of the Month for July 2011: Gunjan Sharma

Posted by Harsh on July 4th, 2011 Filed in About, Announcement, Programmer of the Month View Comments

Welcome to the July Programmer of the Month edition!

This month we have with us Gunjan Sharma who is our Programmer of the Month. Gunjan has been part of CodeChef since November 2009 and is ranked 35th in the long contest and 84th in the short contest format. We hope to see this bright young mind achieve his dreams. On behalf of the CodeChef team, we wish him good luck for the future.  Now let’s see what Gunjan has to tell us about himself.

Name: Gunjan Sharma
Age: 21
Institute: Indian Institute of Technology, Roorkee
Company: Google
User id: shadow

Brief introduction about yourself:

Recently I have finished my bachelors from IIT Roorkee. I got placed in Google. Now I look forward to join Google soon. I have always had interest in Maths and puzzles. And I am quite passionate about programming.

How/When did you start programming?

I started programming only after I came in 2nd year. And it was on the codechef platform that I wrote my first program. The credit goes to my seniors for “how” I started programming.

What do you do when you’re not programming?

I usually watch movies and sitcoms.

What do you like most about CodeChef?

First of all the purpose that it is serving-”Bring out the best of Indian Programmers”. And also I like the codechef’s Interface. Another good thing about codechef is its long contest which gives you enough time to learn and implement new algorithms, and the challenge problems are unique in there own way :)

How many hours a day do you program?

Depends, there is no fixed time but I love coding whenever possible it always feels good to code.

If you could eat dinner with any famous person (past or present), who would it be and what dish would you have?

I would like to go out for dinner with Priyanka Chopra :P and whatever she likes should be good for me :D

What is the secret to being a good programmer?

I think to learn all what u can whenever u get a chance. Also keep participating in any kind of programming competition as u never know what new things u might learn.

What are your plans for the future?

Currently I look forward to join Google and still keep participating in the programming competitions :)

Other than this I would like to say all the very best to the Codechef team and hope that u grow exponentially :)

Cheers!
Team CodeChef

  • Share/Bookmark

Programmer of the Month for June 2011: Tomek Czajka

Posted by Harsh on June 10th, 2011 Filed in About, Programmer of the Month View Comments

Welcome to the June Programmer of the Month edition!

This month we have with us Tomek Czajka who is our Programmer of the Month. Tomek has been part of CodeChef since July 2009 and has submitted over 100 problems since then. He is ranked 4th in the long contest and 24th in the short contest format. We hope this is just the start and we have lots to see from this great mind. On behalf of the CodeChef team, we wish him good luck for the future.  Now let’s see what Tomek has to tell us about himself.

Name:  Tomek Czajka
Age:  30
Company: Google
User id:  tomek

Brief introduction about yourself:

I graduated from University of Warsaw and Purdue University, now I am working for Google, currently on Google Offers. Programming competitions have always been among the most intensive and enjoyable events for me.

How/When did you start programming?

I got a SAM Coupé for my 12th birthday. I quickly learned a lot about how the computer worked and learned to program in the built-in BASIC, and then in Z80 assembly.

What do you do when you’re not programming?

I play volleyball in the evenings on Google campus.

What do you like most about CodeChef?

Interesting problems in the monthly contests. Also the wide variety of compilers available.

How many hours a day do you program?

Between 2 to 6 hours.

If you could eat dinner with any famous person (past or present), who would it be and what dish would you have?

Some ancient Mediterranean cuisine with Euclid and Archimedes.

What is the secret to being a good programmer?

Enjoy doing it. If you are bored, you stop learning and become much less productive.

What are your plans for the future?

I will have a kid or two.

Cheers!
Team CodeChef

  • Share/Bookmark

March 2011 Cook-off Winners!

Posted by Harsh on March 21st, 2011 Filed in About, Announcement, Contests, Winners View Comments

Hi Guys,

The March 2010 Cook-off has ended. All top 10 participants have solved 4 problems, but surprisingly the 2 people who solved the 5th problem aren’t in the winnings!

We would love to thank our fantastic cooks this night, Zac Friggstad and Anton Lunyov, our awesome problem setter, tester and moderators.

Here are the top 10 best performers of the March 2011 Cook-Off:

01. dzhulgakov
02. niyaznigmatul
03. orfest
04. iwiwi
05. al13n
06. mikhailOK
07. KADR
08. Ra16bit
09. nevidomy
10. cmd

Take a look at the contest rankings here.

Contest Statistics:

Length of Contest Unique Participants Total Number of Submissions User who have solved at least one problem
2.5 hours 334 1671 211
Country Total Participants
IN 201
Rest of World 133

Congratulations guys! We look forward to seeing all of you participating in the April 2011 Challenge that begins on 1st April, 2011.

Check out the contest problem editorials here.

If there is anything you would like to let us know regarding this contest then do let us know by either commenting below this blog post or by sending in an email to feedback@codechef.com.

Cheers,
Harsh Munshaw
(Team CodeChef)

P.S. Winners of the contest will be contacted on Monday/Tuesday.

  • Share/Bookmark

The new rating system

Posted by Aniruddha on August 28th, 2009 Filed in About, Features View Comments

Greetings everyone!

We are happy to introduce a rating system for Codechef based on the contests we have every month. In brief, the rating system will have the following features.

1. Every user will have a rating. The user with the highest rating will be ranked 1, the user with the next highest rating will be ranked 2 and so on.

2. The ratings for the users will depend only on how they perform in the contests and not how they perform in the practice section.

3. Every contest problem will get a particular value based on the number of users solving that problem. The maximum value for a problem tends to the value 5 and the minimum value for a problem tends to 1. So, every user is guaranteed at-least 1 point for solving a problem. The selection of the value 5 was to give sufficient room for the top performers to increase their rating. Selection of a smaller range of values would let those participants solving only easy problems and participating frequently overtake those not participating frequently but performing exceptionally well when they do. Suppose the total number of users who have solved a particular problem is PS and the total number of users who have participated in the contest is TS, then the point value for a particular problem is 5 – 4*PS/TS. So, if there are more users successfully solving a problem, it’s value will be less and vice versa. The Challenge problem point value is calculated by taking the product of the score for the challenge problem with the maximum rating a contest problem can have i.e 5.

4. Suppose a user has solved P binary problems and 1 challenge problem and at the end of the contest, these problems have the values V1, V2, .. ,Vp then the total rating score S of the user for that contest will be V1+V2+…+Vp + 5 * (score of the user for the challenge problem).

5. The new rating of the user will be old_rating+S.

Also, every user’s profile page will now have a rating graph along with the current rating and rank. Your feedback in this regard is much appreciated :)

Regards,
Aniruddha.

  • Share/Bookmark

August Algorithm Challenge Ranks / Test Cases / Stats

Posted by Aniruddha on August 11th, 2009 Filed in About, Contests, Prizes, Winners View Comments

Greetings,
We are very happy to announce the winners of our August Algorithm Challenge :)

Winners :

Top 5 (India):
1st – Varun Jalan (6.000)
2nd -Anshuman Singh (5.980)
3rd – Anil (5.979)
4th – Sumeet (5.964)
5th – Pradeep B (5.936)

Top 5 (US):
1st – Balakrishnan Varadarajan (5.991)
2nd – Kevin Chen (5.981)
3rd – Tomasz Czajka (5.976)
4th – Josh Metzler (5.965)
5th – Neal (5.940)

Statistics:

All problems are now available in the practice area. The test cases for the problems can be found here
Here are some additional statistics about the contest:

Length of Contest Unique Visitors Unique Participants Total Number of Submissions Percentage of user who have solved at least one problem
10 days 15,824 235 4867 35%


Country Total Participants Average Score per User
IN 164 0.751
US 41 1.866
Rest of World 30 2.494

Feedback:

This time we tried something different with respect to the challenge problem. A user could submit at most 20 times in a span of 24 hours. We would like your feedback regarding this.

  • Was a limit of 20 submissions a day enough or would you like more number of submissions?
  • Alternatively, should we revert back to the re-judging method that was followed for the July Contest?

We also need your feedback about the contest as a whole.

  • How would you rate the contest problems?
  • Were they easier/similar/difficult compared to the previous contests?

Also, if you have any kind of feedback related to the contest or otherwise, feel free to comment.

Mini Challenge:

Lastly, as you all know, we will be having a shorter contest later this month. The August Mini Challenge will be held from 22nd August 15:00 IST to 24th August 15:00 IST. This will consist of a single challenge problem with no limits on the number of submissions. Hope to see you all there.

Regards,
Aniruddha.

  • Share/Bookmark

Rule Change for August Contest / Guidelines for Disqualification

Posted by The Chef on July 29th, 2009 Filed in About, Contests View Comments

Crème brûlées,
Based on the feedback we received from the July contest we have slightly modified the rules for the August Challenge. This time around we will not be rejudging submissions with new test data. To prevent people from precomputing solutions we will limit the number of submissions to the challenge problem to 20 per calendar day. We will reevaluate after the competition to see if this method has the intended results.

We would like to mention once and hopefully for the last time the guidelines for disqualification:

  • Any form of collaboration including (but not limited to) discussing problems, asking someone to review your code, asking for output for a set of inputs, posting questions on other forums, etc…
  • Hardcoding output for a specific set of inputs. It is ok to run tests to verify the size of inputs and some min/max conditions to help you design your algorithms. But hardcoding output for a specific set of inputs is not allowed.

We reserve the right to ban users based on suspicion of cheating.

We are also happy to announce a weekend long competition at the end of August. Details on this will be announced soon. We are also planning a team based competition for September, this may be judged in the style of ACM-ICPC competitions (time-based, penalities for incorrect submissions). We’ll let you know.

Best of luck!

Cheers,
Cheffy

  • Share/Bookmark

FAQ for problem setters

Posted by Aniruddha on July 24th, 2009 Filed in About View Comments

For the past few weeks we have been getting questions from people interested in setting problems for our contests. Here is a quick FAQ as to what you need to do before sending us the problems and if/how your problems will be used in our contests. Now, at present, we have 2 types of problems in our contest. The first category is the exact algorithm contest problems which have either a wrong or a correct answer. The other type is the challenge problem that we have in each contest. This problem is such that it does not have a deterministic solution. Which means that there is no algorithm that will give an optimal answer for the problem. Submitting problems for both these categories is slightly different.

Exact Algorithm Problems :


Q. What kind of problems are you looking for in the Exact Algorithm Problems category?

A. We are looking for problems which are not standard ones or ones which are not easily ‘googleable’. The problem should be such that it induces the solver to spend time to think of a solution to the problem rather than search for it online.

Q. What files do I need to submit along with the problem?

A. You need to submit the following files :
1) The problem story line. This is the main body of the problem that the participant will read. This should not be ambiguous and should be clear and interesting. It should specify the input format, the output format as well as the constraints on the input and if any, on the output.
2) The solution in a programming language of your choice. This solution should be such that it takes in the input data in the specified format and produces the correct output according to the output format.
3) The test input data. This input data should have all the corner cases covered and should have a few randomly generated test cases too. If there are multiple input files, label them as 0.in, 1.in, 2.in and so on and place all of them in a folder called ‘input’.
4) The output test data. This is the output data corresponding to the input data mentioned previously. The expected output for 0.in should be placed in 0.out, for 1.in should be in 1.out and so on. Place all these files in a folder called ‘output’.
5) A small write-up of the approach taken. You need to give us a small write-up about the approach taken to solve the problem.

Q. How do I send you all the files?

A. Place all the files and folders in another folder named whatever you wish to call the problem. Archive it using an archiver, preferably in .zip or .tar.gz format. Send this archived file as an attachment along with your contact information to admin@codechef.com

Q. How many problems can I submit?

A. You can submit as many problems as you like. If we like a problem, we will use it in one of our contests. If we decide to use your problem in our contest, you would not be eligible to participate in that month’s contest. You might want to send us a set of 4-5 problems so that we might use a higher number of problems in the same contest.

Q. How much do I get paid for submitting the problem?
A. There is no payment for submitting a problem. However, if we decide to use your problem in our contest, we will compensate you accordingly. The compensation would depend on the quality of problems you have submitted. An easy problem would have less compensation compared to a hard one.

Challenge Problems :

There are a couple of things different for challenge problems.

Q. What kind of problems are you looking for in the Challenge Problem category?

A. We are again looking for problems which are not very highly researched. The approaches for such problems should not be available online easily. The problems should not have a polynomial time solution. The challenge problem has a scoring mechanism based on certain parameters. This scoring mechanism needs to be explained properly in the problem statement submitted by you. Also, you need to specify whether the optimal solution minimizes this score or maximizes this score.

Q. What files do I need to submit along with the problem?

A. You need to submit the following files :
1) The problem story line. This is the same as the earlier category. Along with the constraints and other things, you need to mention how the problem is scored and also whether the optimal approach should maximize or minimize the score.
2) The input test data. This should have random and large test cases. Place all the input files in a folder called ‘input’.
3) A program in a programming language of your choice that reads the output and returns the score for that output based on the scoring parameters.
4) A write-up specifying why the problem does not have a polynomial time solution. Some links or research papers pointing to this would be appreciated.

  • Share/Bookmark

July Algorithm Challenge Winners / Test Cases / Stats

Posted by The Chef on July 15th, 2009 Filed in About, Contests, Prizes, Winners View Comments

Pumpkin Pies,
We are pleased to announce the winners for the July Algorithm Challenge.  Drum roll please…

Top 5 (India):
1st – Varun Jalan (6.886)
2nd -Ashutosh Mehra (6.873)
3rd – Imran (6.868)
4th – Prunthaban K (6.854)
5th – Surendra (6.815)

Top 5 (US):
1st – Tomasz Czajka (7)
2nd – Josh Metzler (6.97)
3rd – Balakrishnan Varadarajan (6.964)
4th – Rahul Garg (6.917)
5th – Chris Narrikkattu (6.904)

All problems are now available in the practice arena. Test cases for all contest problems can be found here in three parts: Part 1, Part 2, Part 3.

Here are some additional statistics about the contest:

Length of Contest Unique Visitors Unique Participants Total Number of Submissions Percentage of user who have solved at least one problem
12 days 8,387 406 9656 57%


Country Total Participants Average Score per User
IN 279 1.25
US 63 1.99
Rest of World 64 2.30

There was definitely room for improvement in this contest, and we hope to incorporate all the feedback we have received into making the next contest an even bigger success.

Thank you to everyone who participated.
Cheers,
Chef

  • Share/Bookmark

Important Rule Change for July Contest

Posted by The Chef on June 30th, 2009 Filed in About, Contests View Comments

Chocolate Shakes,
We’ve had some complaints in the last contest about participants reverse engineering test data. While this isn’t necessarily “wrong,” in keeping with the spirit of finding the best solutions to the problems given, we’ve instituted a small rule change. This time around, the challenge problem will be rejudged at the end of the contest, with entirely new test data.

We considered other approaches for all problems including:
* Rejudging all solutions at the end of the contest with new test data (not just the challenge problem)
* Capping the number of submissions per user per day
* Allowing users to only submit solutions at certain time intervals (i.e. one solution per five min)

In the end we have done our best to come up with better, bigger and more random test cases and are holding off on these other change (for now). If you believe there are additional ways to improve the contest format, please let us know.

Cheers,
Amit (The Chef)

p.s. if you wanna see how pretty I am, check out our new Twitter background.

p.p.s don’t forget our first DesignChef competition along starts tomorrow, help us out… spread the word.

  • Share/Bookmark

Frequently Asked Questions

Posted by Aniruddha on June 29th, 2009 Filed in About View Comments

Well, a lot of people seem to be having the same kind of questions across different forums and different problems. Here is a brief list of questions that have been coming up quite frequently over the past few weeks, and some hints on what you should do to solve the issue.

Q. What compilers do we use?
A. The compilers for the different languages are specified when you select the language while submitting the  solution. Code compiled on other non-standard compilers cannot be guaranteed to compile on the online judge system.

Q. What are the system specifications?
A. As of now, the specifications of the system on which the judge executes the solutions are :
Operating System : Gentoo Linux
Processor : Quad Core Intel running at 2.33 GHz
Memory : 4 GB of RAM (64 MB guaranteed for each submission)
Storage : 160 GB effective storage using SATA RAID 0 configuration
Network Link : 144 Mbit maximum throughput

Q. I can’t seem to find the compilers being used by Codechef. Can you give me a link?
A. The IDEs / Compilers / Interpreters for some commonly  used languages are listed below.
C / C++ : You can use the Dev C++ IDE if you are on windows – http://www.bloodshed.net/dev/devcpp.html
Java : Download the Java Development Kit from the Sun website – http://java.sun.com/javase/downloads/index.jsp
Python : Download the python interpreter from – http://www.python.org/download/
Perl : Download perl from http://www.perl.com/download.csp
Ruby : Download it from http://www.ruby-lang.org/en/downloads/
C# : Download it from http://www.microsoft.com/express/vcsharp/

You can use flags like -O2 in C or C++ to turn on compiler level optimization.

Q. Why does my code compile fine in Turbo C but not on the Codechef Judge?
A. The Codechef Judge uses the GNU compiler collection. Turbo C uses some non-standard headers and as such should not be used. A standards compliant C code written under Turbo C will compile fine on the online judge.

Q. Can I include the file conio.h?
A. No, conio.h is not a standard header file and as such is not available under the GNU compiler collection. Code which includes conio.h will not compile on the online judge.

Q. What should I name the class in a java solution?
A. You should name the class as Main. Failure to do so will result in a compilation error on the online judge system.

Q. Do I need to take the input for all testcases at once before processing it?

A. No, you need not take all the input at once. You can take the input for a particular test case and output the answer and then proceed to the next test case. Program should read from standard input and write into standard output. There is no need to read all data first, compute them all and then print all output. It is recommended to read and write data as simultaneously. Technically, server redirects standard stream to files. You can test you programs in the same way at home.

Q. Can I get the input for which my program failed?
A. Currently it is not possible to get the input for which your program fails. Thinking out corner cases is a part of the fun associated with algorithms :)

Q. How do I take input for problems which do not specify a distinct terminating condition or the number of test cases?
A. In cases where the total number of test cases are not specified or some input doesn’t serve as the terminating input, you are expected to take input till an EOF marker is encountered. While testing, you can terminate the input in the command line by pressing the <ctrl> and <z> keys together.

Q. How do I get the execution time of a program in Linux?
A. After compiling the program, say you have the output file with the name ‘solution’, then, you can get the execution time by using the command “time ./solution”. The sys and user times are what you should be looking at in the output.

Q. The code runs within the time limit on my system, but I get a TLE on Codechef. Why is that so?
A. TLE stands for Time Limit Exceeded. The configuration of your system might be different from the one we use. You need to optimize your algorithm or come up with a better algorithm.

Q. I can’t even take input or print output within the time limit, let alone processing the input. What should I do?
A. Make sure you have submitted an efficient solution to http://www.codechef.com/problems/INTEST/ and http://www.codechef.com/problems/TEST/ and make sure you read http://blog.codechef.com/2009/02/24/54/

Q. The time limit for the problem is 2 seconds, but some accepted solutions take more time. How is that possible?

A. This can happen if the problem has multiple test case files. The time mentioned in the constraints is per input file. If there are multiple input files, then the total time taken for executing all of them is displayed. For example, if the time constraint for the problem is 2 seconds and there are 8 input files, then your program must take at most 2 seconds for any particular input file, but the total time displayed will be the sum of the execution times for the 8 input files and this may exceed 2 seconds.

Q. Why do I get an error called SIGSEGV?
A. A SIGSEGV is an error(signal) caused by an invalid memory reference or a segmentation fault. You are probably trying to access an array element out of bounds or trying to use too much memory. Some of the other causes of a segmentation fault are : Using uninitialized pointers, dereference of NULL pointers, accessing memory that the program doesn’t own.

Q. Why do I get an error called SIGABRT?
A. A SIGABRT is caused if your program aborted due to a fatal error. This can also be caused if you are using an assert() which fails or an abort().

Q. Why do I get an error called SIGFPE?
A. A SIGFPE is caused by a floating point error. Your program is encountering such an error, probably a division by zero or some similar undefined operation.

Q. Why do I get an error called NZEC?
A. NZEC stands for Non Zero Exit Code. Usually, returning non-zero values from main() will cause this error. It helps telling crash from WA (Wrong Answer) with interpreted languages. Typically this would happen if you omit a return 0; from main() in C. For interpreted languages or Java/C++, this could happen if your program threw an exception which was not caught (e.g. Trying to allocate too much memory in a vector).

If you have any other questions, do post them as a comment and we will try to incorporate them into the FAQ.

  • Share/Bookmark
« Previous Entries

Recent Posts

  • The February Long Challenge has a Surprise in store!
  • Gennady’s blitz·krieg!
  • An overwhelming participation for IOPC2012 :)
  • IIT-Kanpur along with CodeChef presents Techkriti-IOPC 2012
  • A “tie’ing” start to the year

Categories

  • About (15)
  • Announcement (90)
  • Campus Chapters (4)
  • Contests (94)
  • Events (17)
  • Features (19)
  • Meetup (4)
  • Open Source (1)
  • Practice Problems (6)
  • Prizes (32)
  • Programmer of the Month (27)
  • Tech Talks (2)
  • Tutorials (24)
  • Winners (44)

Recent Comments

  • Anish_7766 on The February Long Challenge has a Surprise in store!
  • Berita Gue on October’s Programmer of Month: Hiroto Sekido
  • pERCY on The February Long Challenge has a Surprise in store!
  • Vivek5402 on The February Long Challenge has a Surprise in store!
  • Vivek on The February Long Challenge has a Surprise in store!

Recent Pictures

Blogroll

  • Documentation
  • Plugins
  • Suggest Ideas
  • Support Forum
  • Themes
  • WordPress Blog
  • WordPress Planet

Archives

  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009

Company Blogs

  • Directi
  • .pw Corp Blog
  • CEOs Blog

Careers@Directi


  • About CodeChef
  • About Directi
  • CEO's Corner
  • CodeChef Campus Chapters
  • Blogger Community Program
  • User Group Outreach Program

© 2009, Directi Group. All Rights Reserved.

Sponsors