QOJ.ac

QOJ

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

#12185. 表情符号

Statistiques

Emma 是一名大学生,她经常在自己喜欢的社交媒体上发布消息。该平台支持多种表情符号(emoticon)——即使用字符组成的表情图案。有一天,她注意到消息中的一些表情符号会被平台自动转换为对应的 emoji。例如,如果她发送消息 “Hello ;-)” 到平台,实际显示内容将是 “Hello ”。如果消息中有两个或多个表情符号重叠,系统总是优先转换最左侧的表情符号。

以下是该社交媒体支持的表情符号完整列表:

类型 表情符号 Emoji 含义
Western :) 🙂 Smiley
Western :-) 🙂 Smiley
Western :-( ☹️ Frown
Western ;-) 😉 Wink
Western xD 😆 Laughing
Eastern ^_^ 🙂 Smiley
Eastern -_- 😑 Expressionless
Eastern ^o^ 🤩 Screwed
Eastern ^^; 😓 Sweating
Eastern (..) 😔 Looking down

她总是使用以下“可见”字符和空格字符 “ ”:

  • 数字:0123456789
  • 大写字母:ABCDEFGHIJKLMNOPQRSTUVWXYZ
  • 小写字母:abcdefghijklmnopqrstuvwxyz
  • 符号:!"#$%&'()*+,-./:;<=>?@[\]^_{|}~`

今天,就在发布消息之前,她不小心将消息中所有出现的某个字符替换成了另一个字符。这些字符包括空格,她也可能将某个字符替换成了它自身,从而不产生任何影响。现在,她想知道在平台将表情符号转换为 emoji(每个 emoji 计为 1 个字符)后,消息的长度是多少。

你能帮她找出消息长度的最小值和最大值吗?

输入格式

输入包含一行 Emma 的原始文本(在她不小心替换字符之前)。文本最多包含 100 个字符,由上述定义的可见 ASCII 字符和空格字符组成。文本不为空,且其首尾字符均为可见字符。

输出格式

输出两个整数,分别表示在消息中的表情符号被转换为 emoji 后,可能的消息长度的最小值和最大值。

样例

输入格式 1

Hello ;-) world ^^.

输出格式 1

15 19

输入格式 2

xDEoE_E

输出格式 2

4 7

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.