Submission #486125

# Submission time Handle Problem Language Result Execution time Memory
486125 2021-11-10T15:02:45 Z groupATSU Akcija (COCI15_akcija) C++14
80 / 80
42 ms 1220 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=1e9;
const int maxn=100;
const ll mod=1e9+7;
void solve(){
	int a;
	cin>>a;
	int sum=0;
	vector <int> b(a);
	for(int i=0;i<a;i++){
		cin>>b[i];
		sum+=b[i];
	}
	int cnt=0;
	sort(b.begin(),b.end());
	for(int i=a-1;i>=0;i--){
		cnt++;
		if(cnt%3==0)sum-=b[i];
	}
	cout<<sum;
}
int main(){
	//ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    int t=1;
   	//cin>>t;
    while(t--){
        solve();
        cout<<'\n';
    }


}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 27 ms 1072 KB Output is correct
7 Correct 23 ms 1084 KB Output is correct
8 Correct 21 ms 1064 KB Output is correct
9 Correct 42 ms 1220 KB Output is correct
10 Correct 36 ms 1192 KB Output is correct