Preparing NOJ

Conflict

2000ms 65536K

Description:

Given several formula like “variable1 relation variable2”, where relation may be <,  <=,  =,  !=,  >=,  >, variables may contain up to 10 letters or digits and are case-sensitive. Please determine whether there is a conflict.

Input:

There are several cases. Each case begins with a line “Case%n:” (%n is the case number), and contains several formulas, one per line. There are no more than 100 formulas for each case. Please see sample input for more details. Input is terminated by EOF.

Output:

If there is no conflict, output “YES”, otherwise, output “NO”. Please refer to sample output for the exact output format.

Sample Input:

Case1:
xyz < 123
123 < 45
Case2:
x < y
y < x

Sample Output:

Case1: YES
Case2: NO

Note:

本题由旧版NOJ导入,来源:第九届中山大学程序设计竞赛预选题

Info

NOJ

Provider NOJ

Code NOJ1123

Tags

Submitted 0

Passed 0

AC Rate 0%

Date 04/20/2019 10:03:10

Related

Nothing Yet