Submission #704695

# Submission time Handle Problem Language Result Execution time Memory
704695 2023-03-02T16:22:13 Z delrey Akcija (COCI15_akcija) C++14
24 / 80
1 ms 468 KB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a[100], v=0;
    cin >> n;
    for (int i=0; i<n; i++)
        cin >> a[i];
    sort(a, a+n);
    for (int i=0; i<n; i++)
            v+=a[i];
    for (int i = n - 3; i>=0; i-=3)
    {
        v=v-a[i];
    }
    cout << v;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Runtime error 1 ms 424 KB Execution killed with signal 6
5 Runtime error 1 ms 468 KB Execution killed with signal 6
6 Runtime error 1 ms 340 KB Execution killed with signal 11
7 Runtime error 1 ms 340 KB Execution killed with signal 11
8 Runtime error 1 ms 340 KB Execution killed with signal 11
9 Runtime error 1 ms 340 KB Execution killed with signal 11
10 Runtime error 1 ms 340 KB Execution killed with signal 11