#802. 递归求最大值

递归求最大值

Description

给定 n 个整数,请用分治思想求出其中最大值。

Input Format

第一行一个整数 n。第二行 n 个整数。

Output Format

一行一个整数,表示最大值。

5
1 9 3 9 2
9

Hint

把区间分成左右两半,分别求最大值后合并。

蜀ICP备2025119001号-1