Lockheed Martin Code Quest Academy
Reference Materials

Frequently Asked Questions

How does the website work?

To solve each problem, you will need to write a computer program that reads input from the standard input channel and prints the expected output to the console. Each problem describes the format of the input and the expected format for the output. When you have finished your program, you can submit the source code for your program to the website. The website will compile and run your code, and you will be notified if your answer is correct or incorrect. If you're not sure how to start with your solutions, take a look at the practice problem Hello World; it contains pre-written solutions that can be used as a foundation for other problems.

Who is judging our answers?

The website handles all of the judging is automatically. The website will compile and run your code, then compare your program’s output to the expected official output. If the outputs match exactly, you will be given credit for answering the problem correctly.

How is each problem scored?

Each problem is assigned a point value based on the difficulty of the problem. When the website runs your program, it will compare your program’s output to the expected judging output. If the outputs match exactly, you will be given the points for the problem. There is no partial credit; your outputs must match exactly. If you are being told your answer is incorrect and you are sure it’s not, double check the formatting of your output, and make sure you don’t have any trailing whitespace or other unexpected characters.

I don't understand the problem. How can I get help?

If you are having trouble understanding a problem, you can email us for assistance using the contact button at the end of this page. Please don't send your solution over email, as most attachments get blocked by our security systems and we won't see them. If you let us know what problem you're working on and the time and date of your last attempt at that problem, we should be able to find your solution within our judging system. Note that we usually won't give full solutions out straightaway, but we will try to give you a hint in the right direction.

My program works with the sample input/output, but it keeps getting marked as incorrect! Why?

Please note that the official inputs and outputs used to judge your answers are MUCH larger than the sample inputs and outputs provided to you. These inputs and outputs cover a wider range of test cases. The problem description will describe the limits of these inputs and outputs, but your program must be able to accept and handle any test case that falls within those limits. All inputs and outputs have been thoroughly tested by our problem development team, and do not contain any invalid inputs.

I can't figure out why our answer is incorrect. What are we doing wrong?

Common errors may include:

  • Incorrect formatting - Double check the sample output in the problem and make sure your program has the correct output format.
  • Incorrect rounding - See the next section for information on rounding decimals.
  • Invalid numbers - 0 (or 0.0, 0.00, etc.) is NOT a negative number. 0 may be an acceptable answer, but -0 is not.
  • Extra characters - Make sure there is no extra whitespace at the end of any line of your output. Trailing spaces are not a part of any problem’s output.
  • Decimal format - We use the period (.) as the decimal mark for all numbers.

If these tips don’t help, feel free to email us using the contact button below.

I get an error when submitting my solution.

When submitting a solution, only select the source code for your program (depending on your language, this may include .java, .cs, .cpp, or .py files). Also make sure that the name of the file does not contain spaces or other non-alphanumeric characters (e.g. “Prob01.java” is ok, but “Prob 01.java” and “Bob’sSolution.java” are not). If uploading a Java solution, you also need to make sure that the name of the file matches the name of your class (for example, a file named "HelloWorld.java" should contain a "public static class HelloWorld" declaration).

Can I get solutions to these problems?

Yes! Please email us using the contact button below for solutions and other questions about these problems.

Mathematical Information

Rounding

Some problems will ask you to round numbers. All problems use the “half up” method of rounding unless otherwise stated in the problem description. Most likely, this is the sort of rounding you learned in school, but some programming languages use different rounding methods by default. Unless you are certain you know how your programming language handles rounding, we recommend writing your own code for rounding numbers based on the information provided in this section.

With "half up" rounding, numbers are rounded to the nearest integer. For example:

  • 1.49 rounds down to 1
  • 1.51 rounds up to 2

The “half up” term means that when a number is exactly in the middle, it rounds to the number with the greatest absolute value (the one farthest from 0). For example:

  • 1.5 rounds up to 2
  • -1.5 rounds down to -2

Rounding errors are a common mistake; if a problem requires rounding and the contest website keeps saying your program is incorrect, double check the rounding!

Trigonometry

Some problems may require the use of trigonometric functions, which are summarized below. Most programming languages provide built-in functions for sin X, cos X, and tan X; consult your language's documentation for full details. Unless otherwise stated in a problem description, it is strongly recommended that you use your language's built-in value for pi whenever necessary.

Trigonometric Formulae: sin X = A/C ; cos X = B/C ; tan X = A/B = (sin X)/(cos X) ; A^2 + B^2 = C^2 ; (degrees * pi) / 180 = radians
US ASCII Table

The inputs for all Code Quest® problems make use of printable US ASCII characters. Non-printable or control characters will not be used in any problem unless explicitly noted otherwise within the problem description. In some cases, you may be asked to convert characters to or from their numeric equivalents, shown in the table below.

Binary Decimal Character Binary Decimal Character Binary Decimal Character
010000032(space)100000064@110000096`
010000133!100000165A110000197a
010001034"100001066B110001098b
010001135#100001167C110001199c
010010036$100010068D1100100100d
010010137%100010169E1100101101e
010011038&100011070F1100110102f
010011139'100011171G1100111103g
010100040(100100072H1101000104h
010100141)100100173I1101001105i
010101042*100101074J1101010106j
010101143+100101175K1101011107k
010110044,100110076L1101100108l
010110145-100110177M1101101109m
010111046.100111078N1101110110n
010111147/100111179O1101111111o
0110000480101000080P1110000112p
0110001491101000181Q1110001113q
0110010502101001082R1110010114r
0110011513101001183S1110011115s
0110100524101010084T1110100116t
0110101535101010185U1110101117u
0110110546101011086V1110110118v
0110111557101011187W1110111119w
0111000568101100088X1111000120x
0111001579101100189Y1111001121y
011101058:101101090Z1111010122z
011101159;101101191[1111011123{
011110060<101101192\1111011124|
011110161=101110193]1111101125}
011111062>101111094^1111110126~
011111163?101111195_
Terminology

Throughout this website, we will describe the inputs and outputs your programs will receive. To avoid confusion, certain terms will be used to define various properties of these inputs and outputs. These terms are defined below.

  • An integer is any whole number; that is, a number with no decimal or fractional component: -5, 0, 5, and 123456789 are all integers.
  • A decimal number is any number that is not an integer. These numbers will contain a decimal point and at least one digit after the decimal point. -1.52, 0.0, and 3.14159 are all decimal numbers.
  • Decimal places refer to the number of digits in a decimal number following the decimal point. Unless otherwise specified in a problem description, decimal numbers may contain any number of decimal places greater or equal to 1.
  • A hexadecimal number or string consists of a series of one or more characters including the digits 0-9 and/or the uppercase letters A, B, C, D, E, and/or F. Lowercase letters are not used for hexadecimal values in this contest.
  • Positive numbers are those numbers strictly greater than 0. 1 is the smallest positive integer; 0.000000000001 is a very small positive decimal number.
  • Non-positive numbers are all numbers that are not positive; that is, all numbers less than or equal to 0.
  • Negative numbers are those numbers strictly less than 0. -1 is the greatest negative integer; -0.000000000001 is a very large negative decimal number.
  • Non-negative numbers are all numbers that are not negative; that is, all numbers greater than or equal to 0.
  • Inclusive indicates that the range defined by a given value (or values) includes that/those value(s). For example, the range “1 to 3 inclusive” contains the numbers 1, 2, and 3.
  • Exclusive indicates that the range defined by a given value (or values) does not include that/those values. For example, the range “0 to 4 exclusive” includes the numbers 1, 2, and 3; 0 and 4 are not included.
  • Date and time formats are expressed using letters in place of numbers:
    • HH indicates the hours, written with two digits (with a leading zero of needed). The problem description will specify if 12- or 24-hour formats should be used.
    • MM indicates the minutes for times or the month for dates. In both cases, the number is written with two digits (with a leading zero if needed; January is 01).
    • YY or YYYY is the year, written with two or four digits (with a leading zero if needed).
    • DD is the date of the month, written with two digits (with a leading zero if needed).
Contact Us

If you prefer to reach out to our support team, feel free to contact us!

Contact our Email Support