22483_MorseCodeGeneration

2022-5-16 18:22| 发布者: Hocassian| 查看: 31| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506481982000-Problem List-采集的数据-后羿采集器.html

Pro.ID

22483

Title

Morse Code Generation

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22483

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1200/400 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Morse Code Generation

     

    Below is a table of the characters which will be used for testing and their Morse Code representation.

    A  .-		J  .---	S  ...		1  .----
    B  -...	K  -.-		T  -		2  ..---
    C  -.-.	L  .-..	U  ..-		3  ...--
    D  -..		M  --		V  ...-	4  ....-
    E  .		N  -.		W  .--		5  .....
    F  ..-.	O  ---		X  -..-	6  -....
    G  --.		P  .--.	Y  -.--	7  --...
    H  ....	Q  --.-	Z  --..	8  ---..
    I  ..		R  .-.		0  -----	9  ----.

    输入

    A text file consisting of a character followed by its Morse code representation as a series of '-' and '.', one character to a line. This data is terminated by a '@' in column 1. The code table is followed by an integer on a line by itself indicating the transmission speed in words-per-minute. This is followed by the message to be sent. For the purpose of transmission, end-of-line characters are _not_ to be sent.

    输出

    Description

    Morse Code Generation

     

    Below is a table of the characters which will be used for testing and their Morse Code representation.

    A  .-		J  .---	S  ...		1  .----
    B  -...	K  -.-		T  -		2  ..---
    C  -.-.	L  .-..	U  ..-		3  ...--
    D  -..		M  --		V  ...-	4  ....-
    E  .		N  -.		W  .--		5  .....
    F  ..-.	O  ---		X  -..-	6  -....
    G  --.		P  .--.	Y  -.--	7  --...
    H  ....	Q  --.-	Z  --..	8  ---..
    I  ..		R  .-.		0  -----	9  ----.
    Input
    A text file consisting of a character followed by its Morse code representation as a series of '-' and '.', one character to a line. This data is terminated by a '@' in column 1. The code table is followed by an integer on a line by itself indicating the transmission speed in words-per-minute. This is followed by the message to be sent. For the purpose of transmission, end-of-line characters are _not_ to be sent.
    Output

    A copy of the message to be sent, one character per line followed by a listing, as integers of the number of milliseconds the transmitter will be on and the number of milliseconds the transmitter will be off to result in the desired speed. Each time is to be preceeded by at least one character of white space (space, tab or cr-lf) and followed by one character of white space. Sound times will be followed by a single character 'S' and no sound times will be followed by a single character 'N". The required inter character spacing will be the last entry in a line. Each line will be terminated by a new line character.

    In determining the speed of transmission of messages in Morse code, the controlling element is the dot, '.'. The dash, '-', is three dots in length. Within a character the space between sounds is considered to be a dot in length. The inter-character space is at least a dash in length and the interword space in three dashes in length. It is assumed that each word is five characters in length.

    For transmission speeds below thirteen (13) words-per-minute, the individual characters are formed using the dot length of thirteen words per minute, with the extra time placed between each character. Thus at 6.5 words per minute, the inter character space is twice (?) that of a 13 wpm transmission.

    Above 13 wpm, both the character time and the inter character spacing are controlled by the speed.

    For the purpose of this problem assume that the average character is eight (8) dots in length. Thus for a standard of 13 wpm transmission there would be 65+13=78 characters per minute or 78*8=626 dot spaces per minute. You are to use this value for the basis of your program.

    Sample Input
    5 words per minute
    Sample Output
    A   15 S 15 N 45 S 450 N
        585 N
    B   45 S 15 N 15 S 15 N 15 S 15 N 15 S 450 N
    A   15 S 15 N 45 S 450 N
    D   45 S 15 N 15 S 15 N 15 S 450 N
        585 N
    B   45 S 15 N 15 S 15 N 15 S 15 N 15 S 450 N
    O   45 S 15 N 45 S 15 N 45 S 450 N
    Y   45 S 15 N 15 S 15 N 45 S 15 N 45 S 450 N
    Source

    样例输入

    5 words per minute

    样例输出

    A   15 S 15 N 45 S 450 N
        585 N
    B   45 S 15 N 15 S 15 N 15 S 15 N 15 S 450 N
    A   15 S 15 N 45 S 450 N
    D   45 S 15 N 15 S 15 N 15 S 450 N
        585 N
    B   45 S 15 N 15 S 15 N 15 S 15 N 15 S 450 N
    O   45 S 15 N 45 S 15 N 45 S 450 N
    Y   45 S 15 N 15 S 15 N 45 S 15 N 45 S 450 N

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部