QOJ.ac

QOJ

Limite de temps : 2 s Limite de mémoire : 1024 MB Points totaux : 100

#702. 三重短信

Statistiques

Julia 喜欢和她的祖母聊天、玩乐高积木,以及发明她拥有必胜策略的双人纸牌游戏。然而最近,由于某种“大混乱”,她无法亲自与祖母交谈。取而代之的是,她们开始通过短信交流,但这是一个非常缓慢的过程,因为祖母打字非常慢,而且经常打错字母。更糟糕的是,祖母开始把每个单词写三遍,以便 Julia 可以纠正她的拼写错误。例如,如果祖母想写单词“hello”,她会写成“hellohellohello”。如果她打错了其中一个字母,它可能会被发送为“hellohrllohello”。

你的任务是编写一个程序,给定祖母发送的一条消息(其中可能有一个字母被改成了其他字母),找出原始单词。

输入格式

输入包含一个字符串 $s$,由小写英文字母组成 ($3 \le |s| \le 99$)。这是祖母发送的消息。保证该字符串是一个单词被重复写了三次的结果,其中可能有一个字母被改成了其他字母。

输出格式

输出一个字符串 $t$,即原始单词。

样例

样例输入 1

hellohrllohello

样例输出 1

hello

样例输入 2

hejhejhej

样例输出 2

hej

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.