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

#include<stdio.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<queue>
using namespace std;
int main(){
    long N,M;
    scanf("%ld",&N);
    scanf("%ld",&M);
    std::priority_queue<long> que;
    for(long i=0;i<N;i++){
        long tmp;
        scanf("ld",tmp);
        que.push(tmp);
    }

    long tmp;
    for(long i=0;i<M;i++){
        tmp = que.top();
        que.pop();
        que.push(tmp/2);
    }
 
    long long ans = 0;

    for(long i=0;i<N;i++){
        ans += que.top();
        que.pop();
    }
 
    cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout << ans << endl;
      |     ^~~~
a.cc:6:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<queue>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:32:20: error: 'endl' was not declared in this scope
   32 |     cout << ans << endl;
      |                    ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include<queue>
  +++ |+#include <ostream>
    6 | using namespace std;
Language: C++

#include<stdio.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<queue>
using namespace std;
int main(){
    long N,M;
    scanf("%ld",&N);
    scanf("%ld",&M);
    std::priority_queue<long> que;
    for(long i=0;i<N;i++){
        long tmp;
        cin >> tmp;
        que.push(tmp);
    }

    long tmp;
    for(long i=0;i<M;i++){
        tmp = que.top();
        que.pop();
        que.push(tmp/2);
    }
 
    long long ans = 0;

    for(long i=0;i<N;i++){
        ans += que.top();
        que.pop();
    }
 
    cout << ans << endl;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'cin' was not declared in this scope
   14 |         cin >> tmp;
      |         ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include<queue>
  +++ |+#include <iostream>
    6 | using namespace std;
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout << ans << endl;
      |     ^~~~
a.cc:32:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:20: error: 'endl' was not declared in this scope
   32 |     cout << ans << endl;
      |                    ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include<queue>
  +++ |+#include <ostream>
    6 | using namespace std;
Language: Java


import java.util.*;
import java.lang.*;

class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();

        PriorityQueue<Integer> pq = new PriorityQueue<>(Comparator.reverseOrder());

        for(i = 0; i < N; i++){
            pq.add(sc.nextInt());
        }

        for(i = 0; i < M; i++){
            pa.add(pq.poll() / 2);
        }

        long minSum = 0;
        for(int i = 0; i < N; i++){
            minSum = minSum + pq.poll();
        }

        System.out.println(minSum);

    }
}






Compiler output:
Main.java:13: error: cannot find symbol
        for(i = 0; i < N; i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
        for(i = 0; i < N; i++){
                   ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
        for(i = 0; i < N; i++){
                          ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
        for(i = 0; i < M; i++){
            ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
        for(i = 0; i < M; i++){
                   ^
  symbol:   variable i
  location: class Main
Main.java:17: error: cannot find symbol
        for(i = 0; i < M; i++){
                          ^
  symbol:   variable i
  location: class Main
Main.java:18: error: cannot find symbol
            pa.add(pq.poll() / 2);
            ^
  symbol:   variable pa
  location: class Main
7 errors
Language: C++

#include<stdio.h>
int main(){
  int num,cpn,i,mxnum,scdnum;
  scanf("%d",&num);
  long val[num],sum=0,max,scd,box;
  scanf("%d",&cpn);
  for(i=0;i<num;i++){
    scanf("%ld",&val[i]);
    sum+=val[i];
  }
  
  while(cpn!=0){
    max=val[0];
    mxnum=0;
    scd=0; scdnum=0;
    for(i=1;i<num;i++){
      if(val[i]>max){
        scd = max;
        scdnum = mxnum;
        max=val[i];
        mxnum=i;
      }else if(val[i]>scd){
        scd = val[i];
        scdnum = i;
      }
    }
    while(val[mxnum]>val[scdnum]){
      box=val[mxnum];
      val[mxnum]/=2;
      sum-=box-val[mxnum]
      cpn--;
    }
  }
  printf("%ld",sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: expected ';' before 'cpn'
   30 |       sum-=box-val[mxnum]
      |                          ^
      |                          ;
   31 |       cpn--;
      |       ~~~
Language: C++

#include<stdio.h>
int main(){
  int num,cpn,i,mxnum;
  scanf("%d",&num);
  long val[num],sum,max;
  scanf("%d",&cpn);
  for(i=0,i<num;i++){
      scanf("%ld",&val[i]);
  }
  
  while(cpn!=0){
    max=num[0];
    for(i=1;i<num;i++){
      if(val[i]>max){
        max=val[i];
        mxnum=i;
      }
    }
    val[mxnum]/=2;
    cpn--;
  }
  sum=0;
  for(i=1;i<num;i++){
    sum+=val[i];
  }
  printf("%ld",sum);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before ')' token
    7 |   for(i=0,i<num;i++){
      |                    ^
      |                    ;
a.cc:12:12: error: invalid types 'int[int]' for array subscript
   12 |     max=num[0];
      |            ^
Language: C++

#include<stdio.h>
int main(){
  int num,cpn,i,mxnum;
  scanf("%d",num);
  long val[num],sum,max;
  scanf("%d",cpn);
  for(i=0,i<num;i++)
      scanf("%ld",&val[i]);
  
  while(cpn!=0){
    max=num[0];
    for(i=1;i<num;i++)
      if(num[i]>max){
        max=num[i];
        mxnum=i;
      }
    num[mxnum]/=2;
    cpn--;
  }
  sum=0;
  for(i=1;i<num;i++)
    sum+=num[i];
  printf("%ld",sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before ')' token
    7 |   for(i=0,i<num;i++)
      |                    ^
      |                    ;
a.cc:11:12: error: invalid types 'int[int]' for array subscript
   11 |     max=num[0];
      |            ^
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |       if(num[i]>max){
      |             ^
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |         max=num[i];
      |                ^
a.cc:17:8: error: invalid types 'int[int]' for array subscript
   17 |     num[mxnum]/=2;
      |        ^
a.cc:22:13: error: invalid types 'int[int]' for array subscript
   22 |     sum+=num[i];
      |             ^
Language: C++

#include<stdio.h>
int main(){
  int num,cpn,i,mxnum;
  scanf("%d",num);
  long val[num],sum,max;
  scanf("%d",cpn);
  for(i=0,i<num;i++)
      scanf("%ld",&val[i]);
  
  while(cpn!=0){
    max=num[0];
    for(i=1;i<num;i++)
      if(num[i]>max){
        max=num[i];
        mxnum=i;
      }
    num[mxnum]/=2;
    cpn--;
  }
  sum=0;
  for(i=1;i<num;i++)
    sum+=num[i];
  printf("%ld",sum);

Compiler output:
a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before ')' token
    7 |   for(i=0,i<num;i++)
      |                    ^
      |                    ;
a.cc:11:12: error: invalid types 'int[int]' for array subscript
   11 |     max=num[0];
      |            ^
a.cc:13:13: error: invalid types 'int[int]' for array subscript
   13 |       if(num[i]>max){
      |             ^
a.cc:14:16: error: invalid types 'int[int]' for array subscript
   14 |         max=num[i];
      |                ^
a.cc:17:8: error: invalid types 'int[int]' for array subscript
   17 |     num[mxnum]/=2;
      |        ^
a.cc:22:13: error: invalid types 'int[int]' for array subscript
   22 |     sum+=num[i];
      |             ^
a.cc:23:21: error: expected '}' at end of input
   23 |   printf("%ld",sum);
      |                     ^
a.cc:2:11: note: to match this '{'
    2 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
int main(){
    int n, m;
    long ai;
    cin >> n >> m;
    vector<long> a(n);
    for (int i = 0; i < n; i++){
        cin >> ai;
        a[i] = ai;
    }
    vector<pair<long,long>> disdiff;
    
    for(int i = 0; i< n; i++){
        long price = a[i];
        for (int j = 0; j < m; j++){
            long pp = price;
            price /= 2;
            auto r = make_pair(pp-price, i);
            disdiff.push_back(r);
        }
    }

    sort(disdiff.begin(), disdiff.end(), greater<pair<long, long>>());

    for(int j = 0; j < m; j++){
        int i = disdiff[j].second;
        a[i] /= 2;
    }

    long total = 0;
    for(int i = 0; i< n; i++){
        total += a[i];
    }
    cout << total << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   26 |     sort(disdiff.begin(), disdiff.end(), greater<pair<long, long>>());
      |     ^~~~
      |     short
Language: C++

#!/usr/bin/ruby
#encoding: utf-8

n,m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)

m.times do
  a.sort!
  a[-1] /= 2
end

puts a.inject(&:+)

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #!/usr/bin/ruby
      |  ^
a.cc:2:2: error: invalid preprocessing directive #encoding
    2 | #encoding: utf-8
      |  ^~~~~~~~
a.cc:4:1: error: 'n' does not name a type
    4 | n,m = gets.split.map(&:to_i)
      | ^
Language: C++

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

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 a = 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:22:5: error: expected primary-expression before '}' token
   22 |     }
      |     ^
Language: Java

from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue
#import numpy as np
#import sympy as syp(素因数分解とか)
Mod = 1000000007
 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

def factorial(i):
    if i == 1:
        return 1
    else:
        return i*factorial(i-1)
 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)




def main(): #startline-------------------------------------------
    N,M =map(int,input().split())
    A = list(map(int,input().split()))
    heap = []
    for i in range(N):
        heappush(heap,-A[i])
    for i in range(M):
        p = -heappop(heap)//2
        heappush(heap,-p)
    print(-sum(heap))
    
if __name__ == "__main__":
    main() #endline===============================================

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
from collections import deque,defaultdict,Counter
^
Main.java:9: error: illegal character: '#'
#import numpy as np
^
Main.java:10: error: illegal character: '#'
#import sympy as syp(???????)
^
Main.java:37: error: '{' expected
class UnionFind:
               ^
Main.java:53: error: class, interface, enum, or record expected
        if px < py:
              ^
Main.java:64: error: illegal character: '#'
def main(): #startline-------------------------------------------
            ^
Main.java:76: error: illegal character: '#'
    main() #endline===============================================
           ^
7 errors
Language: Java

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.PriorityQueue;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class ABC141D {

    public static void main(String args[]) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n  = sc.nextInt();
        int m = sc.nextInt();

        PriorityQueue<Integer> Q = new PriorityQueue<>(Collections.reverseOrder());
        for(int i=0;i<n;i++){
            Q.add(sc.nextInt());
        }

        for(int i=0;i<m;i++){
            int max = Q.poll();
            Q.add(max/2);
        }

        int res = 0;
        for(int i=0;i<n;i++){
            res+=Q.poll();
        }
        
        pw.println(res);

        pw.flush();
    }
}
class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}

Compiler output:
Main.java:8: error: class ABC141D is public, should be declared in a file named ABC141D.java
public class ABC141D {
       ^
1 error
Language: Java

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.PriorityQueue;

public class Main {

    public static void main(String args[]) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n  = sc.nextInt();
        int m = sc.nextInt();

        PriorityQueue<Integer> Q = new PriorityQueue<>(Collections.reverseOrder());
        for(int i=0;i<n;i++){
            Q.add(sc.nextInt());
        }

        for(int i=0;i<m;i++){
            int max = Q.poll();
            Q.add(max/2);
        }

        int res = 0;
        for(int i=0;i<n;i++){
            res+=Q.poll();
        }
        
        pw.println(res);

        pw.flush();
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        FastScanner sc = new FastScanner();
        ^
  symbol:   class FastScanner
  location: class Main
Main.java:9: error: cannot find symbol
        FastScanner sc = new FastScanner();
                             ^
  symbol:   class FastScanner
  location: class Main
2 errors
Language: C++

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

int main(){
  int N, M; cin >> N >> M;
  priority_queue<int> A;
  
  rep(i,N){
    int x; A.push(x);
  }
  
  rep(i,M){
    int y = A.top(); A.pop();
    A.push(y/2);
  }
  
  int ans;
  
  rep(i,N){
    ans += A[i];
  }
  
  cout << ans << endl;
}

 


Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: no match for 'operator[]' (operand types are 'std::priority_queue<int>' and 'int')
   22 |     ans += A[i];
      |             ^
Language: C++

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

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

    priority_queue<long long> queue;
    for (int i = 0; i < N; ++i) {
        long long A; 
        cin >> A; 
        queue.push(A);
    }
    for (int i = 0; i < M; ++i) {
        long long top = queue.top(); 
        queue.pop();
        queue.push(top/2);
    }
    long long ans = 0;
    while (!que.empty()) ans += queue.top(), queue.pop();
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:13: error: 'que' was not declared in this scope; did you mean 'queue'?
   22 |     while (!que.empty()) ans += queue.top(), queue.pop();
      |             ^~~
      |             queue
Language: C

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

#define N_MAX 100001

int desc(const void *a, const void *b){
  if(*(long *)a > *(long *)b){
    return -1;
  }else if(*(long *)a == *(long *)b){
    return 0;
  }else{
    return 1;
  }
}

int main(void){
  int i, j;

  int n, m;
  cin >> n >> m;

  priority_queue<long> q;

  long a;
  for(i = 0; i < n; i++){
    cin >> a;
    q.push(a);
  }

  for(i = 0; i < m; i++){
    a = q.top();
    q.pop();
    a /= 2;
    q.push(a);
  }

  long ans=0;
  for(i = 0; i < n; i++){
    a = q.top();
    q.pop();
    ans += a;
  }

  cout << ans << endl;

  return 0;
}


Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
#include <queue>
using namespace std;

#define N_MAX 100001

int desc(const void *a, const void *b){
  if(*(long *)a > *(long *)b){
    return -1;
  }else if(*(long *)a == *(long *)b){
    return 0;
  }else{
    return 1;
  }
}

int main(void){
  int i, j;

  int n, m;
  scanf("%d%d", &n, &m);

  priority_queue<long> q;

  long a;
  for(i = 0; i < n; i++){
    scanf("%ld", &a);
    q.push(a);
  }

  for(i = 0; i < m; i++){
    a = q.top();
    q.pop();
    a /= 2;
    q.push(a);
  }

  long ans=0;
  for(i = 0; i < n; i++){
    a = q.top();
    q.pop();
    ans += a;
  }

  printf("%ld\n", ans);

  return 0;
}


Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

#include <cstdio>
#include <queue>
#include <iostream>

using namespace std;

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
 

    int a[]={1,2,4,3,5};
    std::priority_queue<int> q;
    int n,m,tmp;

    cin >> n;
    cin >> m;

   for (n; n>0 ; n--) {
       cin>>tmp;
        q.push(tmp);
    }

    while (m>0) {
        tmp=q.top();
        q.pop();
        tmp=tmp/2;
        q.push(tmp);
        m--;

    }
    tmp=0;
    while(!q.empty()){
        tmp+=q.top();
        
        q.pop();

    }
    cout<<tmp;

    return 0;


}

Compiler output:
main.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.
Language: C

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

int main() {
    cin.tie(0);
   	ios::sync_with_stdio(false);
 

    int a[]={1,2,4,3,5};
    std::priority_queue<int> q;
    int n,m,tmp;

    cin >> n;
    cin >> m;

   for (n; n>0 ; n--) {
       cin>>tmp;
        q.push(tmp);
    }

    while (m>0) {
        tmp=q.top();
        q.pop();
        tmp=tmp/2;
        q.push(tmp);
        m--;

    }
    tmp=0;
    while(!q.empty()){
        tmp+=q.top();
        
        q.pop();

    }
    cout<<tmp;

    return 0;


}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	static long power(int[] arr, int ticket){
		PriorityQueue<Integer> pq = new PriorityQueue(Collections.reverseOrder());
		for(int n : arr){
			pq.add(n);
		}
		while(ticket>0){
			int larg = pq.poll();
			larg >>= 1;
		//	System.out.println(larg);
			pq.add(larg);
			ticket -=1;
		}
		Integer val = 0;
		long ans = 0;
		while((val=pq.poll())!=null){
			ans += val;
		//	System.out.println(ans);
		}
		
		return ans;

	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scan = new Scanner(System.in());
      int m = scan.nextInt();
      int ticket = scan.nextInt();
      int[] arr = new int[m];
      for(int i=0;i<m;i++){
        arr[i] = scan.nextInt();
      }
      System.out.println(power(arr,ticket));
		
		// your code goes here
	}
}

Compiler output:
Main.java:35: error: cannot find symbol
		Scanner scan = new Scanner(System.in());
		                                 ^
  symbol:   method in()
  location: class System
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

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


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

}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: 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 'int'
   25 |     int a=price.top; price.pop;
      |                 ^~~
a.cc:25:28: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = int; _Sequence = std::vector<int>; _Compare = std::less<int>]'
   25 |     int a=price.top; price.pop;
      |                      ~~~~~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:157,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:771:7: note: declared here
  771 |       pop()
      |       ^~~
Language: C++

import heapq
N,Y=map(int,input().split())
a=[float(x) for x in input().split()]

for b in range(Y):
  heapq.heapify(a)
  a[N-1]=float(a[N-1])/2
v=0
for c in range(N):
  v+=int(a[c])
print(v)


Compiler output:
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<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#define rep(i, n) rep2(i,0,n)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
typedef long long ll;
using namespace std;

int main()
{
	ll n, m;
	cin >> n >> m;
	vector<int> a(n);
	rep(i, n) cin >> a.at(i);
	int i = 0;
	while (i < m) {
		sort(a.begin(), a.end());
		a.at() /= 2;
		++i;
	}
	ll count = 0;
	rep(i, n) count += a.at(i);
	cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: no matching function for call to 'std::vector<int>::at()'
   22 |                 a.at() /= 2;
      |                 ~~~~^~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1180:7: note: candidate: 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::at(size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type = long unsigned int]'
 1180 |       at(size_type __n)
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1180:7: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_vector.h:1199:7: note: candidate: 'std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::at(size_type) const [with _Tp = int; _Alloc = std::allocator<int>; const_reference = const int&; size_type = long unsigned int]'
 1199 |       at(size_type __n) const
      |       ^~
/usr/include/c++/14/bits/stl_vector.h:1199:7: note:   candidate expects 1 argument, 0 provided
Language: C++

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

const int n_max=100000;

int main() {

    int n,m;
    scanf("%d %d",&n,&m);

    priority_queue<int> q;
    rep(i,n) {
        int a;
        cin>>a;
        q.push(a);
    }
    rep(i,m) {
        int a=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:28:20: error: expected ';' before 'return'
   28 |     cout<<ans<<endl
      |                    ^
      |                    ;
   29 | 
   30 |  return 0;
      |  ~~~~~~
Language: C++

// warm heart, wagging tail,and a smile just for you!
//
//                            ▒█████▒▒
//                             ██████████▒
//                             ▒████████████▒
//                            ██████████████████
//                           ████████████████████▒
//                          ▒██████████████████████▒
//                          ▒███████████████████████
//                      ▒████▒▒▒▒▒▒█████████████████▒
//                    ███▒▒▒▒▒▒██████████████████████▒▒▒
//                  ▒██▒▒███████████████████████▒▒▒▒▒██████
//                 ▒█████████████████████████▒▒▒▒▒▒█████████▒
//                 ▒█████████████████████▒▒▒▒▒▒██████████████
//                  ▒████         ████▒▒▒▒▒████         ████▒
//              ▒█████▒    ████    ▒▒▒▒███████    ████    ██████▒
//            ▒██▒▒▒▒▒    ██████    █████████    ██████    ██▒▒▒██▒
//           █████████   ████████   █████████   ████████   ▒▒▒▒█████
//          ▒█████████    ██████    ████████▒    ██████    █████████
//          ▒██████████    ████    █████▒▒▒▒▒▒    ████    ██████████
//           ████████████        ▒▒▒▒▒▒▒████████        ███████████▒
//       ▒██████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒███████████████████████████████████▒
//     ███▒▒▒▒▒▒▒▒▒▒▒▒█████████████████████████████████████████▒▒████████▒
//   ▒▒▒▒▒▒▒▒▒██████████████                         ███████▒▒▒▒███████████
//   █████████████████████████                     ███████▒▒▒██████████████▒
//   █████████████████████████████             ███████▒▒▒██████████████████▒
//   ██████████████████████████████████████████████████████████████████████
//    ██████████████████████████████████████████████████████████████████▒
//      ▒█████████████████▒▒▒▒▒▒▒██████████████████████████████████▒▒▒
//
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

signed main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n,m;
  cin >> n >> m;

  vector<int> a(n);
  REP(i,n) cin >> a[i];
  
  priority_queue<int> que;
  REP(i,n) que.push(a[i]);

  REP(_,m){
    que.top() /= 2;
  }

  int ans = 0;
  REP(i,n) ans += que.top(),que.pop();

  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:15: error: assignment of read-only location 'que.std::priority_queue<long long int>::top()'
   68 |     que.top() /= 2;
      |     ~~~~~~~~~~^~~~
Language: C++

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

int main() {
	int N, M;
	long long int A[N];
	for (int i = 0; i < N; ++i) {
    	cin >> A[i];
    }
	for (int i = 0; i < M; ++i) {
    	*max_elemnt(A, A+N) /= 2;
    }
	cout << accumulate(A, A+N, 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'max_elemnt' was not declared in this scope
   11 |         *max_elemnt(A, A+N) /= 2;
      |          ^~~~~~~~~~
Language: C++

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

int main() {
	int N, M;
	long long int A[N];
	for (int i = 0; i < N; ++i) {
    	cin >> A[i];
    }
	for (int i = 0; i < N; ++i, --M) {
    	if (M == 0) { break; }
    	*max_elemnt(A, A+N) /= 2;
    }
	cout << accumulate(A, A+N, 0) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'max_elemnt' was not declared in this scope
   12 |         *max_elemnt(A, A+N) /= 2;
      |          ^~~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

void Main();
int main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
}

void Main(){
    auto& fin = cin;
    int64_t n, m;
    fin >> n >> m;
    vector<int64_t> a(n);
    multiset<int64_t> a_set;
    for(int64_t i=0; i < a.size(); i++){
        fin >> a[i];
        a_set.insert(a[i]);
    }
    int64_t my_sum = 0;
    for(const auto& val; a_set){
        my_sum += val;
    }
    cout << my_sum <<endl;
}


Compiler output:
a.cc: In function 'void Main()':
a.cc:24:15: error: declaration of 'const auto& val' has no initializer
   24 |     for(const auto& val; a_set){
      |               ^~~~
a.cc:24:26: error: could not convert 'a_set' from 'std::multiset<long int>' to 'bool'
   24 |     for(const auto& val; a_set){
      |                          ^~~~~
      |                          |
      |                          std::multiset<long int>
a.cc:24:31: error: expected ';' before ')' token
   24 |     for(const auto& val; a_set){
      |                               ^
      |                               ;
Language: C++

#include <iostream>
#include <math.h>
#include <vector>
#include <cstdlib>

using namespace std;

int main(int argc, const char * argv[]) {
	long int N, maxindex;
	long int sum = 0;
	int M;

	cin >> N >> M;
	vector<long int> A(N);

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

	for(int j=0; j<M; j++){
		//max value
		long int max = *std::max_element(A.begin(), A.end());
		*std::max_element(A.begin(), A.end()) = max/2;
		
	}

	for(int i=0; i<N; i++){
		sum += A[i];
	}
	cout << sum << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:22:38: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   22 |                 long int max = *std::max_element(A.begin(), A.end());
      |                                      ^~~~~~~~~~~
      |                                      tuple_element
a.cc:23:23: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   23 |                 *std::max_element(A.begin(), A.end()) = max/2;
      |                       ^~~~~~~~~~~
      |                       tuple_element
Language: C++

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

#define rep(i,n) for (int i = 0;i < n; i++)

using namespace std;
using ll = long long;

int main() {
	int N, M;
	cin >> N >> M;
	priority_queue<int> que;

	rep(i, N)
	{
		int work;
		cin >> work;
		que.push(work);
	}

	rep(i, M)
	{
		que.push(que.top / 2);
		que.pop();
	}

	ll ans = 0;

	rep(i, N)
	{
		ans += que.top();
		que.pop();
	}

	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:30: error: invalid use of member function 'std::priority_queue<_Tp, _Sequence, _Compare>::const_reference std::priority_queue<_Tp, _Sequence, _Compare>::top() const [with _Tp = int; _Sequence = std::vector<int, std::allocator<int> >; _Compare = std::less<int>; const_reference = const int&]' (did you forget the '()' ?)
   26 |                 que.push(que.top / 2);
      |                          ~~~~^~~
      |                                 ()
Language: C++

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

int N, M, a;
long long sum;
priority_queue<int> pq;

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

    for (ll i = 0;i < N; i++) {
        cin >> a;
        pq.push(a);
        sum += a;
    }

    for (ll i = 0;i < M; i++) {
    	a = pq.top(); pq.pop();
    	sum -= (a * 0.5);
    	pq.push(a/2);
    }

    cout << sum << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: 'll' was not declared in this scope
   11 |     for (ll i = 0;i < N; i++) {
      |          ^~
a.cc:11:19: error: 'i' was not declared in this scope
   11 |     for (ll i = 0;i < N; i++) {
      |                   ^
a.cc:17:10: error: 'll' was not declared in this scope
   17 |     for (ll i = 0;i < M; i++) {
      |          ^~
a.cc:17:19: error: 'i' was not declared in this scope
   17 |     for (ll i = 0;i < M; i++) {
      |                   ^
Language: C++

N = list(map(int, (input().split(' '))))
A = list(map(int, (input().split(' '))))

for i in range(N[1]):
    A[A.index(max(A))] = int(max(A) / 2)

print(sum(A))

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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,K,q;
  int64_t sum=0;
  cin >>n>>K;
  vector<int>A(n);
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  sort(A.begin(), A.end());
  for(int i=K;i>=0;i--){
    A[K]=(int)(A[K]/2);
    for(int j=K;j>0;i--){
    if(A[j]<A[j-1])swap(A[j],A[j-1]);
    else break;
    }
  }
  for(int i=0;i<n;i++){
    sum+=A[i];
  }
  cout<<sum<<endl;
}
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,K,q;
  int64_t sum=0;
  cin >>n>>K;
  vector<int>A(n);
  for(int i=0;i<n;i++){
    cin>>A[i];
  }
  sort(A.begin(), A.end());
  for(int i=K;i>=0;i--){
    A[n]=(int)(A[n]/2);
    for(int j=n;j>0;i--){
    if(A[j]<A[j-1])swap(A[j],A[j-1]);
    else break;
    }
  }
  for(int i=0;i<n;i++){
    sum+=A[i];
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc:28:5: error: redefinition of 'int main()'
   28 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

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

#define ll long long
#define v vetor

int main()
{
 	int i,n,m;
 	cin>>n;
 	cin>>m;
 	v<ll> a(n);
 	for(i = 0 ; i < n ; i++)
 	cin>>a[i];
 	make_heap(a.begin(),a.end());
 	while(m > 0)
 	{
 		ll x = a.front();
		x = x/2;
		pop_heap(a.begin(), a.end()); 
    	a.pop_back();
    	a.push_back(x);
    	push_heap(a.begin(),a.end());
    	m--;
	}
	ll sum = 0;
	for( i = 0 ; i < n ; i++)
	sum += a[i];
	cout<<sum;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'vetor' was not declared in this scope
    5 | #define v vetor
      |           ^~~~~
a.cc:12:9: note: in expansion of macro 'v'
   12 |         v<ll> a(n);
      |         ^
a.cc:4:12: error: expected primary-expression before 'long'
    4 | #define ll long long
      |            ^~~~
a.cc:12:11: note: in expansion of macro 'll'
   12 |         v<ll> a(n);
      |           ^~
a.cc:14:14: error: 'a' was not declared in this scope
   14 |         cin>>a[i];
      |              ^
a.cc:15:19: error: 'a' was not declared in this scope
   15 |         make_heap(a.begin(),a.end());
      |                   ^
Language: C++

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

using in = int64_t;

int main(){
in n,m;
  cin >>n>>m;
vector<double> a(n);
  rep(i,n) cin>>a.at(i);//n
  sort(a.begin(),a.end());
  
  rep(i,m){
  in xx=max(n-2-i,0ll);
    a.at(n-1) /= 2;
    sort(a.begin()+xx,a.end());
    
  }//mSORT
  
  in ans =0;
  rep(i,n){
  ans += (in)a.at(i);
  }
  
  cout <<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: no matching function for call to 'max(in, long long int)'
   15 |   in xx=max(n-2-i,0ll);
      |         ~~~^~~~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:15:12: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   15 |   in xx=max(n-2-i,0ll);
      |         ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:15:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   15 |   in xx=max(n-2-i,0ll);
      |         ~~~^~~~~~~~~~~
Language: C++

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

using in = int64_t;

int main(){
in n,m;
  cin >>n>>m;
vector<double> a(n);
  rep(i,n) cin>>a.at(i);//n
  sort(a.begin(),a.end());
  
  rep(i,m){
  int xx=max(n-2-i,0);
    a.at(n-1) /= 2;
    sort(a.begin()+xx,a.end());
    
  }//mSORT
  
  in ans =0;
  rep(i,n){
  ans += (in)a.at(i);
  }
  
  cout <<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: no matching function for call to 'max(in, int)'
   15 |   int xx=max(n-2-i,0);
      |          ~~~^~~~~~~~~
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:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:15:13: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   15 |   int xx=max(n-2-i,0);
      |          ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303: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:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:15:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   15 |   int xx=max(n-2-i,0);
      |          ~~~^~~~~~~~~
Language: C++

int main(){
int N,M;
cin>>N>>M;
priority_queue<double> A;
REP(i,N){
    int a;
    cin>>a;
    A.push(a);
}
REP(i,M){
    int b=A.top();
    A.pop();
    A.push(b/2);
}
int sum=0;
while(!A.empty()){
    sum+=A.top();
    A.pop();
}
int ans=sum;
cout<<sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:1: error: 'cin' was not declared in this scope
    3 | cin>>N>>M;
      | ^~~
a.cc:4:1: error: 'priority_queue' was not declared in this scope
    4 | priority_queue<double> A;
      | ^~~~~~~~~~~~~~
a.cc:4:16: error: expected primary-expression before 'double'
    4 | priority_queue<double> A;
      |                ^~~~~~
a.cc:5:5: error: 'i' was not declared in this scope
    5 | REP(i,N){
      |     ^
a.cc:5:1: error: 'REP' was not declared in this scope
    5 | REP(i,N){
      | ^~~
a.cc:16:8: error: 'A' was not declared in this scope
   16 | while(!A.empty()){
      |        ^
a.cc:21:1: error: 'cout' was not declared in this scope
   21 | cout<<sum;
      | ^~~~
Language: C++

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

using namespace std;

typedef long long ll;

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
  
  ll n, m;
  cin >> n >> m;
  
  priority_queue<ll> pq;
  rep(i, n){
    ll x;
    cin >> x;
    pq.push(x);
  }
  
  rep(i, m){
    ll x = pq.front();
    pq.pop();
    pq.push(x / 2);
  }
  
  ll ans = 0;
  while(!pq.empty()){
    ans += pq.front();
    pq.pop();
  }
  
   cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:15: error: 'class std::priority_queue<long long int>' has no member named 'front'
   24 |     ll x = pq.front();
      |               ^~~~~
a.cc:31:15: error: 'class std::priority_queue<long long int>' has no member named 'front'
   31 |     ans += pq.front();
      |               ^~~~~
Language: C++

#include <iostream>
#include <queue>

using namespace std;

int main(){
  int i,n,m, x,ans = 0;
  cin>>n>>m;
  //vector<int> A;
  priority_queue pq<int>;
  for(i = 0; i<n; i++){
    cin>>x;
    //A.push_back(x);
    pq.push(x);
    ans += x;
  }
  for(i = 0; i<m; i++){
    x = pq.top();
    pq.pop();
    ans -= x - (x >> 1);
    pq.push(x>>1);
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected initializer before '<' token
   10 |   priority_queue pq<int>;
      |                    ^
a.cc:14:5: error: 'pq' was not declared in this scope
   14 |     pq.push(x);
      |     ^~
a.cc:18:9: error: 'pq' was not declared in this scope
   18 |     x = pq.top();
      |         ^~
Language: C++

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

int main() {
  int n,m;
  cin >> n >> m;
  long long ans=0;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
    ans += a.at(i);
  }
  sort(a.begin(),a.end());
  int k=m,x;
  long long count=0;
  while(k>0){
    count += a.at(n-1) - (a.at(n-1)/2);
    a.at(n-1) = a.at(n-1)/2;
    if(n>1)
    if(a.at(n-1) < a.at(n-2)){
      for(int i=n-1;i>0;i--){
        if(a.at(i) < a.at(i-1)){
          x = a.at(i);
          a.at(i) = a.at(i-1);
          a.at(i-1) = x;
        }
        else {
          break;
        }
      }
    }
  }
    
    k--;
  }
  cout << ans - count << endl;
  
  return 0;
}


Compiler output:
a.cc:36:3: error: 'cout' does not name a type
   36 |   cout << ans - count << endl;
      |   ^~~~
a.cc:38:3: error: expected unqualified-id before 'return'
   38 |   return 0;
      |   ^~~~~~
a.cc:39:1: error: expected declaration before '}' token
   39 | }
      | ^
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <math.h>
#include <queue>

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll n,m;
    cin >> n >> m;
    ll a[n];
    REP(i,n)
    {
        cin >> a[i];
    }

    std::priority_queue<ll> que;

    REP(i,n)
    {
        que.push(a[i]);
    }

    REP(i,m)
    {
        ll value = que.top();
        que.pop();
        que.push(value/2);
    }

    ll res;

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

    cout << res << endl;
    return 0;    
}



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

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <algorithm> // sort
#include <math.h> // sort

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
using namespace std;

int main(){
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    ll n,m;
    cin >> n >> m;
    ll a[n];
    REP(i,n)
    {
        cin >> a[i];
    }

    std::priority_queue<ll> que;

    REP(i,n)
    {
        que.push(a[i]);
    }

    REP(i,m)
    {
        ll value = que.top();
        que.pop();
        que.push(value/2);
    }

    ll res;

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

    cout << res << endl;
    return 0;    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:10: error: 'priority_queue' is not a member of 'std'
   25 |     std::priority_queue<ll> que;
      |          ^~~~~~~~~~~~~~
a.cc:7:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    6 | #include <math.h> // sort
  +++ |+#include <queue>
    7 | 
a.cc:25:27: error: expected primary-expression before '>' token
   25 |     std::priority_queue<ll> que;
      |                           ^
a.cc:25:29: error: 'que' was not declared in this scope
   25 |     std::priority_queue<ll> que;
      |                             ^~~