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

3 3
2 13 8#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

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

    int n, m;
    cin >> n >> m;
    priority_queue <int> pq;

    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        pq.push(x);
    }

    for (int i = 1; i <= m; i++)
    {
        int x = pq.top() / 2;
        pq.pop();
        pq.push(x);
    }

    ll ans = 0;
    for (int i = 1; i <= n; i++)
    {
        ans += pq.top();
        pq.pop();
    }
    cout << ans << "\n";

}


Compiler output:
a.cc:2:7: error: stray '#' in program
    2 | 2 13 8#include <bits/stdc++.h>
      |       ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 3 3
      | ^
a.cc: In function 'int main()':
a.cc:10:5: error: 'ios' has not been declared
   10 |     ios::sync_with_stdio(false);
      |     ^~~
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin.tie(0); cout.tie(0);
      |     ^~~
a.cc:11:17: error: 'cout' was not declared in this scope
   11 |     cin.tie(0); cout.tie(0);
      |                 ^~~~
a.cc:15:5: error: 'priority_queue' was not declared in this scope
   15 |     priority_queue <int> pq;
      |     ^~~~~~~~~~~~~~
a.cc:15:21: error: expected primary-expression before 'int'
   15 |     priority_queue <int> pq;
      |                     ^~~
a.cc:21:9: error: 'pq' was not declared in this scope
   21 |         pq.push(x);
      |         ^~
a.cc:26:17: error: 'pq' was not declared in this scope
   26 |         int x = pq.top() / 2;
      |                 ^~
a.cc:34:16: error: 'pq' was not declared in this scope
   34 |         ans += pq.top();
      |                ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int N, M;
	cin >> N;
	cin >> M;
	vector<int> v(N, 0);
	for (int i = 0; i < N; ++i) {
		cin >> v[i];
	}
	priority_queue<int> que;
	for (auto it : v)
	{
		que.push(it);
	}
	for (int i = 0; i < K; ++i) {
		int x = que.top();
		que.pop();
		int p = x / 2 % 1;
		que.push(p);
	}
	long long s = 0;
	while (!que.empty()) {
		s += que.top();
		que.pop();
	}
	cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: 'K' was not declared in this scope
   17 |         for (int i = 0; i < K; ++i) {
      |                             ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int N, M;
	cin >> N;
	cin >> M;
	vector<int> v(N, 0);
	for (int i = 0; i < N; ++i) {
		cin >> v[i];
	}
	priority_queue<int> que;
	for (auto it : v)
	{
		que.push(it);
	}
	for (int i = 0; i < K; ++i) {
		int x = que.top();
		que.pop();
		p = x / 2 % 1;
		que.push(p);
	}
	long long s = 0;
	while (!que.empty()) {
		s += que.top();
		que.pop();
	}
	cout << s;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: 'K' was not declared in this scope
   17 |         for (int i = 0; i < K; ++i) {
      |                             ^
a.cc:20:17: error: 'p' was not declared in this scope
   20 |                 p = x / 2 % 1;
      |                 ^
Language: C++

#include<algorithm>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
using namespace std;
int main(void){
	long long n,m;
	cin>>n>>m;
	vector<long long> q;
	priority_queue<long long> q;
	for(long long i=0;i<n;i++){
		long long tmp;
		cin>>tmp;
		q.push(tmp);
	}
	
	for(long long i=0;i<m;i++){
		long long top=q.top();
		q.pop();
		top/=2;
		q.push(top);
	}
	long long money=0;
	while(!(q.empty())){
		long long kane=q.top;
		q.pop();
		money+=kane;
	}
	cout<<money<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:9: error: 'priority_queue' was not declared in this scope
   11 |         priority_queue<long long> q;
      |         ^~~~~~~~~~~~~~
a.cc:6:1: note: 'std::priority_queue' is defined in header '<queue>'; this is probably fixable by adding '#include <queue>'
    5 | #include<vector>
  +++ |+#include <queue>
    6 | using namespace std;
a.cc:11:24: error: expected primary-expression before 'long'
   11 |         priority_queue<long long> q;
      |                        ^~~~
a.cc:15:19: error: 'class std::vector<long long int>' has no member named 'push'
   15 |                 q.push(tmp);
      |                   ^~~~
a.cc:19:33: error: 'class std::vector<long long int>' has no member named 'top'
   19 |                 long long top=q.top();
      |                                 ^~~
a.cc:20:19: error: 'class std::vector<long long int>' has no member named 'pop'
   20 |                 q.pop();
      |                   ^~~
a.cc:22:19: error: 'class std::vector<long long int>' has no member named 'push'
   22 |                 q.push(top);
      |                   ^~~~
a.cc:26:34: error: 'class std::vector<long long int>' has no member named 'top'
   26 |                 long long kane=q.top;
      |                                  ^~~
a.cc:27:19: error: 'class std::vector<long long int>' has no member named 'pop'
   27 |                 q.pop();
      |                   ^~~
Language: C++

#include <iostream>
#include <queue>
#define int long long
unsigned main(){
  int M,N,ans,temp;
  std::cin>>N>>M;
  std::priority_queue<int>price;
  for (int i=0;i<N;i++){
    std:cin>>temp;
    price.push(temp);
  }
  for (int i=0;i<M;i++){
    temp=price.top();
    price.pop();
    price.push(temp/2);
  }
  for (int i=0;i<N;i++){
    ans+=price.top();
    price.pop();
  }
  std::cout<<ans<<std::endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 |     std:cin>>temp;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define Rep(i,k,n) for(long long i=k;i<(long long)(n);i++)
/*#define all(a) a.begin(),a.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const int inf=1000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}*/
int main(){
  ll n,m;cin>>n>>m;
  priority_queue<ll> v;
  rep(i,n){
    ll a;
    cin>>a;
    v.push(a);
  }
  rep(i,m){
    ll a=v.top();
    a/=2;
    v.pop();
    v.push(a);
  }
  ll ans=0;
  while(!v.empty()){
    ans+=v.top();
    v.pop();
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'll' was not declared in this scope
   21 |   ll n,m;cin>>n>>m;
      |   ^~
a.cc:21:15: error: 'n' was not declared in this scope; did you mean 'yn'?
   21 |   ll n,m;cin>>n>>m;
      |               ^
      |               yn
a.cc:21:18: error: 'm' was not declared in this scope; did you mean 'tm'?
   21 |   ll n,m;cin>>n>>m;
      |                  ^
      |                  tm
a.cc:22:20: error: template argument 2 is invalid
   22 |   priority_queue<ll> v;
      |                    ^
a.cc:22:20: error: template argument 3 is invalid
a.cc:24:7: error: expected ';' before 'a'
   24 |     ll a;
      |       ^~
      |       ;
a.cc:25:10: error: 'a' was not declared in this scope
   25 |     cin>>a;
      |          ^
a.cc:26:7: error: request for member 'push' in 'v', which is of non-class type 'int'
   26 |     v.push(a);
      |       ^~~~
a.cc:29:7: error: expected ';' before 'a'
   29 |     ll a=v.top();
      |       ^~
      |       ;
a.cc:30:5: error: 'a' was not declared in this scope
   30 |     a/=2;
      |     ^
a.cc:31:7: error: request for member 'pop' in 'v', which is of non-class type 'int'
   31 |     v.pop();
      |       ^~~
a.cc:32:7: error: request for member 'push' in 'v', which is of non-class type 'int'
   32 |     v.push(a);
      |       ^~~~
a.cc:34:5: error: expected ';' before 'ans'
   34 |   ll ans=0;
      |     ^~~~
      |     ;
a.cc:35:12: error: request for member 'empty' in 'v', which is of non-class type 'int'
   35 |   while(!v.empty()){
      |            ^~~~~
a.cc:36:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   36 |     ans+=v.top();
      |     ^~~
      |     abs
a.cc:36:12: error: request for member 'top' in 'v', which is of non-class type 'int'
   36 |     ans+=v.top();
      |            ^~~
a.cc:37:7: error: request for member 'pop' in 'v', which is of non-class type 'int'
   37 |     v.pop();
      |       ^~~
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LOOP(val, times)   for(val = 0; val < (times); val++)
int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
  LOOP(i,n){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'i' was not declared in this scope
    8 |   LOOP(i,n){
      |        ^
a.cc:3:32: note: in definition of macro 'LOOP'
    3 | #define LOOP(val, times)   for(val = 0; val < (times); val++)
      |                                ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LOOP(val, times)   for(val = 0; val < (times); val++)

int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
 LOOP(0,n){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}

int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
  for(int i=0;i<n;i++){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: lvalue required as left operand of assignment
    9 |  LOOP(0,n){
      |       ^
a.cc:3:32: note: in definition of macro 'LOOP'
    3 | #define LOOP(val, times)   for(val = 0; val < (times); val++)
      |                                ^~~
a.cc:9:7: error: lvalue required as increment operand
    9 |  LOOP(0,n){
      |       ^
a.cc:3:56: note: in definition of macro 'LOOP'
    3 | #define LOOP(val, times)   for(val = 0; val < (times); val++)
      |                                                        ^~~
a.cc: At global scope:
a.cc:31:5: error: redefinition of 'int main()'
   31 | int main() {
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define LOOP(i,o) for(i=0;i<o;i++)
int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
 LOOP(0,n){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}

int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
  for(int i=0;i<n;i++){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: lvalue required as left operand of assignment
    8 |  LOOP(0,n){
      |       ^
a.cc:3:23: note: in definition of macro 'LOOP'
    3 | #define LOOP(i,o) for(i=0;i<o;i++)
      |                       ^
a.cc:8:7: error: lvalue required as increment operand
    8 |  LOOP(0,n){
      |       ^
a.cc:3:31: note: in definition of macro 'LOOP'
    3 | #define LOOP(i,o) for(i=0;i<o;i++)
      |                               ^
a.cc: At global scope:
a.cc:30:5: error: redefinition of 'int main()'
   30 | 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 LOOP(i,o) for(int y=i;y<o;y++)
int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
 LOOP(0,n){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}

int main() {
  int n,m;
  cin>>n>>m;
  priority_queue<int> d;
  for(int i=0;i<n;i++){
    int y;
    cin>>y;
    d.push(y);
  }
  while(m>0 && d.top()>0){
    int h;
    h=d.top()/2;

    d.pop();

    d.push(h);
    m--;
  }
  int64_t ans=0;
  while (!d.empty()) {
    ans+=d.top();
    d.pop();
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: redeclaration of 'int y'
    9 |     int y;
      |         ^
a.cc:3:27: note: 'int y' previously declared here
    3 | #define LOOP(i,o) for(int y=i;y<o;y++)
      |                           ^
a.cc:8:2: note: in expansion of macro 'LOOP'
    8 |  LOOP(0,n){
      |  ^~~~
a.cc: At global scope:
a.cc:30:5: error: redefinition of 'int main()'
   30 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define pii pair <int, int>
#define fi first
#define sc second
#define ALL(x) x.begin(), x.end()
#define RALL(X) x.begin(), x.end()
#define FOR(i, n, k) for(i=0; i<n; i+=k)
#define FO(i, n, k) for(i=1; i<=n; i+=k)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define N 100005
#define mid ((l+r)/2)
#define dbg(x) (cerr << #x << " : " << x << endl)
#define endl "\n"
#define MOD 100000009

using namespace std;

typedef long long lli;
#define int long long
const int NMAX = 2*1e5;

// dp[i][j] -> i. elemana geldiğimde elime j ticket varsa cevap

lli dp[NMAX][50];
vector <int> ar(NMAX);
int n, m;

lli solve(int i, int left){
	lli &res = dp[i][];
	if(res != -1) return res;
	res = LLONG_MAX;
	
	if(i == n-1){
		left = min(left, 30LL);
		return res = ar[i] / (1<<left); 
	}

	for(int j=min(30LL, left); j>=0; j--){
		res = min(res, solve(i+1LL, left-j) + ar[i]/(1LL<<j));		
	}
	return res;
}

signed main(){
	ios_base::sync_with_stdio(false);
	cin >> n >> m;
	
	for(int i=0; i<n; i++) cin >> ar[i];
	
	for(int i=0; i<NMAX; i++)
		for(int j=0; j<50; j++)
			dp[i][j] = -1;

	solve(0, m);
	cout << dp[0][min(30LL, m)];

	return 0;
}

Compiler output:
a.cc: In function 'lli solve(long long int, long long int)':
a.cc:31:26: error: expected primary-expression before ']' token
   31 |         lli &res = dp[i][];
      |                          ^
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
typedef long long int lint;
using namespace std;


int main(){
    lint n,m;
    cin>>n>>m;
    lint arr[n];
    for(lint i=0;i<n;i++)
        cin>>arr[i];
    for(lint i=0;i<m;i++){
    sort(arr,arr+n);
    arr[n-1]=arr[n-1]/2;
    }
    lint toplam =0;
    for(lint i=0;i<n;i++)
        toplam+=arr[i];
        cout<<toplam;

    return 0;
}#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
typedef long long int lint;
using namespace std;


int main(){
    lint n,m;
    cin>>n>>m;
    lint arr[n];
    for(lint i=0;i<n;i++)
        cin>>arr[i];
    for(lint i=0;i<m;i++){
    sort(arr,arr+n);
    arr[n-1]=arr[n-1]/2;
    }
    lint toplam =0;
    for(lint i=0;i<n;i++)
        toplam+=arr[i];
        cout<<toplam;

    return 0;
}

Compiler output:
a.cc:27:2: error: stray '#' in program
   27 | }#include <cmath>
      |  ^
a.cc:27:3: error: 'include' does not name a type
   27 | }#include <cmath>
      |   ^~~~~~~
a.cc:37:5: error: redefinition of 'int main()'
   37 | int main(){
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main(){
      |     ^~~~
Language: C++

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
typedef long long int l;
using namespace std;


int main(){
    lint n,m;
    cin>>n>>m;
    lint arr[n];
    for(lint i=0;i<n;i++)
        cin>>arr[i];
    for(lint i=0;i<m;i++){
    sort(arr,arr+n);
    arr[n-1]=arr[n-1]/2;
    }
    lint toplam =0;
    for(lint i=0;i<n;i++)
        toplam+=arr[i];
        cout<<toplam;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'lint' was not declared in this scope; did you mean 'uint'?
   12 |     lint n,m;
      |     ^~~~
      |     uint
a.cc:13:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 |     cin>>n>>m;
      |          ^
      |          yn
a.cc:13:13: error: 'm' was not declared in this scope; did you mean 'tm'?
   13 |     cin>>n>>m;
      |             ^
      |             tm
a.cc:14:9: error: expected ';' before 'arr'
   14 |     lint arr[n];
      |         ^~~~
      |         ;
a.cc:15:13: error: expected ';' before 'i'
   15 |     for(lint i=0;i<n;i++)
      |             ^~
      |             ;
a.cc:15:18: error: 'i' was not declared in this scope
   15 |     for(lint i=0;i<n;i++)
      |                  ^
a.cc:16:14: error: 'arr' was not declared in this scope
   16 |         cin>>arr[i];
      |              ^~~
a.cc:17:13: error: expected ';' before 'i'
   17 |     for(lint i=0;i<m;i++){
      |             ^~
      |             ;
a.cc:17:18: error: 'i' was not declared in this scope
   17 |     for(lint i=0;i<m;i++){
      |                  ^
a.cc:18:10: error: 'arr' was not declared in this scope
   18 |     sort(arr,arr+n);
      |          ^~~
a.cc:21:9: error: expected ';' before 'toplam'
   21 |     lint toplam =0;
      |         ^~~~~~~
      |         ;
a.cc:22:13: error: expected ';' before 'i'
   22 |     for(lint i=0;i<n;i++)
      |             ^~
      |             ;
a.cc:22:18: error: 'i' was not declared in this scope
   22 |     for(lint i=0;i<n;i++)
      |                  ^
a.cc:23:9: error: 'toplam' was not declared in this scope; did you mean 'tmpnam'?
   23 |         toplam+=arr[i];
      |         ^~~~~~
      |         tmpnam
a.cc:23:17: error: 'arr' was not declared in this scope
   23 |         toplam+=arr[i];
      |                 ^~~
a.cc:24:15: error: 'toplam' was not declared in this scope; did you mean 'tmpnam'?
   24 |         cout<<toplam;
      |               ^~~~~~
      |               tmpnam
Language: C++

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

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[i];
}


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

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

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[i];
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: request for member 'q' in 'q.std::priority_queue<int>::top()', which is of non-class type 'const __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'const int'}
   16 |     int a = q.top(). q.pop();
      |                      ^
a.cc:21:20: error: no match for 'operator[]' (operand types are 'std::priority_queue<int>' and 'int')
   21 |   rep(i,n) ans += q[i];
      |                    ^
Language: C++

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

ans=0
def cheap(x,y):
    x=int(x/(2**y))
    return x

i=0
while(i<M):
    A.sort(reverse=True)
    A[0]=cheap(A[0],1)
    i+=1

for i in range(0,N):
    ans+=A[i]

print(ans)



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

#include <bits/stdc++.h>
#include <queue>

using namespace std;

int main() {
  int n,m;
  cin >> n >> m;
  long long ans=0;
  priority_queue<int> que;
  Vector<int> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
    que.push(a.at(i));
    ans += a.at(i);
  }
  long long dis=0;
  int x,k=0;
  while(k<m){
    dis += (que.top() + 1)/2;
    x = que.top()/2;
    que.push(x);
    que.pop();
    k++;
  }
  cout << ans - dis << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'Vector' was not declared in this scope
   11 |   Vector<int> a(n);
      |   ^~~~~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   Vector<int> a(n);
      |          ^~~
a.cc:13:12: error: 'a' was not declared in this scope
   13 |     cin >> a.at(i);
      |            ^
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n, m;
    cin >> n >> m;
    int l, i=0, a[n];
    while(cin>>l){
        a[i] = l;
        i++;
        if (i >= n) {
            break;
        }
    }
    for (int j = 0; j < m; j++){
        int maxv = INT_MIN;
        int maxvInd;
        for(int i = 0; i < n; i++) {
            if( a[i] > maxv ) {
                maxv = a[i];
                maxvInd = i;
            }
        }
        a[maxvInd] = a[maxvInd]/2;
    }
    long int pay = 0;
    for (int i = 0; i < n; i++){
        pay = pay+a[i];
    }
    cout << pay;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:20: error: 'INT_MIN' was not declared in this scope
   16 |         int maxv = INT_MIN;
      |                    ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 | using namespace std;
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#define rep(i,n) for (int i = 0; i < (n);i++)
typedef long long ll;
using namespace std;
/*#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;*/



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

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#define rep(i,n) for (int i = 0; i < (n);i++)
typedef long long ll;
using namespace std;
/*#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;*/



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

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

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

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#define rep(i,n) for (int i = 0; i < (n);i++)
typedef long long ll;
using namespace std;
/*#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;*/



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

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

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

#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define mod 1000000007

using namespace std;

int main(){

  int a,n,m;
  long long ans=0;
  priority_queue<int> q;

  cin >> n >> m;
  
  rep(i,0,n-1){
    cin >> a;
    q.push(a);
  }

  rep(i,m){
    a = q.top();
    q.pop();
    q.push(a/2);
  }

  rep(i,0,n-1){
    a = q.top();
    q.pop();
    ans += a;
  }
  
  cout << ans << endl;
  return 0;

}


Compiler output:
a.cc:23:10: error: macro "rep" requires 3 arguments, but only 2 given
   23 |   rep(i,m){
      |          ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,cc,n) for(int i=cc;i<=n;++i)
      |         ^~~
a.cc: In function 'int main()':
a.cc:23:3: error: 'rep' was not declared in this scope
   23 |   rep(i,m){
      |   ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
long long int sum=0,n,m,num,de;
long long int b[1000005];
int getMax(long long int *arr,int n){
	long long int num=arr[0];
	int a;
	for(int i=0;i<n;i++){
		if(arr[i]>num){
			num=arr[i];
			a=i;
		}
	}
	return a;
}

int main(){
	cin>>n>>m;
	
	for(int i=0;i<n;i++){
		cin>>de;
		b[i]=de;
		num+=de;
	}
	//printf("1");
	if(m*m>num){
		printf("0");
		return 0;
	}
	for(int i=0;i<m;i++){
		//printf("%d\t",b[getMax(b,n)]);
		b[getMax(b,n)]/=(1^2);
	}
	for(int i=0;i<n;i++){
		if(b[i]>0){
			sum+=b[i];
		}
		//printf("%lld",b[i]);
	}
	num=9500000000;
	num=1000000000ll+1000000000ll
	printf("%lld",1^2);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:38: error: expected ';' before 'printf'
   43 |         num=1000000000ll+1000000000ll
      |                                      ^
      |                                      ;
   44 |         printf("%lld",1^2);
      |         ~~~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rep(i,N) for (ll i=0;i<N;i++)
#define loop(i,N,M) for(ll i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)

//template<typename A, size_t N, typename T>
//void Fill(A(&array)[N], const T &val) {
	//std::fill((T*)array, (T*)(array + N), val);
//}

//解法
void solve() {

	ll N,M;
	cin >> N >> M;

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

	rep(i,M) {
		double P = PQ.top();
		PQ.pop();
		P/=2;
		PQ.push(P);
	}

	ll ans = 0;
	while(PQ.size()!=0){
		double P = PQ.top():
		PQ.pop();
		ans += floor(P);
	}

}

int main() {

	//入力

	solve();
	cout << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:54:36: error: expected ',' or ';' before ':' token
   54 |                 double P = PQ.top():
      |                                    ^
Language: Java

import java.util.*;
public class JavaApplication6 {
    public static void main(String[] args) {
        Scanner read = new Scanner(System.in);
        int n = read.nextInt();
        int m = read.nextInt();
        List<Integer> array = new ArrayList<Integer>();
        for(int i = 0; i<n; i++){
            array.add(read.nextInt());
        }
        Collections.sort(array);
        for(int i = 0; i<m;i++){
           array.add(array.get(n-1)/2);
           array.remove(n-1);
           int lo = 0;
           int hi = n-2;
           int mid = 0;
//           System.out.println(array.toString());
           while(lo<=hi){
            mid = lo + (hi -lo)/2;
            if(array.get(n-1) == array.get(mid)){
                break;
            }
            else if(array.get(n-1)>array.get(mid)){
                lo = mid;
                if(array.get(n-1)>array.get(mid+1)){
                    lo++;
                }
                else{
                    break;
                }
            }
            else{
                hi = mid - 1;
            }
            } 
           array.add(mid + 1,array.get(n-1));
           array.remove(n);
//           System.out.println("Sorted: " + array.toString());
        }
        long sum = 0;
        for(int i = 0; i<n; i++){
            sum+= array.get(i);
        }
        System.out.println(sum);
    }
    
}


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

#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#define rep(i,n) for (int i = 0; i < (n);i++)
typedef long long ll;
using namespace std;
/*#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;*/



void Main()
{
	ll n,m; cin >> n >> m;
	vector<ll> price(n);
	rep(i,n){
		cin >> price.at(i);
	}
	rep(i,m){
		int x;
		x = distance(price.begin(), max_element(price.begin(), price.end()));
		price.at(x)/=2;
	}
	ll sum = 0;
	rep(i,n){
		sum+=price.at(i);
	}
	cout << sum <<endl;
}

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

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

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

int main() {
    int64_t N, M, a, ans = 0;
    cin >> N >> M;
    priority_queue<int> s;
    for (int i = 0; i < N; i++) {
        cin >> a;
        s.push(a);
    }
    for (int i = 0; i < M) {
        a = s.top();
        a /= 2;
        s.pop();
        s.push(a);
    }
    for (int i = 0; i < N; i++) {
        ans += s.top();
        s.pop();
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ';' before ')' token
   12 |     for (int i = 0; i < M) {
      |                          ^
      |                          ;
Language: C++

import heapq

n,m = map(int,input().split())
a = list(map(int,input().split()))

hq = []
for i in a:
    heapq.heappush(hq,-i)

for _ in range(m):
    heapq.heappush(hq,-(-heapq.heappop(hq)//2))

print(-sum(hq))


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 <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<lli,lli>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int main(){
  lli A,B,C,D,E,L,R,X,Y,W,H,N,M,K,sum=0,num=0,flag=0;string S,T;
  cin >> N >> K;
  priority_queue<lli> P;
  rep(i,0,N){
    cin >> M;
    P.push(M);
  }
  rep(i,0,K){
    X=P.top();P.pop();
    P.push(X/2);
  }
  while(!P.empty()){
    sum+=P.top();P.pop;
  }
  Out(sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:20: error: invalid use of non-static member function 'void std::priority_queue<_Tp, _Sequence, _Compare>::pop() [with _Tp = long long int; _Sequence = std::vector<long long int, std::allocator<long long int> >; _Compare = std::less<long long int>]'
   38 |     sum+=P.top();P.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++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
  int n,m;cin>>n>>m;
  int arr[n];for(int i=0;i<n;i++) cin>>arr[i];
  sort(arr,arr+n,greater<int>);
  ll total=0;
  for(int i=0;i<n && m;i++)
  {
    int maxpow=log2(arr[i]);
    maxpow=min(maxpow,m);
    arr[i]=round(arr[i]/pow(2,maxpow));
    m-=maxpow;
    total+=arr[i];
  }
  cout<<total;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:30: error: expected primary-expression before ')' token
    8 |   sort(arr,arr+n,greater<int>);
      |                              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  priority_queue<int> q;
  int x;
  for (int i = 0; i < n; i++) {
    cin >> x;
    q.push(x);
  }
  for (int i = 0; i < m; i++) {
    x = q.top();
    q.pop();
    q.push(x / 2);
  }
  long long res = 0;
  for (int i = 0; i < n; i++) {
    res += q.top();
    q.pop();
  }
  cout << res << '\n';
  return 0;
}
}

Compiler output:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'a' was not declared in this scope
   17 |     q.push(a / 2);
      |            ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main(){

  int N,M;
  cin >> N >> M;
  vector<unsigned long> now_price(N);
  for (int i=0;i<N;++i) cin >> now_price[i];
  sort(now_price.begin(),now_price.end(),greater<unsigned long>());
  for (int i=0;i<M;++i){
    //cout << "e" << endl;
    // vector<unsigned long>::iterator iter = max_element(now_price.begin(),now_price.end());
    // int index = distance(now_price.begin(),iter);
    //cout << index << endl;
    now_price[0] /= 2;

    int move = now_price[0];
    bool flg = false;
    for(int i=1;i<N;++i){
      if(move > now_price[i]){
        now_price.insert(now_price.begin()+i,move);
        now_price.erase(now_price.begin());
        flg = true;
        break;
      }
    }
    if(!flg){
      now_price.insert(now_price.end(),move);
      now_price.erase(now_price.begin());
    }
  }
  unsigned long long sum = 0;
  // for (int i=0;i<N;++i) sum += now_price[i];
  cout << accumulate(now_price.begin(), now_price.end(), 0); << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:62: error: expected primary-expression before '<<' token
   39 |   cout << accumulate(now_price.begin(), now_price.end(), 0); << endl;
      |                                                              ^~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    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++) {
        int max = 0;
        for (int j = 1; j < n; j++) {
            if (a[j] > a[max]) {
                max = j
            }
        }
        a[max] /= 2;
    }
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += a[i];
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before '}' token
   24 |                 max = j
      |                        ^
      |                        ;
   25 |             }
      |             ~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    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++) {
        int max = 0;
        for (int j = 1; j < n; j++) {
            if (a[j > a[max]) {
                max = j
            }
        }
        a[max] /= 2;
    }
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += a[i];
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:29: error: expected ']' before ')' token
   23 |             if (a[j > a[max]) {
      |                             ^
      |                             ]
a.cc:24:24: error: expected ';' before '}' token
   24 |                 max = j
      |                        ^
      |                        ;
   25 |             }
      |             ~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void){
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i]
    }
    for (int i = 0; i < m; i++) {
        int max = 0;
        for (int j = 1; j < n; j++) {
            if (a[i] > a[max]) {
                max = i;
            }
        }
        a[max] /= 2;
    }
    int sum = 0;
    for (int i = 0; i < n; i++) {
        sum += a[i];
    }
    cout << sum << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: expected ';' before '}' token
   11 |         cin >> a[i]
      |                    ^
      |                    ;
   12 |     }
      |     ~
Language: C

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define ll long long
int main(){
    int i,j,n,m;
    double a[100005];
    ll h=0;
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++)scanf("%lf",&a[i]);
    sort(a,a+n);
    while(m--){
        a[n-1]=a[n-1]/2;
        sort(a,a+n);
    }
    for(i=0;i<n;i++)h=h+(int)a[i];
    printf("%lld\n",h);
    return 0;
}




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

#include<bits/stdc++.h>
using namespace std;
bool cmp(__int64 a,__int64 b)
{
    return a>b;
}
int main()
{
    __int64 n,m;
    __int64 a[100005];
    scanf("%I64d%I64d",&n,&m);
    for(__int64 i=0;i<n;i++)
        scanf("%I64d",&a[i]);
    sort(a,a+n,cmp);
    for(__int64 i=1;i<=m;i++)
    {
        a[0]=a[0]/2;
        sort(a,a+n,cmp);
    }
    __int64 u=0;
    for(int i=0;i<n;i++)
        u=u+a[i];
    printf("%I64d\n",u);
    return 0;
}


Compiler output:
a.cc:3:10: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    3 | bool cmp(__int64 a,__int64 b)
      |          ^~~~~~~
      |          __ynf64
a.cc:3:20: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    3 | bool cmp(__int64 a,__int64 b)
      |                    ^~~~~~~
      |                    __ynf64
a.cc:3:29: error: expression list treated as compound expression in initializer [-fpermissive]
    3 | bool cmp(__int64 a,__int64 b)
      |                             ^
a.cc: In function 'int main()':
a.cc:9:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    9 |     __int64 n,m;
      |     ^~~~~~~
      |     __ynf64
a.cc:10:12: error: expected ';' before 'a'
   10 |     __int64 a[100005];
      |            ^~
      |            ;
a.cc:11:25: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |     scanf("%I64d%I64d",&n,&m);
      |                         ^
      |                         yn
a.cc:11:28: error: 'm' was not declared in this scope; did you mean 'tm'?
   11 |     scanf("%I64d%I64d",&n,&m);
      |                            ^
      |                            tm
a.cc:12:16: error: expected ';' before 'i'
   12 |     for(__int64 i=0;i<n;i++)
      |                ^~
      |                ;
a.cc:12:21: error: 'i' was not declared in this scope
   12 |     for(__int64 i=0;i<n;i++)
      |                     ^
a.cc:13:24: error: 'a' was not declared in this scope
   13 |         scanf("%I64d",&a[i]);
      |                        ^
a.cc:14:10: error: 'a' was not declared in this scope
   14 |     sort(a,a+n,cmp);
      |          ^
a.cc:15:16: error: expected ';' before 'i'
   15 |     for(__int64 i=1;i<=m;i++)
      |                ^~
      |                ;
a.cc:15:21: error: 'i' was not declared in this scope
   15 |     for(__int64 i=1;i<=m;i++)
      |                     ^
a.cc:20:12: error: expected ';' before 'u'
   20 |     __int64 u=0;
      |            ^~
      |            ;
a.cc:22:9: error: 'u' was not declared in this scope
   22 |         u=u+a[i];
      |         ^
a.cc:23:22: error: 'u' was not declared in this scope
   23 |     printf("%I64d\n",u);
      |                      ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<queue>
#include<algorithm>
using namespace std;
int n,m;
double x;
long long s,s1;
priority_queue<double> p;
int main()
{
	int i;
	cin>>n>>m;
	for(i=0;i<n;i++)
	{
		cin>>x;
		p.push(x);
	}
	for(i=0;i<m;i++)
	{
		x=p.top();
		p.pop();
		x/=2;
		p.push(x);
	}
	s=0;
	for(i=0;i<n;i++)
	{
		s1=(long long)(p.top();
		s+=s1;
		p.pop();
	}
	printf("%I64d\n",s);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:39: error: expected ')' before ';' token
   32 |                 s1=(long long)(p.top();
      |                               ~       ^
      |                                       )
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<queue>
#include<algorithm>
using namespace std;
int n,m;
double x;
__int64 s,s1;
priority_queue<double> p;
int main()
{
	int i;
	cin>>n>>m;
	for(i=0;i<n;i++)
	{
		cin>>x;
		p.push(x);
	}
	for(i=0;i<m;i++)
	{
		x=p.top();
		p.pop();
		x/=2;
		p.push(x);
	}
	s=0;
	for(i=0;i<n;i++)
	{
		s1=(int)(p.top();
		s+=s1;
		p.pop();
	}
	printf("%I64d\n",s);
	return 0;
}

Compiler output:
a.cc:11:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   11 | __int64 s,s1;
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:29:9: error: 's' was not declared in this scope
   29 |         s=0;
      |         ^
a.cc:32:17: error: 's1' was not declared in this scope; did you mean 'y1'?
   32 |                 s1=(int)(p.top();
      |                 ^~
      |                 y1
a.cc:32:33: error: expected ')' before ';' token
   32 |                 s1=(int)(p.top();
      |                         ~       ^
      |                                 )
Language: C++

#include <iostream>
#include<string>
#include<map>
#include<queue>
using namespace std;
int main()
{
	int n, m; priority_queue<int>s;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		int k;
		scanf_s("%d", &k);
		s.push(k);
	}
	while (m--)
	{
		int q = s.top();
		s.pop();
		s.push(q / 2);
	}
	long long sum = 0;
	while (!s.empty())
	{
		sum += s.top();
		s.pop();
	}
	cout << sum << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                 scanf_s("%d", &k);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<queue>
#include<algorithm>
using namespace std;
int n,m,x;
__int64 s,s1;
priority_queue<double> p;
int main()
{
	int i;
	cin>>n>>m;
	for(i=0;i<n;i++)
	{
		cin>>x;
		p.push(x);
	}
	for(i=0;i<m;i++)
	{
		x=p.top();
		p.pop();
		x/=2;
		p.push(x);
	}
	s=0;
	for(i=0;i<n;i++)
	{
		s1=(int)p.top();
		s+=s1;
		p.pop();
	}
	printf("%I64d\n",s);
	return 0;
}

Compiler output:
a.cc:10:1: error: '__int64' does not name a type; did you mean '__int64_t'?
   10 | __int64 s,s1;
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:28:9: error: 's' was not declared in this scope
   28 |         s=0;
      |         ^
a.cc:31:17: error: 's1' was not declared in this scope; did you mean 'y1'?
   31 |                 s1=(int)p.top();
      |                 ^~
      |                 y1
Language: C++

#include <iostream>
#include<string>
#include<map>
#include<queue>
using namespace std;
int main()
{
	int n, m; priority_queue<int>s;
	cin >> n >> m;
	for (int i = 0; i < n; i++)
	{
		int k;
		scanf_s("%d", &k);
		s.push(k);
	}
	while (m--)
	{
		int q = s.top();
		s.pop();
		s.push(q / 2);
	}
	int sum = 0;
	while (!s.empty())
	{
		sum += s.top();
		s.pop();
	}
	cout << sum << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   13 |                 scanf_s("%d", &k);
      |                 ^~~~~~~
      |                 scanf
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();
    }
 
    printf(%ld, ans);
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:12: error: expected primary-expression before '%' token
   32 |     printf(%ld, ans);
      |            ^
a.cc:32:13: error: 'ld' was not declared in this scope
   32 |     printf(%ld, ans);
      |             ^~