提出 #7563619


ソースコード 拡げる

#include <bits/stdc++.h>

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;

signed main() {
  ll N, M;
  cin >> N >> M;
  priority_queue<ll> q;
  rep(i,N) {
    ll x;
    cin >> x;
    q.push(x);
  }
  rep(i,M){
    auto t = q.top(); q.pop();
    q.push(t/2);
  }

  ll ans = 0;
  rep(i,N) {
    ans += q.top(); q.pop();
  }
  cout << ans << endl;
  return 0;
}

提出情報

提出日時
問題 D - Powerful Discount Tickets
ユーザ bobuhiro11
言語 C++14 (GCC 5.4.1)
得点 400
コード長 539 Byte
結果 AC
実行時間 62 ms
メモリ 1400 KiB

ジャッジ結果

セット名 All Sample
得点 / 配点 400 / 400 0 / 0
結果
AC × 23
AC × 4
セット名 テストケース
All sample_01, sample_02, sample_03, sample_04, testcase_01, testcase_02, testcase_03, testcase_04, testcase_05, testcase_06, testcase_07, testcase_08, testcase_09, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_15, testcase_16, testcase_17, testcase_18, testcase_19
Sample sample_01, sample_02, sample_03, sample_04
ケース名 結果 実行時間 メモリ
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 2 ms 256 KiB
sample_04 AC 1 ms 256 KiB
testcase_01 AC 33 ms 892 KiB
testcase_02 AC 13 ms 384 KiB
testcase_03 AC 51 ms 1400 KiB
testcase_04 AC 62 ms 1400 KiB
testcase_05 AC 23 ms 892 KiB
testcase_06 AC 50 ms 1400 KiB
testcase_07 AC 12 ms 640 KiB
testcase_08 AC 52 ms 1400 KiB
testcase_09 AC 34 ms 892 KiB
testcase_10 AC 13 ms 640 KiB
testcase_11 AC 33 ms 1400 KiB
testcase_12 AC 52 ms 1400 KiB
testcase_13 AC 10 ms 256 KiB
testcase_14 AC 52 ms 1400 KiB
testcase_15 AC 62 ms 1400 KiB
testcase_16 AC 15 ms 512 KiB
testcase_17 AC 1 ms 256 KiB
testcase_18 AC 1 ms 256 KiB
testcase_19 AC 47 ms 1400 KiB