#include <iostream>
#include <algorithm>
using namespace std;
int v[100001], n, i, sol;
int main ()
{
cin>>n;
for (i=1; i<=n; i++)
cin>>v[i];
sort (v+1, v+n+1);
for (i=n-2; i>=1; i-=3)
sol+=v[i];
for (i=n%3; i>=1; i--)
sol+=v[i];
cout<<sol;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
4 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
5 |
Incorrect |
3 ms |
248 KB |
Output isn't correct |
6 |
Incorrect |
45 ms |
760 KB |
Output isn't correct |
7 |
Incorrect |
42 ms |
732 KB |
Output isn't correct |
8 |
Incorrect |
41 ms |
760 KB |
Output isn't correct |
9 |
Incorrect |
60 ms |
760 KB |
Output isn't correct |
10 |
Incorrect |
59 ms |
632 KB |
Output isn't correct |