답안 #704695

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
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;
}
# 결과 실행 시간 메모리 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