問題一覧 > 通常問題

No.193 Expression on a Cylinder

レベル : / AI推定難易度 : 189 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 259
作問者 : kzyKT
お気に入りにしたユーザー ProblemId : 461 / 自分の提出
問題文最終更新日: 2026-06-25 16:08:29
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder open 2015 small (順位表) の他の問題:

Problem Statement

A mathematical expression is written on the side of a cylinder so that its end connects to its beginning.
Cut the cylinder open at any one position between two characters of your choice to form an expression.
Here, the expression must not begin or end with an operator.
Leading zeros$(012,003$ and other notations of numbers starting with $0$$)$ are allowed.
Find the maximum value of the result of the expression obtained by cutting the cylinder open.
Notation with consecutive operators, such as 1+-1, is not given.

Input

$S$

$S$ is a string consisting only of digits$,$ or $+,-$
$3 \le |S| \le 10$

It contains at least $1$ operator.
The input is given such that at least $1$ valid expression can be formed.

Output

Output the maximum value.

Sample

Sample 1
Input
1+1
Output
2

The $3$ expressions $1+1,+11,11+$ can be formed, but since an expression must not begin or end with an operator, only $1+1$ is valid.

Sample 2
Input
1+111
Output
112

Sample 3
Input
10+4-1+15
Output
514

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。