4 人解决,8 人已尝试。
5 份提交通过,共有 24 份提交。
8.3 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
Polygon is a game for one player that starts on a polygon with +
(addition) or the symbol *
(product). The edges are numbered from
Write a program that, given a polygon, computes the highest possible score and lists all the edges that, if removed on the first move, can lead to a game with that score.
Your program is to read from standard input. The input describes a polygon with t
(representing +
) or the letter x
(representing *
).
For any sequence of moves, vertex labels are in the range
Your program is to write to standard output. On the first line your program must write the highest score one can get for the input polygon. On the second line it must write the list of all edges that, if removed on the first move, can lead to a game with that score. Edges must be written in increasing order, separated by one space.
4 t -7 t 4 x 2 x 5
33 1 2
4 人解决,8 人已尝试。
5 份提交通过,共有 24 份提交。
8.3 EMB 奖励。