제출 #113068

#제출 시각아이디문제언어결과실행 시간메모리
113068CaQtimlAkcija (COCI15_akcija)C++11
40 / 80
36 ms1272 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=1;i<=rob;i++) { ans+=arr[((i-1)*3)+1]; //cout << ans << "\n"; } //for(int i=(3*rob+1);i<=n;i++) ans+=arr[i]; cout << sum-ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...