Submission #154005

# Submission time Handle Problem Language Result Execution time Memory
154005 2019-09-17T17:00:20 Z RaresRosca Akcija (COCI15_akcija) C++14
80 / 80
66 ms 1272 KB
#include <iostream>
#include <algorithm>
using namespace std;
int i,n,j,v[100010],nr;
long long pret;
int main(){
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>v[i];
    sort(v+1,v+n+1);
    for(j=n;j>=1;j--){
        nr++;
        if(nr>3)
            nr=1;
        if(nr<3)
            pret+=v[j];
    }
    cout<<pret;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 4 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 3 ms 376 KB Output is correct
6 Correct 47 ms 1144 KB Output is correct
7 Correct 40 ms 1144 KB Output is correct
8 Correct 40 ms 1272 KB Output is correct
9 Correct 66 ms 1272 KB Output is correct
10 Correct 58 ms 1272 KB Output is correct