criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ins insert
#define all(x) (x).begin(),(x).end()
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
using Graph = vector<vector<int>>;
const double pi=acos(-1);
template<int MOD> struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator - () const noexcept {
        return val ? MOD - val : 0;
    }
    constexpr Fp operator + (const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator - (const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator * (const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator / (const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator += (const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator -= (const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator *= (const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator /= (const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b; swap(a, b);
            u -= t * v; swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator == (const Fp& r) const noexcept {
        return this->val == r.val;
    }
    constexpr bool operator != (const Fp& r) const noexcept {
        return this->val != r.val;
    }
    friend constexpr ostream& operator << (ostream &os, const Fp<MOD>& x) noexcept {
        return os << x.val;
    }
    friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};
using mint = Fp<MOD>;

mint calc(long long N, long long K) {
    mint res = 1;
    for (long long n = 0; n < K; ++n) {
        res *= (N - n);
        res /= (n + 1);
    }
    return res;
}
int main() {
//cout << fixed << setprecision(12);
ll n,k;
cin>>n>>k;
ll a[n]={};
rep(i,n){
cin>>a[i];}
sort(a,a+n);
rep(i,k){
a[n-1]/=2;
sort(a,a+n);}
ll ca=0;
rep(i,n){
ca+=a[i];}
cout << ca << endl+}

Compiler output:
a.cc: In function 'int main()':
a.cc:102:20: error: expected primary-expression before '}' token
  102 | cout << ca << endl+}
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef vector<int> V;
typedef pair<int,int> P;
typedef vector<vector<int>> Graph;

int main() {
    set<pair<ll,int>> a;
    int n,m;
    cin >> n >> m;
    rep(i,n){
        ll A;
        cin >> A;
        a.insert(make_pair(A,i));
    }
    rep(i,m){
        auto k = a.end();
        --k;
        //cout << k.first << " " << k.second << endl;
        a.erase(make_pair(*k.first,*k.second));
        a.insert(make_pair(*k.first/2,*k.second));
    }
    ll ans = 0;
    for(auto i : a){
        //cout << i.first << " " << i.second << endl;
        ans += i.first;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:30: error: 'struct std::_Rb_tree_const_iterator<std::pair<long long int, int> >' has no member named 'first'
   23 |         a.erase(make_pair(*k.first,*k.second));
      |                              ^~~~~
a.cc:23:39: error: 'struct std::_Rb_tree_const_iterator<std::pair<long long int, int> >' has no member named 'second'
   23 |         a.erase(make_pair(*k.first,*k.second));
      |                                       ^~~~~~
a.cc:24:31: error: 'struct std::_Rb_tree_const_iterator<std::pair<long long int, int> >' has no member named 'first'
   24 |         a.insert(make_pair(*k.first/2,*k.second));
      |                               ^~~~~
a.cc:24:42: error: 'struct std::_Rb_tree_const_iterator<std::pair<long long int, int> >' has no member named 'second'
   24 |         a.insert(make_pair(*k.first/2,*k.second));
      |                                          ^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef vector<int> V;
typedef pair<int,int> P;
typedef vector<vector<int>> Graph;

int main() {
    set<pair<ll,int>> a;
    int n,m;
    cin >> n >> m;
    rep(i,n){
        ll A;
        cin >> A;
        a.insert(make_pair(A,i));
    }
    rep(i,m){
        auto k = *a.end();
        --k;
        //cout << k.first << " " << k.second << endl;
        a.erase(make_pair(k.first,k.second));
        a.insert(make_pair(k.first/2,k.second));
    }
    ll ans = 0;
    for(auto i : a){
        //cout << i.first << " " << i.second << endl;
        ans += i.first;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: no match for 'operator--' (operand type is 'std::pair<long long int, int>')
   21 |         --k;
      |         ^~~
Language: C

#include <stdio.h>
int main()
{
  long long n,m,sum=0;
  scanf("%lli%lli",&n,&m);
  long long a[n];
  for (long long i=0;i<n;i++) {
    scanf("%lli",&a[i]);
  }
  long long tmp,max=0;
  for (long long i=0;i<m;i++) {
    while(long long j<n){
      if (a[j]>max) {
        max=a[j];
        tmp=j;
      }
    }
    a[tmp] /= 2;
  }
  for (long long i=0;i<n;i++) {
    sum+=a[i];
  }
  printf("%lli",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: expected expression before 'long'
   12 |     while(long long j<n){
      |           ^~~~
main.c:13:13: error: 'j' undeclared (first use in this function)
   13 |       if (a[j]>max) {
      |             ^
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
int main()
{
  long long n,m,sum=0;
  scanf("%lli%lli",&n,&m);
  long long a[n];
  for (long long i=0;i<n;i++) {
    scanf("%lli",&a[i]);
  }
  long long tmp,max=0;
  for (long long i=0;i<m;i++) {
    while(j<n){
      if (a[j]>max) {
        max=a[j];
        tmp=j;
      }
    }
    a[tmp] /= 2;
  }
  for (long long i=0;i<n;i++) {
    sum+=a[i];
  }
  printf("%lli",sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:11: error: 'j' undeclared (first use in this function)
   12 |     while(j<n){
      |           ^
main.c:12:11: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)();
typedef long long ll;

ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}

const ll big=998244353;
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (exp(x,y-1)*x);
    ll t=exp(x,y/2);
    return (t*t);
}
 
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

typedef pair<int,int> p;



int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(0);
    /*--------------------------------*/
    
  int n,m;
  cin >> n >> m;
  set<p> a;
  rep(i,n){
    int k;cin >> k;
    a.insert(p(k,i));
  }
  rep(i,m){
    p s=*rbegin(a);
    if(s.first==0)break;
    a.erase(s);
    s.first/=2;
    a.insert(s);
  }
  ll ans=0;
  for(p s:a){
    ans+=s.first;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:57:4: error: expected '}' at end of input
   57 |   }
      |    ^
a.cc:34:11: note: to match this '{'
   34 | int main(){
      |           ^
Language: Java

import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
 
	public static void main(String[] args) { //WOOOOOOO AtCoder is HELPING!!!!!!!!!!
		//Arraylist cheese for the win
		Scanner input = new Scanner(System.in);
		PriorityQueue<Long> subs = new PriorityQueue<Long>(Comparitor.reverseOrder());
		int N = input.nextInt();
		int M = input.nextInt();
		long ans = 0;
		for (int i = 0; i < N; i++) {
			long x = input.nextLong();
			ans+=x;
			while (x>0) {
				long sub = x-x/2;
				subs.add(sub);
				x/=2;
			}
		}
		int cnt = 0;
		while (cnt < M) {
			ans-=subs.poll();
			cnt++;
			if (subs.isEmpty()) break;
		}
		System.out.println(ans);
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		PriorityQueue<Long> subs = new PriorityQueue<Long>(Comparitor.reverseOrder());
		                                                   ^
  symbol:   variable Comparitor
  location: class Main
1 error
Language: C++

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, m;
  //cin >> n >> m;
  scanf("%d %d", &n, &m);
  priority_queue<int> p;
  for(int i=0; i<n; i++){
    int tmp;
    //cin >> tmp;
    scanf("%d", &tmp);
    p.push(tmp);
  for(int i=0; i<m; i++){
    int tmp=p.top();
    p.pop();
    p.push(tmp/2);
  }
  int64_t ans = 0;
  while(!p.empty()){
    ans += p.top();
    p.pop();
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
   26 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <priority_queue>
#include <algorithm>
#include <vector>
using ll = long long;

std::vector<int> vec;
std::priority_queue<int> pq;
int p;

int main() {
    int n, m;
    std::cin >> n >> m;
    vec.assign(n, 0);
    for (int i = 0; i < n; i++) {
        std::cin >> p
        pq.push(p);
    }
    for (int i = 0; i < m; i++) {
        int t = pq.top();
        int e = t / 2;
        pq.pop();
        pq.push(e);
    }
    ll ans = 0;
    while (!pq.empty()) {
        ans += pq.top();
        pq.pop();
    }
    std::cout << ans << std::endl;
}

Compiler output:
a.cc:3:10: fatal error: priority_queue: No such file or directory
    3 | #include <priority_queue>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int64_t N,M;
    cin >> N >> M;

    vector<int64_t> A(N);

    for(int i=0;i<N;i++) {
        cin >> A[i];
    }

    sort(A.begin(), A.end());
    int64_t pos = M-1;
    for(int i=0;i<M;i++) {
        if(A[pos] > A[N-1]) {
            int maxa = 0;
            int maxj = N-1; 
            for(int j=pos;j<N-1;j++) {
                if(maxa < A[j]) {
                    maxa = A[j]
                    maxj = j;
                }
            }
            A[maxj] >>= 1;
            pos = maxj-1;
        } else {
            A[N-1] >>= 1;
            pos = N-2;
        }
        if(pos < 0) pos = 0;
    }

    int64_t sum = 0;
    for(int i=0;i<A.size();i++) {
        sum += A[i];
    }
//    cout << accumulate(A.begin(), A.end(),0) << "\n";
    cout << sum << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: expected ';' before 'maxj'
   22 |                     maxa = A[j]
      |                                ^
      |                                ;
   23 |                     maxj = j;
      |                     ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(void) {
    int64_t N,M;
    cin >> N >> M;

    vector<int64_t> A(N);

    for(int i=0;i<N;i++) {
        cin >> A[i];
    }

    A.sort(A.begin(), A.end());
    vector<int64_t>::iterator it;
    for(int i=0;i<M;i++) {
        it = max_element(A.begin(), A.end());
        (*it) /= 2;
    }

    int64_t sum = 0;
    for(int i=0;i<A.size();i++) {
        sum += A[i];
    }
//    cout << accumulate(A.begin(), A.end(),0) << "\n";
    cout << sum << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'class std::vector<long int>' has no member named 'sort'
   14 |     A.sort(A.begin(), A.end());
      |       ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N; int64_t M;
  cin>>N>>M;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  vector<int64_t>B={};
  for(int i=0;i<N;i++){
  int64_t k=A.at(i);
    for(int j=0; ;j++){
    int64_t l=k; k/=2;
      B.push_back(l-k);
      if(k==0)
        break;
    }
  }sort(B.begin(),B.end());
  reverse(B.begin(),B.end());
  int l=B.size();
  int64_t ans=0;
  for(int i=0;i<N;i++)
    ans+=A.at(i);
  int64_t sum=0;
  for(int i=0;i<min(M,l);i++)
    sum+=B.at(i);
  ans-=sum;
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: no matching function for call to 'min(int64_t&, int&)'
   25 |   for(int i=0;i<min(M,l);i++)
      |                 ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:25:20: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   25 |   for(int i=0;i<min(M,l);i++)
      |                 ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:25:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   25 |   for(int i=0;i<min(M,l);i++)
      |                 ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  vector<int64_t>B={};
  for(int i=0;i<N;i++){
  int64_t k=A.at(i);
    for(int j=0; ;j++){
    in64_t l=k; k/=2;
      B.push_back(l-k);
      if(k==0)
        break;
    }
  }sort(B.begin(),B.end());
  reverse(B.begin(),B.end());
  int l=B.size();
  int64_t ans=0;
  for(int i=0;i<N;i++)
    ans+=A.at(i);
  int64_t sum=0;
  for(int i=0;i<min(M,l);i++)
    sum+=B.at(i);
  ans-=sum;
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'in64_t' was not declared in this scope; did you mean 'int64_t'?
   13 |     in64_t l=k; k/=2;
      |     ^~~~~~
      |     int64_t
a.cc:14:19: error: 'l' was not declared in this scope
   14 |       B.push_back(l-k);
      |                   ^
a.cc:25:21: error: 'M' was not declared in this scope
   25 |   for(int i=0;i<min(M,l);i++)
      |                     ^
Language: C++

#include<cstdio>
#include<vector>
#include <functional>
#include<algorithm>
using namespace std;
using ull = unsigned long long;

int main(){
	unsigned N, M;
	scanf("%u %u", &N, &M);
	ull ans = 0;
	vector<unsigned> discount;
	for (int i = 0; i < N; ++i){
		unsigned A;
		scanf("%u", &A);
		ans += A;
		while(A > 0){
			discount.push_back(A - (A >> 1));
			A >>= 1;
		}
	}
	unsigned use = min(M, discount.size());
	nth_element(discount.begin(), discount.begin() + use - 1, discount.end(), greater<unsigned>());
	for (int i = 0; i < use; ++i){
		ans -= discount[i];
	}
	printf("%llu\n", ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: no matching function for call to 'min(unsigned int&, std::vector<unsigned int>::size_type)'
   22 |         unsigned use = min(M, discount.size());
      |                        ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   deduced conflicting types for parameter 'const _Tp' ('unsigned int' and 'std::vector<unsigned int>::size_type' {aka 'long unsigned int'})
   22 |         unsigned use = min(M, discount.size());
      |                        ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:22:27: note:   mismatched types 'std::initializer_list<_Tp>' and 'unsigned int'
   22 |         unsigned use = min(M, discount.size());
      |                        ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd(ll a,ll b){if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}



int main(){

  ll N,M;
  cin >> N >> M;
  priority_queue<ll> A;
  ll a;
  FOR(i,0,N){
    cin >> a;
    A.push(a);
  }
  FOR(i,0,m){
    a = A.top();
    A.pop();
    a /= 2;
    A.push(a); 
  }
  ll ans = 0;
  while(A.size()){
    ans += A.top();
    A.pop();
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:11: error: 'm' was not declared in this scope
   35 |   FOR(i,0,m){
      |           ^
a.cc:5:45: note: in definition of macro 'FOR'
    5 | #define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
      |                                             ^
a.cc:20:16: error: 'class std::priority_queue<long long int>' has no member named '__builtin_popcount'
   20 | #define pop(a) __builtin_popcount((a))
      |                ^~~~~~~~~~~~~~~~~~
a.cc:37:7: note: in expansion of macro 'pop'
   37 |     A.pop();
      |       ^~~
a.cc:20:37: error: expected primary-expression before ')' token
   20 | #define pop(a) __builtin_popcount((a))
      |                                     ^
a.cc:37:7: note: in expansion of macro 'pop'
   37 |     A.pop();
      |       ^~~
a.cc:20:16: error: 'class std::priority_queue<long long int>' has no member named '__builtin_popcount'
   20 | #define pop(a) __builtin_popcount((a))
      |                ^~~~~~~~~~~~~~~~~~
a.cc:44:7: note: in expansion of macro 'pop'
   44 |     A.pop();
      |       ^~~
a.cc:20:37: error: expected primary-expression before ')' token
   20 | #define pop(a) __builtin_popcount((a))
      |                                     ^
a.cc:44:7: note: in expansion of macro 'pop'
   44 |     A.pop();
      |       ^~~
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    PriorityQueue pq = new PriorityQueue<Long>(Collections.reverseOrder());
    for(int i = 0; i < n; i++) {
      long a = sc.nextLong();
      pq.add(a);
    }
    for(int i = 0; i < m; i++) {
      long t = pq.poll();
      t /= 2;
      pq.add(t);
    }
    long ans = 0;
    while(pq.size() > 0) {
      long t = pq.poll();
      ans += t;
    }
    System.out.println(ans);
  }
}


Compiler output:
Main.java:14: error: incompatible types: Object cannot be converted to long
      long t = pq.poll();
                      ^
Main.java:20: error: incompatible types: Object cannot be converted to long
      long t = pq.poll();
                      ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: C++

N,M = map(int,input().split())
As = list(map(int,input().split()))

for i in range(M):
    mx = max(As)
    As[As.index(mx)] = mx//2

print(sum(As)) 

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,M = map(int,input().split())
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  priority_queue<long long>A;
  for(int i=0;i<N;i++){
    long long a;
    cin>>a;
    A.push(a)
  }
  for(int j=0;j<M;j++){
    long long b=A.top();
    b=b/2;
    A.pop();
    A.push(b);
  }
  long long sum=0;
  for(int i=0;i<N;i++){
    long long c=A.top();
    sum=sum+c;
    A.pop();
  }
  cout<<sum<<endl;
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: expected ';' before '}' token
   10 |     A.push(a)
      |              ^
      |              ;
   11 |   }
      |   ~
Language: C++

def main():
    import heapq
    n,m = map(int,input().split())
    a = list(map(int,input().split()))
    heap = []
    for i in range(n):
        heapq.heappush(heap,-1*a[i])
    for i in range(m):
        a = int(heapq.heappop(heap)/2)
        heapq.heappush(heap,a)
    print(-1*sum(heap))



if __name__ == "__main__":
    main()

Compiler output:
a.cc:1:1: error: 'def' does not name a type
    1 | def main():
      | ^~~
Language: C++

using namespace std;

int main() {
    priority_queue<long long> q;
    int n, m; cin >> n >> m;
    for (int i = 0; i < n; i++) {
        int a; cin >> a;
        q.push(a);
    }
    for (int i = 0; i < m; i++) {
        int a; a = q.top(); q.pop();
        q.push(a/2);
    }
    long long t = 0;
    for (int i = 0; i < n; i++) {
        int a; a = q.top(); q.pop();
        t += a;
    }
    cout << t << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'priority_queue' was not declared in this scope
    4 |     priority_queue<long long> q;
      |     ^~~~~~~~~~~~~~
a.cc:1:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | using namespace std;
a.cc:4:20: error: expected primary-expression before 'long'
    4 |     priority_queue<long long> q;
      |                    ^~~~
a.cc:5:15: error: 'cin' was not declared in this scope
    5 |     int n, m; cin >> n >> m;
      |               ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:8:9: error: 'q' was not declared in this scope
    8 |         q.push(a);
      |         ^
a.cc:11:20: error: 'q' was not declared in this scope
   11 |         int a; a = q.top(); q.pop();
      |                    ^
a.cc:16:20: error: 'q' was not declared in this scope
   16 |         int a; a = q.top(); q.pop();
      |                    ^
a.cc:19:5: error: 'cout' was not declared in this scope
   19 |     cout << t << endl;
      |     ^~~~
a.cc:19:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:18: error: 'endl' was not declared in this scope
   19 |     cout << t << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define ll long long
#define INF 1000000000000000000

int main() {
    int N, M;
    cin >> N >> M;

    priority_queue<ll, ll> que;
    rep(i, N) {
        ll a;
        cin >> a;
        que.push(a);
    }

    rep(i, N) {
        ll t = que.top();
        que.pop();
        que.push(t / 2);
    }

    ll res = 0;
    while (!que.empty()) {
        res += que.top();
        que.pop();
    }

    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:26: error: 'long long int' is not a class, struct, or union type
   13 |     priority_queue<ll, ll> que;
      |                          ^
a.cc:13:26: error: template argument 3 is invalid
a.cc:17:13: error: request for member 'push' in 'que', which is of non-class type 'int'
   17 |         que.push(a);
      |             ^~~~
a.cc:21:20: error: request for member 'top' in 'que', which is of non-class type 'int'
   21 |         ll t = que.top();
      |                    ^~~
a.cc:22:13: error: request for member 'pop' in 'que', which is of non-class type 'int'
   22 |         que.pop();
      |             ^~~
a.cc:23:13: error: request for member 'push' in 'que', which is of non-class type 'int'
   23 |         que.push(t / 2);
      |             ^~~~
a.cc:27:17: error: request for member 'empty' in 'que', which is of non-class type 'int'
   27 |     while (!que.empty()) {
      |                 ^~~~~
a.cc:28:20: error: request for member 'top' in 'que', which is of non-class type 'int'
   28 |         res += que.top();
      |                    ^~~
a.cc:29:13: error: request for member 'pop' in 'que', which is of non-class type 'int'
   29 |         que.pop();
      |             ^~~
Language: C++

#include <iostream>
#include <priority_queue>
using namespace std;


int main() {
	int n, m;
	cin >> n >> m;

	long long res = 0;

	priority_queue<int, vector<int>, greater<int>> pq;
	for (int i = 0; i < n; ++i) {
		int a;
		cin >> a;
		pq.push(a);
	}
	for (int i = 0; i < m; ++i) {
		int current = pq.top();
		pq.pop();
		pq.push(current / 2);
	}
	while (!pq.empty()) {
		res += pq.top();
		pq.pop();
	}

	cout << res << endl;

	return 0;
}

Compiler output:
a.cc:2:10: fatal error: priority_queue: No such file or directory
    2 | #include <priority_queue>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int m = sc.nextInt();
		long [] a = new int [n];
        for(int i=0;i<n;i++){
                             a[i] = sc.nextLong();
                            }        
        while(m>0){Arrays.sort(a);long max = a[n-1];
                  for(int i=n-1;i<=0;i--){if(a[i]>max/2){a[i]/=2;m--;if(m==0){break;}
                                                        }else{break;}
                                         } 
                  }
        long ans = 0;
        for(int i=0;i<n;i++){ans+=a[i];
                            }      
		System.out.println(ans);
	}
}


Compiler output:
Main.java:7: error: incompatible types: int[] cannot be converted to long[]
		long [] a = new int [n];
		            ^
1 error
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
        int m = sc.nextInt();
		long [] a = new int [n];
        for(int i=0;i<n;i++){
                             a[i] = sc.nextLong();
                            }
        Arrays.sort(a);
        while(m>0){long max = a[n-1];
                  for(int i=n-1;i<=0;i--){if(a[i]>max/2){a[i]/=2;m--;}if(m==0){break;}
                                         }else{break;} 
                   Arrays.sort(a);
                  }
        long ans = 0;
        for(int i=0;i<n;i++){ans+=a[i];
                            }      
		System.out.println(ans);
	}
}


Compiler output:
Main.java:14: error: 'else' without 'if'
                                         }else{break;} 
                                          ^
1 error
Language: C++

import heapq

n, m = map(int, input().split())
a = list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(a)  # aを優先度付きキューに

for _ in range(m):
    tmp_min = heapq.heappop(a)
    heapq.heappush(a, (-1)*(-tmp_min//2))  # 計算誤差の関係で-1を2回かけてます
print(-sum(a))

Compiler output:
a.cc:5:19: error: stray '#' in program
    5 | heapq.heapify(a)  # aを優先度付きキューに
      |                   ^
a.cc:1:1: error: 'import' does not name a type
    1 | import heapq
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n,m,ans=0;
    cin>>n>>m;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    rep(i,m){
        sort(all(disc));
        a[n-1]/=2;
    }
    rep(i,n) ans+=a[i];
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'disc' was not declared in this scope
   15 |         sort(all(disc));
      |                  ^~~~
a.cc:2:17: note: in definition of macro 'all'
    2 | #define all(x) (x).begin(),(x).end()
      |                 ^
Language: C++

#include <iostream>
#include <queue>
#include <vector>
using namespace std;

int main() {
  int n, m; cin >> c >> m;
  priority_queue<long long> que;
  
  for (int i = 0; i < n; i++) {
	long long a; cin >> a; que.push(a);
  }
  
  for (int i = 0; i < n; i++) {
    long long t = que.top();
    que.pop();
    que.push(t / 2)
  }
  
  long long ans = 0;
  while(!que.empty()) {
    ans += que.top();
    que.pop();
  }
  cout << ans << endl;
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: 'c' was not declared in this scope
    7 |   int n, m; cin >> c >> m;
      |                    ^
a.cc:17:20: error: expected ';' before '}' token
   17 |     que.push(t / 2)
      |                    ^
      |                    ;
   18 |   }
      |   ~
Language: C++


#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include <queue>

#define ll long long
#define vll vector<ll>
using namespace std;

ll ipow(ll x, ll n){
    ll ans = x;
    for (int i = 1; i < n; i++) {
        ans *= x;
    }
    return ans;
}

struct data{
    ll moto;
    ll n;
};

int main() {
    int n, m;
    cin >> n >> m;
    priority_queue<pair<ll,data>,vector<pair<ll,data>>,greater<>> que;

    for(int i = 0; i < n ; i++){
        ll x;
        cin >> x;
        que.push({x,{x,1}});
    }
    for (int i = 0; i < m ;i++){
        auto z = que.top();
        que.pop();
        auto y = z.second.n;
        y *= 2;
        ll x = (z.second.moto / y);
        que.push({x,{z.second.moto,y}});
    }
    ll ans = 0;
    while(!que.empty()) {
        ans += que.top().first;
        que.pop();
    }
    cout << ans << endl;



}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:32: error: template argument 2 is invalid
   28 |     priority_queue<pair<ll,data>,vector<pair<ll,data>>,greater<>> que;
      |                                ^
a.cc:28:49: error: template argument 2 is invalid
   28 |     priority_queue<pair<ll,data>,vector<pair<ll,data>>,greater<>> que;
      |                                                 ^~~~
a.cc:28:53: error: template argument 1 is invalid
   28 |     priority_queue<pair<ll,data>,vector<pair<ll,data>>,greater<>> que;
      |                                                     ^~
a.cc:28:53: error: template argument 2 is invalid
a.cc:28:64: error: template argument 1 is invalid
   28 |     priority_queue<pair<ll,data>,vector<pair<ll,data>>,greater<>> que;
      |                                                                ^~
a.cc:28:64: error: template argument 2 is invalid
a.cc:33:13: error: request for member 'push' in 'que', which is of non-class type 'int'
   33 |         que.push({x,{x,1}});
      |             ^~~~
a.cc:36:22: error: request for member 'top' in 'que', which is of non-class type 'int'
   36 |         auto z = que.top();
      |                      ^~~
a.cc:37:13: error: request for member 'pop' in 'que', which is of non-class type 'int'
   37 |         que.pop();
      |             ^~~
a.cc:41:13: error: request for member 'push' in 'que', which is of non-class type 'int'
   41 |         que.push({x,{z.second.moto,y}});
      |             ^~~~
a.cc:44:16: error: request for member 'empty' in 'que', which is of non-class type 'int'
   44 |     while(!que.empty()) {
      |                ^~~~~
a.cc:45:20: error: request for member 'top' in 'que', which is of non-class type 'int'
   45 |         ans += que.top().first;
      |                    ^~~
a.cc:46:13: error: request for member 'pop' in 'que', which is of non-class type 'int'
   46 |         que.pop();
      |             ^~~
Language: C++

#include<algorithm>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include<vector>

using namespace std;
 
typedef long long ll;

#define PB push_back
#define MP make_pair
#define F first
#define S second

template<typename T,typename U>
bool chmax(T& max, const U& x){
	if(max<x){
		max = x;
		return true;
	}
	return false;
}

template<typename T,typename U>
bool chmin(T& min, const U& x){
	if(min>x){
		min = x;
		return true;
	}
	return false;
}



int main(){
	ll n,m;
  	cin >> n >> m;
  	vector<ll> a(n);
  	for(ll i=0;i<n;i++){
    	cin >> a[i];
    }
  	sort(a.begin(),a.end());
  	ll d;
  	while( (d=distance(lower_bound(a.begin(),a.end(),a.back()/2),a.end())) >=m){
      	if(m<=0) break;
    	for(int i=0;i<min(d,m);i++){
        	a[n-1-i]/=2;	
        }
      	m= min(m-d,0);
      	sort(a.begin(),a.end());
    }
  	
  	for(ll i=0;i<m;i++){
    	ll tmp=a.back()/2;
      	a.pop_back();
      	if(tmp>0){
      		auto itr = lower_bound(a.begin(),a.end(),tmp);
      		a.insert(itr,tmp);
        }
    }
  	ll sum=0;
  	for(auto &e:a){
    	sum+=e;
    }
  	cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:15: error: no matching function for call to 'min(ll, int)'
   57 |         m= min(m-d,0);
      |            ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:57:15: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   57 |         m= min(m-d,0);
      |            ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:57:15: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   57 |         m= min(m-d,0);
      |            ~~~^~~~~~~
Language: C++

int main() {
	int n, m, a[100000] = {}; long long ans = 0;
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		int j = i - 1;
		int v = a[i];
		while (a[j] > v && j >= 0) {
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = v;

	}
	for (int i = 0; i < m;i++) {
		int v = a[n - 1] / 2;
		int j = n - 2;
		while (a[j] > v && j >= 0) {
			a[j + 1] = a[j];
			j--;
		}
		a[j + 1] = v;
	}
	for (int i = 0; i < n; i++) {
		ans += a[i];
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n >> m;
      |         ^~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout << ans << endl;
      |         ^~~~
a.cc:27:24: error: 'endl' was not declared in this scope
   27 |         cout << ans << endl;
      |                        ^~~~
Language: C++

from heapq import heapify,heappop,heappush
N,M=map(int,input().split())
A=list(map(lambda x:-int(x),input().split()))
heapify(A)
for i in range(M):
    heappush(A,-(-heappop(A)//2))
print(-sum(A))

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from heapq import heapify,heappop,heappush
      | ^~~~
Language: C++

#include <iostream>
#include <priority_queue>
using namespace std;
signed main(){
  int n, m;
  cin >> n >> m;
  priority_queue<int> Q;
  for(int i=0; i<n; i++){
  	int a; cin >> a;
    Q.push(a);
  }
  while(m--){
  	int a; a = Q.top(); Q.pop();
    Q.push(a/2);
  }
  long long sum = 0;
  for(const auto &a: Q){
  	sum += a;
  }
  cout << sum << endl;
}


Compiler output:
a.cc:2:10: fatal error: priority_queue: No such file or directory
    2 | #include <priority_queue>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

using namespace std;
signed main(){
  int n, m;
  cin >> n >> m;
  priority_queue<int> Q;
  for(int i=0; i<n; i++){
  	int a; cin >> a;
    Q.push(a);
  }
  while(m--){
  	int a; a = Q.top(); Q.pop();
    Q.push(a/2);
  }
  long long sum = 0;
  for(const auto &a: Q){
  	sum += a;
  }
  cout << sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
    4 |   cin >> n >> m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:3: error: 'priority_queue' was not declared in this scope
    5 |   priority_queue<int> Q;
      |   ^~~~~~~~~~~~~~
a.cc:1:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | using namespace std;
a.cc:5:18: error: expected primary-expression before 'int'
    5 |   priority_queue<int> Q;
      |                  ^~~
a.cc:8:5: error: 'Q' was not declared in this scope
    8 |     Q.push(a);
      |     ^
a.cc:11:20: error: 'Q' was not declared in this scope
   11 |         int a; a = Q.top(); Q.pop();
      |                    ^
a.cc:15:22: error: 'Q' was not declared in this scope
   15 |   for(const auto &a: Q){
      |                      ^
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout << sum << endl;
      |   ^~~~
a.cc:18:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:18: error: 'endl' was not declared in this scope
   18 |   cout << sum << endl;
      |                  ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;

int main() {
    int n, m;
    cin >> n >> m;
    priority_queue<int> q;
    rep(i,n) {
        int a;
        cin >> a;
        q.push(a);
    }
    rep(i,m) {
        int max = q.top(); q.pop();
        q.push(a/2);
    }
    ll ans = 0;
    rep(i,n) {
        ans += q.top(); q.pop();
    }
    cout << ans << endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: 'a' was not declared in this scope
   17 |         q.push(a/2);
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

/* #pragma */
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int
#define endl '\n'

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/*template*/
template<class T>constexpr bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>constexpr bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
constexpr int32_t GCD(int32_t a, int32_t b){return b ? GCD(b, a%b) : a;}
constexpr int64_t GCD(int64_t a, int64_t b){return b ? GCD(b, a%b) : a;}
constexpr int32_t LCM(int32_t a, int32_t b){return a / GCD(a, b) * b;}
constexpr int64_t LCM(int64_t a, int64_t b){return a / GCD(a, b) * b;}

/* const */
constexpr int32_t INF = 1001001001;
constexpr int64_t LINF = 1001001001001001001ll;
constexpr int32_t MOD = 1e9 + 7;
constexpr int32_t EPS = 1e-9;
constexpr int32_t dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//constexpr int32_t dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};


//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

//#define int int64_t

/*global*/



signed main()
{
	int n, m; cin >> n >> m;
	priority_queue<int> q;
	for (size_t i = 0; i < n; i++)
	{
		int a; cin >> a;
		q.push(a);
	}

	for (size_t i = 0; i < m; i++)
	{
		const int large = q.top;
		q.pop();
//		large >>= 1;

		q.push(large>>1);
	}
	int sum{};
	for(int i = 0; i < n; ++i)
	{
		sum += q.top();
		q.pop();
	}
	
	cout << sum << '\n';
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:37: error: cannot convert 'std::priority_queue<int>::top' from type 'const __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type& (std::priority_queue<int>::)() const' {aka 'const int& (std::priority_queue<int>::)() const'} to type 'const int'
   69 |                 const int large = q.top;
      |                                     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

/* #pragma */
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int
#define endl '\n'

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/*template*/
template<class T>constexpr bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>constexpr bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
constexpr int32_t GCD(int32_t a, int32_t b){return b ? GCD(b, a%b) : a;}
constexpr int64_t GCD(int64_t a, int64_t b){return b ? GCD(b, a%b) : a;}
constexpr int32_t LCM(int32_t a, int32_t b){return a / GCD(a, b) * b;}
constexpr int64_t LCM(int64_t a, int64_t b){return a / GCD(a, b) * b;}

/* const */
constexpr int32_t INF = 1001001001;
constexpr int64_t LINF = 1001001001001001001ll;
constexpr int32_t MOD = 1e9 + 7;
constexpr int32_t EPS = 1e-9;
constexpr int32_t dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//constexpr int32_t dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};


//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

//#define int int64_t

/*global*/



signed main()
{
	int n, m; cin >> n >> m;
	priority_queue<int> q;
	for (size_t i = 0; i < n; i++)
	{
		int a; cin >> a;
		q.push(a);
	}

	for (size_t i = 0; i < m; i++)
	{
		const int large = q.top;
		q.pop();
		large >>= 1;

		q.push(large);
	}
	int sum{};
	for(int i = 0; i < n; ++i)
	{
		sum += q.top();
		q.pop();
	}
	
	cout << sum << '\n';
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:69:37: error: cannot convert 'std::priority_queue<int>::top' from type 'const __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type& (std::priority_queue<int>::)() const' {aka 'const int& (std::priority_queue<int>::)() const'} to type 'const int'
   69 |                 const int large = q.top;
      |                                     ^~~
a.cc:71:23: error: assignment of read-only variable 'large'
   71 |                 large >>= 1;
      |                 ~~~~~~^~~~~