Submission #823688

# Submission time Handle Problem Language Result Execution time Memory
823688 2023-08-13T00:59:51 Z Sandarach151 Autići (COCI22_autici) C++17
0 / 50
9 ms 1688 KB
#include<bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int arr[n];
    for(int i=0; i<n; i++){
        cin >> arr[i];
    }
    sort(arr, arr+n);
    int ans = 0;
    ans+=arr[0]*(n-1);
    for(int i=1; i<n; i++){
        ans+=arr[i];
    }
    cout << ans << '\n';
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 5 ms 852 KB Output is correct
3 Incorrect 9 ms 1688 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 320 KB Output is correct
2 Correct 1 ms 316 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Incorrect 0 ms 340 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 852 KB Output is correct
3 Incorrect 9 ms 1688 KB Output isn't correct
4 Halted 0 ms 0 KB -