User Tools

Site Tools


Prelude to Jolly Jumpers

First, start by reading the problem statement for Jolly Jumpers. The input format is the same and you will be computing a similar function.

For each line of input, you will determine if that line contains the complete set of integers from the smallest value to the largest value with no duplicates. (That is, each integer from lowest to highest must appear exactly once in the input.) Note that the integers on the line are unsorted.


Like Jolly Jumpers, the input consists of a series of test cases, one per line. Each line is a set of space-separated integers. The first integer gives the number of remaining integers on the line. There are no more than 3000 integers in a set.


For each line of input, print “set” if the integers form a complete set from smallest to largest without duplicates; otherwise print “not a set”.

Sample Input

4 1 4 2 3
5 1 4 2 -1 6
5 1 2 3 4 4
6 3 -1 2 -2 1 0

Sample Output

not a set
not a set
contest_prelude_jolly_jumpers.txt · Last modified: 2011/08/30 13:44 by jtkorb