The first round of original multi school training. E -- everyone cares a long long name

Title Description

In the Kingdom of Bears, the King Tommmmmmmmmmmmmmmmy has a very strange hobby: he dislike all names with length less than 1010! In fact every time he see who has a short name, he'd be so angry that he refuse to speak in the next 998244353998244353 days!

But Tommmmmmmmmmmmmmmmy the King is essential for the Kingdom of Bears, so the Minister of civil affair, Pneumonoultramicroscopicsilicovolcanoconiosis, announces that: every bear should have a long long name! Renaming is hard for bears, so Pneumonoultramicroscopicsilicovolcanoconiosis uses a sequence of methods to show the rules of renaming as follow:

If first letter of the name is not 'g', reverse the name, else append 'h' after the name.
If last letter of the name is not 'y' and first letter of the name is 'w', append 'j' after the name, else append 't' after the name.
If length of the name is not greater than 42, append 'u' after the name, else do nothing.
If last letter of the name is not 'v', reverse the name, else append 'd' after the name.
If length of the name is not greater than 43, append 'o' after the name, else append 'q' after the name.
If first letter of the name is not 'm', reverse the name, else reverse the name.
If last letter of the name is 'x', do nothing, else append 's' after the name.
If length of the name is less than 22, append 'n' after the name, else append 't' after the name.
If first letter of the name is not 'i', do nothing, else reverse the name.
If last letter of the name is 'c', append 'e' after the name, else append 'a' after the name.
If length of the name is not 42 and last letter of the name is 'v', append 'u' after the name, else do nothing.
If length of the name is not less than 47, append 'j' after the name, else reverse the name.
If first letter of the name is not 'v', append 'e' after the name, else append 'd' after the name.
If last letter of the name is 'y', append 'w' after the name, else reverse the name.
If first letter of the name is 'u', reverse the name, else append 'i' after the name.
If length of the name is not less than 32, append 'w' after the name, else do nothing.
If last letter of the name is not 'i' and first letter of the name is 'd', append 'a' after the name, else reverse the name.
If last letter of the name is not 'y', reverse the name, else do nothing.
If first letter of the name is 'y', append 'v' after the name, else reverse the name.
If length of the name is greater than 50, do nothing, else append 'm' after the name.
If last letter of the name is 't', append 'w' after the name, else append 'q' after the name.
If first letter of the name is 't', append 'e' after the name, else do nothing.
If length of the name is greater than 48, append 'l' after the name, else reverse the name.
If last letter of the name is 'y', append 'w' after the name, else reverse the name.
If length of the name is not less than 18 and first letter of the name is not 'b', reverse the name, else append 'c' after the name.
If length of the name is greater than 18, append 'y' after the name, else do nothing.
If last letter of the name is not 'g', append 'a' after the name, else reverse the name.
If first letter of the name is 'q', do nothing, else append 'i' after the name.
If last letter of the name is 'n' and length of the name is not less than 38, append 'o' after the name, else append 'v' after the name.
If first letter of the name is not 'n', do nothing, else append 'z' after the name.
If length of the name is 21 and first letter of the name is not 'm', append 'u' after the name, else append 'o' after the name.
If length of the name is 34, do nothing, else append 'z' after the name.
If first letter of the name is not 'r', reverse the name, else reverse the name.
If length of the name is greater than 25, append 'c' after the name, else reverse the name.
If first letter of the name is not 'u', append 'k' after the name, else append 'l' after the name.
If length of the name is less than 41, reverse the name, else append 'p' after the name.
If first letter of the name is not 'p', reverse the name, else append 'z' after the name.
If length of the name is less than 4 and last letter of the name is 'p', reverse the name, else append 'l' after the name.
If length of the name is not 16 and first letter of the name is 'w', append 'r' after the name, else append 'o' after the name.
If last letter of the name is 'c', append 'p' after the name, else append 'i' after the name.
If length of the name is not 20, append 'p' after the name, else reverse the name.
If last letter of the name is not 'b', reverse the name, else append 'p' after the name.
If first letter of the name is not 'c', append 'n' after the name, else append 'l' after the name.
If length of the name is not greater than 40, append 'd' after the name, else do nothing.
If first letter of the name is 'g', append 'y' after the name, else append 'i' after the name.
If last letter of the name is 'k', reverse the name, else append 'v' after the name.
If length of the name is not 20 and first letter of the name is not 'u', reverse the name, else reverse the name.
If length of the name is not greater than 46, append 'v' after the name, else append 'f' after the name.
If first letter of the name is not 'i', do nothing, else append 'z' after the name.
If length of the name is not less than 38, reverse the name, else append 'b' after the name.

But it is still very hard for bears to do the transforms precisely. So they ask you - a human who can use computer program - to solve the request. Can you help them?

Input format

Input contains single string s(1≤∣s∣≤50)s (1 \leq |s| \leq 50)s(1≤∣s∣≤50) consists of lowercase English letter - the original name your program need to operate.

Output format

Output the desired name in a single line.

input

winnie

tommmmmmmmmmmmmmmmy

pneumonoultramicroscopicsilicovolcanoconiosis

output

vidniansutwinnieoemqcaivozkloipvb

vpiolkcqmeoymmmmmmmmmmmmmmmmottustaiyavozniv

fpiolzoviaylqejatstpneumonoultramicroscopicsilicovolcanoconiosisqiwckpniv

Description / tips

The statement may be too narrow to show all content clearly. You are allowed to copy it from the website to local editor for convenience.

meaning of the title

  • Give you a string, and 50 operations, let you output the string after the operation

Title Solution

  • QAQ, I cry
  • The inspiration of this question comes from the three questions of Keep talking and nobody explodes in aim tech poorly prepared competition, but because the level of the author is low, the imitation is very poor.
  • The original intention of this topic is to write a parser to handle this content and translate it into code.
  • Of course, considering that if it is an input file, the difficulty of the topic (relatively speaking) is too high, so we put 50 sentences in the topic, hoping that everyone can show their own wisdom.
  • The methods are as follows:
    1. Call code hand to copy 50 sentences. Code complexity O (if there is no AC, the coder wants to hit someone).
    2. Write a parser to translate. Code complexity O (OK)
    3. Use the search and replace function of the editor to delete some useless words, such as "of the name", "after the name", and then copy / use the parser to translate. Code complexity O (feel OK).
    4. Further replacement shows that the order of this language is very close to that of most programming languages, even after a series of replacement, the parentheses can be removed
      All changed, just 50 semicolons. Code complexity O(50).
  • Here is a possible replacement sequence for C + +:
    • of ther name,after ther name,do nothing → ×
    • is greater than, is not greater than, is less than, is not less than → >, <=, <, >=
    • is, is not → ==, ! =
    • first letter, last letter → name.front(), name.back()
    • append → name +=
    • reverse the name → reverse(name.begin(), name.end())
    • If → if (
    • , → ;

AC-Code

#include <bits/stdc++.h>
using namespace std;
int main() {
	string name;
	cin >> name;
	if ((name.front() != 'g')) reverse(name.begin(), name.end());
	else name += 'h';
	if ((name.back() != 'y') && (name.front() == 'w')) name += 'j';
	else name += 't';
	if (!(name.size() > 42)) name += 'u';
	else;
	if ((name.back() != 'v')) reverse(name.begin(), name.end());
	else name += 'd';
	if (!(name.size() > 43)) name += 'o';
	else name += 'q';
	if ((name.front() != 'm')) reverse(name.begin(), name.end());
	else reverse(name.begin(), name.end());
	if ((name.back() == 'x'));
	else name += 's';
	if ((name.size() < 22)) name += 'n';
	else name += 't';
	if ((name.front() != 'i'));
	else reverse(name.begin(), name.end());
	if ((name.back() == 'c')) name += 'e';
	else name += 'a';
	if (!(name.size() == 42) && (name.back() == 'v')) name += 'u';
	else;
	if (!(name.size() < 47)) name += 'j';
	else reverse(name.begin(), name.end());
	if ((name.front() != 'v')) name += 'e';
	else name += 'd';
	if ((name.back() == 'y')) name += 'w';
	else reverse(name.begin(), name.end());
	if ((name.front() == 'u')) reverse(name.begin(), name.end());
	else name += 'i';
	if (!(name.size() < 32)) name += 'w';
	else;
	if ((name.back() != 'i') && (name.front() == 'd')) name += 'a';
	else reverse(name.begin(), name.end());
	if ((name.back() != 'y')) reverse(name.begin(), name.end());
	else;
	if ((name.front() == 'y')) name += 'v';
	else reverse(name.begin(), name.end());
	if ((name.size() > 50));
	else name += 'm';
	if ((name.back() == 't')) name += 'w';
	else name += 'q';
	if ((name.front() == 't')) name += 'e';
	else;
	if ((name.size() > 48)) name += 'l';
	else reverse(name.begin(), name.end());
	if ((name.back() == 'y')) name += 'w';
	else reverse(name.begin(), name.end());
	if (!(name.size() < 18) && (name.front() != 'b')) reverse(name.begin(), name.end());
	else name += 'c';
	if ((name.size() > 18)) name += 'y';
	else;
	if ((name.back() != 'g')) name += 'a';
	else reverse(name.begin(), name.end());
	if ((name.front() == 'q'));
	else name += 'i';
	if ((name.back() == 'n') && !(name.size() < 38)) name += 'o';
	else name += 'v';
	if ((name.front() != 'n'));
	else name += 'z';
	if ((name.size() == 21) && (name.front() != 'm')) name += 'u';
	else name += 'o';
	if ((name.size() == 34));
	else name += 'z';
	if ((name.front() != 'r')) reverse(name.begin(), name.end());
	else reverse(name.begin(), name.end());
	if ((name.size() > 25)) name += 'c';
	else reverse(name.begin(), name.end());
	if ((name.front() != 'u')) name += 'k';
	else name += 'l';
	if ((name.size() < 41)) reverse(name.begin(), name.end());
	else name += 'p';
	if ((name.front() != 'p')) reverse(name.begin(), name.end());
	else name += 'z';
	if ((name.size() < 4) && (name.back() == 'p')) reverse(name.begin(), name.end());
	else name += 'l';
	if (!(name.size() == 16) && (name.front() == 'w')) name += 'r';
	else name += 'o';
	if ((name.back() == 'c')) name += 'p';
	else name += 'i';
	if (!(name.size() == 20)) name += 'p';
	else reverse(name.begin(), name.end());
	if ((name.back() != 'b')) reverse(name.begin(), name.end());
	else name += 'p';
	if ((name.front() != 'c')) name += 'n';
	else name += 'l';
	if (!(name.size() > 40)) name += 'd';
	else;
	if ((name.front() == 'g')) name += 'y';
	else name += 'i';
	if ((name.back() == 'k')) reverse(name.begin(), name.end());
	else name += 'v';
	if (!(name.size() == 20) && (name.front() != 'u')) reverse(name.begin(), name.end());
	else reverse(name.begin(), name.end());
	if (!(name.size() > 46)) name += 'v';
	else name += 'f';
	if ((name.front() != 'i'));
	else name += 'z';
	if (!(name.size() < 38)) reverse(name.begin(), name.end());
	else name += 'b';
	cout << name << endl;
}
Published 203 original articles, praised 130, visited 20000+
Private letter follow

Keywords: less Programming

Added by uday on Mon, 02 Mar 2020 07:30:59 +0200