QOJ.ac

QOJ

Límite de tiempo: 1 s Límite de memoria: 256 MB Puntuación total: 100

#6750. 计算

Estadísticas

给定一个算术表达式。 将所有的 “?” 替换为 0 到 9 之间的整数。 求出你能得到的最大结果。 字符串中最多包含 2 个问号。 保证给定的每个整数都在 0 到 9 之间,且给定的字符串是一个合法的算术表达式。 以下是一些定义:

= ‘+’ | ‘-’

= ‘0’ | ‘1’ | ‘2’ | ‘3’ | ‘4’ | ‘5’ | ‘6’ | ‘7’ | ‘8’ | ‘9’ | ‘?’

= | | ‘(’ ‘)’

输入格式

第一行包含给定的字符串 $s$。 $s$ 的长度不超过 5000。

输出格式

在一行中输出你能得到的最大值。

样例

输入 1

?+?

输出 1

18

输入 2

(?+9)-(?+1)

输出 2

17

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.