題目列表
簡單 時間限制:3 s記憶體限制:128 MB

Online Judge - 11063 - B2-Sequence

來源代碼:UVa
前往提交 ↓

A B2-Sequence is a sequence of positive integers 1 ≤ b_1 < b_2 < b_3 . . . such that all pairwise sums b_i +b_j , where i ≤ j, are different. Your task is to determine if a given sequence is a B2-Sequence or not.

輸入說明

Each test case starts with 2 ≤ N ≤ 100, the number of elements in a sequence. Next line will have N integers, representing the value of each element in the sequence. Each element b_i is an integer such that b_i ≤ 10000. There is a blank line after each test case. The input is terminated by end of file (EOF).

輸出說明

For each test case you must print the number of the test case, starting from 1, and a message indicating if the corresponding sequence it is a B2-Sequence or not. See the sample output below. After each test case you must print a blank line.

輸入輸出範例

範例 1

範例輸入
4
1 2 4 8

4
3 7 10 14
範例輸出
Case #1: It is a B2-Sequence.

Case #2: It is not a B2-Sequence.

範例 2

範例輸入
2
1 10000
範例輸出
Case #1: It is a B2-Sequence.

範例 3

範例輸入
3
0 1 3
範例輸出
Case #1: It is not a B2-Sequence.

討論

登入後即可加入討論。 登入

目前還沒有討論文章。

最近提交

目前還沒有提交紀錄。

登入後即可撰寫程式、測試範例及提交解答。

登入