제출 #532285

#제출 시각아이디문제언어결과실행 시간메모리
532285rainboy도넛 (JOI14_ho_t3)C11
20 / 100
20 ms336 KiB
#include <stdio.h> #define N 400 long long min(long long a, long long b) { return a < b ? a : b; } long long max(long long a, long long b) { return a > b ? a : b; } int main() { static long long aa[N + 1]; int n, i, j, k; long long ans; scanf("%d", &n); for (i = 1; i <= n; i++) { scanf("%lld", &aa[i]); aa[i] += aa[i - 1]; } ans = 0; for (i = 0; i < n; i++) for (j = i + 1; j < n; j++) for (k = j + 1; k < n; k++) ans = max(ans, min(min(aa[j] - aa[i], aa[k] - aa[j]), aa[n] + aa[i] - aa[k])); printf("%lld\n", ans); return 0; }

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

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