给定一个算术表达式。 将所有的 “?” 替换为 0 到 9 之间的整数。 求出你能得到的最大结果。 字符串中最多包含 2 个问号。 保证给定的每个整数都在 0 到 9 之间,且给定的字符串是一个合法的算术表达式。 以下是一些定义:
输入格式
第一行包含给定的字符串 $s$。 $s$ 的长度不超过 5000。
输出格式
在一行中输出你能得到的最大值。
样例
输入 1
?+?
输出 1
18
输入 2
(?+9)-(?+1)
输出 2
17
给定一个算术表达式。 将所有的 “?” 替换为 0 到 9 之间的整数。 求出你能得到的最大结果。 字符串中最多包含 2 个问号。 保证给定的每个整数都在 0 到 9 之间,且给定的字符串是一个合法的算术表达式。 以下是一些定义:
第一行包含给定的字符串 $s$。 $s$ 的长度不超过 5000。
在一行中输出你能得到的最大值。
?+?
18
(?+9)-(?+1)
17
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.
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: