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


#include <bits/stdc++.h>
 
using namespace std;
 
int main()
{
  	long
  	long sum = 0;
  	int i = 0;
  	
    scanf("%ld",&H);
	while(H >= 1){
	    sum += pow(2,i);
	    H = H/2;
	    i++;
	}
	printf("l%d\n",sum);
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: 'H' was not declared in this scope
   12 |     scanf("%ld",&H);
      |                  ^
Language: Java

import java.util.*;
public class Main{
  
  static long findAns(long n,long ans,int count){
    if(n>1){
      ans+=Math.pow(2,count);
      ++count;
      findAns(n/2,ans,count);
    }
    else if(n==1){
      ans+=Math.pow(2,count);
      return ans;
    }
  }
  
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    long n=sc.nextLong();
    long ans=0;
   	System.out.println(findAns(n,ans,0));
  }
}


Compiler output:
Main.java:14: error: missing return statement
  }
  ^
1 error
Language: Java

import java.util.*;
public class Main{
  
  static long findAns(long n,long ans,int count){
    if(n>1){
      ans+=Math.pow(2,count);
      ++count;
      findAns(n/2,ans);
    }
    else if(n==1){
      ans+=Math.pow(2,count);
      return ans;
    }
  }
  
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    long n=sc.nextLong();
    long ans=0;
   	System.out.println(findAns(n,ans,0));
  }
}


Compiler output:
Main.java:8: error: method findAns in class Main cannot be applied to given types;
      findAns(n/2,ans);
      ^
  required: long,long,int
  found:    long,long
  reason: actual and formal argument lists differ in length
1 error
Language: C++

#include<iostream>
using namespace std;
int d=0;
int div(int h)
{ 
  if(h>2){
  if(h%2==0){
    div(h/2);
    div(h/2);}
  else{
     div((h/2)+1);
    div((h/2)+1);
  }  
    d++;
  }
  return d;
}

int main()
{
    int h;
    cin>>h;
    if(h>2)
     int k= div(h);
    cout<<k+6;
     else if(h==2)
       cout<<3;
      else
        cout<<1;
   

     
     return 0;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: 'k' was not declared in this scope
   25 |     cout<<k+6;
      |           ^
a.cc:26:6: error: 'else' without a previous 'if'
   26 |      else if(h==2)
      |      ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int H;
  cin>>H;
  int i=0;
  int sum=0;
  while(H!=0)
  {
    H=H/2;
    sum+=pow(2,i);
    i++;
  }
  cout<<sum;
    


Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: expected '}' at end of input
   15 |   cout<<sum;
      |             ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

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

int main(){
    int n,s=0,sum=0;
    while ( n >1 ){
    	s = s+1;
    	sum = sum +(s*2)
    	n = n/2
    }
    sum = sum +(s*2);
    cout << sum;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before 'n'
    8 |         sum = sum +(s*2)
      |                         ^
      |                         ;
    9 |         n = n/2
      |         ~
Language: C++

#include<iostream>
using namespace std;
int d=0;
int div(int h)
{ 
  if(h>2){
  if(h%2==0){
    div(h/2);
    div(h/2);}
  else{
     div((h/2)+1);
    div((h/2)+1);
  }  
    d++;
  }
  return k;
}

int main()
{
    int h;
    cin>>h;
    if(h>2)
     int k= div(h);
    cout<<k+6;
     else if(f==2)
       cout<<3;
      else
        cout<<1;
   

     
     return 0;

}


Compiler output:
a.cc: In function 'int div(int)':
a.cc:16:10: error: 'k' was not declared in this scope
   16 |   return k;
      |          ^
a.cc: In function 'int main()':
a.cc:25:11: error: 'k' was not declared in this scope
   25 |     cout<<k+6;
      |           ^
a.cc:26:6: error: 'else' without a previous 'if'
   26 |      else if(f==2)
      |      ^~~~
a.cc:26:14: error: 'f' was not declared in this scope
   26 |      else if(f==2)
      |              ^
Language: C++

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

int main() {
  int h;
  int count = 0;
  int enemy = 1;
  int a = 0;
  vector<long> v(1);
  cin >> h;
  v.at(0) = h / 2;
  while(true) {
    a = sizeof(v) / sizeof(v.at(0));
    v.at(a - 1) / 2;
    v.push_back(v.at(a - 1));
    count++;
    while(v.at(a - 1) == 0) {
      v.pop_back();
    }
    if (v.at(0) != 1) {
      continue;
    }
    count++;
    break;
  }
  cout << count << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected '}' at end of input
   26 |   cout << count << endl;
      |                         ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

include <stdio.h>

int main(void){
  long long int h;
  scanf("%lld", &h);
  long long int count = 1;
  
  while(1){
    h = h/2;
    count = count *2;
    if(h == 1){
      printf("%lld", count);
      return 0;
    }
  }
  return 0;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
Language: C++

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

long long a;
int h;

int main(){
	cin>>a;
	for(int i=1;i<=40;i++){
		if(a<=sum){
			break;
		}
		sum*=2;
	}
	cout<<sum*2-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: 'sum' was not declared in this scope
   10 |                 if(a<=sum){
      |                       ^~~
a.cc:13:17: error: 'sum' was not declared in this scope
   13 |                 sum*=2;
      |                 ^~~
a.cc:15:15: error: 'sum' was not declared in this scope
   15 |         cout<<sum*2-1<<endl;
      |               ^~~
Language: C

#include<stdio.h>
int main()
{
  int h,count=0;
  scanf("%d",&h) 
    count=(h+(h-1));
   printf("%d\n",count);
}

Compiler output:
main.c: In function 'main':
main.c:5:17: error: expected ';' before 'count'
    5 |   scanf("%d",&h)
      |                 ^
      |                 ;
    6 |     count=(h+(h-1));
      |     ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int H;
  cin>>H;
  int i=0;
  sum=0;
  while(H!=0)
  {
    H=H/2;
    sum+=pow(2,i);
    i++;
  }
  cout<<sum;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'sum' was not declared in this scope
    8 |   sum=0;
      |   ^~~
a.cc:15:13: error: expected '}' at end of input
   15 |   cout<<sum;
      |             ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

#include<stdio.h>
int main()
{
  int h,count;
  scanf("%d",&h) 
    count=(h+(h-1));
   printf("%d\n",count);
}

Compiler output:
main.c: In function 'main':
main.c:5:17: error: expected ';' before 'count'
    5 |   scanf("%d",&h)
      |                 ^
      |                 ;
    6 |     count=(h+(h-1));
      |     ~~~~~
Language: C++

#include <algorithm>
#include <vector>
#include <iostream>
#include <regex>
#define pb push_back
using namespace std;

int main() {
	int a, b, count = 0;
	cin >> a;
	while (a > 0) {
		a = a / 2;
		count++;
	}
	cout << pow(2,count)-1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: 'pow' was not declared in this scope
   15 |         cout << pow(2,count)-1;
      |                 ^~~
Language: C++

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

using namespace std;

int main() {
	unsigned long long h;
	cin >> h;

	int count=0;

	while (h/2 != 1) {
		count++;
		h = h / 2;
	}
	count++;

	unsigned long long result = 1;

	for (int i = 0; i < count; i++) {
		result += pow(2,i+1);
		cout << "2^i:" << pow(2,i) << endl;
	}

	cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:27: error: 'pow' was not declared in this scope
   22 |                 result += pow(2,i+1);
      |                           ^~~
Language: C++

#include <algorithm>
#include <vector>
#include <regex>
#define pb push_back
using namespace std;

int main() {
	int a, b, count = 0;
	cin >> a;
	while (a > 0) {
		a = a / 2;
		count++;
	}
	cout << pow(2,count)-1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
    9 |         cin >> a;
      |         ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include <regex>
  +++ |+#include <iostream>
    4 | #define pb push_back
a.cc:14:9: error: 'cout' was not declared in this scope
   14 |         cout << pow(2,count)-1;
      |         ^~~~
a.cc:14:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:17: error: 'pow' was not declared in this scope
   14 |         cout << pow(2,count)-1;
      |                 ^~~
Language: Java

import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        long hp = scan.nextLong();
        scan.close();
        long count = 1;
        int jyosu = 0; //hpは2の何乗か?

        if(hp == 1) System.out.println(count);
        else{
            while(hp != 1){
                hp = hp / 2;
                jyosu++;
            }

            for(int i = 0;i < jyosu;i++) count = count * 2;
            System.out.println(count - 1);
        }

Compiler output:
Main.java:20: error: reached end of file while parsing
        }
         ^
1 error
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int main() {
	long long int h,count=0;
	cin >> h;
	else {
		while (1) {
		count++;
		h /= 2;
		if (h == 1) {
			break;
		}
	}
	cout << (long long int)pow(2, count + 1) - 1 << endl;
		}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'else' without a previous 'if'
    7 |         else {
      |         ^~~~
Language: C++

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int h;
if(h%2!=0)
   h=h+1;
 q=h; 
 for(int i=0;q>1;)
 {
 q=q/2;
   ++i;
 }
 cout<<pow(2,i)-1; 
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:2: error: 'q' was not declared in this scope
    9 |  q=h;
      |  ^
a.cc:15:14: error: 'i' was not declared in this scope
   15 |  cout<<pow(2,i)-1;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,cnt=0,b=1;
int i=1;
cin>>a;
for (;a==0;i++)
a/=2
for (int n=1;n<=i;n++)
{
cnt+=b;
b*=2;
}
cout<<cnt<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ';' before 'for'
    9 | a/=2
      |     ^
      |     ;
   10 | for (int n=1;n<=i;n++)
      | ~~~  
a.cc:10:14: error: 'n' was not declared in this scope
   10 | for (int n=1;n<=i;n++)
      |              ^
Language: C++

int main() {
    int H;
    cin >> H;
    int sam = 0, b=0;
    while (H != 0) {
        H = H / 2;
        b++;
        sam += pow(b - 1);
    }
    cout << sam;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> H;
      |     ^~~
a.cc:8:16: error: 'pow' was not declared in this scope
    8 |         sam += pow(b - 1);
      |                ^~~
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout << sam;
      |     ^~~~
Language: C

#include <stdio.h>

int main(){
  long l=0,m=1;
  scanf("%d",&n);
  while(n!=0){
    n=n>>1;
    m=m<<1;
  }
  printf("%d",m);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:5:15: error: 'n' undeclared (first use in this function)
    5 |   scanf("%d",&n);
      |               ^
main.c:5:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
using namespace std;

int main() {
	int H;
	cin >> H;

	int counter = 0;
	long answer = 1;
	while (H > 1) {
		H /= 2;
		++counter;
		answer += pow(2, counter);
	}

	cout << answer;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:27: error: 'pow' was not declared in this scope
   13 |                 answer += pow(2, counter);
      |                           ^~~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
int main(void){
    long long H;
    cin >> H;

    long long sum;
    int i = 0;
  
    while (H != 0) {
      H = H / 2;
      sum += 2 ** i;
      i += 1;
    }
  cout << sum;
   return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: invalid type argument of unary '*' (have 'int')
   13 |       sum += 2 ** i;
      |                 ^~~
Language: C++

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

int main() {
	long h
	ll res;
	int count=0;
	cin >> h ;
	
	while (h != 1){
		h = floor(h/2);
		count++;
	}
	
	rep(i,count+1) res += pow(2,i);
	
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: expected initializer before 'll'
    8 |         ll res;
      |         ^~
a.cc:10:16: error: 'h' was not declared in this scope
   10 |         cin >> h ;
      |                ^
a.cc:17:24: error: 'res' was not declared in this scope; did you mean 'rep'?
   17 |         rep(i,count+1) res += pow(2,i);
      |                        ^~~
      |                        rep
a.cc:19:17: error: 'res' was not declared in this scope; did you mean 'rep'?
   19 |         cout << res << endl;
      |                 ^~~
      |                 rep
Language: C++

int main() {
    int H;
    cin >> H;
    int sam = 0, b;
    while (H != 0) {
        H = H / 2;
        b++;
    }
    cout << (pow(2, b-1)+1);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> H;
      |     ^~~
a.cc:9:5: error: 'cout' was not declared in this scope
    9 |     cout << (pow(2, b-1)+1);
      |     ^~~~
a.cc:9:14: error: 'pow' was not declared in this scope
    9 |     cout << (pow(2, b-1)+1);
      |              ^~~
Language: C++

#include<iostream.
using namespace std;
int main()
{
  int H,count;
  cin>>H;
  count=0;
  while(H==0)
  {    
  	if(H>1)
    {
      count++;
      H=H/2;
      count+=2;
    }
    else if(H==1)
    {
      	H=0;
    	count++;
    }
  }
  cout<<count;
  return 0;
}


    

Compiler output:
a.cc:1:19: error: missing terminating > character
    1 | #include<iostream.
      |                   ^
a.cc:1:9: fatal error: iostream.: No such file or directory
    1 | #include<iostream.
      |         ^
compilation terminated.
Language: C

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

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(void){
	long long  h;
	scanf("%lld",&h);
	long long a = 2;
	while(a <= h){
		a = a*2;
	}
	printf("%lld\n",a-1);
    return 0; 
}
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(void){
	long long  h;
	scanf("%lld",&h);
	long long a = 2;
	while(a <= h){
		a = a*2;
	}
	printf("%lld\n",a-1);
    return 0; 
}


Compiler output:
main.c:27:5: error: redefinition of 'main'
   27 | int main(void){
      |     ^~~~
main.c:9:5: note: previous definition of 'main' with type 'int(void)'
    9 | int main(void){
      |     ^~~~
Language: Java

import java.util.*;
public class monster {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long h = sc.nextLong();
		double s =  (Math.log(h)/Math.log(2));
		//System.out.println((long)s);
		if(h==1) {
			System.out.println(h);
		}
		else {
			int n = (int)s;
			long h1 = 2*(power(2,n)-1);
			System.out.println(h1+1);
			
		}
		
	}
	static long power(int x, int y) 
    { 
        if (y == 0) 
            return 1; 
        else if (y % 2 == 0) 
            return power(x, y / 2) * power(x, y / 2); 
        else
            return x * power(x, y / 2) * power(x, y / 2); 
    } 

}


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

inp = int(input())

h = inp 
cnt = 0
while (h != 1):
    cnt += 1
    h = h / 2
cnt += 1
ans = (1 << (cnt)) -1
print ans

Compiler output:
a.cc:1:1: error: 'inp' does not name a type; did you mean 'int'?
    1 | inp = int(input())
      | ^~~
      | int
Language: C

/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>
#include<conio.h>

int main()
{
  long h,n=0,sum,k=1,i;
  scanf("%ld",&h);
  while(h!=0)
  {
      h=h/2;
      n=n+1;
      
  }
  for(i=0;i<n;i++)
  {
      k=k*2;
  }
  sum=(k-1);
  printf("%ld",sum);
  
}


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

int main() {
  int a, c, d;
  cin >> a;
  c = 1;
  d = 0;
  for (int i = a; i >= 1; i /= 2){
    d += c;
    c *= 2;
  }
  cout << d << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin >> a;
      |   ^~~
a.cc:10:3: error: 'cout' was not declared in this scope
   10 |   cout << d << endl;
      |   ^~~~
a.cc:10:16: error: 'endl' was not declared in this scope
   10 |   cout << d << endl;
      |                ^~~~
Language: C

#include<stdio.h>
long c(long x,long r){
    if(x/2>1)r=2*c(x/2,r);
    else r+=2;
    return r+1;
}
long h,s=0;
int main(){
    scanf("%ld",&h);
    if(h==1){put("1");return 0;}
    s=c(h,s);
    printf("%ld",s);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:14: error: implicit declaration of function 'put'; did you mean 'puts'? [-Wimplicit-function-declaration]
   10 |     if(h==1){put("1");return 0;}
      |              ^~~
      |              puts
Language: C++

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

int main()
{
  long int n;
  cin>>n;
  long int count=1;
  long int final=0;
  for(int i=1;n!=1;i=++)
  {
    n=n/2;
    final=pow(2,i);
    count=count+final;
  }
  long int ans=(count+2*final);
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected primary-expression before ')' token
   10 |   for(int i=1;n!=1;i=++)
      |                        ^
Language: Java


import java.util.Scanner;

public class CaracalVsMonster {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long h = sc.nextLong();
		long count = 0;
		while(h > 1){
			count++;
			h /= 2;
		}
		long ans = 2;
		for(int i = 0; i < count; i++){
			ans *= 2;
		}
		System.out.println(ans - 1);
	}
}


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

#include"iostream"
using namespace std;
int main(void) {
	int long long a, res = 0, cnt = 0;
	cin >> a;
	while (a > 0) {
		a /= 2;
		res += pow(2, cnt);
		cnt++;
	}

	cout << res;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:24: error: 'pow' was not declared in this scope
    8 |                 res += pow(2, cnt);
      |                        ^~~
Language: C++

map <lo,lo> dp;
lo f(lo n){
    if(n == 1) return 1;
    if(n < 1) return 0;
    if(dp[n] != 0) return dp[n];
    return dp[n] = f(n / 2) + f(n / 2) + 1;
}
int main(){
    //freopen("kenar.gir","r",stdin);
    //freopen("kenar.cik","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

    lo n;
    cin >> n;
    cout << f(n);
    
}

Compiler output:
a.cc:1:1: error: 'map' does not name a type
    1 | map <lo,lo> dp;
      | ^~~
a.cc:2:1: error: 'lo' does not name a type; did you mean 'long'?
    2 | lo f(lo n){
      | ^~
      | long
a.cc: In function 'int main()':
a.cc:11:9: error: 'ios_base' has not been declared
   11 |         ios_base::sync_with_stdio(false);
      |         ^~~~~~~~
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin.tie(NULL); cout.tie(NULL);
      |         ^~~
a.cc:12:17: error: 'NULL' was not declared in this scope
   12 |         cin.tie(NULL); cout.tie(NULL);
      |                 ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | map <lo,lo> dp;
a.cc:12:24: error: 'cout' was not declared in this scope
   12 |         cin.tie(NULL); cout.tie(NULL);
      |                        ^~~~
a.cc:14:5: error: 'lo' was not declared in this scope; did you mean 'long'?
   14 |     lo n;
      |     ^~
      |     long
a.cc:15:12: error: 'n' was not declared in this scope
   15 |     cin >> n;
      |            ^
a.cc:16:13: error: 'f' was not declared in this scope
   16 |     cout << f(n);
      |             ^
Language: C++

#include<bits/stdc++.h>
#define ll long long
#define sti string
#define REP(i,a) for(int i=0,_a=(a);i<_a;i++)
using namespace std;
int main(){
 long long n;
 cout<<2n-1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: unable to find numeric literal operator 'operator""n'
    8 |  cout<<2n-1;
      |        ^~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int H;
  cin >> H;
  int counter=0;
  while(H>0) {
    counter++;
    H/=2;
  }
  cout << pow(2, counter-1)-1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'pow' was not declared in this scope
   12 |   cout << pow(2, counter-1)-1 << endl;
      |           ^~~
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
//max=({});
//条件式が真ならwhileの中身を回し続ける



int main() {
	ll h;
	cin >> h;
	ll target = h;
	ll monster = 1;
	ll div=0
	while (target > 1) {
		target /= 2;
		div++;
		monster *= 2;
	}
	ll ans = div + monster;
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: expected ',' or ';' before 'while'
   17 |         while (target > 1) {
      |         ^~~~~
Language: C++

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

int main()
{
  long N;
  cin>>N;
  ans=1;
  while(ans<=N){
    ans*=2;
  }
  cout<<ans-1<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
    8 |   ans=1;
      |   ^~~
      |   abs
Language: C++

#include "bits/stdc++.h"
using namespace std;
#define INF 1e9
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define FOR(i, c) \
  \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
const long long mod = 1e9 + 7;
typedef long long ll;  // ll とdoubleは違う
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<bool> VB;
typedef vector<int> VI;  // VI a(n);
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VI> VII;  // VII a(n,vector<int>(m)) n * m
typedef vector<VL> VLL;
typedef pair<int, int> PII;
typedef map<int, int> MP;  // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>  // chmax(max, a);
bool chmax(T &a, U b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>  // chmin(min,a)
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>  // operator << (cout,a);
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}

// g++ -std=c++11 prac.cpp

// Union Find
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3]=2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
const ll MAX_N = 10000000000;
ll a[MAX_N];
ll ans=0;

int main() {
  ll z=0,k,n,m,h,w,sum=0,cnt=0,Max=-1e9,Min=1e9+1;
  string u;
  bool ok = false;
  cin >> h;
  ll x = log2(h);
  ans = 1;
  while(x>0){
    ans *= 2;
    x--;
  }
  cout << ans*2 -1 << endl;
  return 0;
}


Compiler output:
/tmp/ccYcDnVr.o: in function `main':
a.cc:(.text+0x6f): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccYcDnVr.o
a.cc:(.text+0x7c): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccYcDnVr.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccYcDnVr.o
a.cc:(.text+0x99): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccYcDnVr.o
collect2: error: ld returned 1 exit status
Language: C++

#include <stdc++.h>
using namespace std;
using ll = long long;

int main()
{
  ll h; cin >> h;
  ll r = 1;
  while (h)
  {
    h >> 1;
    r << 1;
  }
  
  cout << r - 1 << endl;
}

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

#include<bits/stdc++.h>

using namespace std;
#define endl "\n"

const int MOD = 1e9 + 7;

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

    int64_t h;
    cin >> h;
    int64_t sum = 1;
    if(h == 1)
		cout << "1\n";
	else {
		while(sum <= h){
			sum *= 2;
		}
		cout << sum - 1 << "\n";d
	}


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:41: error: 'd' was not declared in this scope
   22 |                 cout << sum - 1 << "\n";d
      |                                         ^
Language: C

#include <iostream>

using namespace std;

int main() {
  long h;
  cin >> h;

  long sum = 0;
  long cnt = 1;
  while(h != 0) {
  	h /= 2;
  	sum += cnt;
  	cnt *= 2;
  }

  cout << sum << endl;

  return 0;
}


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


#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;

template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}
template <class _T> static _T tp_pow(int base, int exp)
{
	_T ans = 1;

	for (int i = 0; i < exp; i++) {
		ans *= base;
	}
	return ans;
}

static const long long MOD_NUM = 1000000007LL;

static void D_task();

int main()
{
	D_task();
	fflush(stdout);
	return 0;
}


Compiler output:
a.cc:71:13: warning: 'void D_task()' used but never defined
   71 | static void D_task();
      |             ^~~~~~
/usr/bin/ld: /tmp/ccEbOXcz.o: in function `main':
a.cc:(.text+0x45): undefined reference to `D_task()'
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <iostream>
#include <string.h>
#include <limits.h>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

typedef unsigned long long ULLONG;
typedef long long LLONG;

template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void get2int(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void get3int(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}
static void getstring(char* buff) {
	if (scanf(" %s", buff) < 0) {
		printf("getstr error!\n");
	}
}

static const long long MOD_NUM = 1000000007LL;

static void D_task();

int main()
{
	D_task();
	fflush(stdout);
	return 0;
}

static void D_task()
{
	LLONG H;
	get1int<LLONG>(H);

	LLONG cnt = 1;
	LLONG divCnt = 1;
	LLONG rest = H / 2;
	while (rest) {
		cnt += tp_pow<LLONG>(2, divCnt);
		rest = rest / 2;
		divCnt++;
	}
	printf("%lld\n", cnt);
}


Compiler output:
a.cc: In function 'void D_task()':
a.cc:79:24: error: 'tp_pow' was not declared in this scope
   79 |                 cnt += tp_pow<LLONG>(2, divCnt);
      |                        ^~~~~~
a.cc:79:36: error: expected primary-expression before '>' token
   79 |                 cnt += tp_pow<LLONG>(2, divCnt);
      |                                    ^
Language: C++


#include <iostream>
#include <cstring>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}

li dp[1000000000001];


li solve(li h) {
	if (dp[h] >= 0) return dp[h];
	if (h == 1) return 1;

	return dp[h] = solve(h / 2) + h;

}

int main() {

	memset(dp, -1, sizeof(do));
    li h, n, k, num;
    vector<li> v;
    
    
    cin >> h;

    cout << solve(h) << endl;

    

    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:68:31: error: expected primary-expression before 'do'
   68 |         memset(dp, -1, sizeof(do));
      |                               ^~
a.cc:68:31: error: expected ')' before 'do'
   68 |         memset(dp, -1, sizeof(do));
      |                              ~^~
      |                               )
Language: C++


#include <iostream>
#include <cstring>
#include <fstream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits>
#include <map>
#include <numeric>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <deque>
#include <stack>

typedef long long li;
using namespace std;

li max(li a, li b) {
    return a > b ? a : b;
}

li max(li a, li b, li c) {
    return max(a, max(b, c));
}

li max(li a, li b, li c, li d) {
    return max(a, max(b, max(c, d)));
}

li max(li a, li b, li c, li d, li e) {
    return max(a, max(b, max(c, max(d, e))));
}


li pow_mod(li n, li e, li mod)
{
    li r = 1;
    
    while(e > 0)
    {
        if(e & 1)
            r *= n;
            r %= mod;
        
        n *= n;
        n %= mod;
        e >>= 1;
    }
    
    return r;
}



li solve(li h) {
	if (dp[h] >= 0) return dp[h];
	if (h == 1) return 1;

	return dp[h] = solve(h / 2) + h;

}

int main() {
	li dp[1000000000001];
	memset(dp, -1, sizeof(do));
    li h, n, k, num;
    vector<li> v;
    
    
    cin >> h;

    cout << solve(h) << endl;

    

    return 0;
}




Compiler output:
a.cc: In function 'li solve(li)':
a.cc:58:13: error: 'dp' was not declared in this scope
   58 |         if (dp[h] >= 0) return dp[h];
      |             ^~
a.cc:61:16: error: 'dp' was not declared in this scope
   61 |         return dp[h] = solve(h / 2) + h;
      |                ^~
a.cc: In function 'int main()':
a.cc:67:31: error: expected primary-expression before 'do'
   67 |         memset(dp, -1, sizeof(do));
      |                               ^~
a.cc:67:31: error: expected ')' before 'do'
   67 |         memset(dp, -1, sizeof(do));
      |                              ~^~
      |                               )
Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

std::map<long long, long long> dp;
dp[1] = 1;
long long dfs(long long x){
  long long res;
  res = 1 + 2*dfs(x/2);
  return dp[x] = res;
}
int main(){
  using namespace std;
  long long h;
  cin>>h;
  long long ans = dfs(h);
  cout<<ans<<endl;
  return 0;
}



Compiler output:
a.cc:70:1: error: 'dp' does not name a type
   70 | dp[1] = 1;
      | ^~
Language: C++

#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

//using namespace std;
//using namespace boost::multiprecision;
//using namespace __gnu_pbds;

map<long long, long long> dp;
dp[1] = 1;
long long dfs(long long x){
  long long res;
  res = 1 + 2*dfs(x/2);
  return dp[x] = res;
}
int main(){
  using namespace std;
  long long h;
  cin>>h;
  long long ans = dfs(h);
  cout<<ans<<endl;
  return 0;
}



Compiler output:
a.cc:69:1: error: 'map' does not name a type
   69 | map<long long, long long> dp;
      | ^~~
a.cc:70:1: error: 'dp' does not name a type
   70 | dp[1] = 1;
      | ^~
a.cc: In function 'long long int dfs(long long int)':
a.cc:74:10: error: 'dp' was not declared in this scope; did you mean 'dup'?
   74 |   return dp[x] = res;
      |          ^~
      |          dup
Language: C++

#pragma GCC optimize ("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
using namespace std;

#define _GLIBCXX_DEBUG

using _loop_ll = long long;
#define REP(i,n) for(_loop_ll (i)=0; (i)<(_loop_ll)(n); (i)++)
#define FOR(i,a,b) for(_loop_ll (i)=(_loop_ll)(a); (i)<(_loop_ll)(b); (i)++)
#define FORR(i,a,b) for(_loop_ll (i)=(_loop_ll)(b)-1; (i)>=(_loop_ll)(a); (i)--)
 
#define ALL(v) (v).begin(),(v).end()
 
#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;

constexpr long long int MOD = 1e9 + 7;

map<ll, ll> ans;

ll attack(ll n){
    if(n == 0) return 0;
    if(n == 1) return 1;
    if(ans[n] != 0) return ans[n];
    return ans[n] = 1 + 2 * attack(n / 2);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
    ans[0] = 0;
    ans[1] = 1;
    ll h;
    cin >> h;
    cout << attack(h) << endl;

    return 0;
};


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:3:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Rb_tree<long long int, std::pair<const long long int, long long int>, std::_Select1st<std::pair<const long long int, long long int> >, std::less<long long int>, std::allocator<std::pair<const long long int, long long int> > >::_Rb_tree_impl<std::less<long long int>, true>::~_Rb_tree_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::_Rb_tree_node<std::pair<const long long int, long long int> >]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/map:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152:
/usr/include/c++/14/bits/stl_tree.h:658:16: note: called from here
  658 |         struct _Rb_tree_impl
      |                ^~~~~~~~~~~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		execute5_1();
	}
	
	private static void execute5_1() {
		try (Scanner sc = new Scanner(System.in)) {
			long H = sc.nextLong();
			
			long pw=0;
			long ans = 1;
			while(H>1) {
				pw++;
				ans += (long) (Math.pow(2, pw));
				H=H/2;
			}
		
		
		System.out.println(ans);
		}
		
	}
}

Compiler output:
Main.java:8: error: cannot find symbol
		try (Scanner sc = new Scanner(System.in)) {
		     ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
		try (Scanner sc = new Scanner(System.in)) {
		                      ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

//FA専用
#include <bits/stdc++.h>
using namespace std;
#define int long long
const long long LINF=1e18;
int a,b,c,d,e,f,n,m,ans;
string s,t,u;
template<typename T>
void chmax(T &a,T b){
  if(a<b)a=b;
}
template<typename T>
void chmin(T &a,T b){
  if(a>b)a=b;
}
template<typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}
template<typename T,typename U>
void fin(T a,U b){
  cout<<a<<" "<<b<<endl;
  exit(0);
}
template<typename T,typename U,typename S>
void fin(T a,U b,S c){
  cout<<a<<" "<<b<<" "<<c<<endl;
  exit(0);
}

signed main(){
  cin>>h;int cnt=1;
  while(h){
    ans+=cnt;
    h/=2;
    cnt*=2;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:8: error: 'h' was not declared in this scope
   33 |   cin>>h;int cnt=1;
      |        ^
Language: C++

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

int main(){
  int H,N;
  cin >> H >> N;
  vector<int> a(N);
  vectot<int> b(N);
  double Am = 0;
  int ans = 0;
  int mA = 0,mB = 0;
  for (int i = 0; i < N; i++) {
    int A,B;
    cin >> A >> B;
    a.at(i) = A;
    b.at(i) = B;
    double Ac = (double)A,Bc = (double)B;
    if (Ac / Bc > Am) {
      mA = A;
      mB = B;
    }
  }
  int cnt = H / mA;
  ans += cnt * mB;
  H /= mA;
   int amax = 10000000;
  for (int i = 0; i < N; i++){
    amax = min(amax,(H + A.at(i) - 1) / A.at(i) * B.at(i));
  }
  cout << ans + amax << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vectot' was not declared in this scope
    8 |   vectot<int> b(N);
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vectot<int> b(N);
      |          ^~~
a.cc:16:5: error: 'b' was not declared in this scope
   16 |     b.at(i) = B;
      |     ^
a.cc:28:26: error: 'A' was not declared in this scope
   28 |     amax = min(amax,(H + A.at(i) - 1) / A.at(i) * B.at(i));
      |                          ^
a.cc:28:51: error: 'B' was not declared in this scope
   28 |     amax = min(amax,(H + A.at(i) - 1) / A.at(i) * B.at(i));
      |                                                   ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
int main(void) {
  ll H, N;
  cin >> H >> N;
  vector<ll> minMag(H * 2, INT_MAX);
  vector<ll> A(N), B(N);
  for (ll i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
  }
  ll ans = INT_MAX;
  minMag[0] = 0;
  for (ll h = 0; h < H; h++) {
    for (ll spell = 0; spell < N; spell++) {
      if (h + A[spell] >= H) {
        ans = min(ans, minMag[h] + B[spell]);
      } else {
        minMag[h + A[spell]] = min(minMag[h + A[spell]], minMag[h] + B[spell]);
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:28: error: 'INT_MAX' was not declared in this scope
    9 |   vector<ll> minMag(H * 2, INT_MAX);
      |                            ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include <vector>
  +++ |+#include <climits>
    3 |
Language: C++

int main(){
    INT(h,n);
    vector<tuple<double,int,int>> vec(n);
    int a,b,maxa=0;
    rep(i,n){
        in(a,b);
        vec[i]=make_tuple((double)a/b,a,b);
        maxa=max(maxa,a);
    }
    sort(rall(vec));
    ll ans=0;
    while(h>maxa){
        ans+=get<2>(vec[0]);
        h-=get<1>(vec[0]);
    }
    int minv=1000000,h2,d;
    for(int i=0;i<n;i++){
        h2=h;
        d=0;
        while(h2>0){
            d+=get<2>(vec[i]);
            h2-=get<1>(vec[i]);
        }
        minv=min(minv,d);
    }
    out(ans+minv);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'h' was not declared in this scope
    2 |     INT(h,n);
      |         ^
a.cc:2:11: error: 'n' was not declared in this scope
    2 |     INT(h,n);
      |           ^
a.cc:2:5: error: 'INT' was not declared in this scope
    2 |     INT(h,n);
      |     ^~~
a.cc:3:5: error: 'vector' was not declared in this scope
    3 |     vector<tuple<double,int,int>> vec(n);
      |     ^~~~~~
a.cc:3:12: error: 'tuple' was not declared in this scope
    3 |     vector<tuple<double,int,int>> vec(n);
      |            ^~~~~
a.cc:3:18: error: expected primary-expression before 'double'
    3 |     vector<tuple<double,int,int>> vec(n);
      |                  ^~~~~~
a.cc:5:9: error: 'i' was not declared in this scope
    5 |     rep(i,n){
      |         ^
a.cc:5:5: error: 'rep' was not declared in this scope
    5 |     rep(i,n){
      |     ^~~
a.cc:10:15: error: 'vec' was not declared in this scope
   10 |     sort(rall(vec));
      |               ^~~
a.cc:10:10: error: 'rall' was not declared in this scope
   10 |     sort(rall(vec));
      |          ^~~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(rall(vec));
      |     ^~~~
      |     short
a.cc:11:5: error: 'll' was not declared in this scope
   11 |     ll ans=0;
      |     ^~
a.cc:13:9: error: 'ans' was not declared in this scope
   13 |         ans+=get<2>(vec[0]);
      |         ^~~
a.cc:13:14: error: 'get' was not declared in this scope
   13 |         ans+=get<2>(vec[0]);
      |              ^~~
a.cc:21:16: error: 'get' was not declared in this scope
   21 |             d+=get<2>(vec[i]);
      |                ^~~
a.cc:24:14: error: 'min' was not declared in this scope; did you mean 'minv'?
   24 |         minv=min(minv,d);
      |              ^~~
      |              minv
a.cc:26:9: error: 'ans' was not declared in this scope
   26 |     out(ans+minv);
      |         ^~~
a.cc:26:5: error: 'out' was not declared in this scope
   26 |     out(ans+minv);
      |     ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define pri_que priority_queue
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vvchar vector<vector<char>>
#define vchar vector<char>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int h,n;cin>>h>>n;
    vint a(n),b(n);
    rep(i,n)cin>>a[i]>>b[i];

    //i-1番目までの魔法でhpjの魔物を倒すときの最小魔力
    vvint dp(n+10,vint(h+10,INF));
    dp[0][0]=0;
    
    

    for(int i=0; i<n; i++){
        for(int j=0; j<=h; j++){
            chmin(dp[i+1][j],dp[i+1][max(0LL,j-a[i])]+b[i]];
            chmin(dp[i+1][j],dp[i][j]);
        }
    }
    cout<<dp[n][h]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:59: error: expected ')' before ']' token
   63 |             chmin(dp[i+1][j],dp[i+1][max(0LL,j-a[i])]+b[i]];
      |                  ~                                        ^
      |                                                           )