24 hour archive: Problem
3101  Nonboring Sequences 3101  Nonboring Sequences 3101  Nonboring Sequences
Statistics  Sub: 40  AC: 14  AC%: 35,00  Score: 3,85 
Created by  2012 Central Europe Regional Contest 
Added by  jcfernandez (20150130) 
Limits 
Total Time: 20000 MS

Test Time:
6000 MS
Memory: 256 MB  Output: 64 MB  Size:
16 KB

Enabled languages  
Available in 
Description
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called nonboring if its every connected subsequence contains a unique element, i.e. an element such that no other element of that subsequence has the same value. Given a sequence of integers, decide whether it is nonboring.
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called nonboring if its every connected subsequence contains a unique element, i.e. an element such that no other element of that subsequence has the same value. Given a sequence of integers, decide whether it is nonboring.
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called nonboring if its every connected subsequence contains a unique element, i.e. an element such that no other element of that subsequence has the same value. Given a sequence of integers, decide whether it is nonboring.
Input specification
The first line of the input contains the number of test cases T . The descriptions of the test cases follow: Each test case starts with an integer n (1 <= n <= 200000) denoting the length of the sequence. In the next line the n elements of the sequence follow, separated with single spaces. The elements are nonnegative integers less than 10^9.
The first line of the input contains the number of test cases T . The descriptions of the test cases follow: Each test case starts with an integer n (1 <= n <= 200000) denoting the length of the sequence. In the next line the n elements of the sequence follow, separated with single spaces. The elements are nonnegative integers less than 10^9.
The first line of the input contains the number of test cases T . The descriptions of the test cases follow: Each test case starts with an integer n (1 <= n <= 200000) denoting the length of the sequence. In the next line the n elements of the sequence follow, separated with single spaces. The elements are nonnegative integers less than 10^9.
Output specification
Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing the word nonboring or boring.
Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing the word nonboring or boring.
The first line of the input contains the number of test cases T . The descriptions of the test cases follow: Each test case starts with an integer n (1 <= n <= 200000) denoting the length of the sequence. In the next line the n elements of the sequence follow, separated with single spaces. The elements are nonnegative integers less than 10^9.
Sample input
4
5
1 2 3 4 5
5
1 1 1 1 1
5
1 2 3 2 1
5
1 1 2 1 1
Sample output
nonboring
boring
nonboring
boring
Hint(s)
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/
http://coj.uci.cu/24h/