結果
| 問題 | No.1416 ショッピングモール |
| コンテスト | |
| ユーザー |
y61mpnl
|
| 提出日時 | 2021-03-05 21:53:39 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 1,000 ms |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 1,982 ms |
| コンパイル使用メモリ | 213,212 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-18 12:11:31 |
| 合計ジャッジ時間 | 2,811 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#include<bits/stdc++.h>
#define REP(i,b,e) for(int i=b;i<e;i++)
using ll = int_fast64_t;
int main(){
int n;
scanf("%d", &n);
std::priority_queue<int> que;
REP(i, 0, n){
int a;
scanf("%d", &a);
que.push(a);
}
ll ans = 0;
REP(i, 0, 20){
REP(j, 0, 1<<i){
ll tmp = que.top();
que.pop();
ans += tmp * i;
if(que.empty()) break;
}
if(que.empty()) break;
}
printf("%ld\n", ans);
return 0;
}
y61mpnl