2248A You Delete, I Delete
本题活力0.23按难度、完成结果与训练证据估算
算法如山行则将至
题目描述
Alice and Bob are given a binary string∗
s
of length n
. It contains at least one 0
and at least one 1
.
They each perform exactly one operation in the following order:
First, Alice chooses an occurrence of 0
in s
and deletes it.
Then, Bob chooses an occurrence of 1
in the resulting string and deletes it.
Alice wants the final string to be lexicographically†
as large as possible, while Bob wants it to be lexicographically as small as possible. Determine the final string if both players act optimally.