-->
当前位置:首页 > 题库

PROGRAMMING:Eliminate ACM

Luz5年前 (2021-05-10)题库495
Xiao Li is a enthusiast of programming competition. Now he has encountered such a problem: given a string composed of only a, C and m, and the length is no more than 10000000. If there is an "ACM" substring in the string, then the "ACM" substring can be deleted automatically. After elimination, the following elements are moved forward and then become a new complete string. The new string continues to do so until it is eliminated into an empty string or there are no more "ACM" substrings. The task of GGS is to determine whether a given string can be deleted as an empty string. If so, output yes, otherwise output No. Of course, Xiao Li can finish this simple problem very quickly, so do you~
###Input format:
Enter a string containing only a, C, m (upper case) and not null.
###Output format:
Output yes or no, the output occupies a single line.
###Input sample - 1:
Here is a set of inputs. For example:
```in
ACM
```
###Output sample - 1:
The corresponding output is given here. For example:
```out
YES
```
###Input sample - 2:
Here is a set of inputs. For example:
```in
AACMCM
```
###Output example - 2:
The corresponding output is given here. For example:
```out
YES
```
###Input sample - 3:
Here is a set of inputs. For example:
```in
ACACCM
```
###Output example - 3:
The corresponding output is given here. For example:
```out
NO
```







answer:If there is no answer, please comment