Loading...

Във форума е въведено ограничение, което позволява на потребителите единствено да разглеждат публикуваните въпроси.

wisdom avatar wisdom 1 Точки

Regular Expressions - More Exercise / 4. Santa's Secret Helper

Здравейте, изписвами това съобщение на един тест:
 

The process executing your submission for this test may not have received the output successfully. Please try to submit again the same solution. If the result does not change, then search the error in the submission itself.

и ми дава 88/100.

Субмитнах няколко пъти и пак същото.
Това е кода:

https://pastebin.com/4n4wP8gJ

Това е условието на задачата.

1.Santa's Secret Helper

After the successful second Christmas, Santa needs to gather information about the behavior of children to plan the presents for next Christmas. He has a secret helper, who is sending him encrypted information. Your task is to decrypt it and create a list of the good children.

You will receive an integer, which represents a key, and afterward some messages, which you must decode by subtracting the key from the value of each character. After the decryption, to be considered a valid match, a message should:

  • Have a name, which starts after '@' and contains only letters from the Latin alphabet
  • Have a behavior type - "G"(good) or "N"(naughty) and must be surrounded by "!" (exclamation mark).

The order in the message should be: child’s name -> child’s behavior. They can be separated from the others by any character except: '@', '-', '!', ':' and '>'.

You will be receiving messages until you are given the “end” command. Afterward, print the names of the children, who will receive a present, each on a new line.

Input / Constraints

  • The first line holds n – the number which you have to subtract from the characters – integer in the range [1…100];
  • On the next lines, you will be receiving encrypted messages.

Output

Print the names of the children, each on a new line

Examples

Input

Output

Comments

['3',

'CNdwhamigyenumje$J$',

'CEreelh-nmguuejnW$J$',

'CVwdq&gnmjkvng$Q$',

'end']

Kate

Bobbie

We receive three messages and to decrypt them we use the key:

First message has decryption key 3. So we substract from each characters code 3 and we receive:

@Kate^jfdvbkrjgb!G!

@Bobbie*kjdrrbgk!G!

@Stan#dkjghskd!N!

They are all valid and they contain a child’s name and behavior – G for good and N for naughty.

Input

Output

Comments

['3',

'N}eideidmk$'(mnyenmCNlpamnin$J$',

'ddddkkkkmvkvmCFrqqru-nvevek$J$nmgievnge',

'ppqmkkkmnolmnnCEhq/vkievk$Q$',

'yyegiivoguCYdohqwlqh/kguimhk$J$',

'end']

Kim

Connor

Valentine

We receive four messages.

They are with key 3:

Kzbfabfajh!$%jkvbkj@Kim^jkfk!G!

aaaahhhhjshsj@Connor*ksbsbh!G!kjdfbskdb

mmnjhhhjklijkk@Ben,shfbsh!N!

vvbdffsldr@Valentine,hdrfjeh!G!

Тагове:
0
Fundamentals Module
Frostspell09 avatar Frostspell09 1 Точки

Similar to other supercharacters such as? * +, a dot in a character class matches only one dot. The reason for this is that there is no purpose in having a character match every character in a character class, since if that were the case. There would be no need for a character class, and the same geometry dash lite logic applies to the other super characters.

0
28/02/2024 10:44:59
Можем ли да използваме бисквитки?
Ние използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Можете да се съгласите с всички или част от тях.
Назад
Функционални
Използваме бисквитки и подобни технологии, за да предоставим нашите услуги. Използваме „сесийни“ бисквитки, за да Ви идентифицираме временно. Те се пазят само по време на активната употреба на услугите ни. След излизане от приложението, затваряне на браузъра или мобилното устройство, данните се трият. Използваме бисквитки, за да предоставим опцията „Запомни Ме“, която Ви позволява да използвате нашите услуги без да предоставяте потребителско име и парола. Допълнително е възможно да използваме бисквитки за да съхраняваме различни малки настройки, като избор на езика, позиции на менюта и персонализирано съдържание. Използваме бисквитки и за измерване на маркетинговите ни усилия.
Рекламни
Използваме бисквитки, за да измерваме маркетинг ефективността ни, броене на посещения, както и за проследяването дали дадено електронно писмо е било отворено.