22105_JavaneseCryptoanalysis

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

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

Pro.ID

22105

Title

Javanese Cryptoanalysis

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Javanese is the language of the people in the Central and Eastern parts of the island of Java, Indonesia. In 1926, a standard orthography using the English Alphabet was created for the Javanese language. This writing system uses all letters from A to Z. The ve letters A, E, I, O, and U are vowels, while all other letters are consonants. In Javanese words vowels and consonants always alternate. This property is quite useful when deciphering encrypted Javanese texts.

    A text s consists of words, each word contains only capital letters. Let's call text s legitimate if in each word of s vowels and consonants alternate (no two vowels and no two consonants are located next to each other).

    A simple substitution cipher is applied to a text s. That is, a bijection f : A -> A is chosen, where A is the set of capital letters. The encoded text t is obtained from s by substituting each letter c with f(c).

    You're given the encoded text t. Find any legitimate text s that can be encoded as t, or detect that there is no such legitimate s.

    输入

    The input file contains the encoded text t, a list of words separated by spaces and/or line breaks. Each word consists only of capital letters (A to Z).

    The input file contains no more than 100000 characters.

    输出

    Description

    Javanese is the language of the people in the Central and Eastern parts of the island of Java, Indonesia. In 1926, a standard orthography using the English Alphabet was created for the Javanese language. This writing system uses all letters from A to Z. The ve letters A, E, I, O, and U are vowels, while all other letters are consonants. In Javanese words vowels and consonants always alternate. This property is quite useful when deciphering encrypted Javanese texts.

    A text s consists of words, each word contains only capital letters. Let's call text s legitimate if in each word of s vowels and consonants alternate (no two vowels and no two consonants are located next to each other).

    A simple substitution cipher is applied to a text s. That is, a bijection f : A -> A is chosen, where A is the set of capital letters. The encoded text t is obtained from s by substituting each letter c with f(c).

    You're given the encoded text t. Find any legitimate text s that can be encoded as t, or detect that there is no such legitimate s.

    Input

    The input file contains the encoded text t, a list of words separated by spaces and/or line breaks. Each word consists only of capital letters (A to Z).

    The input file contains no more than 100000 characters.

    Output

    If the text t cannot be an encoded legitimate text, output only one word impossible.

    Otherwise, output any legitimate text s that can be encoded into t. Separate words of s with spaces and/or line breaks. All letters in s should be capital.

    Sample Input

    Sample #1
    O RISK LIP FOCUS LUCKY

    Sample #2
    NEERC

    Sample Output

    Sample #1
    A CODE FOR VALID FILES

    Sample #2
    impossible

    Source

    样例输入

    Sample #1
    O RISK LIP FOCUS LUCKY

    Sample #2
    NEERC

    样例输出

    Sample #1
    A CODE FOR VALID FILES

    Sample #2
    impossible

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部