# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
482405 | rainboy | 3D Histogram (COCI20_histogram) | C11 | 2565 ms | 1716 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#define N 200000
#define INF 0x3f3f3f3f
#define LINF 0x3f3f3f3f3f3f3f3fLL
int min(int a, int b) { return a < b ? a : b; }
long long max(long long a, long long b) { return a > b ? a : b; }
int main() {
static int aa[N], bb[N];
int n, i, j;
long long ans;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d%d", &aa[i], &bb[i]);
ans = 0;
for (i = 0; i < n; i++) {
int a = INF, b = INF;
for (j = i; j < n; j++) {
a = min(a, aa[j]), b = min(b, bb[j]);
ans = max(ans, (long long) a * b * (j - i + 1));
}
}
printf("%lld\n", ans);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |