제출 #791127

#제출 시각아이디문제언어결과실행 시간메모리
791127Username4132Autići (COCI22_autici)C++14
50 / 50
10 ms1308 KiB
#include<iostream> using namespace std; using ll = long long; #define forn(i, n) for(int i=0; i<(int)n; ++i) int a, n, mn=1000000010; ll s; int main(){ scanf("%d", &n); forn(i, n){ scanf("%d", &a); s+=a; mn = min(mn, a); } printf("%lld\n", s + ((n-2)*((ll)mn))); }

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

Main.cpp: In function 'int main()':
Main.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", &a);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...