B. 最大的矩形纸片

    problem_type.default 1000ms 512MiB

最大的矩形纸片

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

一张半边参差不齐的网格纸(网格边长均为 11),有一边是完整没有破损的。现要从中剪出一片面积最大的矩形纸片。

给定网格纸中完整边的长度 NN(1≤N≤1 000 0001 \leq N \leq 1\,000\,000),以及网格中每一列残存部分的高度(1≤1 \leq 高度 ≤10 000\leq 10\,000),输出能够剪出的最大矩形纸片面积。

输入格式

第一行输入一个正整数 NN(1≤N≤1 000 0001 \leq N \leq 1\,000\,000),表示纸片完整边的长度。

第二行输入 NN 个正整数(1≤1 \leq 正整数 ≤10 000\leq 10\,000),表示每列格子残存部分的高度,两个正整数之间用一个空格隔开。

输出格式

输出一个正整数,表示能够剪出的最大矩形纸片面积。

输入输出样例 #1

输入 #1

6
3 2 1 4 5 2

输出 #1

8

基础训练11月10日

Not Attended
Status
Done
Rule
IOI
Problem
7
Start at
2026-11-17 11:00
End at
2026-11-18 11:00
Duration
24 hour(s)
Host
Partic.
1