Felix Halim .NET |  |

| Enter your search terms Submit search form

Story | Research | Programming | Scripts | Member | Miscellaneous

### ACM/ICPC Indonesia National Contest 2007 - Qualification

## Problem C

# No Pause Telegraph

Time Limit: 1s
Several hundreds years ago in a country, there was a war between the colonialist and the military of the country. In the war, telegraph machine was used to communicate between the country and its allied cities around the country. The Morse code was used to send messages through telegraph machine. In Morse, letters are represented only by "." (dot) and "-" (dash). Between letters there is a pause to avoid mistranslation of letters.
In that era with the popularity of telegraph machine, there was wariness that the enemy could read the messages, if the messages were accidentally sent to them. Being aware of the threat, a machine was created to encode the messages. It was called No Pause Telegraph. This new telegraph machine was similar to the regular machine, only that the machine encoded the messages with no pause between letters.
After doing some researches on old relics, our archeologist has analyzed the code being used successfully. The archeologist so far has found 7 letters that been used on the found relics, those are:

    A	.--	dot dash dash
    B	-.	dash dot
    C	---	dash dash dash
    D	..	dot dot
    E	--..	dash dash dot dot
    F	--.-	dash dash dot dash
    G	.-.	dot dash dot

Your task is to translate several messages encoded by the machine on the remaining relics. You should be careful that any ambiguousity may arise when translating those messages. For example: If the code for X were "." and the code for Y were "..", then two dots in a row could be either XX or Y. For this particular reason, you should output only the least alphabetical solution.

## Input Specification

Each line of input is a code encoded by No Pause Telegraph. The line will consists of only characters of . (dot(s)) and - (dash(es)).

## Output Specification

For each line of input, print the least alphabetical possible message in one line. If there is no possible message, print "could not be translated" (without quotes).

## Sample Input

    .---.-
    .---.---..--..--.-.-.

## Sample Output

    could not be translated
    ABCDEFG

Problem Setter: Bong Win Ce

Kembali ke pembahasan soal ini

Lihat problem lain:

1. The Chosen Sub Matrix
2. Avoiding Financial Nightmare
3. No Pause Telegraph
4. Burger, French Fries, Soft Drink
5. Taxi!

`© Felix Halim 2009 (Loaded in 0.11975 secs)`

    Timeline:
    start_time (diff_time_with_previous) tree_structure
    0.00000 (0.00000) Total
    0.00003 (0.00003) -Logging Request
    0.00005 (0.00003) --Creating fhnet PDO...
    0.11168 (0.11163) --fhnet PDO created
    0.11172 (0.00004) --Statement created
    0.11894 (0.00722) --Statement executed

    Summary:
    start_time (duration) section_name
    0.00000 (0.11979) : Total
    0.00003 (0.11897) : Logging Request