Submission #146292

#TimeUsernameProblemLanguageResultExecution timeMemory
146292FashoAkcija (COCI15_akcija)C++14
80 / 80
22 ms1656 KiB
#include <bits/stdc++.h> #define N 1000005 #define ll long long int #define MP make_pair #define pb push_back #define ppb pop_back #define sp " " #define endl "\n" #define fi first #define se second #define ii pair<int,int> #define lli pair<ll,ll> #define fast cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false) #define fast2 freopen ("kmp.in","r",stdin);freopen ("kmp.out","w",stdout); #define mod 1000000009 #define fs(x,y) for(int i=1;i<=y;i++) cin>>x[i] #define fo(i,x,y) for(int i=x;i<=y;i++) #define INF 1000000000005 using namespace std; ll n,m,ar[N],sum,tut[30][13],res[N]; char s[N]; int main() { fast; cin>>n; fs(ar,n); sort(ar+1,ar+n+1); int l=0; for(int i=n;i>=1;i--) { l++; if(l%3==0) continue; sum+=ar[i]; } cout<<sum; } /* cd onedrive\desktop\kod cls */
#Verdict Execution timeMemoryGrader output
Fetching results...