# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
528609 |
2022-02-20T18:12:16 Z |
Hacv16 |
Autići (COCI22_autici) |
C++17 |
|
13 ms |
1100 KB |
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,avx")
#pragma GCC optimize("unroll-loops")
#define endl '\n'
#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define bn binary_search
#define lb lower_bound
#define up upper_bound
#define np next_permutation
#define all(x) x.begin(), x.end()
#define sz(x) (int) x.size()
#define mdc(x, y) __gcd(x, y)
#define dbg(x) cout << #x << ": " << "[ " << x << " ]\n"
typedef int ii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef priority_queue<int, vector<int>, greater<int>> heap;
const int MAX = 2e6 + 15;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const int VAR[4] = {-1, 1, 0, 0};
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
ll n, ans = 0;
cin >> n;
ll mn = INF;
vector<ll> v(n);
for(auto &x : v){
cin >> x;
mn = min(mn, x);
}
bool aux = false;
for(auto x : v){
if(x == mn && !aux) aux = true;
else ans += (x + mn);
}
cout << ans << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
6 ms |
972 KB |
Output is correct |
3 |
Correct |
13 ms |
972 KB |
Output is correct |
4 |
Correct |
10 ms |
972 KB |
Output is correct |
5 |
Correct |
11 ms |
972 KB |
Output is correct |
6 |
Correct |
9 ms |
972 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Correct |
1 ms |
204 KB |
Output is correct |
8 |
Correct |
1 ms |
204 KB |
Output is correct |
9 |
Correct |
0 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
6 ms |
972 KB |
Output is correct |
3 |
Correct |
13 ms |
972 KB |
Output is correct |
4 |
Correct |
10 ms |
972 KB |
Output is correct |
5 |
Correct |
11 ms |
972 KB |
Output is correct |
6 |
Correct |
9 ms |
972 KB |
Output is correct |
7 |
Correct |
0 ms |
204 KB |
Output is correct |
8 |
Correct |
0 ms |
204 KB |
Output is correct |
9 |
Correct |
1 ms |
204 KB |
Output is correct |
10 |
Correct |
1 ms |
204 KB |
Output is correct |
11 |
Correct |
1 ms |
204 KB |
Output is correct |
12 |
Correct |
0 ms |
204 KB |
Output is correct |
13 |
Correct |
1 ms |
204 KB |
Output is correct |
14 |
Correct |
1 ms |
204 KB |
Output is correct |
15 |
Correct |
0 ms |
204 KB |
Output is correct |
16 |
Correct |
1 ms |
204 KB |
Output is correct |
17 |
Correct |
1 ms |
204 KB |
Output is correct |
18 |
Correct |
1 ms |
204 KB |
Output is correct |
19 |
Correct |
0 ms |
204 KB |
Output is correct |
20 |
Correct |
0 ms |
204 KB |
Output is correct |
21 |
Correct |
6 ms |
972 KB |
Output is correct |
22 |
Correct |
13 ms |
972 KB |
Output is correct |
23 |
Correct |
11 ms |
1100 KB |
Output is correct |
24 |
Correct |
10 ms |
972 KB |
Output is correct |
25 |
Correct |
11 ms |
972 KB |
Output is correct |
26 |
Correct |
10 ms |
972 KB |
Output is correct |
27 |
Correct |
10 ms |
972 KB |
Output is correct |
28 |
Correct |
10 ms |
972 KB |
Output is correct |
29 |
Correct |
11 ms |
972 KB |
Output is correct |
30 |
Correct |
12 ms |
972 KB |
Output is correct |