Submission #113072

#TimeUsernameProblemLanguageResultExecution timeMemory
113072CaQtimlAkcija (COCI15_akcija)C++14
80 / 80
36 ms1016 KiB
#include "bits/stdc++.h" using namespace std; int arr[(int)1e5+10]; long long sum; int main() { int n; cin >> n; int rob = n/3; for(int i=1;i<=n;i++) { cin >> arr[i]; sum+=arr[i]; } sort(arr+1,arr+1+n); long long ans=0; for(int i=n-2;i>=1;i-=3) { ans+=arr[i]; //cout << ans << "\n"; } //for(int i=(3*rob+1);i<=n;i++) ans+=arr[i]; cout << sum-ans; }

Compilation message (stderr)

akcija.cpp: In function 'int main()':
akcija.cpp:9:6: warning: unused variable 'rob' [-Wunused-variable]
  int rob = n/3;
      ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...