#C7129. Unique Participant IDs
Unique Participant IDs
Unique Participant IDs
In this problem, you are given (T) test cases. For each test case, the first line contains an integer (N), which indicates the number of participant IDs. The second line contains (N) space-separated integers representing the participant IDs. Your task is to determine, for each participant ID in the given order, whether it is being encountered for the first time in that test case or if it has appeared before. Output "UNIQUE" if the participant ID appears for the first time, and "DUPLICATE" otherwise. Each result should be printed on a new line.
For example, consider a test case where (N = 5) and the participant IDs are: 1234, 5678, 1234, 9012, 5678. The corresponding outputs are:
- 1234: UNIQUE (first occurrence)
- 5678: UNIQUE (first occurrence)
- 1234: DUPLICATE (already seen)
- 9012: UNIQUE (first occurrence)
- 5678: DUPLICATE (already seen)
inputFormat
Standard input is used. The first line contains a single integer (T) denoting the number of test cases. For each test case, the first line contains an integer (N) — the number of participant IDs, followed by a line with (N) space-separated integers representing the participant IDs.
outputFormat
For each participant ID in each test case, output a single line containing either "UNIQUE" or "DUPLICATE" based on whether the ID is seen for the first time or not.## sample
2
5
1234 5678 1234 9012 5678
3
1111 1112 1113
UNIQUE
UNIQUE
DUPLICATE
UNIQUE
DUPLICATE
UNIQUE
UNIQUE
UNIQUE
</p>