Mock CCC '18 Contest 5 J2 - Carol's Cute Cacti

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 1G

Problem type

Many definitions exist for cacti. Cacti? Cactuses? Simple graphs where every edge is a part of at most one cycle? Graphs where all maximal subgraphs without cut-vertices are either edges or cycles?

Of all the things that cacti have, cacti tend to have spikes on them, to keep people who are not worthy of embracing cacti from running away with them. Carol is very protective of her cacti, and wants to nurture them. She's currently in nurturing mode, but she will sometimes switch into defense mode if she feels that her cacti are threatened. She has more modes than that, but those are out of scope for this problem.

Don't be surprised that Carol likes counting the spikes on her cacti - she knows how many spikes all of the cacti have. She wants to know what number of spikes is most common among all of her cacti - in the event multiple counts of spikes are equally common, she cares only for the minimum such number.

Everyone knows that Carol is still in nurturing mode, and is not yet ready to transition into thinking mode. Help her get into the right mode for thinking about computing the smallest mode in a list of integers by solving this unrelated problem about cacti and spike counting.


1 \le N \le 10

1 \le a_i \le 10

Input Specification

The first line of the input consists of a single integer, N.

The next line contains N space-separated integers, the values a_1 through a_n representing the number of spikes on the ith cactus.

Output Specification

Output, on a single line, the smallest count of spikes that is most frequent among all counts of spikes on the cacti that Carol owns.

Sample Input

1 1 2 2

Sample Output



There are no comments at the moment.