EXAM SETS

4

2 votes
Problem

EXAM SETS

STATEMENT:

  Given N question papers with their difficulty levels as A0,A1,A2….AN-1. A subset is something that  includes two  question papers with different difficulty levels. Each   question paper will appear at most 1 time among all the subsets.Find  number of subsets that can be made.

 

INPUT

First line consists of the number N.

Next   line contains A0,A1,A2….AN-1 values separated by spaces.

OUTPUT

 Print the maximum number of subsets that can be made.

 

CONSTRAINTS

0<N<100

SAMPLE INPUT 0

5

1 2 3 4 5

SAMPLE OUTPUT 0

2

SAMPLE INPUT 1

1

5

 

SAMPLE OUTPUT 1

0

Explanation 

In the test case 0,  Let subsets are {1,2},{3,4}. So the output is 2

In the test case 1, A subset can not  be made with 1 value. 

Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?