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

#include <iostream>
using namespace std;
int main() {
  int N,K;
  cin >> N >> K; 
  long double ans = 0.0;
  for (int x = 1; x <= N; x++) {
    int a = x;
    int y = 0;
    for (int g = a; g < K; g*=2) {
      y++;
    }
    long double result = 1 / (long double)(N);
    result *= 1 / (long double)pow(2,cnt);
    ans += result;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:38: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |     result *= 1 / (long double)pow(2,cnt);
      |                                      ^~~
      |                                      int
a.cc:14:32: error: 'pow' was not declared in this scope
   14 |     result *= 1 / (long double)pow(2,cnt);
      |                                ^~~
Language: C++

int main(){
int a,b;scanf("%d%d",&a,&b);
double ret=0;
for(int i=1;i<=a;i++){
double tmp=1.0/a;
int now=i;
while(now<b){
now*=2;
tmp/=2;
}
ret+=tmp;
}
printf("%.12f\n",ret);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'scanf' was not declared in this scope
    2 | int a,b;scanf("%d%d",&a,&b);
      |         ^~~~~
a.cc:13:1: error: 'printf' was not declared in this scope
   13 | printf("%.12f\n",ret);
      | ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
Language: C++

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

int n,k;

signed main() {
  cin >> n >> k;
  vector<int> bumbo(n);
  for(int i=1; i<=n; i++) {
    int b = n;
    for(int c = i; c<k; c*=2) b *= 2;
    bumbo[i-1] = b;
  }
  int b0 = bumbo[0];
  int s = 1;
  for(int i=1; i<n; i++) {
    assert(bumbo[i] > 0);
    assert(b0 % bumbo[i] == 0);
    s += b0 / bumbo[i];
  }
  double ans = (double)s / b0;
  cout << fixed << setprecision(12) << ans << endl;
}


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | ma#include<bits/stdc++.h>
      |   ^
a.cc:1:1: error: 'ma' does not name a type
    1 | ma#include<bits/stdc++.h>
      | ^~
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> n >> k;
      |   ^~~
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> bumbo(n);
      |   ^~~~~~
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> bumbo(n);
      |          ^~~
a.cc:14:5: error: 'bumbo' was not declared in this scope
   14 |     bumbo[i-1] = b;
      |     ^~~~~
a.cc:16:12: error: 'bumbo' was not declared in this scope
   16 |   int b0 = bumbo[0];
      |            ^~~~~
a.cc:19:5: error: 'assert' was not declared in this scope
   19 |     assert(bumbo[i] > 0);
      |     ^~~~~~
a.cc:1:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
  +++ |+#include <cassert>
    1 | ma#include<bits/stdc++.h>
a.cc:24:3: error: 'cout' was not declared in this scope
   24 |   cout << fixed << setprecision(12) << ans << endl;
      |   ^~~~
a.cc:24:11: error: 'fixed' was not declared in this scope
   24 |   cout << fixed << setprecision(12) << ans << endl;
      |           ^~~~~
a.cc:24:20: error: 'setprecision' was not declared in this scope
   24 |   cout << fixed << setprecision(12) << ans << endl;
      |                    ^~~~~~~~~~~~
a.cc:24:47: error: 'endl' was not declared in this scope
   24 |   cout << fixed << setprecision(12) << ans << endl;
      |                                               ^~~~
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define forp(i,a,b) for (int i = a; i <b; i++)
#define forn(i,a,b) for (int i = a; i >b; i--)
#define mod 1000000007
#define MAX 50
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;


long long int fact(long long int n)
{
  if(n==0 || n==1)
  return 1;
  else
  return (n*fact(n-1)%mod)%mod;
}

int prime(long long int n)
{
  for(int i=2;i<=sqrt(n);i++)
  {
    if(n%i==0)
    {
      return 0;
    }
  }
  return 1;
}

long long int gcd(long long int a,long long int b)
{
  if(a==0)
  return b;
  else
  return gcd(b%a,a);
}

long long int lcm(long long a,long long b)
{
    return (a*b)/gcd(a,b);
}

int check_palin(string s)
{
  string str=s;
  reverse(str.begin(),str.end());
  if(str==s)
  return 1;
  else 
  return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
            int k,n,z=0,ans=0,start=-1,end=-1,f=0,c=0;
            cin>>n>>k;
     long double ans=0,temp=1.0/n;
  for(int i=1;i<=n;i++)
  {
      z=(int)log2(k) - (int)log2(i) + 1;
    ans+=(temp/(long double)(pow(2,z)));
  }
            cout<<ans;
return 0;
}
            
            
            
            


Compiler output:
a.cc: In function 'int main()':
a.cc:68:18: error: conflicting declaration 'long double ans'
   68 |      long double ans=0,temp=1.0/n;
      |                  ^~~
a.cc:66:25: note: previous declaration as 'int ans'
   66 |             int k,n,z=0,ans=0,start=-1,end=-1,f=0,c=0;
      |                         ^~~
Language: C++

#include<bits/stdc++.h> 
using namespace std; 
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define forp(i,a,b) for (int i = a; i <b; i++)
#define forn(i,a,b) for (int i = a; i >b; i--)
#define mod 1000000007
#define MAX 50
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;


long long int fact(long long int n)
{
  if(n==0 || n==1)
  return 1;
  else
  return (n*fact(n-1)%mod)%mod;
}

int prime(long long int n)
{
  for(int i=2;i<=sqrt(n);i++)
  {
    if(n%i==0)
    {
      return 0;
    }
  }
  return 1;
}

long long int gcd(long long int a,long long int b)
{
  if(a==0)
  return b;
  else
  return gcd(b%a,a);
}

long long int lcm(long long a,long long b)
{
    return (a*b)/gcd(a,b);
}

int check_palin(string s)
{
  string str=s;
  reverse(str.begin(),str.end());
  if(str==s)
  return 1;
  else 
  return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
            int k,n,z=0,ans=0,start=-1,end=-1,f=0,c=0;
            cin>>n>>k;
     long double ans=0,temp=1.0;
  for(int i=1;i<=n;i++)
  {
      z=(int)log2(k) - (int)log2(i) + 1;
      temp=1.0/(long double)(pow(2,z));
    ans+=temp;
  }
            cout<<ans;
return 0;
}
            
            
            
            

Compiler output:
a.cc: In function 'int main()':
a.cc:68:18: error: conflicting declaration 'long double ans'
   68 |      long double ans=0,temp=1.0;
      |                  ^~~
a.cc:66:25: note: previous declaration as 'int ans'
   66 |             int k,n,z=0,ans=0,start=-1,end=-1,f=0,c=0;
      |                         ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef vector<int> vec;
int main(){
  int n,k; cin>>n;
  long double ans=0,memo=0,k;
  cin>>k;
  
  rep(i,n){
    if(i+1>=k)ans+=2;
    else ans+=pow(0.5,int(log2(ceil(k/(i+1)))));
  }
  
  ans/=2*n;
  cout<<fixed<<setprecision(12);
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:28: error: conflicting declaration 'long double k'
    7 |   long double ans=0,memo=0,k;
      |                            ^
a.cc:6:9: note: previous declaration as 'int k'
    6 |   int n,k; cin>>n;
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
int K;
int kaisuu(int N){
  int i=0;
  while(N<K-1){
    i++;
    N=N*2;
  }
  return i;
}
int main (){
  int N;
  cin>>N>>K;
  vector<Real>mo(N);
  rep(i,N){
    mo[i]=1/kaisuu(i+1);
  }
  Real ans;
  rep(i.N){
  ans+=mo[i];
  }
  cout<<ans;
}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
int K;
int kaisuu(int N){
  int i=0
  while(N<K-1){
    i++;
    N=N*2;
  }
  return i;
}
int main (){
  int N;
  cin>>N>>K;
  vector<Real>mo(N);
  rep(i,N){
    mo[i]=1/kaisuu(i+1);
  }
  Real ans;
  rep(i,N){
  ans+=mo[i];
  }
  cout<<ans;
}


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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
int K;
int kaisuu(int N){
  int i=0
  while(N<K-1){
    i++;
    N=N*2;
  }
  return i;
}
int main (){
  int N;
  cin>>N>>K;
  vector<Real>mo(N);
  rep(i,N){
    mo[i]=1/kaisuu(i+1);
  }
  Real ans;
  rep(i.N){
  ans+=mo[i];
  }
  cout<<ans;
}


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

#include<iostream>
using namespace std;
int main(){
long double a,b;
  cin>>a>>b;
  for(int i=1;i<=a;i++){
    double tmp=1.0/a;
    int now=i;
    while(now<b){
      now*=2;
      tmp/=2;
    }
    ret+=tmp;
  }
  cout<<ret<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'ret' was not declared in this scope
   13 |     ret+=tmp;
      |     ^~~
a.cc:15:9: error: 'ret' was not declared in this scope
   15 |   cout<<ret<<endl;
      |         ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
long double n,k;
  cin>>n>>k;
  for(int i=1;i<=a;i++){
    double tmp=1.0/a;
    int now=i;
    while(now<b){
      now*=2;
      tmp/=2;
    }
    ret+=tmp;
  }
  cout<<ret<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: 'a' was not declared in this scope
    6 |   for(int i=1;i<=a;i++){
      |                  ^
a.cc:9:15: error: 'b' was not declared in this scope
    9 |     while(now<b){
      |               ^
a.cc:13:5: error: 'ret' was not declared in this scope
   13 |     ret+=tmp;
      |     ^~~
a.cc:15:9: error: 'ret' was not declared in this scope
   15 |   cout<<ret<<endl;
      |         ^~~
Language: C++

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

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

	double pro_sum = 0;
	for(int i = 1; i <= n; i++){
		int now = i;
		double pro = 1/n;
		while(now < k){
			pro *= 0.5;
			now *= 2;
		}
		pro_sum += pro;
	}

	cout << pro_sum << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before 'double'
    8 |         cin >> n >> k
      |                      ^
      |                      ;
    9 | 
   10 |         double pro_sum = 0;
      |         ~~~~~~        
a.cc:18:17: error: 'pro_sum' was not declared in this scope
   18 |                 pro_sum += pro;
      |                 ^~~~~~~
a.cc:21:17: error: 'pro_sum' was not declared in this scope
   21 |         cout << pro_sum << endl;
      |                 ^~~~~~~
Language: C++

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

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

	double pro_sum = 0;
	for(int i = 1; i <= n; i++){
		int now = i;
		double pro = 1/n;
		while(now < k){
			pro *= 0.5;
			now *= 2;
		}
		pro_sum += pro;
	}

	cout << pro << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:22: error: expected ';' before 'double'
    8 |         cin >> n >> k
      |                      ^
      |                      ;
    9 | 
   10 |         double pro_sum = 0;
      |         ~~~~~~        
a.cc:18:17: error: 'pro_sum' was not declared in this scope
   18 |                 pro_sum += pro;
      |                 ^~~~~~~
a.cc:21:17: error: 'pro' was not declared in this scope
   21 |         cout << pro << endl;
      |                 ^~~
Language: C++

#include<iostream>
#include <algorithm>
#include<cstdio>
#include<string>
#include<math.h>
#include<vector>
#include <queue>
#include <bits/stdc++.h>
#include <map>
#include <cmath>
#include <cctype>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define srep(i,s,t) for (int i = s; i < t; i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
using namespace std;
typedef vector<vector<char>> field_t;

typedef pair<int, int> point_t;
vector<vector<pair<int,int>>> z(100010);
int ans[100010];
bool used[100010];
void dfs(int v, int w){
    if(w%2==0){
        ans[v]=1;
    }else{
        ans[v]=0;
    }
    for(auto t:z[v]){
        if(!used[t.first]){
            used[t.first]=true;
            dfs(t.first,t.second+w);
        }
    }
}

int main()
{
    int N,K,i;
    cin >> N >>K;
    double ans=0; 
    srep(i,1,N+1){
        int cnt=0;
        while(i*pow(2,cnt)<K){
            cnt++;
        }
        ans+=(double)1*pow(0.5,cnt)/N
    }
        cout << ans <<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:38: error: expected ';' before '}' token
   46 |         ans+=(double)1*pow(0.5,cnt)/N
      |                                      ^
      |                                      ;
   47 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279

#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 1; i <= n; i++)
#define REPR(i, n) for(ll i = n; i >= 1; i--)
#define FOR(i, m, n) for(ll i = m; i <= n; i++)
const ld INF = 1e9+123;
#define VEC(type,A,N) vector<type> A(N+10)
#define VECi(type,A,N,i) vector<type> A(N+10,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N+10,vector<type>(M+10))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N+10,vector<type>(M+10,i))
#define ALL(v) v.begin()+1, v.end()-9
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main(){
    ld N,K;
    cin>>N>>K;
    
    ld t,k=0;
    REP(i,N){
        t=ceil(log(K/i)/log(2));
        k+=1.0<pow((ld)1/2,t)/N)?1.0:pow((ld)1/2,t)/N);
        //sl(t,k)
    }
    //cout<<ac<<" "<<wa;
    cout<<fixed<<setprecision(15)<<k;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:32: error: expected ';' before ')' token
   62 |         k+=1.0<pow((ld)1/2,t)/N)?1.0:pow((ld)1/2,t)/N);
      |                                ^
      |                                ;
Language: C

#include <math.h>
main(){
	long double n,k,a=0.0;
	scanf("%Lf%Lf",&n,&k);
	for(int i=1;i<(k<n+1?k:n+1);i++)a+=(powl(0.5,ceill(log2l(k/(Lf)i))));
	if(k<n)a+=n-k+1;
	a/=n;
	printf("%.10Lf",a);
}


Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    4 |         scanf("%Lf%Lf",&n,&k);
      |         ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    1 | #include <math.h>
  +++ |+#include <stdio.h>
    2 | main(){
main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    4 |         scanf("%Lf%Lf",&n,&k);
      |         ^~~~~
main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:69: error: 'Lf' undeclared (first use in this function)
    5 |         for(int i=1;i<(k<n+1?k:n+1);i++)a+=(powl(0.5,ceill(log2l(k/(Lf)i))));
      |                                                                     ^~
main.c:5:69: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:72: error: expected ')' before 'i'
    5 |         for(int i=1;i<(k<n+1?k:n+1);i++)a+=(powl(0.5,ceill(log2l(k/(Lf)i))));
      |                                                                 ~      ^
      |                                                                        )
main.c:8:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    8 |         printf("%.10Lf",a);
      |         ^~~~~~
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:8:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

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

int main() {
  int n,k;
  cin>>n>>k;
  ////////// 1/nかける1／2の（kを超える回数）乗　　の和
  double ans;
  for(int i = 1 ; i <= (n) ; i ++ ){
    int count=0;
    
    int c=i;
    
    while(c<k){
      
      count++;
      
      c*=2;
    }
    
    ans+=pow(0.5,count)/n;
    
    
    
    //cout<<ans<<endl;
  }
  cout<<fixed<<setprecision(10)
 cout<<ans<<endl;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:31:32: error: expected ';' before 'cout'
   31 |   cout<<fixed<<setprecision(10)
      |                                ^
      |                                ;
   32 |  cout<<ans<<endl;
      |  ~~~~
Language: C

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


int main()
{
int i,j,l,m,a,b;
double n,k,x;
double p[100010];

scanf("%lf %lf",&n,&k);

for(i=;i<100010;i++)
{
    p[i] = 0;
}

j = 0; 
while(1)
{
    if(k<2^j)
        break;
    j++;
}



if(n<k)
{
    for(i=1;i<=n;i++)
    {
        a = k;
        for(l=1;l<=j;l++)
        {
            if(i>=(a-1)/2 + 1)
            {
                m = l;
                break;
            }
            a = (a-1)/2 + 1;
        }
        p[i] = 1/n * pow(0.5,m);
    }
}else
{
    p[0] = (n-k+1)/n;
    for(i=1;i<=k-1;i++)
    {
        a = k;
        for(l=1;l<=j;l++)
        {
            if(i>=(a-1)/2 + 1)
            {
                m = l;
                break;
            }
            a = (a-1)/2 + 1;
        }
        p[i] = 1/n * pow(0.5,m);
    }
}

for(i=0;i<=n;i+)
{
    x = x + p[i];
}

printf("%lf",x);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:7: error: expected expression before ';' token
   14 | for(i=;i<100010;i++)
      |       ^
main.c:64:16: error: expected expression before ')' token
   64 | for(i=0;i<=n;i+)
      |                ^
Language: C++

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

int main() {
    double N,K; cin >> N >> K;

    double ans = 0;
    for (int i = 1; i <= N ; i++){
        double I = i;
        double a = K / I;
        double x = log2(a);
        int y = x;
        if (x != y)y++;
        double Y = y;
        ans += pow(0.5, Y) / N;
    }

    cout << fixed;
    cout << setprecision(10) << ans << endl;
}

Compiler output:
a.cc:21:13: error: stray '\16' in program
   21 |     cout << <U+000E>setprecision(10) << ans << endl;
      |             ^~~~~~~~
Language: C++

from math import log2

N,K = map(int,input().split())

r = 0
for i in range(1,N+1):
    if i >= K:
        r += 1.0 / N
        continue
    count = int(log2(K / i)) + 1

    r += 1.0 / (N * (2 ** count))

print(r)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import log2
      | ^~~~
Language: C++

from math import log2

N,K = map(int,input().split())

r = 0
for i in range(1,N+1):
    if i >= K:
        r += 1.0 / N
        continue
    count = int(log2(K / i)) + 1
    print(count)
    r += 1.0 / (N * (2 ** count))

print(r)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import log2
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, k;
  cin >> n >> k;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    double tmp = 1.0 / n;
    int now = i;
    while (now < k) {
      now *= 2;
      tmp /= 2;
    }
    ans += tmp;
  }
  printf("%.13f", ans);
 
  return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, k;
  cin >> n >> k;
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    double tmp = 1.0 / n;
    int now = i;
    while (now < k) {
      now *= 2;
      tmp /= 2;
    }
    ans += tmp;
  }
  printf("%.13f", ans);

  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
  cin>>N>>K;
  double sum=0;
  for(int i=1;i<=N;i++){
  double a=1;
    for(int  j=0; ;j++){
    if((double)i/(double)K<a)
      a/=2;
      else{
       sum=a; break;
      }
    } ans+=sum;
 } double ans=sum/N;
  cout<<setprecision(10)<<ans<<endl;
   return 0;
}

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

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int N,K;
  cin>>N>>K;
  int t=K;
  int counter=0;
  while(t>0){
    t/=2;
    counter++;
  }
  int i=0;
  for (int i=0; i<=counter; i++){
if (N>(K)/(pow(2,i))) break;
  }
  double sum=0;
for (int j=i; j<=counter; j++){
   double w=(1)/pow(2,j);
   sum+=(K/pow(2,j))*w;
   }
  double z=(1)/pow(2,i);
   if (i>0 && K%pow(2,(i-1))!=0) sum+=(N-K/pow(2,i))*z;
  else sum+=(N-K/pow(2,i)+1)*z;
  double a=sum/N;
  cout<<a<<endl;
}
                          
  


Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   23 |    if (i>0 && K%pow(2,(i-1))!=0) sum+=(N-K/pow(2,i))*z;
      |               ~^~~~~~~~~~~~~
      |               |    |
      |               int  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int N,K;
  cin>>N>>K;
  int t=K;
  int counter=0;
  while(t>0){
    t/=2;
    counter++;
  }
  for (int i=0; i<=counter; i++){
if (N>(K)/(pow(2,i))) break;
  }
  double sum=0;
  int b=i;
for (int j=b; j<=counter; j++){
   double w=(1)/pow(2,j);
   sum+=(K/pow(2,j))*w;
   }
  double z=(1)/pow(2,b);
   if (b>0 && K%pow(2,(b-1))!=0) sum+=(N-K/pow(2,b))*z;
  else sum+=(N-K/pow(2,b)+1)*z;
  double a=sum/N;
  cout<<a<<endl;
}
                          
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'i' was not declared in this scope
   17 |   int b=i;
      |         ^
a.cc:23:16: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
   23 |    if (b>0 && K%pow(2,(b-1))!=0) sum+=(N-K/pow(2,b))*z;
      |               ~^~~~~~~~~~~~~
      |               |    |
      |               int  __gnu_cxx::__promote<double>::__type {aka double}
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
int N,K;
  cin>>N>>K;
  int t=K;
  int counter=0;
  while(t>0){
    t/=2;
    counter++;
  }
  for (int i=0; i<=counter; i++){
if (N>(K)/(pow(2,i))) break;
  }
  double sum=0;
for (int j=i; j<=counter; j++){
   double w=(1)/pow(2,j);
   sum+=(K/pow(2,j))*w;
   }
  double z=(1)/pow(2,i);
   if (i>0 && K%pow(2,(i-1))!=0) sum+=(N-K/pow(2,i))*z;
  else sum+=(N-K/pow(2,i)+1)*z;
  double a=sum/N;
  cout<<a<<endl;
}
                          
  

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'i' was not declared in this scope
   17 | for (int j=i; j<=counter; j++){
      |            ^
a.cc:21:22: error: 'i' was not declared in this scope
   21 |   double z=(1)/pow(2,i);
      |                      ^
Language: C++

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

int devide_by2(int i, int K){
  int count = 0;
  while(i < K){
    i *= 2;
    count++;
  }
  return count;
}

double bi(double &ans, int i, double N, int K){
  double count = 1;
  for(int j = 0; j < devide_by2(i, K); j++){
    double /= 2;
  }
  return count * (1 / N);
}

int main(){
  double N;
  int K;
  cin >> N >> K;
  cout << fixed << setprecision(11);
  
  double ans = 0;
  for(int i = 0; i < N; i++){
    ans += bi(ans, i, N, K);
  }
  
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'double bi(double&, int, double, int)':
a.cc:16:12: error: expected unqualified-id before '/=' token
   16 |     double /= 2;
      |            ^~
Language: C++

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        
        int tmp;
        double sum = 0,p;
        for(int i=0;i<n;i++){
            tmp = i+1;
            p = 1.0/n;
            while(tmp<=k-1){
                tmp*=2;
                p/=2.0;
            }
            sum+=p;
        }
        System.out.println(sum);
        System.out.flush();
        sc.close();
    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

import math
n, k = map(int, input().split())
su = 0
for i in range(1, n + 1):
    if i < k:
        su += (1 / n) * math.pow(0.5, math.ceil(math.log2(k / i)))
    else:
        su += 1 / n
print(su)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

int main(){
  int a,b;scanf("%d%d",&n,&k);
  double ret=0;
  for(int i=1; i<n+1; i++){
    double a=1.0/n;
    int now=i;
    while(now<k){
      now*=2;
      a/=2;
    }
    ret+=a;
  }
  printf("%.12f\n",ret);
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:25: error: 'n' was not declared in this scope
    5 |   int a,b;scanf("%d%d",&n,&k);
      |                         ^
a.cc:5:28: error: 'k' was not declared in this scope
    5 |   int a,b;scanf("%d%d",&n,&k);
      |                            ^
Language: C++

import numpy as np

N, K = map(int, input().split())
P = 0
for p in range(1, N+1):
  i = max(0, np.ceil(np.log2(K/p)))
  P += (1/N)*(0.5**i)
  
print(P)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<iostream>
using namespace std;
int main(){
	int a,b;double cnt=0;
	cin>>a>>b;
	for(int i=1;i<=a;i++){
		double tot=1.0/a;int now=i;
		while(now<b){
			now*=2;//翻倍 
			tot/=2;//几率减半 
		}
		cnt+=tot;
	}
	cout<<fixed<<setprecision(12)<<cnt<<endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: 'setprecision' was not declared in this scope
   14 |         cout<<fixed<<setprecision(12)<<cnt<<endl;
      |                      ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    double n,k,s=0,c=0.5;cin>>n>>k;
    for(int i=1;i<=n;i++){
    	int a=1,b=i;
    	while(b<k) a++,b*=2;
    	s=s+pow(c,a-1);
	}
	double dd=s/n;
	cout<<fixed<<setprecision(12)<<dd;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: 'pow' was not declared in this scope
    9 |         s=s+pow(c,a-1);
      |             ^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    double n,k,s=0,c=0.5;cin>>n>>k;
    for(int i=1;i<=n;i++){
    	int a=1,b=i;
    	while(b<k) a++,b*=2;
    	s=s+pow(c,a-1);
	}
	double dd=s/n;
	cout<<fixed<<setprecision(12)<<dd;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'pow' was not declared in this scope
    8 |         s=s+pow(c,a-1);
      |             ^~~
a.cc:11:22: error: 'setprecision' was not declared in this scope
   11 |         cout<<fixed<<setprecision(12)<<dd;
      |                      ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 | #include<iostream>
  +++ |+#include <iomanip>
    2 | using namespace std;
Language: Java

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(void){
    long N,border;
    double probability=1,allP=0;
    scanf("%ld %ld",&N,&border);
    long i,j;
    //printf("N:%ld\n",N);
    double a=N;
    //printf("a:%f\n",a);
    for(i=1;i<=N;i++){
        if(border<=i){
            allP+=(1/a)*(N+1-i);
            break;
        }
        j=i;
        probability=1/a;
        //printf("(%lf)",probability);
        while(j<border){
            j=j<<1;
            //printf("%ld:",j);
            probability/=2;
        }
        //printf("(%lf)",probability);
        allP+=probability;
        //printf("\n");
    }
    printf("%lf",allP);
    return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:3: error: illegal character: '#'
#include<math.h>
^
Main.java:4: error: illegal character: '#'
#include<string.h>
^
Main.java:7: error: unnamed classes are a preview feature and are disabled by default.
    double probability=1,allP=0;
    ^
  (use --enable-preview to enable unnamed classes)
Main.java:8: error: class, interface, enum, or record expected
    scanf("%ld %ld",&N,&border);
    ^
Main.java:9: error: class, interface, enum, or record expected
    long i,j;
    ^
Main.java:13: error: class, interface, enum, or record expected
    for(i=1;i<=N;i++){
    ^
Main.java:13: error: class, interface, enum, or record expected
    for(i=1;i<=N;i++){
            ^
Main.java:13: error: class, interface, enum, or record expected
    for(i=1;i<=N;i++){
                 ^
Main.java:16: error: class, interface, enum, or record expected
            break;
            ^
Main.java:17: error: class, interface, enum, or record expected
        }
        ^
Main.java:19: error: class, interface, enum, or record expected
        probability=1/a;
        ^
Main.java:21: error: class, interface, enum, or record expected
        while(j<border){
        ^
Main.java:24: error: class, interface, enum, or record expected
            probability/=2;
            ^
Main.java:25: error: class, interface, enum, or record expected
        }
        ^
Main.java:29: error: class, interface, enum, or record expected
    }
    ^
Main.java:31: error: class, interface, enum, or record expected
    return 0;
    ^
Main.java:32: error: class, interface, enum, or record expected
}
^
20 errors
Language: C++

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

int function(int j,int k)
{
	int count=0;
	while(j < k)
	{
		j *= 2;
		count++;
    }
    return count;
}
int main()
{
      int n,k;
      cin >> n >> k;
  
      double ans = 0.;
  
      for(int j = 1; j <= n;j++)
      {
		  int y = function(j,k);
		  int value = n * pow(2, y);
		  ans += (double)(1)/value;
	  }
	  cout << setprecision(15) << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:27: error: reference to 'function' is ambiguous
   23 |                   int y = function(j,k);
      |                           ^~~~~~~~
In file included from /usr/include/c++/14/functional:59,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/std_function.h:111:11: note: candidates are: 'template<class _Signature> class std::function'
  111 |     class function;
      |           ^~~~~~~~
a.cc:4:5: note:                 'int function(int, int)'
    4 | int function(int j,int k)
      |     ^~~~~~~~
Language: C

#include<stdio.h>
int main(void){
  int a,b,i,ret;
  scanf("%d%d",&a,&b);
 double ret;
 for(int i=1;i<=a;i++){
double tmp=1.0/a;
int now=i;
while(now<b){
now*=2;
tmp/=2;
}
ret+=tmp;
}
printf("%.12f\n",ret);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:9: error: conflicting types for 'ret'; have 'double'
    5 |  double ret;
      |         ^~~
main.c:3:13: note: previous declaration of 'ret' with type 'int'
    3 |   int a,b,i,ret;
      |             ^~~
Language: Java

import java.util.*;
import java.math.BigDecimal;
public class At_coder
{static int c=0;
    public static void main()
    { Scanner sc=new Scanner(System.in);
        int num=sc.nextInt();
        int k=sc.nextInt();
        BigDecimal A, B; 
        double sum_power=0,count=0;
        B  = BigDecimal.valueOf(sum_power); 
        for(int i=1;i<=num;i++){
            count=doublet(i,k);
            double p=Math.pow(2,count)*num;
            A  = BigDecimal.valueOf(1/p);
            //System.out.println(A);
            B=B.add(A);
            c=0;
        }
        System.out.println(B);
    }

    static int doublet(int n,int f){
        if (n<f){
            c=c+1;
            return doublet(2*n,f);}
        else
            return c;}
}



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

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

int main() {
int n,k;
cin >> n >> k;
long double ans=0;
for(int i=1;i<=n;i++){
    int tmp=ceil(log2(i/k));
    ans+=pow(1/2,tmp);
}
cout << ans << ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected primary-expression before ';' token
   12 | cout << ans << ;
      |                ^
Language: C++

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

int main() {
int n,k;
cin >> n >> k;
long double ans=0;
for(int i=1;i<=n;i++){
    int tmp=ceil(log2(l/k));
    ans+=pow(1/2,tmp);
}
cout << ans << \n;
}


Compiler output:
a.cc:12:16: error: stray '\' in program
   12 | cout << ans << \n;
      |                ^
a.cc: In function 'int main()':
a.cc:9:23: error: 'l' was not declared in this scope
    9 |     int tmp=ceil(log2(l/k));
      |                       ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int n,k,N;
  double ans=0,sum,m;
  cin>>n>>k;
  for(int i=1;i<=n;i++){
    sum=i;
    m=0:
    while(k>sum){
      sum*=2;
      m++;
    }
    ans+=(1/n*pow(1/2,m));
  }
  cout<<ans<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected ';' before ':' token
    9 |     m=0:
      |        ^
      |        ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int n,k;
  double ans=0,sum,m;
  cin>>n>>k;
  for(int i=1;i<=n;i++){
    sum=i;
    m=0
    while(k>sum){
      sum*=2;
      m++;
    }
    ans+=(1/n*pow(1/2,m));
  }
  cout<<ans<<"\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:8: error: expected ';' before 'while'
    9 |     m=0
      |        ^
      |        ;
   10 |     while(k>sum){
      |     ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int n,k,N;
  double ans=0,sum,m;
  cin>>n>>k;
  for(int i=1;i<=n;i++){
    N=n;
    sum=i;
    m=0
    while(N>sum){
      sum*=2;
      m++;
    }
    ans+=(1/n*pow(1/2,m));
  }
  cout<<ans<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected ';' before 'while'
   10 |     m=0
      |        ^
      |        ;
   11 |     while(N>sum){
      |     ~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    double n, k;
    cin >> n >> k;
    double ret = 0;
    for(int i=1;i<=n;i++){
       double tmp=1.0/n;
       int now =i;
       while(now<k){
           now*=2
           tmp/=2
       }
       ret+=tmp;
    }
    cout << ret;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: expected ';' before 'tmp'
   11 |            now*=2
      |                  ^
      |                  ;
   12 |            tmp/=2
      |            ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    double , k;
    cin >> n >> k;
    double ret = 0;
    for(int i=1;i<=n;i++){
       double tmp=1.0/n;
       int now =i;
       while(now<k){
           now*=2
           tmp/=2
       }
       ret+=tmp;
    }
    cout << ret;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: expected unqualified-id before ',' token
    4 |     double , k;
      |            ^
a.cc:5:12: error: 'n' was not declared in this scope
    5 |     cin >> n >> k;
      |            ^
a.cc:11:18: error: expected ';' before 'tmp'
   11 |            now*=2
      |                  ^
      |                  ;
   12 |            tmp/=2
      |            ~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    double n k;
    cin >> n >> k;
    double ret = 0;
    for(int i=1;i<=n;i++){
       double tmp=1.0/n;
       int now =i;
       while(now<k){
           now*=2
           tmp/=2
       }
       ret+=tmp;
    }
    cout << ret;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:14: error: expected initializer before 'k'
    4 |     double n k;
      |              ^
a.cc:5:12: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |     cin >> n >> k;
      |            ^
      |            yn
a.cc:5:17: error: 'k' was not declared in this scope
    5 |     cin >> n >> k;
      |                 ^
a.cc:11:18: error: expected ';' before 'tmp'
   11 |            now*=2
      |                  ^
      |                  ;
   12 |            tmp/=2
      |            ~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<limits.h>
#include<float.h>

#define NUM 100001

float arr[NUM];

float dc(int n, int k, int i){
	if(i>=k) return 1;
	if(arr[i] != 0) return arr[i];
	int sum = 0;
	for(int j=0; j<n; j++){
		sum += f(n, k, i+j);
	}
	arr[i] = sum / n / 2;
	return arr[i];
}

int main(){
	int n, k;
	scanf("%d%d\n", &n, &k);
	for(int i=0; i<n; i++){
		arr[i] = 0;
	}
	printf("%f\n", dc(n, k, 0));
	return 0;
}

Compiler output:
a.cc: In function 'float dc(int, int, int)':
a.cc:16:24: error: 'f' was not declared in this scope
   16 |                 sum += f(n, k, i+j);
      |                        ^
Language: C++

n,k=map(int,input().split())
a=[]
def x(t,k):
  c=0
  while t<k:
    t*=2
    c+=1
  return c

for i in range(n):
  a.append(x(i+1),k)

ans=0
for i in range(k):
  ans=ans+1/6*(1/2)**k
print(ans)


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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++) 
#define rep(i,n); for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b); 
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e10+10;

/*----------------------------------------------*/

signed main(){
  int n,k;
  cin>>n>>k;
  double ans=0;
  FOR(i,1,n){
    double p=1,t=i;
    while(k>t){#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++) 
#define rep(i,n); for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b); 
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e10+10;

/*----------------------------------------------*/

signed main(){
  int n,k;
  cin>>n>>k;
  double ans=0;
  FOR(i,1,n){
    double p=1,t=i;
    while(k>t){
      p/=2;t*=2;
    }
    ans+=p;
  }
  ans/=n;

  cout<<setprecision(15)<<ans<<endl;
  return 0;
}
      p/=2;t*=2;
    }
    ans+=p;
  }
  ans/=n;

  cout<<setprecision(15)<<ans<<endl;
  return 0;
}

Compiler output:
a.cc:25:16: error: stray '#' in program
   25 |     while(k>t){#include <bits/stdc++.h>
      |                ^
a.cc: In function 'int main()':
a.cc:25:17: error: 'include' was not declared in this scope
   25 |     while(k>t){#include <bits/stdc++.h>
      |                 ^~~~~~~
a.cc:25:26: error: 'bits' was not declared in this scope
   25 |     while(k>t){#include <bits/stdc++.h>
      |                          ^~~~
a.cc:25:31: error: 'stdc' was not declared in this scope; did you mean 'std'?
   25 |     while(k>t){#include <bits/stdc++.h>
      |                               ^~~~
      |                               std
a.cc:26:1: error: expected primary-expression before 'using'
   26 | using namespace std;
      | ^~~~~
a.cc:33:21: error: a function-definition is not allowed here before '{' token
   33 | int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
      |                     ^
a.cc:43:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   43 | signed main(){
      |            ^~
a.cc:43:12: note: remove parentheses to default-initialize a variable
   43 | signed main(){
      |            ^~
      |            --
a.cc:43:12: note: or replace parentheses with braces to value-initialize a variable
a.cc:43:14: error: a function-definition is not allowed here before '{' token
   43 | signed main(){
      |              ^
Language: C++


  #include<bits/stdc++.h>

using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  int cnt;
  double ans,ki;
  ki = 0;
for(int i = 1; i < N + 1; i++){
  ans = 1.0/n;

  cnt = i;  
  while(cnt < k){
    cnt *= 2;
    ans = ans * 0.5;

  }
  ki += ans;
}

cout << ki << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'N' was not declared in this scope
   12 | for(int i = 1; i < N + 1; i++){
      |                    ^
Language: C++


  #include<bits/stdc++.h>

using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  int cnt;
  double ans,ki;
  k = 0;
for(int i = 1; i < N + 1; i++){
  ans = 1.0/n;

  cnt = i;  
  while(cnt < k){
    cnt *= 2;
    ans = ans * 0.5;

  }
  ki += ans;
}

cout << ki << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'N' was not declared in this scope
   12 | for(int i = 1; i < N + 1; i++){
      |                    ^
Language: C++


  #include<bits/stdc++.h>

using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  int cnt;
  double ans,k;
  k = 0;
for(int i = 1; i < N + 1; i++){
  ans = 1.0/n;

  cnt = i;  
  while(cnt < K){
    cnt *= 2;
    ans = ans * 0.5;

  }
  k += ans;
}

cout << k << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: conflicting declaration 'double k'
   10 |   double ans,k;
      |              ^
a.cc:7:9: note: previous declaration as 'int k'
    7 |   int n,k;
      |         ^
a.cc:12:20: error: 'N' was not declared in this scope
   12 | for(int i = 1; i < N + 1; i++){
      |                    ^
a.cc:16:15: error: 'K' was not declared in this scope
   16 |   while(cnt < K){
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K
  cin>>N>>K;
  int sum=0;
  vector<int>p(N,1);
  for(int i=0;i<N;i++){
    int pt=i+1;
    p[i]/=N;
    while(0<pt && pt<K){
      p[i]*=(1/2);
      pt*=2;
    }
   sum+=p[i];
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: expected initializer before 'cin'
    5 |   cin>>N>>K;
      |   ^~~
a.cc:11:22: error: 'K' was not declared in this scope
   11 |     while(0<pt && pt<K){
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K,pt;
  cin>>N>>K;
  pt=N;
  int sum=0;
  vector<int>p(N,1);
  for(int i=0;i<N;i++){
    p/=N;
    while(0<pt && pt<K){
      p*=(1/2);
    }
   sum+=p[i];
  }
  cout<<sum<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:6: error: no match for 'operator/=' (operand types are 'std::vector<int>' and 'int')
   10 |     p/=N;
      |     ~^~~
a.cc:12:8: error: no match for 'operator*=' (operand types are 'std::vector<int>' and 'int')
   12 |       p*=(1/2);
      |       ~^~~~~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
  public static void main(){
      BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
       try {
            String str = reader.readLine();
            reader.close();
         	String[] astr = str.split(" ");
      		long n = Long.parseLong(astr[0]);
      		long k = Long.parseLong(astr[1]);
      		double result = 0;
      		for(int i = 1; i <= n; i++){
          		long p = 0, a = i;	
          		while(a < k){
              		a = a * 2;
              		p++;
          		}
          		double tmp = 0.5;
          		for(long j = 1; j < p; j++){
              		tmp = tmp * 0.5 ;
          		}
          		result = result + tmp;
      		}
      r		esult = result / (double)3.0;
      		System.out.print(result);
        } catch (IOException e) {
            e.printStackTrace();
        }
  }
}


Compiler output:
Main.java:27: error: cannot find symbol
      r		esult = result / (double)3.0;
      ^
  symbol:   class r
  location: class Main
1 error