結果

問題 No.1416 ショッピングモール
ユーザー eQeeQe
提出日時 2021-03-05 21:33:14
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 19 ms / 1,000 ms
コード長 1,200 bytes
コンパイル時間 803 ms
コンパイル使用メモリ 82,900 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 08:52:48
合計ジャッジ時間 1,713 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 4 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 4 ms
5,376 KB
testcase_18 AC 4 ms
5,376 KB
testcase_19 AC 4 ms
5,376 KB
testcase_20 AC 5 ms
5,376 KB
testcase_21 AC 18 ms
5,376 KB
testcase_22 AC 19 ms
5,376 KB
testcase_23 AC 17 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#include <bits/stdc++.h>>
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define pt(sth) cout << sth << "\n"
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
typedef long long ll;
typedef pair<ll, ll> pll;
template<class T>bool chmax(T &a, const T &b) {if(a<b) {a=b; return 1;} return 0;}
template<class T>bool chmin(T &a, const T &b) {if(b<a) {a=b; return 1;} return 0;}
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;
//static const ll MOD=998244353;
//for(i=0;i<N;i++) cin>>a[i];

typedef vector<vector<vector<ll>>> v3D;
typedef vector<vector<ll>> v2D;
typedef vector<ll> v1D;





int main(void) {
  ll i, j, k;
  
  ll N;cin>>N;
  priority_queue<ll> q;
  for(i=0;i<N;i++){
    ll a;cin>>a;
    q.push(a);
  }
  
  ll ans=0;
  for(i=0;i<20;i++){
    ll t=1<<i;
    while(t--){
      if(q.size()==0){
        pt(ans);
        return 0;
      }
      
      ans+=q.top()*i;
      q.pop();
    }
    
    
    
  }
  
  
  
  
  
  
}




0