Submission #542536

#TimeUsernameProblemLanguageResultExecution timeMemory
542536inksamuraiAutići (COCI22_autici)C++17
50 / 50
14 ms1620 KiB
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define rng(i,x,n) for(int i=x;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define fi first #define se second #define pb push_back #define sz(a) (int)a.size() #define vec(...) vector<__VA_ARGS__> #define _3wByxeT ios::sync_with_stdio(0),cin.tie(0) typedef long long ll; using pii=pair<int,int>; using vi=vector<int>; void print(){cout<<'\n';} template<class h,class...t> void print(const h&v,const t&...u){cout<<v<<' ',print(u...);} // e signed main(){ _3wByxeT; int n; cin>>n; vi a(n); rep(i,n){ cin>>a[i]; } int mi=1e9+11; rep(i,n){ mi=min(mi,a[i]); } ll ans=0; rep(i,n){ ans+=a[i]+mi; } ans-=mi+mi; print(ans); // return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...