73 人解决,169 人已尝试。
91 份提交通过,共有 867 份提交。
5.5 EMB 奖励。
单点时限: 2.0 sec
内存限制: 256 MB
After learnt the Principles of Compiler,partychen thought that he can solve a simple expression problem.So he give you strings of less than 100 characters which strictly adhere to the following grammar (given in EBNF):
A:= ‘(‘ B’)’|’x’.
B:=AC.
C:={‘+’A}.
Can you solve them too?
The first line of input gives the number of cases, N(1 ≤ N ≤ 100). N test cases follow.
The next N lines will each contain a string as described above.
For each test case,if the expression is adapt to the EBNF above output “Good”,else output “Bad”.
3 (x) (x+(x+x)) ()(x)
Good Good Bad
73 人解决,169 人已尝试。
91 份提交通过,共有 867 份提交。
5.5 EMB 奖励。