criyle/codenet-compile-errors huggingface dataset:
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++)
	{
		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:31: 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'
   69 |                 int large = q.top;
      |                               ^~~
Language: C++

#include <iostream>
#include <list>
#include <numeric>
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    auto a = list<int>();
    for (int i = 0; i < n; i++) {
        int a_i;
        cin >> a_i;
        a.push_back(a_i);
    }
    a.sort();

    for (; m > 0; --m) {
        int x = a.back();
        a.pop_back();
        x /= 2;

        auto itr = lower_bound(a.begin(), a.end(), x, less<int>());
        a.insert(itr, x);
    }

    cout << accumulate(a.begin(), a.end(), 0LL);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: no matching function for call to 'lower_bound(std::__cxx11::list<int>::iterator, std::__cxx11::list<int>::iterator, int&, std::less<int>)'
   22 |         auto itr = lower_bound(a.begin(), a.end(), x, less<int>());
      |                    ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:1530:5: note: candidate: 'template<class _ForwardIterator, class _Tp> _ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&)'
 1530 |     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1530:5: note:   candidate expects 3 arguments, 4 provided
Language: C++

#include<iostream>
#include<vector>
using namespace std;
long long max(long long a,long long b){
if(a<b)return b;
return a;
}
int main(){
int n,m;
long long ans=0,sum=0;
cin>>n>>m;
vector<long long> a(n);
for(int i=0;i<n;i++){
cin>>a[i];
ans+=a[i];
}
for(int j=0;j<m;j++){
  long long x=0;
for(int i=0;i<n;i++){
  x=max(x,a[i]);
}
for(int i=0;i<n;i++){
if(a[i]==x){
ansｰ=a[i]/2;
break;
}
}
}
cout<<ans<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:1: error: 'ans\U0000ff70' was not declared in this scope
   24 | ansｰ=a[i]/2;
      | ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
int n､m;
  long long ans=0,sum=0;
cin>>n>>m;
  vector<long long> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    ans+=a[i];
  }
  for(int j=0;j<m;j++){
    int x=0;
    for(int i=0;i<n;i++){
      x=max(x,a[i]);
      }
    sum+=x;
    for(int i=0;i<n;i++){
      if(x==a[i]/2){
      a[i]/=2;
      }
    } 
  }
  ansｰ=sum;
  cout<<ans<<endl;
  return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: 'n' was not declared in this scope
    7 | cin>>n>>m;
      |      ^
a.cc:7:9: error: 'm' was not declared in this scope; did you mean 'tm'?
    7 | cin>>n>>m;
      |         ^
      |         tm
a.cc:16:12: error: no matching function for call to 'max(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   16 |       x=max(x,a[i]);
      |         ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 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:16:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   16 |       x=max(x,a[i]);
      |         ~~~^~~~~~~~
/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
a.cc:25:3: error: 'ans\U0000ff70' was not declared in this scope
   25 |   ansｰ=sum;
      |   ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
int n､m;
  int ans=0
cin>>n>>m;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
    ans+=a[i];
  }
  for(int j=0;j<m;j++){
    int x=0;
    for(int i=0;i<n;i++){
      x=max(x,a[i]);
      }
    sum+=x;
    for(int i=0;i<n;i++){
      if(x==a[i]/2){
      a[i]/=2;
      }
    } 
  }
  ansｰ=sum;
  cout<<ans<<endl;
  return 0;
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: expected ',' or ';' before 'cin'
    7 | cin>>n>>m;
      | ^~~
a.cc:8:17: error: 'n' was not declared in this scope
    8 |   vector<int> a(n);
      |                 ^
a.cc:13:17: error: 'm' was not declared in this scope
   13 |   for(int j=0;j<m;j++){
      |                 ^
a.cc:18:5: error: 'sum' was not declared in this scope
   18 |     sum+=x;
      |     ^~~
a.cc:25:3: error: 'ans\U0000ff70' was not declared in this scope
   25 |   ansｰ=sum;
      |   ^~~~
a.cc:25:8: error: 'sum' was not declared in this scope
   25 |   ansｰ=sum;
      |        ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define floop(i, N) for (ll i = 0; i < N; i++)
#define floop1(i, N) for (ll i = 1; i <= N; i++)
#define floopi(i, j, N) for (ll j = i + 1; j < N; j++)
#define out(ans) cout << ans << endl
#define in(n) cin >> n

constexpr ll inf = 1e18;

void solve();

int main()
{
    solve();
}

void solve()
{
    ll n, m;
    in(n);
    in(m);
    priority_queue<ll> pque;
    floop(i, n)
    {
        ll a;
        in(a);
        pque.push(a);
    }
    ll ans = -;
    while (m != 0)
    {
        ll x = pque.top() / 2;
        pque.pop();
        pque.push(x);
        m--;
    }
    while (!pque.empty())
    {
        ans += pque.top();
        pque.pop();
    }
    out(ans);
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:33:15: error: expected primary-expression before ';' token
   33 |     ll ans = -;
      |               ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

public class PowerfulDiscountTickets {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] nm = br.readLine().split(" ");
		int n = Integer.parseInt(nm[0]), m = Integer.parseInt(nm[1]);
		String[] line = br.readLine().split(" ");
		ArrayList<Integer> prices = new ArrayList<>(n);
		for (int i = 0; i < n; i++) {
			prices.add(Integer.parseInt(line[i]));
		}
		for (int i = 0; i < m; i++) {
			Collections.sort(prices,Collections.reverseOrder());
			prices.set(0,prices.get(0)/2);
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum+= prices.get(i);
		}
		System.out.println(sum);
		br.close();
	}

}

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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;

public class PowerfulDiscountTickets {

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] nm = br.readLine().split(" ");
		int n = Integer.parseInt(nm[0]), m = Integer.parseInt(nm[1]);
		String[] line = br.readLine().split(" ");
		ArrayList<Integer> prices = new ArrayList<>(n);
		for (int i = 0; i < n; i++) {
			prices.add(Integer.parseInt(line[i]));
		}
		for (int i = 0; i < m; i++) {
			Collections.sort(prices,Collections.reverseOrder());
			System.out.println("antes " + prices);
			prices.set(0,prices.get(0)/2);
			System.out.println("despues " + prices);
		}
		int sum = 0;
		for (int i = 0; i < n; i++) {
			sum+= prices.get(i);
		}
		System.out.println(sum);
		br.close();
	}

}

Compiler output:
Main.java:7: error: class PowerfulDiscountTickets is public, should be declared in a file named PowerfulDiscountTickets.java
public class PowerfulDiscountTickets {
       ^
1 error
Language: C++

/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;

const int mod = 1e9+7;

int n;
int m;
int a[N];

int main(){
    priority_queue < int > pq;
    scanf("%d%d" , &n , &m);
    for(int i = 1; i <= n; i++){
        scanf("%d" , &a[i]);
        pq.push(a[i]);
    }
    while(!pq.empty() && m){
        if(pq.size() >= 2){
            int a = pq.top();
            pq.pop();
            int b = pq.top();
            pq.pop();
            if( (a >> 1) + b <= (b >> 1) + a){
                pq.push(a >> 1);
                pq.push(b);
                m--;
            } else {
                pq.push(b >> 1);
                pq.push(a);
                m--;
            }
        } else {
            int cur = pq.top();
            cur >>= 1;
            pq.pop();
            m--;
            if(cur){
                pq.push(cur);
            }
        }
    }
    long long sm = 0;
    while(!pq.empty()){
        sm += pq.top();
        pq.pop();
    }

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

#include <bits/stdc++.h>
using  namespace std;
typedef long long ll;
int main(){
    ll n, m, a, temp, ans=0;
    list<ll> A;
    cin >> n >> m;
    for(ll i=0;i<n;i++){
        cin >> a;
        A.push_back(a);
    }
    A.sort();
    for(ll i=0;i<m;i++){
        temp = A.back/2;
        auto checkItr = lower_bound(A.begin(), A.end(), temp);
        A.insert(checkItr, temp);
        A.pop_back();
    }
    for(auto itr=A.begin();itr!=A.end();itr++){
        ans += *itr;
      	//cout << *itr << " ";
    }
    cout << ans << endl;
    return 0;
 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator/'
   14 |         temp = A.back/2;
      |                ~~~~~~^~
      |                  |    |
      |                  |    int
      |                  <unresolved overloaded function type>
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   long tmp = 0;
   PriorityQueue pq = new PriorityQueue (N,new MyComparator());
   for(int i=0;i<N;i++) 
   {
     tmp = sc.nextLong();
     pq.add(tmp);
   }
   for(int i = 0;i<N;i++)
   {
     tmp = (long) pq.poll();
     tmp/=2;
     pq.add(tmp);
   }
   long ans =0;
   for(int i = 0;i<N;i++) ans += (long)pq.poll();
   
   System.out.println(ans);
 }
  class MyComparator implements Comparator {
 
  public static int compare(Object obj1, Object obj2) {
         
        long num1 = (long)obj1;
        long num2 = (long)obj2;
         
        if(num1 < num2) {
            return 1;
        } else if(num1 > num2) {
            return -1;
        } else{
            return 0;
        }
    }
}
}

Compiler output:
Main.java:7: error: non-static variable this cannot be referenced from a static context
   PriorityQueue pq = new PriorityQueue (N,new MyComparator());
                                           ^
Main.java:26: error: compare(Object,Object) in Main.MyComparator cannot implement compare(T,T) in Comparator
  public static int compare(Object obj1, Object obj2) {
                    ^
  overriding method is static
  where T is a type-variable:
    T extends Object declared in interface Comparator
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   long tmp = 0;
   PriorityQueue pq = new PriorityQueue (N,new MyComparator());
   for(int i=0;i<N;i++) 
   {
     tmp = sc.nextLong();
     pq.add(tmp);
   }
   for(int i = 0;i<N;i++)
   {
     tmp = (long) pq.poll();
     tmp/=2;
     pq.add(tmp);
   }
   long ans =0;
   for(int i = 0;i<N;i++) ans += pq.poll();
   
   System.out.println(ans);
 }
  class MyComparator implements Comparator {
 
    public int compare(Object obj1, Object obj2) {
         
        long num1 = (long)obj1;
        long num2 = (long)obj2;
         
        if(num1 < num2) {
            return 1;
        } else if(num1 > num2) {
            return -1;
        } else{
            return 0;
        }
    }
}
}

Compiler output:
Main.java:7: error: non-static variable this cannot be referenced from a static context
   PriorityQueue pq = new PriorityQueue (N,new MyComparator());
                                           ^
Main.java:20: error: bad operand types for binary operator '+'
   for(int i = 0;i<N;i++) ans += pq.poll();
                              ^
  first type:  long
  second type: Object
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   long tmp = 0;
   PriorityQueue pq = new PriorityQueue ();
   for(int i=0;i<N;i++) 
   {
     tmp = sc.nextLong();
     pq.add(tmp);
   }
   for(int i = 0;i<N;i++)
   {
     tmp = pq.poll();
     tmp/=2;
     pq.add(tmp);
   }
   long ans =0;
   for(int i = 0;i<N;i++) ans += pq.poll();
   
   System.out.println(ans);
 }
}

Compiler output:
Main.java:15: error: incompatible types: Object cannot be converted to long
     tmp = pq.poll();
                  ^
Main.java:20: error: bad operand types for binary operator '+'
   for(int i = 0;i<N;i++) ans += pq.poll();
                              ^
  first type:  long
  second type: Object
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Language: C++

#include <bits/stdc++.h>

int main() 
{
	int n,m,i;
	long long sum=0;
	scanf("%d %d",&n,&m);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(;m>0;m--)
	{
		sort(a, a + n);
		a[0]=a[0]/2;
	}
	for(i=0;i<n;i++)
	{
		sum=sum+a[i];
	}
	printf("%lld",sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   15 |                 sort(a, a + n);
      |                 ^~~~
      |                 std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>

int main() 
{
	int n,m,i;
	long long sum=0;
	scanf("%d %d",&n,&m);
	int a[n];
	for(i=0;i<n;i++)
	{
		scanf("%d",&a[i]);
	}
	for(;m>0;m--)
	{
		sort(a,n);
		a[0]=a[0]/2;
	}
	for(i=0;i<n;i++)
	{
		sum=sum+a[i];
	}
	printf("%lld",sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   15 |                 sort(a,n);
      |                 ^~~~
      |                 std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod = 1e9+7;

int n,m;
int main(){
	cin >> n >> m;
	vector<ll>a(n);
	priority_queue<ll> queue;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		queue.push(a[i]);
	}
	while(m > 0){a
		ll tmp = queue.top(); queue.pop();
		tmp /= 2;
		queue.push(tmp);
		m--;
	}
	ll ans = 0;
	for(int i = 0; i < n; i++){
		ans += queue.top();
		queue.pop();
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: expected ';' before 'll'
   24 |         while(m > 0){a
      |                       ^
      |                       ;
   25 |                 ll tmp = queue.top(); queue.pop();
      |                 ~~     
a.cc:26:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   26 |                 tmp /= 2;
      |                 ^~~
      |                 tm
Language: C

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

int main() {
	priority_queue<int> a;
 	int n,m,i,d;
	long long ans = 0;

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

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

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

}


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

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

void solve() {
  int n, m;
  cin >> n >> m;
  priority_queue<int> q;
  rep(i,n) {
    int a;
    cin >> a;
    q.push(a);
  }
  rep(i,m) {
    int temp = q.top();
    q.pop();
    temp /= 2;
    q.push(temp);
  }
  ll ans = 0;
  while(!q.empty()) {
    ans += q.top();
    q.pop();
  }
  cout << ans << endl;
}

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

void solve() {
  int n, m;
  cin >> n >> m;
  priority_queue<int> q;
  rep(i,n) {
    int a;
    cin >> a;
    q.push(a);
  }
  rep(i,m) {
    int temp = q.top();
    q.pop();
    temp /= 2;
    q.push(temp);
  }
  ll ans = 0;
  while(!q.empty()) {
    ans += q.top();
    q.pop();
  }
  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}

Compiler output:
a.cc:32:2: error: stray '#' in program
   32 | }#include<bits/stdc++.h>
      |  ^
a.cc:32:3: error: 'include' does not name a type
   32 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:37:6: error: redefinition of 'void solve()'
   37 | void solve() {
      |      ^~~~~
a.cc:6:6: note: 'void solve()' previously defined here
    6 | void solve() {
      |      ^~~~~
a.cc:60:5: error: redefinition of 'int main()'
   60 | int main() {
      |     ^~~~
a.cc:29:5: note: 'int main()' previously defined here
   29 | int main() {
      |     ^~~~
Language: C++

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

int main(){
  long long n, m; cin >> n >> m;
  priority queue<long long> que;
  for(int i = 0; i < n; i++){
    long long a; cin >> a;
    queue.push(a);
  }
  for(int i = 0; i < m; i++){
    long long tmp = que.top();
    que.pop();
    que.push(tmp / 2);
  }
  long long out = 0;
  for(int i = 0; i < n; i++){
    out += que.top();
    que.pop();
  }
  cout << out;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'priority' was not declared in this scope
    6 |   priority queue<long long> que;
      |   ^~~~~~~~
a.cc:9:10: error: expected unqualified-id before '.' token
    9 |     queue.push(a);
      |          ^
a.cc:12:21: error: 'que' was not declared in this scope
   12 |     long long tmp = que.top();
      |                     ^~~
a.cc:18:12: error: 'que' was not declared in this scope
   18 |     out += que.top();
      |            ^~~
Language: C++

#include<stdio.h>
#include<queue>
int n;
int m;
std::priority_queue<int> pq;
int min(){
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++){
        int x;
        scanf("%d",&x);
        pq.push(x);
    }
    for(int i=0;i<m;i++){
        int price=pq.top();pq.pop();
        price/=2;
        pq.push(price);
    }
    long long ans=0;
    for(int i=0;i<n;i++){
        ans+=pq.top();
        pq.pop();
    }
    printf("%lld",ans);
    return 0;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <queue>

using namespace std;

int N;
int M;
std::priority_queue<int> pq;

int main()
{
	int i;
	scanf("%d %d", &N, &M);

	for (i = 0; i < N; i++) {
		int x;
		scanf("%d", &x);
		pq.push(x);
	}

	for (i = 0; i < M; i++) {
		int price = pq.front();
		pq.pop();
		price /= 2;
		pq.push(price);
	}
	long long sum = 0;

	for (i = 0; i < N; i++) {
		sum += pq.front();
		pq.pop();
	}

	printf("%lld\n", sum);

	return 0;
}

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

#include <stdio.h>
#include <queue>

using namespace std;

int n, m;
std::priority_queue<int> pq;

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

	for (i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		pq.push(x);
	}

	for (i = 0; i < m; i++) {
		int price = pq.top(); pq.pop();
		price /= 2;
		pq.push(price);
	}
	long long sum = 0;

	for (i = 0; i < n; i++) {
		sum += pq.top(); pq.pop();
	}

	printf("%lld\n", sum);

	return 0;
}


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

#include <stdio.h>
#include <queue>

using namespace std;

int n, m;
std::priority_queue<int> pq;

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

	for (i = 0; i < n; i++) {
		int x;
		scanf("%d", &x);
		pq.push(x);
	}

	for (i = 0; i < m; i++) {
		int price = pq.top(); pq.pop();
		price /= 2;
		pq.push(price);
	}
	long long ans = 0;

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

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

	return 0;
}


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

#include <stdio.h>
#include <iostream>
#include <functional>
#include <algorithm>
int main(void){

using namespace std;

	double N,M;
	int A[10^9];


	cin >> N;
	cin >> M;


	int i;

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

	for(i = 0;i<M;i++){
		sort(A,A+N,greater<int>());	
		A[0] /= 2;
	}

	int kei = 0;

	for(i = 0; i<N;i++)
		kei += A[i];

	cout << kei << endl;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   10 |         int A[10^9];
      |                 ^
      |               ---
      |               1e
a.cc:10:15: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   10 |         int A[10^9];
      |               ^~
      |               0xa
a.cc:23:25: error: invalid operands of types 'int [3]' and 'double' to binary 'operator+'
   23 |                 sort(A,A+N,greater<int>());
      |                        ~^~
      |                        | |
      |                        | double
      |                        int [3]
Language: C++

#include<stdio.h>
#include<queue>

int N;
int M;

std::priority_queue<int>pq;     //優先度付きキュー、

int main(){

    scanf("%d %d", &N, &M);     //個数の読込み
        //初期化（品物の値段の読込み）
    for(int i=0; i<N; i++){
        int x; 
        scanf("%d", &x);
        pq.push(x);
    }

    // M回割引券を適用、一番高い品物を選んで半額にする
    for(int i=0; i<M; i++) {
        int price = pq.top(); pq.pop();
        prince/=2;
        pq.push(price);
    }

    // 割引後の商品の値段の合計額を求める
    long long  sum = 0;
    while(pq.empty()) {
        sum += pq.top(); pq.pop();
    }

    printf("%lld", sum);
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'prince' was not declared in this scope; did you mean 'price'?
   22 |         prince/=2;
      |         ^~~~~~
      |         price
Language: C++

include<stdio.h>
include<queue>

int N;
int M;

std::priority_queue<int> pq;

int main(){
		scanf("%d %d",&N,&M);
		for(int i = 0;i < N;i++){
			int x;
			scanf("%d",&x);
			pq push (x);
		}

		for (int = 0;i < M; i++){
			int price = pq, top(); pq,pop();
			price /= 2;
			pq push(price);
		}

	long long sum = 0;
	int z;
	while (!pq = empty()){

		z += dequeue(&pq);

	}
	sum = z;
	printf("%lld\n",sum);
	return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
a.cc:7:6: error: 'priority_queue' in namespace 'std' does not name a template type
    7 | std::priority_queue<int> pq;
      |      ^~~~~~~~~~~~~~
a.cc:1:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
  +++ |+#include <queue>
    1 | include<stdio.h>
a.cc: In function 'int main()':
a.cc:10:32: error: 'N' was not declared in this scope
   10 |                 scanf("%d %d",&N,&M);
      |                                ^
a.cc:10:17: error: 'scanf' was not declared in this scope
   10 |                 scanf("%d %d",&N,&M);
      |                 ^~~~~
a.cc:14:25: error: 'pq' was not declared in this scope
   14 |                         pq push (x);
      |                         ^~
a.cc:17:26: error: expected unqualified-id before '=' token
   17 |                 for (int = 0;i < M; i++){
      |                          ^
a.cc:17:25: error: expected ';' before '=' token
   17 |                 for (int = 0;i < M; i++){
      |                         ^~
      |                         ;
a.cc:17:26: error: expected primary-expression before '=' token
   17 |                 for (int = 0;i < M; i++){
      |                          ^
a.cc:17:30: error: 'i' was not declared in this scope
   17 |                 for (int = 0;i < M; i++){
      |                              ^
a.cc:17:35: error: expected ')' before ';' token
   17 |                 for (int = 0;i < M; i++){
      |                     ~             ^
      |                                   )
a.cc:17:37: error: 'i' was not declared in this scope
   17 |                 for (int = 0;i < M; i++){
      |                                     ^
a.cc:25:17: error: 'pq' was not declared in this scope
   25 |         while (!pq = empty()){
      |                 ^~
a.cc:25:22: error: 'empty' was not declared in this scope
   25 |         while (!pq = empty()){
      |                      ^~~~~
a.cc:27:22: error: 'dequeue' was not declared in this scope
   27 |                 z += dequeue(&pq);
      |                      ^~~~~~~
a.cc:31:9: error: 'printf' was not declared in this scope
   31 |         printf("%lld\n",sum);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include<stdio.h>
Language: C++

#include <stdio.h>
#include <iostream>
#include <functional>
#include <algorithm>
int main(void){

using namespace std;

	int N,M;
	int A[10^9];


	cin >> N;
	cin >> M;


	int i;

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

	for(i = 0;i<M;i++){
		sort(A,A+N,greater<int>());	
		A[0] = A[0] / 2;
	}

	int kei = 0;

	for(i = 0; i<N;i++)
		kei += A[i];

	cout << kei << endl;
	put("");


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   10 |         int A[10^9];
      |                 ^
      |               ---
      |               1e
a.cc:10:15: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   10 |         int A[10^9];
      |               ^~
      |               0xa
a.cc:33:9: error: 'put' was not declared in this scope; did you mean 'putw'?
   33 |         put("");
      |         ^~~
      |         putw
Language: C++

#include<stdio.h>
#include<queue>

int N;
int M;

std::priority_queue<int>pq;     //優先度付きキュー、

int main(){

    scanf("%d %d", &N, &M);     //個数の読込み
        //初期化（品物の値段の読込み）
    for(int i=0; i<N; i++){
        int x; scanf("%d", &x);
        pq.push(x);
    }

    // M回割引券を適用、一番高い品物を選んで半額にする
    for(int i=0; i<M; i++) {
        int price = pq.top(); pq.pop();
        prince/=2;
        pq.push(price);
    }

    // 割引後の商品の値段の合計額を求める
    long long  sum = 0;
    while(pq.empty()) {
        sum += pq.top(); pq.pop();
    }

    printf("%d", sum);
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'prince' was not declared in this scope; did you mean 'price'?
   21 |         prince/=2;
      |         ^~~~~~
      |         price
Language: C++

#include<stdio.h>
#include<iostream.h>
#include<queue>
using namespace std;
priority_queue<int> pq;

int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++){
		int x;
		scanf("%d",&x);
		pq.push(x);
	}
	for(int i=0;i<m;i++){
		int price/=pq.top();pq.pop();
		price/=2;
		pq.push(price);
	}
	long long sum=0;
	while(i<m){
		sum+=pq.top();pq.pop();
		i++;
	}
	printf("%lld\n",sum);

}


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

#include <stdio.h>
#include <queue>
#include <iostream>
using namespace std;
std::priority_queue<int> pq;

int main()
{
	int N,M,i;
	scanf("%d,%d",&N,&M);
	for(i=0;i<N;i++){
		int x;
		scanf("%d",&x);
		pq.push(x);
	}
	for(i=0;i<M;i++){
		int price = pq.top(); pq.pop();
		price /=2;
		pq.push(price);
	}

	long long sum = 0;
	while(i<N){
	sum += pq.top(); pq.pop();
	i++
	}
	printf("%d\n", sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:12: error: expected ';' before '}' token
   25 |         i++
      |            ^
      |            ;
   26 |         }
      |         ~
Language: C++

#include<stdio.h>
#include<queue>
int n;
int m;
std::priority_queue<int> pq;
int min(){
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++){
        int x;
        scanf("%d",&x);
        pq.push(x);
    }
    for(int i=0;i<m;i++){
        int price=pq.top();pq.pop;
        price/=2;
        pq.push(price);
    }
    long long ans=0;
    for (int i = 0; i < n; i++){
        ans += pq.top();
        pq.pop();
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int min()':
a.cc:14:31: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = int; _Sequence = std::vector<int, std::allocator<int> >; _Compare = std::less<int>]'
   14 |         int price=pq.top();pq.pop;
      |                            ~~~^~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_queue.h:771:7: note: declared here
  771 |       pop()
      |       ^~~
Language: C

#include<stdio.h>
#include<queue>
int n;
int m;
std::priority_queue<int> pq;
int min(){
    scanf("%d%d",&n,&m);
    for(int i=0;i<n;i++){
        int x;
        scanf("%d",&x);
        pq.push(x);
    }
    for(int i=0;i<m;i++){
        int price=pq.top();pq.pop;
        price/=2;
        pq.push(price);
    }
    long long ans=0;
    for (int i = 0; i < n; i++){
        ans += pq.top();
        pq.pop();
    }
    printf("%d",ans);
    return 0;
}

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

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#pragma GCC optimize("Ofast")

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n, m;
    cin >> n >> m;
    vector<ll> price(n);
    for (ll i = 0; i < n; ++i) {
        cin >> price.at(i);
    }
    for (ll j = 0; j < m; ++j) {
        sort(price.rbegin(), price.rend());
        price.at(0) /= 2;
    }
    ll ans = 0;
    for (ll k : price) {
        ans += k;
    }
    cout << ans << "\n";
}


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

#include <stdio.h>
#include <stdlib.h>

int compare( const void  a , const void  b ) {
  if( ( int  )a < ( int  )b ) {
    return -1;
  } else if( ( int  )a == ( int  )b ) {
    return 0;
  }
  return 1;
}

int main() {
    int N, M;
    scanf("%d %d", &N, &M);
    int Ai[N];
    long int sum = 0;
    for(int i = 0; i < N; i++){
        scanf("%d", &Ai[i]);
        sum += Ai[i];
    }
    int M_use = 0, same_start;
    long int Ai_round_up;
    while(M > 0){
        qsort((void*)Ai, sizeof(Ai)/sizeof(Ai[0]), sizeof(Ai[0]), compare);
        M_use++;
        for(same_start = N-2; same_start >= 0; same_start--){
            if(Ai[same_start] == Ai[N]){
                M_use++;
            } else {
                break;
            }
        }
        while(M > 0 && M_use > 0){
            Ai_round_up = (int)Ai[same_start + M_use] * 0.5 + 0.5;
            Ai[same_start + M_use] -= Ai_round_up;
            sum -= Ai_round_up;
            M--;
            M_use--;
        }
    }
    printf("%ld\n", sum);
    return 0;
}

Compiler output:
main.c:4:26: error: parameter 1 ('a') has incomplete type
    4 | int compare( const void  a , const void  b ) {
      |              ~~~~~~~~~~~~^
main.c:4:42: error: parameter 2 ('b') has incomplete type
    4 | int compare( const void  a , const void  b ) {
      |                              ~~~~~~~~~~~~^
Language: C

#include <stdio.h>
#include <stdlib.h>

int compare( const void  a , const void  b ) {
  if( ( int  )a < ( int  )b ) {
    return -1;
  } else if( ( int  )a == ( int  )b ) {
    return 0;
  }
  return 1;
}

int main() {
    int N, M;
    scanf("%d %d", &N, &M);
    int Ai[N];
    long int sum = 0;
    for(int i = 0; i < N; i++){
        scanf("%d", &Ai[i]);
        sum += Ai[i];
    }
    int M_use = 0, same_start;
    long int Ai_round_up;
    while(M > 0){
        qsort((void*)Ai, sizeof(Ai)/sizeof(Ai[0]), sizeof(Ai[0]), compare);
        M_use++;
        for(same_start = N-2; same_start >= 0; same_start--){
            if(Ai[same_start] == Ai[N]){
                M_use++;
            } else {
                break;
            }
        }
        while(M > 0 && M_use > 0){
            Ai_round_up = (int)Ai[same_start + M_use] * 0.5 + 0.5;
            Ai[same_start + M_use] -= Ai_round_up;
            sum -= Ai_round_up;
            M--;
            M_use--;
        }
    }
    printf("%ld\n", sum);
    return 0;
}


Compiler output:
main.c:4:26: error: parameter 1 ('a') has incomplete type
    4 | int compare( const void  a , const void  b ) {
      |              ~~~~~~~~~~~~^
main.c:4:42: error: parameter 2 ('b') has incomplete type
    4 | int compare( const void  a , const void  b ) {
      |                              ~~~~~~~~~~~~^
Language: C

#include <stdio.h>
#include <stdlib.h>

int ask(const void a, const void b) {
  return (int )a - (int )b;
}

int main() {
    int N, M;
    scanf("%d %d", &N, &M);
    int Ai[N];
    long int sum = 0;
    for(int i = 0; i < N; i++){
        scanf("%d", &Ai[i]);
        sum += Ai[i];
    }
    int M_use = 0, same_start;
    long int Ai_round_up;
    while(M > 0){
        qsort(Ai, sizeof(Ai) / sizeof(int), sizeof(int), ask);
        M_use++;
        for(same_start = N-2; same_start >= 0; same_start--){
            if(Ai[same_start] == Ai[N]){
                M_use++;
            } else {
                break;
            }
        }
        while(M > 0 && M_use > 0){
            Ai_round_up = (int)Ai[same_start + M_use] * 0.5 + 0.5;
            Ai[same_start + M_use] -= Ai_round_up;
            sum -= Ai_round_up;
            M--;
            M_use--;
        }
    }
    printf("%ld\n", sum);
    return 0;
}

Compiler output:
main.c:4:20: error: parameter 1 ('a') has incomplete type
    4 | int ask(const void a, const void b) {
      |         ~~~~~~~~~~~^
main.c:4:34: error: parameter 2 ('b') has incomplete type
    4 | int ask(const void a, const void b) {
      |                       ~~~~~~~~~~~^
Language: C++

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

int main() {
    #pragma GCC optimize("Ofast")
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n, m;
    cin >> n >> m;
    vector<ll> items(n);
    for (ll i = 0; i < n; ++i) {
        cin >> items.at(i);
    }
    for (ll j = 0; j < m; ++j) {
        sort(items.rbegin(), items.rend());
        items.at(0) /= 2;
    }
    ll ans = 0;
    for (ll k : items) ans += k;
    cout << ans << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: '#pragma GCC optimize' is not allowed inside functions
    6 |     #pragma GCC optimize("Ofast")
      |             ^~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	priority_queue<int>q;    //优先队列自动从大到小排序
	int m,n,t;
	cin >>n>>m;
	for(int i=0;i<n;i++){
		cin>>t;
		q.push(t);    //每输入一个数都入队
	}
	long long sum=0;
	while(m)
	{
		t=q.top()/2;
		q.pop();
		q.push(t);
		m--;
	}
	while(!q.empty())
	{
		sum+=q.top();
		q.pop();
	}
	cout<<sum;    //输出都处理完的总和
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'priority_queue' was not declared in this scope
    6 |         priority_queue<int>q;    //优先队列自动从大到小排序
      |         ^~~~~~~~~~~~~~
a.cc:3:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    2 | #include<algorithm>
  +++ |+#include <queue>
    3 | using namespace std;
a.cc:6:24: error: expected primary-expression before 'int'
    6 |         priority_queue<int>q;    //优先队列自动从大到小排序
      |                        ^~~
a.cc:11:17: error: 'q' was not declared in this scope
   11 |                 q.push(t);    //每输入一个数都入队
      |                 ^
a.cc:16:19: error: 'q' was not declared in this scope
   16 |                 t=q.top()/2;
      |                   ^
a.cc:21:16: error: 'q' was not declared in this scope
   21 |         while(!q.empty())
      |                ^
Language: C++

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

void putNumber(vector<int> a, int n) {
  int firstIndex = 0;
  int lastIndex = a.size()-1;

  while(firstIndex != lastIndex) {
    int half = (lastIndex - firstIndex) / 2;

    if(n > a[half]) {
      firstIndex = half+1;
    } else if (n == a[half]) {
      firstIndex = half;
      lastIndex = half;
    } else {
      lastIndex = half-1;
    }
  }

  if(n > a[firstIndex]) {
    if(firstIndex != a.size()-1) {
      a.insert(a.begin() + firstIndex + 1, n);
    } else {
      a.push_back(n);
    }
  } else if (n == a[firstIndex]) {
    a.insert(a.begin() + firstIndex, n);
  } else {
    if(firstIndex != 0) {
      a.insert(a.begin() + firstIndex - 1, n);
    } else {
      a.insert(a.begin() + firstIndex, n);
    }
  }


}

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N);

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

  if(N == 1) {
    for(int i=0;i<M;i++) {
      a[0] /= 2;
    }

    cout << a[0] << endl;
    return 0;
  }

  for(int i=0;i<M;i++) {
    sort(a.begin(), a.end());
    a[N-1] = a[N-1] 2;
  }

  long long int 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:60:20: error: expected ';' before numeric constant
   60 |     a[N-1] = a[N-1] 2;
      |                    ^~
      |                    ;
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
	int n,m;
	cin >> n >> m;
	set <int> s;
	for(int i=0;i<n;i++){
		int x;
		cin >> x;
		x.insert(x);
	}
	while(m--){
		auto it=s.end();
		it--;
		int x=*it;
		s.erase(it);
		x/=2;
		s.insert(x);
	}
	int sum=0;
	for(int i:s)
		sum+=i;
	cout << sum << endl;
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:11:19: error: request for member 'insert' in 'x', which is of non-class type 'long long int'
   11 |                 x.insert(x);
      |                   ^~~~~~
Language: C++

import heapq 
import math 
n,m = map(int,input().split())
a = list(map(lambda x:int(x)*(-1), input().split()))
heapq.heapify(a)
for i in range(m):
    p = heapq.heappop(a)
    p = math.ceil(p/2)
    heapq.heappush(a,p)
print(sum(a)*(-1))

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 <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main()
{
  long long N, M;
  cin >> N >> M;
  vector<long long> A(N);
  auto * const a = &A[0];
  for (long long i = 0; i < N; ++i)
    cin >> a[i];
  sort(a, a + N, std::greater<long long>());
  for (long long i = 0; i < M; ++i)
  {
    a[i] /= 2;
    sort(a, a + N, greater<long long>())
  }
  long long sum = 0;
  for (long long i = 0; i < N; ++i)
    sum += a[i];
  cout << sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:41: error: expected ';' before '}' token
   19 |     sort(a, a + N, greater<long long>())
      |                                         ^
      |                                         ;
   20 |   }
      |   ~
Language: C++

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

using namespace std;

int main(){
  int n, m, tmp, mar, d=0;
  long long int ans=0;
  vector<int> a, b(40, 0);
  
  cin>> n >> m;
  a.resize(n);
  
  for(int i=0;i<n;i++){
    cin>> tmp;
    a[i]=tmp;
    for(int j=0;j<40;j++){
      if(tmp>0){
        tmp/=2;
        b[j]++;
      }else{
        break;
      }
    }
  }

  sort(a.begin(), a.end(), greater<int>);

  for(int i=39;i>=0;i--){
    if(m-b[i]<0){
      break;
    }
    m-=b[i];
    mar+=b[i];
    d++;
  }

  mar=min(mar, n);

  for(int i=0;i<mar;i++) a[i]/=pow(2, d);
  
  sort(a.begin(), a.end(), greater<int>);
  
  for(int i=0;i<n;i++) a[i]/=2;
  
  for(int i=0;i<n;i++) ans+=a[i];
  
  cout<< ans <<endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: expected primary-expression before ')' token
   29 |   sort(a.begin(), a.end(), greater<int>);
      |                                        ^
a.cc:44:40: error: expected primary-expression before ')' token
   44 |   sort(a.begin(), a.end(), greater<int>);
      |                                        ^
Language: C++

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<ll> A(N);
  
  for(ll i=0; i<N; i++) cin >> A.at(i);
  
  for(int i=0; i<M; i++){
    //vector<ll>::iterator iter = max_element(A.begin(), A.end());
    //size_t index = distance(A.begin(), iter);//TLEになったから降順ソートする方法を試す!!
    //↑↑　https://qiita.com/ryu136/items/08eca54fbbe38cddbc8b
    //A.at(index) /= 2;//N個の中で最大の値段のやつに割引券を使う
    
    //std::sort(A.begin(),A.end(),std::greater<int>());//降順ソート これもTLEになった
    //A.at(0) /= 2;//N個の中で最大の値段のやつに割引券を使う
        
    int t=A.top();//https://yamakasa.net/atcoder-abc-141-d/
    A.pop();
    t /= 2;
    A.push(t);
  }
    
  //各要素の和//http://baikichiz.hatenablog.com/entry/2019/02/08/085053
  //ll sum = accumulate(A.begin(), A.end(), 0);
  //cout << sum << endl;なんか上手く行ってないから↓を使う( accumulateがll対応してない??)
  
  ll ans = 0;
  //for(int i=0; i<N; i++) cout << i << " : " << A.at(i) << endl;

  for( int i=0; i<N; i++){
    ans += A.at(i);
    //cout << " 0~"<<i<<": " << ans << endl;
  }  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: 'class std::vector<long long int>' has no member named 'top'
   21 |     int t=A.top();//https://yamakasa.net/atcoder-abc-141-d/
      |             ^~~
a.cc:22:7: error: 'class std::vector<long long int>' has no member named 'pop'
   22 |     A.pop();
      |       ^~~
a.cc:24:7: error: 'class std::vector<long long int>' has no member named 'push'
   24 |     A.push(t);
      |       ^~~~
Language: C++

#include<stduo.h>
int main(void)
{
  int n,m,a[100000],max,k,i,j;
  for(i=0; i<n; i++)
  scanf("%d", &a[i]);
  for(i=0; i<m; i++)
  {
      max=0;
      for(j=0; j<n; j++)
      {
          if(max<a[j])
          {
              max=0;
              k=j;
          }
      }
      a[k]/=2;
  }
  k=0;
  for(i=0; i<n; i++)
  k+=a[j];
  printf("%d¥n", k);
  
  return 0;
}

  
  

Compiler output:
a.cc:1:9: fatal error: stduo.h: No such file or directory
    1 | #include<stduo.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

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

const int N = 100005;

int n, m;

priority_queue<int> pq;

int main()
{
	ios_base::sync_with_stdio(false);

	cin >> n >> m;

	for(int i=0; i<n; i++){
		int x;
		cin >> x;
		pq.insert(x);
	} 
	
	while(m--) {
		int x = pq.top(); pq.pop();
		pq.insert(x/2);
	}

	long long ans = 0;

	while(pq.size()) {
		ans+=(long long)pq.top(); pq.pop();
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: 'class std::priority_queue<int>' has no member named 'insert'
   19 |                 pq.insert(x);
      |                    ^~~~~~
a.cc:24:20: error: 'class std::priority_queue<int>' has no member named 'insert'
   24 |                 pq.insert(x/2);
      |                    ^~~~~~