Submission #482404

# Submission time Handle Problem Language Result Execution time Memory
482404 2021-10-24T12:42:59 Z rainboy 3D Histogram (COCI20_histogram) C
0 / 110
4 ms 204 KB
#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(int a, int 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

histogram.c: In function 'main':
histogram.c:15:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
histogram.c:17:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |   scanf("%d%d", &aa[i], &bb[i]);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -