Submission #185232

#TimeUsernameProblemLanguageResultExecution timeMemory
185232anubhavdharAkcija (COCI15_akcija)C++14
80 / 80
30 ms2036 KiB
#include<bits/stdc++.h> #define ll long long int #define ff first #define ss second #define FOR(i,N) for(i=0;i<N;i++) #define FORe(i,N) for(i=1;i<=N;i++) #define FORr (i,a,b) for(i=a;i<b;i++) #define vi vector <ll> #define ii pair<ll,ll> #define vii vector<ii> #define mp make_pair #define pb push_back using namespace std; const ll MAXN = 1e5+ 4; const ll LOGN = 17; const ll ROOTN = 320; const ll MOD = 1e9+7; const ll INF = 1e17+8; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll N,i,sum = 0; cin>>N; priority_queue<ll> p; while(N--) { cin>>i; p.push(i); } i = 1; while(p.size()) { if((i++)%3) sum+=p.top(); p.pop(); } cout<<sum; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...