Submission #542535

# Submission time Handle Problem Language Result Execution time Memory
542535 2022-03-26T21:17:38 Z inksamurai Autići (COCI22_autici) C++17
0 / 50
15 ms 1712 KB
#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]);
	}
	int ans=0;
	rep(i,n){
		ans+=a[i]+mi;
	}
	ans-=mi+mi;
	print(ans);
//
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 5 ms 836 KB Output is correct
3 Incorrect 15 ms 1712 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 1 ms 328 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 5 ms 836 KB Output is correct
3 Incorrect 15 ms 1712 KB Output isn't correct
4 Halted 0 ms 0 KB -