IPSC Logo

Internet Problem Solving Contest

IPSC 2009

Problem C – Cryptic punchcards

Punch cards are an important part of programming history. Quoting Wikipedia, a punch card is a piece of stiff paper that contains digital information represented by the presence or absence of holes in predefined positions. Now almost an obsolete recording medium, punched cards were widely used throughout the 19th century for controlling textile looms and in the late 19th and early 20th century for operating fairground organs and related instruments. It was used through the 20th century in unit record machines for input, processing, and data storage. Early digital computers used punched cards as the primary medium for input of both computer programs and data, with offline data entry on key punch machines.

One of the most famous types of punch cards were IBM’s 80-column punch cards. Their width is the reason why even nowadays many terminals default to 80 columns of characters.

Various encodings were used to punch the data onto cards. One of the most famous ones is EBCDIC. Quoting the Jargon File, It exists in at least six mutually incompatible versions, all featuring such delights as non-contiguous letter sequences and the absence of several ASCII punctuation characters fairly important for modern computer languages. […] Hackers blanch at the very name of EBCDIC and consider it a manifestation of purest evil.

You probably already know where this leads to.

Problem specification

In this problem you will be given image files showing some punch cards. Imagine that you are several decades in the past. You actually have the same data punched on real paper punch cards. You take them and feed them into the machine…

Your task is to find out what the machine (most probably) read, and use that to determine the output you send us.

Input specification

The input is a set of image files numbered in order in which they should be fed into the machine.

Output specification

Send us a text file containing a single line with a single positive integer.