제출 #869787

#제출 시각아이디문제언어결과실행 시간메모리
869787rainboyMean (info1cup19_mean)C11
100 / 100
2 ms512 KiB
#include <stdio.h> #define N 200 int max(int a, int b) { return a > b ? a : b; } int main() { static int aa[N], dp[N][N]; int n, i, j, k; scanf("%d", &n); for (i = 0; i < n; i++) scanf("%d", &aa[i]); for (i = n - 1; i >= 0; i--) for (j = i; j < n; j++) if (i == j) dp[i][j] = aa[i]; else for (k = i; k < j; k++) dp[i][j] = max(dp[i][j], (dp[i][k] + dp[k + 1][j]) / 2); printf("%d\n", dp[0][n - 1]); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

mean.c: In function 'main':
mean.c:11:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d", &n);
      |  ^~~~~~~~~~~~~~~
mean.c:13:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d", &aa[i]);
      |   ^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...