用户输出
1
系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#82004 | #1320. [L1-7]救火队员 | Accepted | 100 | 27 ms | 308 K | C++ 11 / 796 B | y | 2023-03-10 8:52:13 |
#include <cstdio>
#define N 10009
#define RI register int
#define Max(x, y) ((x) > (y) ? (x) : (y))
using namespace std;
int n, a[N], va[N], ii[N], sq, ans = 0;
inline int read();
inline void add(int x, int i) {
while (sq && va[sq] > x) {
RI now = va[sq] * (i - ii[sq - 1] - 1);
ans = Max(ans, now);
--sq;
}
va[++sq] = x;
ii[sq] = i;
}
int main() {
n = read();
a[n + 1] = -1;
for (RI i = 1; i <= n; ++i) a[i] = read();
for (RI i = 1; i <= n + 1; ++i) add(a[i], i);
printf("%d\n", ans);
return 0;
}
inline int read() {
int x = 0, fh = 1;
char c = getchar();
while (c > '9' || c < '0') fh = c == '-' ? -1 : fh, c = getchar();
while (c >= '0' && c <= '9') {
x *= 10;
x += c - '0';
c = getchar();
}
return x * fh;
}
8192
60522 14575 36426 79445 48772 90081 33447 90629 3497 47202 7775 94325 63982 4784 68417 2156 319
<48151 bytes omitted>
用户输出
901408
系统信息
Exited with return code 0
8191
85925 39836 63225 34999 22439 10902 3198 53774 26740 40447 83006 28518 67297 37973 86792 80230
<48192 bytes omitted>
用户输出
1201200
系统信息
Exited with return code 0
10000
68547 24256 53097 1352 49208 27787 55371 32853 50232 66335 14396 91997 93687 85044 21626 16751
<58788 bytes omitted>
用户输出
823277
系统信息
Exited with return code 0
8192
94564 65283 16004 30238 9987 91514 57736 52928 65520 45505 31845 84075 14031 61374 85994 25599
<48080 bytes omitted>
用户输出
928620
系统信息
Exited with return code 0
8191
59453 639 55985 4685 57316 93757 24797 65975 53785 38796 92578 82666 31328 57969 19952 71686 59
<48171 bytes omitted>
用户输出
983232
系统信息
Exited with return code 0
10000
79719 33046 3578 77246 51964 1670 78656 10898 70510 32707 30807 65248 39849 60178 97957 3125 8
<58852 bytes omitted>
用户输出
997808
系统信息
Exited with return code 0