Submission #528606

# Submission time Handle Problem Language Result Execution time Memory
528606 2022-02-20T18:06:20 Z Hacv16 Autići (COCI22_autici) C++17
0 / 50
16 ms 1540 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);
    
    int n, ans = 0;
    cin >> n;

    int mn = INF;
    vector<int> 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 5 ms 588 KB Output is correct
3 Incorrect 16 ms 1540 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 Incorrect 1 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 5 ms 588 KB Output is correct
3 Incorrect 16 ms 1540 KB Output isn't correct
4 Halted 0 ms 0 KB -