Submission
Status:
[PPPPP][PPPPP][PPPPP][PP][P][P][P][P][PP][PP]
Subtask/Task Score:
{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}{10/10}
Score: 100
User: chawinkn
Problemset: โดรน
Language: cpp
Time: 0.003 second
Submitted On: 2025-05-23 14:31:05
#include <bits/stdc++.h>
using namespace std;
priority_queue<int> pq;
int main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
int n;
cin >> n;
vector<int> x(n);
for (auto& i : x)
cin >> i;
for (int i = 1; i <= 200; i++) {
pq.push(-i);
for (int j = 1; j <= 9; j++)
pq.push(-2*i);
}
int ans=0;
sort(x.begin(), x.end(), greater<int>());
for (auto i : x)
ans -= pq.top()*i, pq.pop();
cout << ans;
return 0;
}