What is Code Jam ?
Google Code Jam is a yearly coding competition which is organised and administered by google. It is a coding competition for all professional and student coders, where they are asked to solve complex algorithmioc challenges within a provided time limit.
The winner for the 2009 competition was ACRUSH from China.
Official Dates for Code Jam 2010 competition will be announced in January.
This is for the newbies having very less knowledge about it and want to participate in next competition. With this, you will get to know the necessary things to participate and how to start coding in the beginning.
For participation you need to have a google account and then you can register for the contest from code jam website.
For understanding the contest and its environment you should visit this contest link and sign in with your google account and in right side you will see a column like below :
- Who is Eligible
- How to Register
- How it Works
- How to Win
- How to Track Your Performance
- How to Be a Spectator
- How to Practice
- How to Ask Questions During the Contest
- How to Interact With Other Participants
- How to Advance to the Finals
- Prize Overview
After you enter the competition area you will get a dashboard in which you will see the problems in your left corner.
Your problem will include two input files. One with small set of inputs in it and another with large set of inputs. After reading your problem statements you can start coding on your system. When you finish with your coding then you can download one of these input files and upload your output file generated by your program. This output file much match the sample output given in the problem statement. After downloading the small input file you will be given four minutes to submit your output file along with your source code otherwise attempt will be marked as incorrect, time limitation for large input file will be eight minutes. Marks for submitting output file for large input is higher than the small input file.
In your left sidebar you will see submissions of all the coders and top scores.
Hope it gives you a brief overview of the contest.
Now we are going to give you some tips about how to take input and generate output using your program. I am using the language C for this purpose, further you can implement same in other languages. I learned doing this from top scorers, thanks to all of them.
Easy way of taking inputs from input file and generating output file as well.-
char file[40];
char inputfile[40], outputfile[40]; // for the name of input and output file
scanf("%s", file); // give desired name
strcpy(inputfile, file); // naming input file
strcpy(outputfile, file); // naming output file
strcat(inputfile, ".in"); // adding extension for difference in input & output file
strcat(outputfile, ".out");// adding extension for difference in input & output file
FILE *fp =fopen(inputfile, "r"); //opening input file for read
FILE *ofp=fopen(outpufile, "w"); //opening output file for write
This code sample can be used in your code for easy creation of files.
Hope you like it ! Any comment will be appreciated.
Keep practicing and Stay Tuned!



[...] This post was mentioned on Twitter by Sahil Malhan and slimb mani, TechTickle. TechTickle said: How to: Participate in Google Code Jam http://bit.ly/8Dqs9J (RT plz) #google #programming #codejam #codejam2010 #coding [...]
I like wat you guy are doing.
Thank you!