Sign in
 
 

Frequently Asked Questions

Please carefully read the Google Code Jam Terms & Conditions and Contest Rules For Code Jam 2017 first, as many of your questions regarding eligibility, contest structure, onsite Finals, prizes, grounds for disqualification and more, are addressed there.


How do I Register?

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

Competing in a Round

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 [email protected] 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 3 (Contest Structure) in the Contest Rules for Code Jam 2017.

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 4 (Judging and Scoring) in the Google Code Jam Terms & Conditions.

Competing in a Round: Tools

What programming languages can I use to solve the problems?

See Section 4.1, B (Programming Language, Code, and Compiler) in the Contest Rules for Code Jam 2017.

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.1, B (Programming Language, Code, and Compiler) in the Contest Rules for Code Jam 2017.

If you do use an online integrated development environment (IDE), it is your responsibility to make sure nobody else can see your code during the Round. Be aware that for some popular online IDE websites, your code is publicly visible by default; in that case, you must change that setting so that your code for a Round is not publicly visible while that Round is still in progress.

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.

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.

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 is considered cheating?

See section 7 (Disqualification) in the Google Code Jam Terms & Conditions and Section 7 (Disqualification) of the Contest Rules for Code Jam 2017.

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 during the contest. 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 emailing us at [email protected].

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 4.2, B (Time Limit) of the Contest Rules for Code Jam 2017.

Penalty Time = Your penalty time for a round in Code Jam or Distributed Code Jam is equal to the time it took you to submit your last correct solution measured from the start of the round, plus 4 minutes for each incorrect solution you submitted for small inputs you eventually solved.

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 many times can I submit each set?

See section 4.2, C and D of the Contest Rules for Code Jam 2017.

When you download an input, you will be given the opportunity to upload an output.

Small datasets: You may upload a single output and you will know immediately whether or not it was correct. If you do not upload an output within the 4 minute window, or you upload an output that is judged Incorrect, your attempt for that input will end, and you will incur a 4 minute penalty (see above). However, once that happens, you may download a new Small input, and so on. Once you upload a correct output, you will not be able to download a new input or upload a new output for the rest of the contest.

Large datasets: When you download the input, you will have 8 minutes to upload outputs. Only the last output you upload during this time will be judged, and you will only know the result at the end of the contest. You can never download a new input. You can only upload output attempts during the 8 minute window following you starting the download of the input.

Note that if you use one solution to correctly solve the Small, and then you develop a new solution that you want to use for the Large, you will not be able to download a new Small input to test it. For problems with only one answer per test case, you can use your previously accepted Small output as a standard. However, for problems with multiple acceptable answers per test case, this strategy may not work, since your new solution might produce a different correct result.

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.

Our Quick-Start Guide has more information on this topic.

What are the requirements for uploading source code files?

See section 4.2, A (Submission Requirements) in the Contest Rules for Code Jam 2017.

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. If you solve a problem by hand, briefly explain how you solved the problem. Google reserves the right to disqualify any submissions that we believe do not comply with the Terms.

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 4.2, E (Submission Errors and Discrepancies) in the Contest Rules for Code Jam 2017.

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 4 (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 1000, 1000.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,000, 1,5, 6.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.001, 1000, 999.999, 1000., 1e3, 10.00001e2, 9.99999E3 (all are within a relative distance of 10-6). The following will be considered incorrect: 1000.002, 1,000, 1000,0, 999.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 and 0.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 [email protected]. 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 Section 5 (Attendance at the Final Round and Related Events) in the Contest Rules for Code Jam 2017. 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 cannot.

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.

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 Past Problems 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 and our social channels on Google+, Facebook, Twitter and YouTube. 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' 'email'.

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'. You must run this command twice. This unlocks your account so you can use it.
  3. Finally use the usual /nick 'nickname' to reclaim your nickname.

Consider asking in the #freenode channel if you need help.

Remember that you are not allowed to discuss problems with other contestants during a round, except for during the Qualification Round. Even then, we ask that you avoid giving away entire answers to the entire IRC channel!