제출 #528239

#제출 시각아이디문제언어결과실행 시간메모리
528239rainboyAutići (COCI22_autici)C11
50 / 50
14 ms1148 KiB
#include <stdio.h> #define INF 0x3f3f3f3f int min(int a, int b) { return a < b ? a : b; } int main() { int n, mn, i; long long sum; scanf("%d", &n); sum = 0, mn = INF; for (i = 0; i < n; i++) { int a; scanf("%d", &a); sum += a; mn = min(mn, a); } printf("%lld\n", sum + (long long) mn * (n - 2)); return 0; }

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

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