Submission #791127

#TimeUsernameProblemLanguageResultExecution timeMemory
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))); }

Compilation message (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...