#B. 【GESP三级模拟题】消消乐

    Type: Default 1000ms 256MiB

【GESP三级模拟题】消消乐

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

一个字符串全部由小写字母 'a' ~ 'z' 构成,其中字符 'a''c' 是粘性字符,也就是 'a' 可以替换为 'c' 使用,同时 'c' 也可以替换为 'a' 使用。对于这个字符串,如果存在两个及以上的相同的 'a''c' 字符子串,则可以消去该子串,即消去连续的粘性字符。存在其他字符的连续子串不用消去,如 "bbcd",其中的 "bb"不用消去,但是对于字符串 "baacadad",消去后为 "bdad"

输入格式

输入一行满足上述要求的字符串。

输出格式

输出消去粘性字符后的字符串。

样例输入输出

baacadad
bdad
ababcdab
ababcdab

数据范围

字符串长度不大于 10610^6

GESP三级模拟题

Not Claimed
Status
Done
Problem
5
Open Since
2024-12-4 0:00
Deadline
2024-12-7 23:59
Extension
24 hour(s)