Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Formula
Description Nick is a mathematician and his speciality is Boolean logic, especially repetition-free functions. The Boolean function is repetition-free if it can be represented as a repetition-free formula. Formula is repetition-free if each variable occurs in the formula only once. Let us fix the syntax of considered logical formulae: - Variables — letters from ‘
`a`’ to ‘`k`’; - Parentheses — if
*E*is a formula, then (*E*) is another; - Negation — ¬
*E*is a formula for any formula*E*; - Conjunction —
*E*_{1}∧*E*_{2}∧ ⋯ ∧*E*;_{n} - Disjunction — E
_{1}∨*E*_{2}∨ ⋯ ∨*E*._{n}
The operations are listed from the highest priority to the lowest. The problem is to represent given Boolean function by a repetition-free formula. Input The only line of input contains the Boolean function represented as a string consisting of characters ‘ Output The first line of the output file must contain “ In the former case the following line must contain the repetition-free formula for given Boolean function in the same format as in the input file. The line must contain no more than Sample Input
Sample Output
Source Northeastern Europe 2007, Northern Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator