Skip to main content

Google Code Jam

Registration is open!
It's that time again, Code Jam 2015 Registration is now open! Make sure you register between now and the end of the Qualification Round by clicking on the blue 'Participate' button to the right.
This year we're excited to announce the introduction of a brand new track within the Code Jam competition called Distributed Code Jam. Those of you who make it to Code Jam Round 3 can choose to participate in this new leg of the competition designed to challenge your distributed coding, latency reduction abilities, and of course, your algorithmic coding skills. For Distributed Code Jam we've added one new online round and one on-site final round made up of algorithmic puzzles similar to Code Jam, but in order to solve them you will need to write code for a distributed environment. If you compete in both, you could attend the finals in Seattle, Washington and win both Code Jam and Distributed Code Jam.
In order to participate in Distributed Code Jam, you must register for Code Jamand make it to Code Jam Round 3. Please note, the first round for Distributed Code Jam will take place on June 14th at 14:00 UTC, one day after Code Jam Round 3. To learn more about the new competition visit the Distributed Code Jam page and Terms and Conditions.
Don't forget to brush up on your Code Jam skills before the Qualification Round by doing some of the practice problems from Code Jam's past contests, and visit the Quick Start Guide if you're new to Code Jam.


                                                                 REGISTER




What's the least you need to know to use the competition arena?

There's a lot of important information in the official Terms and FAQ for Google Code Jam; and if you're competing, you should read them. But if you're on the site to practice your programming skills, or you just need a quick refresher on how the competition arena works, here are the steps you should follow:
  1. Open the competition arena to your round. [+]
  2. Read the problem. The first few sections will describe precisely what problem your program needs to solve. [+] Take careful note of the Limits section. This section will describe two different sets of limits: limits for the Small input and the Large input. This should give you some idea of how quickly your algorithm will need to run.
  3. Write a program that will solve the problem described, with the Small limits described, in less than ~3 minutes. Make sure your program accepts input and gives output in the format given; if you run it with the Sample Input as input, it should produce precisely the Sample Output (including the "Case #" text).
  4. At the top of the page, click to solve the small and download the input. During a real contest, a 4-minute timer will start as soon as we receive the download request. If you're practicing, there won't be a timer (but your code should still be able to solve the problem in 4 minutes).
  5. Run your program on that input, and save the result in a file. Submit that file as your output, and your source code as your code.[+] The server will respond in one of a few ways:
    1. Correct: Your submission was completely correct in every case!
    2. Rejected: The response should tell you what was wrong; often it means you submitted the wrong file. The clock is still ticking, so see if you can fix the bug before you run out of time.
    3. Incorrect: Your result was wrong, maybe even in just one test case. You can fix your program and try again as many times as you like. [+] You'll download a new input file every time, so don't use the old one again by mistake! [+]
    If you run out of time before making a submission, it will be treated in the same way as if you submitted and were incorrect.
  6. After you solve the Small input, the Large input will become available. Once your program is ready to deal with the higher limits, download the Large input. An 8-minute timer will start as soon as we receive the download request.
  7. Run your program and submit as with the Small. You won't know whether you solved the problem correctly until the end of the competition, though your submission could be rejected. [+] We won't stop the timer after you submit, so if you want to do some testing and submit again, you can do that. You'll only be judged on your last submission.
  8. Move on to another problem (there's a list on the left). Each input you solve correctly is worth a number of points that's written next to its download link; the contestant with the most points at the end of the contest wins. Ties are broken by which contestant got her last point first, with 4 minutes of penalty time given for each incorrect submission on a small input that you got right later.

How do I Register?

After registration opens, and before the end of the Qualification Round, you can register for Google Code Jam athttps://code.google.com/codejam. You can tell whether registration is open by checking our schedule.

Competing in a Round

What are Rounds

For a detailed description of Rounds please Section 3 (Contest Structure) in the Additional Terms for Code Jam 2015.

There is a round happening right now, but I can only watch. Why?

First, make sure that you're logged in with the same Google Account that registered for Code Jam. If you are, there are a few possible reasons: if this is Round 1B or Round 1C, perhaps you already advanced to Round 2 in an earlier Round 1. Or perhaps you failed to advance to the round currently taking place. If you received an email from Google saying that you're eligible for the round, you're logged in with the right account and you're still unable to compete, please contact us immediately at codejam@google.com and we will investigate.

Competing in a Round: Mechanics

A round is starting soon. Where do I go to compete?

For global Google Code Jam rounds, go to https://code.google.com/codejam. There will be a countdown timer that counts down to the start of the round. Check the schedule to be sure.

How do I compete in a round?

Our Quick-Start Guide will show you the basics of how to compete. If there's no round running right now, you can use the guide to practice, which will teach you what you'll need to know.
For a detailed description of rounds see Section 5 (Problems) in the Google Code Jam Terms & Conditions

Do I have to solve the problems in any particular order?

You can answer the problems in any order you like. Looking at a problem does not start any timers, so you can read all of them at the start and solve them in the order of your choice. There are different point values for each input in each problem, and we generally give lower point values to the questions we think are the easiest.

How is the winner of a round determined?

See Section 6 (Judging and Scoring) in the Google Code Jam Terms & Conditions

Competing in Round: Tools

What programming languages can I use to solve the problems?

See Section 4 (Environment) in the Google Code Jam Terms & Conditions.

What development environments can I use?

You can use any development environment or text editor, including those that cost money. Bear in mind that the programming language you use must have a free compiler or interpreter as further explained in Section 4 (Environment) in the Google Code Jam Terms & Conditions.

What OS and browser should I use?

You are free to use whichever operating system you wish for solving the problems. We continually test the website on Linux, Windows and Mac OS to make sure it works on as many operating systems and browsers as possible. The site should work with most modern browsers; if you're having trouble with yours, please let us know and fall back to Chrome, Firefox 3+ or Internet Explorer 7+ while we examine your issue.

Can I use a phone to compete?

Yes, you can use your phone if you wish.

What programming languages would you recommend?

Many of our contestants use C++, Java and Python, though occasionally Python's slowness at dealing with large sets of numbers can pose a problem. Our contestants have used a wide variety of languages to compete in Code Jam, though we aren't certain that we'd recommend LOLCODE and Piet. See a site set up by one of our contestants, at http://go-hero.net/jam, for a look at what languages people used in previous Code Jams, and how that distribution changed in later rounds.

Can I use code that I don't write during the contest?

As long as you have a license to use it, and it was written before the contest, yes. Make sure to submit all code that you used, unless it comes from a standard library that's available online (in which case you should put a comment in your code to that effect). That means you can write your own helper code, or collect your own personal library of code, as long as the license terms of the code permit it. Some Code Jam contestants will have competed on an ACM ICPC team, and many of those teams have their own code books; check with your team's coach whether it's OK for you to use that code in a different context.

What other resources can I use?

You're welcome to use any documents written before the contest started, including web pages. However, discussing Code Jam problems with other contestants, or anyone else, during the contest is not allowed. Likewise you aren't permitted to write about the problems in a round until after the round is over.

What is considered cheating?

See section 9 (Disqualification) in the Google Code Jam Terms & Conditions and Section 6 (Disqualification) of the Additional Terms for Code Jam 2015.
Collaborating with anyone else during any round of the contest, with the exception of the qualification round, is strictly prohibited and will result in your disqualification. This includes discussing or sharing the problem statements or solutions with others. Participating with multiple accounts is also prohibited. If we believe that you have undermined the integrity of the contest, we reserve the right to disqualify you. Use your best judgment. If you have a question about whether something is allowed, please ask an administrator, either by clicking the "Ask a question" link during a contest or by mailing us at codejam@google.com.
If you suspect another contestant of cheating, please report it.

Competing in a Round: Submissions

What are the time limits and other rules surrounding submissions?

See section 5.2 (Time Limit) in the Google Code Jam Terms & Conditions.
Penalty Time = Time of the last submission that earned you points (time measured from start of contest) + four minutes for each incorrect Small submission (for Small inputs you eventually solve).
For example, if you have made the following submissions:
[17m10s] wrong submission for A-Small
[17m35s] wrong submission for A-Small
[18m15s] correct submission for A-Small (10 points)
[29m30s] wrong submission for B-Small
[30m59s] correct submission for C-Small (30 points)
[45m11s] correct submission for A-Large (15 points)
[59m45s] wrong submission for C-Large
...then your score will be 55, with 53m11s of penalty time (45m11s + 2*4m).
Note that we may have Input/Output sets that aren't Small or Large, and we might specify penalty rules for those sets.

How do I open the .in file that I downloaded?

The ".in" files are simply text files. You are required to write a program that takes the text from the .in file as input and produces some output (as defined by the problem statement). If you would like to look inside the .in file, you can open it in a text editor. Wordpad and Notepad++ will work, as will any other editor that understands UNIX endlines. Warning: Notepad will generally display .in files incorrectly.

What are the requirements for uploading source code files?

See section 5.5 (Submission Requirements) in the Google Code Jam Terms & Conditions.
You must upload all of your code in addition to any non-standard libraries you used to solve each Input/Output set. If you use a standard library that's available on the Internet, and it's too large to upload, put a comment in your source code explaining where the library is available.

What if I solve a problem by hand?

Instead of code, upload a text file briefly explaining that you solved the problem by hand. Google reserves the right to disqualify any submissions that we believe do not comply with the Terms.

What if I uploaded the wrong version of my source code, or uploaded an entirely different file?

See section 5.5 (Submission Requirements) in the Google Code Jam Terms & Conditions.

How can I confirm that I uploaded the right files?

You can double-check the submissions you've made by clicking the "View my submissions" link on the left panel of the contest page. This page will let you download the input, output and source code for each of your submissions. For submissions to Large Input/Output sets, only your most recent submission will be available. You can only download your output and source code if you have submitted them.

How will my submission be judged?

See Section 6 (Judging and Scoring) in the Google Code Jam Terms & Conditions.

How are real numbers treated in Code Jam?

Sometimes a decimal number will appear as part of an input file or a correct output file. This section describes how they work.
  • In output files:
    • The problem will specify if real numbers are treated specially, and will likely link to this FAQ answer. For example, in a problem where the correct output is "Case #1: 500 2.3", the problem may indicate that the second value doesn't have to be the exact string 2.3, but could be any number within 10-6; but it might not indicate that for the 500, in which case that would have to be exact. In that case, "Case #1: 500 2.30000001" would be accepted, but "Case #1: 500.0 2.3" would not.
    • Specially-treated real numbers must be expressed in decimal form, with the decimal point expressed as a.  character, not a, character.
    • Two specially-treated real numbers are considered equal if their absolute or relative difference is smaller than some constant amount, typically 10-6. More details follow.
    • Our judge program will accept real numbers using an "e" or "E" character to indicate exponential notation, like 5e6 or 1.0e9(but not like 1,0e9).
  • Unless the problem specifies otherwise, in input files:
    • Real numbers will be expressed in decimal form, with the decimal expressed as a.  character, not a,  character.
    • We will not use a "thousands" separator for integers or real numbers. One thousand will be expressed as 10001000.000 or something similar; but not as 1,000.
    • We will not use exponential notation.
  • The "absolute or relative difference" check is implemented by code equivalent to the following Python code:
    def IsApproximatelyEqual(x, y, epsilon):
      """Returns True iff y is within relative or absolute 'epsilon' of x.
    
      By default, 'epsilon' is 1e-6.
      """
      # Check absolute precision.
      if -epsilon <= x - y <= epsilon:
        return True
    
      # Is x or y too close to zero?
      if -epsilon <= x <= epsilon or -epsilon <= y <= epsilon:
        return False
    
      # Check relative precision.
      return (-epsilon <= (x - y) / x <= epsilon
           or -epsilon <= (x - y) / y <= epsilon)
          
  • Note that although real numbers in output files are sometimes considered equivalent to other real numbers, real numbers in input files are considered exact. For example, if you are asked to output whether the input is less than 2.0, and the number provided in the input file is 1.9999999, then "true" is the only acceptable result.
  • Some examples:
    • Unless the problem specifies otherwise, the following will not express real numbers in input files: 2,0001,56.022e23.
    • In an output file, if the correct output is 1000.0 and an absolute or relative difference of 10-6 is permitted, then the following will be considered correct: 1000.0011000999.9991000.1e310.00001e29.99999E3 (all are within a relative distance of 10-6). The following will be considered incorrect: 1000.0021,0001000,0999.998.
    • In an output file, if the correct output is 0.001 and an absolute or relative difference of 10-6 is permitted, then 0.001001 and0.000999 will be considered correct (both are within an absolute difference of 10-6).
    • In an output file, if the correct output is 1000 and there is nothing to indicate that token will be judged specially, then only the exact string 1000 will be considered correct.

Why might a submission be rejected?

Sometimes when you submit a malformed or over-sized submission, your submission will be rejected without being judged. You'll be able to resubmit in the time you have left without penalty. Here are some error messages you might receive when that happens, followed by the reason for the message:
  • No output file or empty file: Make sure you uploaded the output file.
  • Output file too large: For any data set, there is always a correct output under 200kB in size. If the uploaded output file is larger than 200kB, it will be immediately rejected.
  • Output file contains non-ASCII characters: The output file must be a text file consisting only of ASCII characters.
  • Output file contains invalid ASCII characters: Your submission contains ASCII characters that will never appear in a correct submission. If you can't see those characters, consider using a hex editor (or, if you're on Linux or Unix, cat -e) to look at your file.
  • Your output should start with 'Case #1: ': If you get this message, make sure you did not upload the source file in place of the output file, and that you're outputting case numbers properly. The first line of the output file should always start with "Case #1:", followed by a space or the end of the line.
  • Your output file contains 98 test cases instead of the expected 100: The number of times "Case #X:" appeared in your output file was different from the number of test cases in your input file. You may have submitted the wrong output file.
  • A source file you included appears not to be source code: We think your submission probably isn't actually source code. It didn't appear to be text, and it isn't on our list of recognized file types. If it really is source code, though, we don't mean to stop you; please click the 'contact us' link and we'll let it through.
  • Source file(s) too large: The total uploaded source file size may not exceed 100kB.
  • Your source files unzipped into more than 1048576 bytes: The total size of source files after they are unzipped may not exceed 1MB.
  • Your submitted file appears to be a zipfile, but is either nested in too many layers of recursion, or isn't really a zipfile: Our system identified one of your files as a zipfile, but had trouble unzipping it or found it inside another zipfile. Please fix the file, or (if you've received this message in error) click the "Ask a question" link to let us know.
  • The file you submitted as source code starts with 'Case #1:': Make sure you did not upload the output file in place of the source file.
  • The file you submitted as source code appears to be an input file: Make sure you did not upload the input file in place of the source file.
  • A source file you included appears to be either a Maple file or a Mathematica file: Neither Maple nor Mathematica has a free version that we're aware of. Sometimes people don't see the rule that forbids their use, so this is a helpful warning to let you know. If you aren't using either of them, or you think there is a free version, let us know through the "Ask a question" link.
  • Error in getting your source file(s). Please make sure you are not submitting an empty file: Either the source file is missing, or it is empty.
  • The contest is not running: Unfortunately, the contest ended before your submission finished uploading.
  • Please try again: something weird happened, which may be a bug in the platform. Try again, and if you're still having trouble then let us know through the "Ask a question" link.

How do I know if I solved a Small Input/Output set correctly?

A message will appear in yellow above the problem interface telling you whether you solved it correctly or not.

How do I know if I solved a Large Input/Output set correctly?

The judgments for the Large inputs will not be available until the end of the round. During the round, we will show your score and rank as though you (and everyone else) had successfully solved every Large set. At the end of the round, the scoreboard and dashboard will reflect the final judgment.

Dealing with 502 Errors

What is a 502 error?

We have recently received reports that a small fraction of contestants received these errors when they tried to submit their output. A 502 error is an indication that your submission didn't get to Google's servers, or arrived at our servers malformed. This can be caused by an incorrectly-configured proxy. All of our reports so far have come from China.

What should I do if I got a 502 error?

Try submitting from a different browser. If that doesn't work, try competing from https://gcj-prod.appspot.com/codejam. That's just an alias for https://code.google.com/codejam, but using it can solve the problem. If that doesn't work, you'll have to investigate your proxy settings.

How do I know for sure that I got a 502 error?


  • If you weren't directed here by an error message from the contest dashboard, you almost certainly didn't get a 502 error.
  • If you were, open the "Network" tab of your browser's "Developer Tools" (usually hitting F12 will do that).
  • Reload the dashboard. Notice that most requests are "GET" requests, and return code 200.
  • If your submission is still active, try to submit again. If it isn't still active, you can download and submit again, but we will not compensate you for consequences of the extra download.
  • The submission request will show code 502 if it was a 502 error, or a different code (probably 500 in case of failure, or 200 if it succeeds) otherwise.
The reason we can't tell you for sure on the dashboard whether you got a 502 is that the mechanism we use for submitting problems uses a hidden iframe, which doesn't expose the HTTP status code it received.

Is this a new problem?

We only learned about this error recently, so we're still gathering information about it. We believe that the steps listed above should resolve most 502 issues, but we won't know until we hear from more users who have had the same problem. If you have a 502 error (or we incorrectly tell you that you got a 502), please let us know at codejam@google.com. Include your geographic location, and let us know what worked and what didn't.

Competing in the Onsite Finals

For all questions relating to the onsite finals see Sections 3.5 (Final Round) and 4 (Attendance at the Final Round and Related Events) in the Additional Terms for Code Jam 2015. If you become a finalist additional details will be emailed to you prior to the round.

Can I attend the finals if I'm not a finalist?

No, unfortunately you can not.

Using the Code Jam Site

How do I change my nickname or flag after registering?

You can change that by visiting the "Update Profile" link on the front page at https://code.google.com/codejam.

Please note that your flag will be updated for the next contest you compete in but all previous scoreboard pages will remain unchanged.

Please note that you can only change your nickname once a year.

I registered with a new email address but want to use my old handle/nickname that I’ve used before in Code Jam.

Your handle/username/nickname can only be associated with one account. If you have ever competed in a previous Code Jam with that username, you will not be able to use it with a different email address. Your only option is to chose a new handle for your new account/email address.

However, if you only registered but never actually competed in a Code Jam with the handle you wish to use, you can send us an email from the old email address associated with that handle, asking us to "un-assign" that handle from that address. Once this is done, we will let you know and you can then use that handle for your new account.

Please keep in mind that competing with multiple email addresses is grounds for disqualification.

How can I see my status in the competition?

The contest dashboard, which is the page you go to in order to compete, has a number of ways of tracking your status.

At the top of the page, you can find several pieces of information. You can find the time left in the contest, your current rank, your score assuming you solved all Large sets correctly, and a link to the full contest scoreboard.

The "Submissions" panel on the left tells you which problems you've attempted, and your status on each. Problems you haven't attempted yet are shown as "No submissions". Input/Output sets for which you've downloaded the input but not yet uploaded an output are marked "In progress...". If no submission is currently in progress, Small sets may give a number of incorrect attempts, or say "Correct"; Large sets may say "Submitted" or "Time expired".

The "Submissions" panel also lets you see which Small Input/Output sets have been attempted by other users, and how many of them solved each correctly, for an at-a-glance check of what's likely to be the easiest remaining problem.

The "Top Scores" panel of the left shows the scores of the top 10 competitors. Those scores assume that all of their Larges were correct.

The "View my submissions" button on the left lets you see all of your submissions so far. You can see what their status is, and download the input, output and source code files for those submissions.

The contest scoreboard, which appears on a different page, lets you see details of each user's submissions, including time submitted and how many wrong attempts they have on Smalls. There are aggregate statistics about each Input/Output set at the bottom. There's also a Friends tab, for tracking the performance of your friends, and a Closest Competitors tab, which as far as we know is used by nobody... but it's there if you want it!

How can I watch a round?

Visit the contest's home page (e.g. https://code.google.com/codejam) while a round is running, and if you aren't eligible to compete you should see links to "Watch" and to "Read the Problems." If you want to see how a friend or friends are doing, click "Watch", make sure you're logged in with a Google Account, and go to the "Friends" tab. Go to the "Add Friend" area in the top-right and enter your friend's Code Jam nickname, case-sensitive. Then you can watch as your friend climbs the ranks to victory (hopefully).

How can I practice?

Before you ever participate in a round, it's a good idea to get used to how the platform works. Even if you have participated before, it can't hurt to try out a few extra problems, and sharpen your skills! Visit our Practice and Learn page, which is all about how to practice for Code Jam.

About Code Jam

Are the questions available in other languages? Can I use a translator?

Because programming problems often require very precise language, the risk of mistranslating a problem is too great, and the consequences are very severe: a single wrong word can give a very real disadvantage or advantage to contestants reading it. Because of this, we've decided not to make the problems available in more than one language. You may use the mechanical translator of your choice. Talking about the problems with other people, even translators, is not allowed.

How are Google Code Jam problems prepared?

We've described the process in our problem preparation guide.

Interacting With Other Participants

How can I find other Code Jam participants?

There are a few places to find other Code Jam participants. The primary one is our mailing list. You can also find other Code Jammers on our IRC channel.

How can I find other Code Jammers on your IRC channel?

You can chat with other competitors using the Channel #gcj on Freenode.

First you need a client. One convenient client is Chatzilla, which is an add-on to Firefox. Many other clients can be used for basic IRC chatting.

Next, you need a connection. First connect to a Freenode server. There are many servers to choose from, but we'll show you how to connect to chat.freenode.net.
  • Run: /server chat.freenode.net from inside your client.
  • Then type: /join #gcj — and you are in!
Finally, you need to register your nickname.

You can change nicknames using the command /nick 'nickname'. To register your current nickname, just type: /msg nickserv register 'password'.

To identify yourself as a registered user, log on to IRC using the same nickname and type: /msg nickserv identify 'password' to identify yourself as the owner of that name.

If your nickname has been taken the next time you sign on, read the following instructions to get it back.
  1. Type: /msg nickserv recover 'nickname' 'password'. This locks the nickname so no one else can use it, and boots existing users.
  2. Type: /msg nickserv release 'nickname' 'password'. This unlocks your account so you can use it.
  3. Finally use the usual /nick 'nickname' to reclaim your nickname.

Can I communicate with other participants during a round?

With the exception of the Qualification Round, you are not allowed to collaborate with other participants — or with anyone else, for that matter — during a contest. This includes discussing, sharing, or posting the problem statements or solutions. Any contestant found cheating or attempting to cheat will be disqualified.

Comments

Popular posts from this blog

AWS Cheat Sheet

Year in Review | Facebook New Year video | Facebook

FB New Year in Review How can I see, edit and share my Year in Review? Your Year in Review is a personalized video that lets you highlight and share your meaningful moments from this year. These moments can include photos and posts that you've shared or been tagged in. To see your Year in Review visit  facebook.com/yearinreview2016  or click  Watch Yours  on a Year in Review that has been shared by a friend. You may also see your Year in Review video in your News Feed, but it's only visible to you unless you share it. To share your Year in Review: Go to  facebook.com/yearinreview2016 Click  Share Video Select the audience  for the post Click  Post To edit your Year in Review before you share it: Go to  facebook.com/yearinreview2016 Click  Edit Video  and then choose the photos you want to appear in your video Click  Share Select the audience  for the post Click  Post You can also edit and share your video by clicking  Share Video  or  Edi

Why Upgrading to Terraform 1.0. Should be a Priority ?

  HashiCorp Terraform version 1.0, released this week, contains few new technical feature updates. But that's actually the point. The company is known for its unconventional philosophy on what constitutes a "version 1.0" product and has spent seven years updating, supporting and marketing the infrastructure-as-code tool without this designation. Other HashiCorp products such as  Nomad  container orchestration and  Vault  secrets management also spent long periods being used in production before reaching version 1.0. Terraform is used to define infrastructure resources using programming code, which DevOps teams can then automatically test and deploy alongside applications using the same processes. Terraform is among the most widely used such tools, with more than 100 million open source downloads to date. The HashiCorp-hosted Terraform Cloud has amassed 120,000 customers. Despite its widespread production use, each new version of Terraform over the last three years came wi