#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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
596 KB |
Output is correct |
3 |
Correct |
13 ms |
596 KB |
Output is correct |
4 |
Correct |
9 ms |
1456 KB |
Output is correct |
5 |
Correct |
10 ms |
1608 KB |
Output is correct |
6 |
Correct |
9 ms |
1448 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
332 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
5 ms |
596 KB |
Output is correct |
3 |
Correct |
13 ms |
596 KB |
Output is correct |
4 |
Correct |
9 ms |
1456 KB |
Output is correct |
5 |
Correct |
10 ms |
1608 KB |
Output is correct |
6 |
Correct |
9 ms |
1448 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
0 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Correct |
1 ms |
212 KB |
Output is correct |
12 |
Correct |
1 ms |
212 KB |
Output is correct |
13 |
Correct |
1 ms |
212 KB |
Output is correct |
14 |
Correct |
1 ms |
212 KB |
Output is correct |
15 |
Correct |
1 ms |
212 KB |
Output is correct |
16 |
Correct |
1 ms |
212 KB |
Output is correct |
17 |
Correct |
1 ms |
332 KB |
Output is correct |
18 |
Correct |
1 ms |
212 KB |
Output is correct |
19 |
Correct |
1 ms |
212 KB |
Output is correct |
20 |
Correct |
1 ms |
212 KB |
Output is correct |
21 |
Correct |
5 ms |
852 KB |
Output is correct |
22 |
Correct |
14 ms |
1620 KB |
Output is correct |
23 |
Correct |
11 ms |
1620 KB |
Output is correct |
24 |
Correct |
12 ms |
1580 KB |
Output is correct |
25 |
Correct |
10 ms |
1620 KB |
Output is correct |
26 |
Correct |
10 ms |
1512 KB |
Output is correct |
27 |
Correct |
10 ms |
1616 KB |
Output is correct |
28 |
Correct |
10 ms |
1440 KB |
Output is correct |
29 |
Correct |
10 ms |
1620 KB |
Output is correct |
30 |
Correct |
13 ms |
1620 KB |
Output is correct |