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

#include <iostream>
using namespace std;

bool isMonth(char s[])
{
    if (s[0] == '0' && s[1] >= '1' && '9' >= s[1])
    {
        return true;
    }
    else if (s[0] == '1' && ('2' >= s[1] && s[1] >= '0'))
    {
        return true;
    }
    return false;
}

bool isYear(char s[])
{
    bool a = ture;
    for (int i = 0; i < 2; i++)
    {
        if ('0' <= s[i] && s[i] <= '9')
        {
            a || true;
        }
        else
        {
            a = false;
        }
    }

    return a;
}

int main()
{
    char s[4];

    cin >> s;

    if (isYear(s) && isMonth(&s[2]) && isMonth(s) && isYear(&s[2]))
    {
        cout << "AMBIGUOUS" << endl;
    }
    else if (isYear(s) && isMonth(&s[2]))
    {
        cout << "YYMM" << endl;
    }
    else if (isMonth(s) && isYear(&s[2]))
    {
        cout << "MMYY" << endl;
    }
    else
    {
        cout << "NA" << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'bool isYear(char*)':
a.cc:19:14: error: 'ture' was not declared in this scope
   19 |     bool a = ture;
      |              ^~~~
Language: C++

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

int main() {
    int S;
    cin >> S;
    
    bool isYYMM = false;
    bool isMMYY = false;
    
    string S_str = to_string(S);
    string pre = S_str.substr(0, 2);
    string post = S_str.substr(2);
    
    int pre_int = stoi(pre);
    int post_int = stoi(post);
    
    if(pre_int >= 1 && pre_int <= 99){
        if(pre_int <= 12) isMMYY = true;
        if(post_int == 0 || post_int > 99) isMMYY = false;
    }
    
    if(post_int >= 1 && post_int <= 99){
        if(post_int <= 12) isYYMM = true;
        if(pre_int == 0 || pre_int > 99) isYYMM = false;
    }
    
    if(isYYMM || isMMYY){
        if(isYYMM && isMMYY) cout << "AMBIGUOUS" << endl;
        else if(isYYMM) cout << "YYMM" << endl;
        else if(isMMYY) cout << "MMYY" << endl;
    }
    else{
        cout << "NA" << endl;
    }
    
    
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: expected '}' at end of input
   38 |     return 0;
      |              ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin >> s;
  vector <int> t(4);
  int a=0;
  int b=0;
  if (t[0] == '0' && t[1] != '0'){
    a=1;
  }
  if (t[0] == '1' && (t[1] == '1'|| t[1] == '2')){
    a=1;
  }
  if (t[2] == '0' && t[3] != '0'){
    b=1;
  }
  if (t[2] == '1' && (t[2] == '1'|| t[1] == '2')){
    b=1;
  }
  
  if (a=0 && b=0){
    cout << "NA" << endl;
  }
  if (a=0 && b=1){
    cout << "YYMM" << endl;
  }
  if (a=1 && b=0){
    cout << "MMYY" << endl;
  }
  if (a=1 && b=1){
    cout << "AMBIGUOUS" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: lvalue required as left operand of assignment
   23 |   if (a=0 && b=0){
      |         ~~^~~~
a.cc:26:11: error: lvalue required as left operand of assignment
   26 |   if (a=0 && b=1){
      |         ~~^~~~
a.cc:29:11: error: lvalue required as left operand of assignment
   29 |   if (a=1 && b=0){
      |         ~~^~~~
a.cc:32:11: error: lvalue required as left operand of assignment
   32 |   if (a=1 && b=1){
      |         ~~^~~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int number;
    cin >> number;
    if( number % 100 <= 12 && number % 100 != 0 ){
      if( number/100 <=12 && number != 0 ){
        cout << "AMBIGUOUS" <<endl;
        continue;
      }
      cout << number/100 <<endl;
    }
    else{
      cout << "MMYY" <<endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: continue statement not within a loop
   10 |         continue;
      |         ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int S,a,b,c,d;
  cin >> S;
  a=S/100;
  b=S-a;
  if(a<13 && 0<a) c=1;
  else if(12<a) c=2;
  else c=2
  if(b<13 && 0<b) d=1;
  else if(12<b) d=2;
  else d=2
  if(c==1&d==2) cout << "YYMM" << endl;
  else if(c==2&&d==1) cout << "MMYY" << endl;
  else if(c==1&&d==1) cout << "AMBIGUOUS" << endl;
  else if(c==2&&d==2) cout << "NA" << endl;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: expected ';' before 'if'
   11 |   else c=2
      |           ^
      |           ;
   12 |   if(b<13 && 0<b) d=1;
      |   ~~       
a.cc:13:3: error: 'else' without a previous 'if'
   13 |   else if(12<b) d=2;
      |   ^~~~
a.cc:14:11: error: expected ';' before 'if'
   14 |   else d=2
      |           ^
      |           ;
   15 |   if(c==1&d==2) cout << "YYMM" << endl;
      |   ~~       
a.cc:16:3: error: 'else' without a previous 'if'
   16 |   else if(c==2&&d==1) cout << "MMYY" << endl;
      |   ^~~~
Language: C++

#include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define int64 long long
#define modbig (10*10*10*10*10*10*10*10*10+7)
using namespace std;

int main(){
  string s;
  cin>>s;
  int a=atoi(s.substr(0,2));
  int b=atoi(s.substr(2,2));
  int ym=0,my=0;
  if(1<=b && b<=12){
    ym=1;
  }
  if(1<=a && a<=12){
    my=2;
  }
  int x=ym+my;
  switch(x){
    case 0:
      cout<<"NA";
      break;
    case 1:
      cout<<"YYMM";
      break;
    case 2:
      cout<<"MMYY";
      break;
    case 3:
      cout<<"AMBIGUOUS";
      break;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   17 |   int a=atoi(s.substr(0,2));
      |              ~~~~~~~~^~~~~
      |                      |
      |                      std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:18:22: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   18 |   int b=atoi(s.substr(2,2));
      |              ~~~~~~~~^~~~~
      |                      |
      |                      std::__cxx11::basic_string<char>
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C

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

int main() {
	char s[5];
	int a,b;
	scanf_s("%s", s,5);
	b = atoi(&s[2]);
	s[2] = '\0';
	a = atoi(s);
	//printf("%d %d\n",a,b);
	int am, bm;
	if (a >= 1 && a <= 12) 	am = 1; else am = 0;
	if (b >= 1 && b <= 12) 	bm = 1; else bm = 0;

	if (am&&bm) printf("AMBIGUOUS\n");
	else if (am&&!bm) printf("MMYY\n");
	else if (!am&&bm) printf("YYMM\n");
	else printf("NA\n");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |         scanf_s("%s", s,5);
      |         ^~~~~~~
      |         scanf
Language: C++

/*
我的心脏怦怦跳，监管者就在附近
*/
#include<bits/stdc++.h>
#include<string>
#include<iostream>
#include<cmath>
#include<set>
#include<stack>
#include<queue>
#include<unistd.h>
#include<stdio.h>
#include<cstring>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
int ksd(string st)
{
	int s=0;
	for(i=0;i<st.size();i++)
	{
		s=s*10+(st[i]-'0');
	}
	return s;
}
int main()
{
	string st;
	cin>>st;
	string c,s;
	c=st.substr(0,2);
	s=st.substr(2,2);
	int ct,sot;
	ct=ksd(c);
	sot=ksd(s);
	if(ct>12&&sot>12) cout<<"NA";
	else if(ct<=12&&sot>12) cout<<"MMYY";
	else if(ct<=12&&sot<=12) cout<<"AMBIGUOUS";
	else if(ct>12&&sot<=12)cout<<"YYMM";
	return 0;
}


Compiler output:
a.cc: In function 'int ksd(std::string)':
a.cc:19:13: error: 'i' was not declared in this scope
   19 |         for(i=0;i<st.size();i++)
      |             ^
Language: C++

#include <iostream>
#include <string>
#include<sstream>


using namespace std;

int main() {
	string s; string y; string m; bool r = false; bool b = false;

	cin >> s;


	y = s[0] + s[1];
	m = s[2] + s[3];
	size_t sz;

	int p = std::stoi(y, &sz);
	int q = std::stoi(m, &sz);

	if (p > 12) {
		bool r = true;
	}
	if (q > 12) {
		bool b = true;
	}
	if (r&&b) {
		cout << "NA";
	}
	else if (r) {
		cout << "YYMM";
	}
	else if (b) {
		cout << "MMYY";
	}
	else {
		cout << "AMMBIGUOUS";
	}
	



Compiler output:
a.cc: In function 'int main()':
a.cc:38:10: error: expected '}' at end of input
   38 |         }
      |          ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  d = n%10;
  n = n/10;
  c = n%10;
  n = n/10;
  b = n%10;
  n = n/10;
  a = n%10;
  x = a*10+b;
  y = c*10+d;
  if(x>12 || x<1)
  {
    if(y>12 || y<1)
    {
      cout<<"NA";
    }
    else
      cout<<"YYMM";
  }
  else
  {
    if(y>12 || y<1)
    {
      cout<<"MMYY";
    }
    else
      cout<<"AMBIGUOUS";
  }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'd' was not declared in this scope
    7 |   d = n%10;
      |   ^
a.cc:9:3: error: 'c' was not declared in this scope
    9 |   c = n%10;
      |   ^
a.cc:11:3: error: 'b' was not declared in this scope
   11 |   b = n%10;
      |   ^
a.cc:13:3: error: 'a' was not declared in this scope
   13 |   a = n%10;
      |   ^
a.cc:14:3: error: 'x' was not declared in this scope
   14 |   x = a*10+b;
      |   ^
a.cc:15:3: error: 'y' was not declared in this scope
   15 |   y = c*10+d;
      |   ^
Language: C++

include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;i++)
int main(void){
    string s;cin>>s;
    int a=s[0]-0x30;int b=s[1]-0x30;int c=s[2]-0x30;int d=s[3]-0x30;
    int x=a*10+b;int y=c*10+d;
    if((x==0||x>12)&&(y>=1&&y<=12))cout<<"YYMM"<<endl;
    else if((x>=1&&x<=12)&&(y==0||y>12))cout<<"MMYY"<<endl;
    else if((x>=1&&x<=12)&&(y>=1&&y<=12))cout<<"AMBIGUOUS"<<endl;
    else cout<<"NA"<<endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'string' was not declared in this scope
    6 |     string s;cin>>s;
      |     ^~~~~~
a.cc:6:14: error: 'cin' was not declared in this scope
    6 |     string s;cin>>s;
      |              ^~~
a.cc:6:19: error: 's' was not declared in this scope
    6 |     string s;cin>>s;
      |                   ^
a.cc:9:36: error: 'cout' was not declared in this scope
    9 |     if((x==0||x>12)&&(y>=1&&y<=12))cout<<"YYMM"<<endl;
      |                                    ^~~~
a.cc:9:50: error: 'endl' was not declared in this scope
    9 |     if((x==0||x>12)&&(y>=1&&y<=12))cout<<"YYMM"<<endl;
      |                                                  ^~~~
a.cc:10:41: error: 'cout' was not declared in this scope
   10 |     else if((x>=1&&x<=12)&&(y==0||y>12))cout<<"MMYY"<<endl;
      |                                         ^~~~
a.cc:10:55: error: 'endl' was not declared in this scope
   10 |     else if((x>=1&&x<=12)&&(y==0||y>12))cout<<"MMYY"<<endl;
      |                                                       ^~~~
a.cc:11:42: error: 'cout' was not declared in this scope
   11 |     else if((x>=1&&x<=12)&&(y>=1&&y<=12))cout<<"AMBIGUOUS"<<endl;
      |                                          ^~~~
a.cc:11:61: error: 'endl' was not declared in this scope
   11 |     else if((x>=1&&x<=12)&&(y>=1&&y<=12))cout<<"AMBIGUOUS"<<endl;
      |                                                             ^~~~
a.cc:12:10: error: 'cout' was not declared in this scope
   12 |     else cout<<"NA"<<endl;
      |          ^~~~
a.cc:12:22: error: 'endl' was not declared in this scope
   12 |     else cout<<"NA"<<endl;
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;


int main(){
  string S;
  cin >> S;

  int num1,num2;

  istringstream ss1;
  istringstream ss2;

  ss1 = istringstream(S.substr(0,1))
  ss2 = istringstream(S.substr(2,3))
  
  ss1 >> num1;
  ss2 >> num2;

  if((num1 > 12) && (num2 > 12)){
    cout << "NA" << endl;
    return 0;
  }
  if((num1 == 0) || (num2 == 0)){
    cout << "NA" << endl;
    return 0;
  }
  if((num1 > 12 ) && (num2 <= 12)){
    cout << "YYMM" << endl;
    return 0;
  }
  if((num1 <= 12 ) && (num2 > 12)){
    cout << "MMYY" << endl;
    return 0;
  }
  cout << "AMBIGUOUS" << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:37: error: expected ';' before 'ss2'
   15 |   ss1 = istringstream(S.substr(0,1))
      |                                     ^
      |                                     ;
   16 |   ss2 = istringstream(S.substr(2,3))
      |   ~~~
Language: C

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



int main(void)
{
	char s[];
	
	scanf("%s",s);
	
	int n1 = (s[0] - '0')*10 + (s[1] - '0');
	
	int n2 = (s[2] - '0')*10 + (s[3] - '0');
	
	if(0 < n1 && n1 < 13 && 0 < n2 && n2 < 13){
		printf("AMBIGIOUS\n");
	}else if(0 < n1 && n1 < 13){
		printf("MMYY\n");
	}else if(0 < n2 && n2 < 13){
		printf("YYMM\n");
	}else{
		printf("NA\n");
	}
	
	return 0;
}
	
	

Compiler output:
main.c: In function 'main':
main.c:8:14: error: array size missing in 's'
    8 |         char s[];
      |              ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
	char a3[4];
	int a,n;
	bool a1=false,a2=false;
		cin>>a3[0];
	
		cin>>a3[1];
        a=(a3[0]-'0')*10+a3[1]-'0';

		cin>>a3[2];
	
		cin>>a3[3];
        b=(a3[2]-'0')*10+a3[3]-'0';
    
    if(a<=12 && a>0)
    {
    	a1=true;
	}
	
	if(b<=12 && b>0)
	{
		a2=true;
	}
	
	if(a1 && !a2)
	{
		cout<<"MMYY";
	}
	
	if(a2 && !a1)
	{
		cout<<"YYMM";
	}
	
	if(a2 && a1)
	{
		cout<<"AMBIGUOUS";
	}
	
	if(!a1 && !a2)
	{
		
		cout<<"NA";
	}
	
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'b' was not declared in this scope
   16 |         b=(a3[2]-'0')*10+a3[3]-'0';
      |         ^
Language: C++

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


int main(){
      int s;
      cin >>s;
      int b,c;
      b = s/100;
      c = s%100;
      if(b>0 && b<13){
            if(c>0 && c<13){
                  cout << "AMBIGUOUS";
            }else{#include<bits/stdc++.h>
using namespace std;
#define ll long long 


int main(){
      int s;
      cin >>s;
      int b,c;
      b = s/100;
      c = s%100;
      if(b>0 && b<13){
            if(c>0 && c<13){
                  cout << "AMBIGUOUS";
            }else{
                  cout << "MMYY";
            }
      }else{
            if(c>0 && c<13){
                  cout << "YYMM";
            }else{
                  cout << "NA";
            }
      }
      cout << endl;
      

}
                  cout << "MMYY";
            }
      }else{
            if(c>0 && c<13){
                  cout << "YYMM";
            }else{
                  cout << "NA";
            }
      }
  
      

}

Compiler output:
a.cc:15:19: error: stray '#' in program
   15 |             }else{#include<bits/stdc++.h>
      |                   ^
a.cc: In function 'int main()':
a.cc:15:20: error: 'include' was not declared in this scope
   15 |             }else{#include<bits/stdc++.h>
      |                    ^~~~~~~
a.cc:15:28: error: 'bits' was not declared in this scope
   15 |             }else{#include<bits/stdc++.h>
      |                            ^~~~
a.cc:15:33: error: 'stdc' was not declared in this scope; did you mean 'std'?
   15 |             }else{#include<bits/stdc++.h>
      |                                 ^~~~
      |                                 std
a.cc:16:1: error: expected primary-expression before 'using'
   16 | using namespace std;
      | ^~~~~
a.cc:20:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   20 | int main(){
      |         ^~
a.cc:20:9: note: remove parentheses to default-initialize a variable
   20 | int main(){
      |         ^~
      |         --
a.cc:20:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:20:11: error: a function-definition is not allowed here before '{' token
   20 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long int lli;

int main() {
    int s;

    cin >> s;

    int a = 0, b = 0;
    a += s%10;
    s /= 10;
    a += 10 * (s%10);
    s /= 10;
    
    b += s%10;
    s /= 10;
    b += 10 * (s%10);
    s /= 10;

    if (1 <= a && a <= 12) {
        if (1 <= b && b <= 12)
        {
            cout << "AMBIGUOUS" << endl;
        }
        else {
            cout << "YYMM" << endl;
        }
    }
    else
    {
        if (1 <= b && b <= 12)
        {
            cout << "MMYY" << endl;
        }
        else {
            cout << "NA" << endl;
        }
    }
    
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

typedef long long int lli;

int main() {
    int s;

    cin >> s;

    int a = 0, b = 0;
    a += s%10;
    s /= 10;
    a += 10 * (s%10);
    s /= 10;
    
    b += s%10;
    s /= 10;
    b += 10 * (s%10);
    s /= 10;

    if (1 <= a && a <= 12) {
        if (1 <= b && b <= 12)
        {
            cout << "AMBIGUOUS" << endl;
        }
        else {
            cout << "YYMM" << endl;
        }
    }
    else
    {
        if (1 <= b && b <= 12)
        {
            cout << "MMYY" << endl;
        }
        else {
            cout << "NA" << endl;
        }
    }
    
    return 0;
}


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

a = list(input())
for i in range(4):
	a[i] = int(a[i])
s = [0,0]
s[0] = a[0]* 10 +a[1]
s[1] = a[2] * 10 + a[3]
def judge(a):
	if 0<a<13:
		return True
	else:
		return False
if judge(s[0]):
	if judge(s[1]):
		print("AMBIGUOUS")
	else:
		print("MMYY")
else:
	if judge(s[1]):
		print("YYMM")
	else:
		print("NA")



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

#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define mod 1000000007


int main()
{
	string s;
	cin>>s;

	string t1 ;
	t1 += s[0];
	t1 += s[1];

	string t2;
	t2 += s[2];
	t2 += s[3];

	ll t11 = stoi(t1);
	ll t22 = stoi(t2);

	if(t11 > 12 && t22 <= 12 && t22 > 0)
	{
		cout<<"YYMM"<<endl;
	}
	else if(t11 <= 12 && t22 > 12 && t11 > 0)
	{
		cout<<"MMYY"<<endl;
	}
	else if(t11 == 0 && t22 != 0 && t22 <= 12 && t22 > 0)
	{
		cout<<"YYMM"<<endl;
	}
	else if(t11 != 0 && t22 == 0 && t11 <= 12 && t11 > 0)
	{
		cout<<"MMYY"<<endl
	}
	else
	{
		cout<<"NA"<<endl;
	}

}	

Compiler output:
a.cc: In function 'int main()':
a.cc:40:35: error: expected ';' before '}' token
   40 |                 cout<<"MMYY"<<endl
      |                                   ^
      |                                   ;
   41 |         }
      |         ~
Language: C++


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

int main()
{
int i;
int A;
int B;
bool bA;
bool bB;
char S[ 10 ];

	ios::sync_with_stdio( false );
	cin.tie( 0 );

	cin >> S;

	i = S[ 0 ] - '0'
	A = S[ 1 ] - '0'
	A += i * 10;

	i = S[ 2 ] - '0'
	B = S[ 3 ] - '0'
	B += i * 10;

	bA = ( A > 0 && A < 13 );
	bB = ( B > 0 && B < 13 );

	if( bA && bB )
		cout << "AMBIGUOUS" << endl;
	else if( bA )
		cout << "MMYY" << endl;
	else if( bB )
		cout << "YYMM" << endl;
	else
		cout << "NA" << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected ';' before 'A'
   19 |         i = S[ 0 ] - '0'
      |                         ^
      |                         ;
   20 |         A = S[ 1 ] - '0'
      |         ~                
a.cc:23:25: error: expected ';' before 'B'
   23 |         i = S[ 2 ] - '0'
      |                         ^
      |                         ;
   24 |         B = S[ 3 ] - '0'
      |         ~
Language: C

s=gets.chomp.split("").map{|s| s.to_i}
if s[0]*10+s[1]<=12 && s[2]*10+s[3]<=12 && s[0]*10+s[1]!=0 && s[2]*10+s[3]!=0
  puts "AMBIGUOUS"
elsif (s[0]*10+s[1]<=12 && s[0]*10+s[1]!=0) && (s[2]*10+s[3]>12 || s[2]*10+s[3]==0)
  puts "MMYY"
elsif (s[0]*10+s[1]>12 && s[0]*10+s[1]==0) && (s[2]*10+s[3]<=12 || s[2]*10+s[3]!=0)
  puts "YYMM"
else
  puts "NA"
end

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | s=gets.chomp.split("").map{|s| s.to_i}
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
main.c:1:3: error: 'gets' undeclared here (not in a function)
    1 | s=gets.chomp.split("").map{|s| s.to_i}
      |   ^~~~
main.c:1:27: error: expected ',' or ';' before '{' token
    1 | s=gets.chomp.split("").map{|s| s.to_i}
      |                           ^
main.c:2:1: error: expected identifier or '(' before 'if'
    2 | if s[0]*10+s[1]<=12 && s[2]*10+s[3]<=12 && s[0]*10+s[1]!=0 && s[2]*10+s[3]!=0
      | ^~
Language: C++

#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}

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

	string S=in<string>();

	int f,s;
	sscanf_s(S.c_str(),"%2d%2d",&f,&s);
	auto check=[](int y,int m){
		if(m<1 || m>12) return false;
		if(y==0) return false;
		return true;
	};

	int flag=0;
	flag += check(f,s) ? 1 : 0;
	flag += check(s,f) ? 10 : 0;
	switch(flag){
	case 0:
		cout << "NA" << endl;
		return 0;
	case 1:
		cout << "YYMM" << endl;
		return 0;
	case 10:
		cout << "MMYY" << endl;
		return 0;
	case 11:
		cout << "AMBIGUOUS" << endl;
		return 0;
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'sscanf_s' was not declared in this scope; did you mean 'sscanf'?
   20 |         sscanf_s(S.c_str(),"%2d%2d",&f,&s);
      |         ^~~~~~~~
      |         sscanf
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  string S;
  cin >> S;
  
  bool YYMM, MMYY;
  if(int(S[0]+'0')*10 + int(S[1]) == 0 || int(S[0]+'0')*10 + int(S[1]) >= 13) MMYY = false;
  else MMYY = true;
  
  if(int(S[2]+'0')*10 + int(S[3]) == 0 || int(S[2]+'0')*10 + int(S[3]) >= 13) YYMM = false;
  else YYMM = true;
  
  if(YYMM & MMYY) cout << "AMBIGUOUS";
  else if(YYMM & !MMYY) << "YYMM";
  else if(!YYMM & MMYY) << "MMYY";
  else cout << "NA";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: expected primary-expression before '<<' token
   18 |   else if(YYMM & !MMYY) << "YYMM";
      |                         ^~
a.cc:19:25: error: expected primary-expression before '<<' token
   19 |   else if(!YYMM & MMYY) << "MMYY";
      |                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std ;
 
int main () {
  
  string s ;
  cin >> s ;
  int f = (s[0] - '0')*10 + (s[1] - '0') ;
  int t = (s[2] - '0')*10 + (s[3] - '0') ;
  if(t >= 1 && t <= 12 && f >= 1 && f <= 12) 
    cout<<"AMBIGUOUS\n" ;
  else if(t == 0 || f == 0)
    cout<<"NA\n" ;
  else if( t > 12 && f > 12) cout<<"NA\n" ;
  else if(t >= 1 && t <= 12) cout<<"YYMM\n" ;
  else cout<<"MMYY\n" ;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected '}' at end of input
   16 |   else cout<<"MMYY\n" ;
      |                        ^
a.cc:4:13: note: to match this '{'
    4 | int main () {
      |             ^
Language: C++

#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	int a, b;
	scanf_s("%2d%2d", &a,&b);
	if (a == 0) {
		if (1<=b && b<=12) {
			cout << "YYMM" << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}
	else if (1 <= a && a <= 12) {
		if (1 <= b && b <= 12) {
			cout << "AMBIGUOUS" << endl;
		}
		else {
			cout << "MMYY" << endl;
		}
	}
	else {
		if (1 <= b && b <= 12) {
			cout << "YYMM" << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}
	return 0;
}


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

int main(){
    int u,d;
    int n; cin >> n;
    u = n / 100;
    d = n - u*100;
    if(u == 0 && d <= 12 && d > 0) cout << "YYMM" << endl;
    else if(d == 0 && u <= 12 && u > 0) cout << "MMYY" << endl;
    else if(u <= 12 && d <= 12) cout << "AMBIGUOUS" << endl;
    else if(u <= 12 && u > 0 && d > 12) cout <<  "MMYY" << endl;
    else if(u > 12 && d <= 12 && d > 0) cout << "YYMM" << endl;
    else cout << "NA" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:12: error: 'cin' was not declared in this scope
    3 |     int n; cin >> n;
      |            ^~~
a.cc:6:36: error: 'cout' was not declared in this scope
    6 |     if(u == 0 && d <= 12 && d > 0) cout << "YYMM" << endl;
      |                                    ^~~~
a.cc:6:54: error: 'endl' was not declared in this scope
    6 |     if(u == 0 && d <= 12 && d > 0) cout << "YYMM" << endl;
      |                                                      ^~~~
a.cc:7:41: error: 'cout' was not declared in this scope
    7 |     else if(d == 0 && u <= 12 && u > 0) cout << "MMYY" << endl;
      |                                         ^~~~
a.cc:7:59: error: 'endl' was not declared in this scope
    7 |     else if(d == 0 && u <= 12 && u > 0) cout << "MMYY" << endl;
      |                                                           ^~~~
a.cc:8:33: error: 'cout' was not declared in this scope
    8 |     else if(u <= 12 && d <= 12) cout << "AMBIGUOUS" << endl;
      |                                 ^~~~
a.cc:8:56: error: 'endl' was not declared in this scope
    8 |     else if(u <= 12 && d <= 12) cout << "AMBIGUOUS" << endl;
      |                                                        ^~~~
a.cc:9:41: error: 'cout' was not declared in this scope
    9 |     else if(u <= 12 && u > 0 && d > 12) cout <<  "MMYY" << endl;
      |                                         ^~~~
a.cc:9:60: error: 'endl' was not declared in this scope
    9 |     else if(u <= 12 && u > 0 && d > 12) cout <<  "MMYY" << endl;
      |                                                            ^~~~
a.cc:10:41: error: 'cout' was not declared in this scope
   10 |     else if(u > 12 && d <= 12 && d > 0) cout << "YYMM" << endl;
      |                                         ^~~~
a.cc:10:59: error: 'endl' was not declared in this scope
   10 |     else if(u > 12 && d <= 12 && d > 0) cout << "YYMM" << endl;
      |                                                           ^~~~
a.cc:11:10: error: 'cout' was not declared in this scope
   11 |     else cout << "NA" << endl;
      |          ^~~~
a.cc:11:26: error: 'endl' was not declared in this scope
   11 |     else cout << "NA" << endl;
      |                          ^~~~
Language: C++

S = input()
SL = []
for i in range(1,13):
    SL.append("0"+str(i) if len(str(i)) == 1 else str(i))


if S[2:] in SL:
    if S[:2] in SL or S[:2] == "00":
        print("AMBIGOUS")
    else:
        print("YYMM")
    
else:
    if S[:2] in SL or SL[:2] == "00":
        print("MMYY")
    else:
        print("NA")

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: C++

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

	int a;
	cin>>a;
	int z=a%100;
	int c=a/100;
	if(c<=12&&c>0&&z<=12&&>0){
		cout<<"AMBIGUOUS"<<endl;
	}
	else if(c<=12&&c>0&&(z>12)){
		cout<<"MMYY"<<endl;
	}
	else if(z<=12&&z>0&&(c>12)){
		cout<<"YYMM"<<endl;
	}
	else cout<<"NA"<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:31: error: expected primary-expression before '>' token
    9 |         if(c<=12&&c>0&&z<=12&&>0){
      |                               ^
Language: C++

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

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

int main(void) {

  string s;
  cin>>s;
  bool a=false,b=false;
  int f,l;
  f = (int)(s[0])*10+(int)(s[1]);
  l = (int)(s[2])*10+(int)(s[3]);
  a = (f <= 12);
  b = (l <= 12);
  if(a){
    if(b)cout<<"AMBIGUOUS";
	else cout<<"MMYY"; 
  }else{
  	if(b)cout << "YYMM";
    else cout<< "NA"
  }
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:21: error: expected ';' before '}' token
   22 |     else cout<< "NA"
      |                     ^
      |                     ;
   23 |   }
      |   ~
Language: C++

//----------ACCIDENTAL COMPETITIVE PROGRAMMER---------------------

#include<bits/stdc++.h>

/*
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
using namespace std;

#define LL long long
#define LD long double
#define PB push_back
#define MP make_pair


const LL MOD = (1e9) + 7 ;
const LD EPS = 0.0000001 ;

bool cm(int x)
{
	if (x >=0 && x <= 11)
		return true;
	return false;
}

bool cy(int x)
{
	if (x >= 0 && x <= 99)
		return true;
	return false;
}

int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

   string st; cin >> s;

   int f = 10 * (st[0] - '0') + (st[1] - '0');
   int s = 10 * (st[2] - '0') + (st[3] - '0');
   bool flag = cm(f);
   bool flag2 = cm(s);
   bool flag3 = cy(f);
   bool flag4 = cy(s);

   if (flag && flag4 && flag3 && flag2){
   	cout << "AMBIGUOUS\n";
   	return 0;
   }

   if (flag && flag4){
   	cout << "MMYY\n";
   } else {
   	cout << "YYMM\n";
   }

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:22: error: 's' was not declared in this scope; did you mean 'st'?
   41 |    string st; cin >> s;
      |                      ^
      |                      st
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
	int n;
	scanf("%d", &n);
	int f = n / 100;
	int b = n % 100;
	if (f > 12 && b == 0)
	{
		printf("NA\n");
		return;
	}
	if (b <= 12 && f > 12)
		printf("YYMM\n");
	else if (b <= 12 && f <= 12)
		printf("AMBIGUOUS\n");
	else if (b > 12 && f <= 12)
		printf("MMYY\n");


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
   13 |                 return;
      |                 ^~~~~~
Language: C++

//----------ACCIDENTAL COMPETITIVE PROGRAMMER---------------------

#include<bits/stdc++.h>

/*
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
*/
using namespace std;

#define LL long long
#define LD long double
#define PB push_back
#define MP make_pair


const LL MOD = (1e9) + 7 ;
const LD EPS = 0.0000001 ;

bool cm(int x)
{
	if (x >=0 && x <= 11)
		return true;
	return false;
}

bool cy(int x)
{
	if (x >= 0 && x <= 99)
		return true;
	return false;
}

int main(void)
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);

   string s; cin >> s;

   int f = 10 * (s[0] - '0') + (s[1] - '0');
   int s = 10 * (s[2] - '0') + (s[3] - '0');
   bool flag = cm(f);
   bool flag2 = cm(s);
   bool flag3 = cy(f);
   bool flag4 = cy(s);

   if (flag && flag4 && flag3 && flag2){
   	cout << "AMBIGUOUS\n";
   	return 0;
   }

   if (flag && flag4){
   	cout << "MMYY\n";
   } else {
   	cout << "YYMM\n";
   }

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:8: error: conflicting declaration 'int s'
   44 |    int s = 10 * (s[2] - '0') + (s[3] - '0');
      |        ^
a.cc:41:11: note: previous declaration as 'std::string s'
   41 |    string s; cin >> s;
      |           ^
a.cc:46:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
   46 |    bool flag2 = cm(s);
      |                    ^
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
a.cc:22:13: note:   initializing argument 1 of 'bool cm(int)'
   22 | bool cm(int x)
      |         ~~~~^
a.cc:48:20: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int'
   48 |    bool flag4 = cy(s);
      |                    ^
      |                    |
      |                    std::string {aka std::__cxx11::basic_string<char>}
a.cc:29:13: note:   initializing argument 1 of 'bool cy(int)'
   29 | bool cy(int x)
      |         ~~~~^
Language: C

#include <iostream>
#include <cstdio>
#include <sstream>

#include <string>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>

#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>

#include <chrono>
#include <random>

using namespace std;
using i64 = int_fast64_t;
using ui64 = uint_fast64_t;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<i64>;
using vvl = vector<vl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vb = vector<bool>;
using vvb = vector<vb>;
using pii = pair<int, int>;
using pll = pair<i64, i64>;

//////////////////////////////////////////////////

int main(){
    int n;
    cin >> n;
    if(n % 100 < 1)cout << "NA" << endl;
    else if(n / 100 <= 12 && n % 100 <= 12)cout << "AMBIGUOUS" << endl;
    else if(n / 100 > 12)cout << "YYMM" << endl;
    else if(n % 100 > 12)cout << "MMYY" << endl;
    else cout << "NA" << 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 <bits/stdc++.h>

using namespace std;

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

    double p = 0;

    for(double i=1; i<=N; i++)
    {
        double temp = 1.0 / N ;
        int point = i;
        while(point < K){
            temp *= 0.5;
            point *= 2;
        }
        res += temp;
    }

    cout << fixed << setprecision(12) << p << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'res' was not declared in this scope
   20 |         res += temp;
      |         ^~~
Language: C++

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

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll n, k;
    cin >> n >> k;
    double ans = 0;
    REP(i,1,n+1){
        if(i >= k){
            ans += n-k+1.0;
            break;
        }else{
            ll x = ceil(log2((k+i-1)/i)));
            ans += pow(0.5,x);
        }
    }
    ans /= (double)n;
    printf("%.10f\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:41: error: expected ',' or ';' before ')' token
   25 |             ll x = ceil(log2((k+i-1)/i)));
      |                                         ^
Language: C++

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

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll n, k;
    cin >> n >> k;
    double ans = 0;
    REP(i,1,n+1){
        if(i >= k){
            ans += n-k+1.0;
            break;
        }else{
            ll x = ceil(log2(ceil(double)(k/i)));
            ans += pow(0.5,x);
        }
    }
    ans /= (double)n;
    printf("%.10f\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: expected primary-expression before 'double'
   25 |             ll x = ceil(log2(ceil(double)(k/i)));
      |                                   ^~~~~~
Language: C++

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

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll n, k;
    cin >> n >> k;
    double ans = 0;
    REP(i,1,n+1){
        if(i >= k){
            ans += n-k+1.0;
            break;
        }else{
            ll x = ceil(log2(ceil(k/i));
            ans += pow(0.5,x);
        }
    }
    ans /= (double)n;
    printf("%.10f\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:40: error: expected ')' before ';' token
   25 |             ll x = ceil(log2(ceil(k/i));
      |                        ~               ^
      |                                        )
Language: C++

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

using namespace std;
typedef long long ll;

int main(){
  ll N,K;
  cin >> N >> K;
  ll ans=0;
  for(ll i=0;i<N;i++){
    ll m = ceil(log2((1.0*K)/(i+1)));
    if(m>=1){
      ans += (pow(10,14))/(N*pow(2,m));
    }else ans+= pow(10,14)/N;
  }
  cout << "0." << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'log2' was not declared in this scope
   14 |     ll m = ceil(log2((1.0*K)/(i+1)));
      |                 ^~~~
a.cc:14:12: error: 'ceil' was not declared in this scope
   14 |     ll m = ceil(log2((1.0*K)/(i+1)));
      |            ^~~~
a.cc:16:15: error: 'pow' was not declared in this scope
   16 |       ans += (pow(10,14))/(N*pow(2,m));
      |               ^~~
a.cc:17:17: error: 'pow' was not declared in this scope
   17 |     }else ans+= pow(10,14)/N;
      |                 ^~~
Language: Java


import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main2 {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();

		double all = 0; 
		for( int i = 1 ; i <= n ; i++ ) {
			int now = i;
			int p_all = 1;
			while( now < k ) {
				now *= 2;
				p_all *= 2;
			}
			all += 1.0/n/p_all;
		}
		
		System.out.println( (double)all );
		

	}
}



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

#include<stdio.h>
#include<math.h>
int main()
{
long int k[20],i,j;
for(i=0;i<20;++i)
{
k[i]=pow(2,i);  
} 
  
double p,n,pp,l,cc,ans;
  ans=0;
int sw;
cin >> n >> l;
  pp=1/n;
  p=1/2;
  
  for(j=1;j<=n;++j)
  {if(l/j<1) sw=0;
    else{
   for(i=0;i<19;++i)
   {
   if(k[i]<(l/j) && (l/j)<=k[i+1]) sw=i+1;
   }
    }
  ans=ans+pp*pow(p,sw);
    sw=0;
  }
  
  
  printf("%.9f",ans);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: 'cin' undeclared (first use in this function); did you mean 'sin'?
   14 | cin >> n >> l;
      | ^~~
      | sin
main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<math.h>
int main()
{
long int k[20],i,j;
for(i=0;i<20;++i)
{
k[i]=pow(2,i);  
} 
  
double p,n,pp,l,cc,ans;
  ans=0;
int sw;
cin >> n >> l;
  pp=1/n;
  p=1/2;
  
  for(j=1;j<=n;++j)
  {if(l/j<1) sw=0
    else{
   for(i=0;i<19;++i)
   {
   if(k[i]<(l/j) && (l/j)<=k[i+1]) sw=i+1;
   }
    }
  ans=ans+pp*pow(p,sw);
    sw=0;
  }
  
  
  printf("%.9f",ans);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:1: error: 'cin' undeclared (first use in this function); did you mean 'sin'?
   14 | cin >> n >> l;
      | ^~~
      | sin
main.c:14:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:18: error: expected ';' before 'else'
   19 |   {if(l/j<1) sw=0
      |                  ^
      |                  ;
   20 |     else{
      |     ~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
using ll = long long;
using namespace std;
ll pow2(ll a,ll n){
    ll res=1;
    while(n>0){
        if(n&1){
            res=res*a;
        }
        a=a*a;
        n>>=1;
    }
    return res;
}
int main(){
    int n,k;
    cin>>n>>k;
    double ans=0;
    rep(i,n){
        int a=i+1;
        double tmp=1.0/n;
        while(a<k){
            a*=2;
            tmp/=2;
        }
        ans+=tmp;
    }
    cout<<fixed<<setprecision(15)<<ans<<endl;
}
/*

Compiler output:
a.cc:32:1: error: unterminated comment
   32 | /*
      | ^
Language: C++

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


int main(){
  ll n, k;
  cin >> n >> k;
  int count;
  long long double ans = 0;
  long long double a = 0.5;
  for(int i = 1; i <= n; i++){
    count = 0;
    ll now = i;
    while(now <= k - 1){
      now *= 2;
      count++;
    }
    
    ans += pow(a, (long long double)count);
    
  }
  ans = ans / (long long double)n;
 cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'long long' specified with 'double'
   11 |   long long double ans = 0;
      |        ^~~~
a.cc:12:8: error: 'long long' specified with 'double'
   12 |   long long double a = 0.5;
      |        ^~~~
a.cc:21:25: error: 'long long' specified with 'double'
   21 |     ans += pow(a, (long long double)count);
      |                         ^~~~
a.cc:24:21: error: 'long long' specified with 'double'
   24 |   ans = ans / (long long double)n;
      |                     ^~~~
Language: C++

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


int main(){
  ll n, k;
  cin >> n >> k;
  int count;
  ll double ans = 0;
  ll double a = 0.5;
  for(int i = 1; i <= n; i++){
    count = 0;
    ll now = i;
    while(now <= k - 1){
      now *= 2;
      count++;
    }
    
    ans += pow(a, (double)count);
    
  }
  ans = ans / (double)n;
 cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: two or more data types in declaration of 'ans'
   11 |   ll double ans = 0;
      |   ^~
a.cc:12:3: error: two or more data types in declaration of 'a'
   12 |   ll double a = 0.5;
      |   ^~
a.cc:21:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |     ans += pow(a, (double)count);
      |     ^~~
      |     abs
a.cc:21:16: error: 'a' was not declared in this scope
   21 |     ans += pow(a, (double)count);
      |                ^
a.cc:24:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   ans = ans / (double)n;
      |   ^~~
      |   abs
Language: C++

#include <iostream>
using namespace std;
#include <math.h>
int main(void){
    // Your code here
    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;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: expected ',' or ';' before 'int'
   10 |         int now=i;
      |         ^~~
a.cc:11:15: error: 'now' was not declared in this scope; did you mean 'pow'?
   11 |         while(now < b){
      |               ^~~
      |               pow
Language: C++

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

int main() {
	int n,k;
	cin >> n >> k;
	//n>k k/n 
	double ans=0;
	for(int i = 1;i <= n;i++)
	{
		double t =1.0/n;
		int a=i;
		while(a<k)
		{
			a*=2;
			t/=2;
		}
		ans+=t;
	}
	cout << fixed << setprecision(15) << t << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:46: error: 't' was not declared in this scope
   20 |         cout << fixed << setprecision(15) << t << endl;
      |                                              ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
using ll = long long;
#define rep(i, j, n) for(int i = (j); i < (n); ++i)
#define rrep(i, j, n) for(int i = (n) - 1; (j) <= i; --i)

constexpr ll MOD = 1000000007;
constexpr ll INF = 1LL << 60;


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

	int n, k; cin >> n >> k;

	double ans = 0.0;
	rep(i, 1, n + 1) {
		int j = i;
		int cnt = 0;
		while (j < k) {
			j <<= 1;
			cnt++;
		}
		ans += pow(0.5, (double)cnt) / (double)n;
	}
	cout << fixed << setprecision(10) << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:24: error: 'pow' was not declared in this scope
   31 |                 ans += pow(0.5, (double)cnt) / (double)n;
      |                        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    unsigned double x,ans=0.0;
    int K;
    cin >> x >> K;
    int N = x;
    for (int i = 1; i <= N; i++)
    {
        int a = i , j = 1;
        while(true)
        {
            a *= 2;
            if(a >= K){
                ans += pow(1/2,j);
                break;
            }
            else j++;
        }
        
    }
    cout << ans/x << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'unsigned' specified with 'double'
    4 |     unsigned double x,ans=0.0;
      |     ^~~~~~~~
a.cc:4:5: error: 'unsigned' specified with 'double'
Language: C++

/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){ 
    int n,k; cin>>n>>k;
    ld ans=0.0;
    for (int i=1;i<=n;i++){
        int h=i,c=0;
        while (h<=k){
            h*=2; c++;
        }
        ans += (1.0/(ld)n)*(pow(.5,c)) ; 
    }
    cout << fixed << precision(8);
    cout << ans << endl;
} 

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:39:22: error: 'precision' was not declared in this scope
   39 |     cout << fixed << precision(8);
      |                      ^~~~~~~~~
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:11: error: 'scanf' was not declared in this scope
    2 |   int a,b;scanf("%d%d",&a,&b);
      |           ^~~~~
a.cc:9:1: error: 'printf' was not declared in this scope
    9 | 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(){