# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165814 | 2019-11-29T08:03:45 Z | ArKCa | Akcija (COCI15_akcija) | C++17 | 25 ms | 1016 KB |
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define pob pop_back #define N 10 using namespace std; vector<int>v; int n; ll tot; int main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); scanf("%d",&n); int a; for(int i=0;i<n;i++){ scanf("%d",&a); v.pb(a); tot+=a; } sort(v.begin(), v.end()); ll ans=0; for(int i=(n-3);i>=0;i-=3){ ans+=v[i]; } printf("%lld\n",tot-ans ); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 128 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 21 ms | 1012 KB | Output is correct |
7 | Correct | 14 ms | 1016 KB | Output is correct |
8 | Correct | 14 ms | 1012 KB | Output is correct |
9 | Correct | 25 ms | 1012 KB | Output is correct |
10 | Correct | 24 ms | 1012 KB | Output is correct |