Help the judgeProblem code: J6 |
All submissions for this problem are available.
A scandal has been revealed in the ruling political party: there is a large case of corruption! You are the judge in the case, and you have a lot of evidence at your disposal. Unfortunately, some of the statements may potentially contradict the others. Each piece of evidence says something about the involvement of two (not necessary different) politicians in the crime. To be precise, each statement says: "A (is/is not) involved or B (is/is not) involved." Your job is to process all the pieces of evidence, and decide one of three options:
- the evidence is inconsistent,
- you can decide exactly who is involved and who isn't,
- there is some doubt left as to who is involved.
Input
In the first line of input there is an integer t (1≤t≤10), representing the number of test cases. The subsequent test cases are defined as follows. In the first line of each test case there is an integer n (1≤n≤105) which denotes the number of politicians. Then, an integer k follows (1≤k≤3*105), denoting the number of pieces of evidence. The following k lines contain the evidence. The description of each statement contains 2 integers, ui,vi. If statement i says that politician A is involved, then ui = A or vi = A, whereas if statement i says politician A is not involved, then ui = -A or vi = -A. There is a blank line after each test case.
Output
For each test case, write in a separate line of the output one of the words: "CONFLICT", "UNIQUE", or "MULTIPLE", corresponding to the above described possibilities.
Example
Input: 4 1 0 1 1 1 1 1 1 1 -1 1 2 1 1 -1 -1 Output: MULTIPLE UNIQUE MULTIPLE CONFLICT
| Author: | admin |
| Date Added: | 15-10-2009 |
| Time Limit: | 1 - 15 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, FORT, FS, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, NODEJS, PAS fpc, PAS gpc, PERL, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
|
If you are still having problems, see a sample solution here. |

Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach.
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section.
where are the inequality
where are the inequality signs? Maybe escaping :P