Problem:


Score : 200 points

Problem Statement

You have a digit sequence S of length 4. You are wondering which of the following formats S is in:

YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order

MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order

If S is valid in only YYMM format, print YYMM; if S is valid in only MMYY format, print MMYY; if S is valid in both formats, print AMBIGUOUS; if S is valid in neither format, print NA.

Constraints

S is a digit sequence of length 4.

Input

Input is given from Standard Input in the following format:

S

Output

Print the specified string: YYMM, MMYY, AMBIGUOUS or NA.

Sample Input 1

1905

Sample Output 1

YYMM

May XX19 is a valid date, but 19 is not valid as a month. Thus, this string is only valid in YYMM format.

Sample Input 2

0112

Sample Output 2

AMBIGUOUS

Both December XX01 and January XX12 are valid dates. Thus, this string is valid in both formats.

Sample Input 3

1700

Sample Output 3

NA

Neither 0 nor 17 is valid as a month. Thus, this string is valid in neither format.



Sample input:
1905


Sample output:
YYMM

Submission status: Wrong Answer

Solution code:
s = list(input())
s1,s2 = int(s[0]+s[1]),int(s[2]+s[3])
ans = 'NA'
if 12 < s1 or 0 == s1:
    if s2 and s2<=12:
        ans = 'YYMM'
else:
    if 1<= s1 and s2!=0 :
        ans = 'AMBIGUOUS'
    elif 0 == s2:
        ans = 'MMYY'
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = 'NA'
if 12 < int(s[0]+s[1]) or 0 == int(s[0]+s[1]):
    if 1<=int(s[2]+s[3]) and int(s[2]+s[3])<=12:
        ans = 'YYMM'
else:
    if 1<=int(s[0]+s[1]) and int(s[0]+s[1])<=12:
        ans = 'AMBIGUOUS'
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = 'NA'
if 12 < int(s[0]+s[1]):
    if 1<=int(s[2]+s[3]) and int(s[2]+s[3])<=12:
        ans = 'YYMM'
else:
    if 1<=int(s[0]+s[1]) and int(s[0]+s[1])<=12:
        ans = 'AMBIGUOUS'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
x = int(s[:2])
y = int(s[2:])

if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and 1 <= y <= 99:
    print("MMYY")
elif 1 <= y <= 12 and 1 <= x <= 99:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])

if a==0 & b==0:
    print('NA')


if a==0:
    if b<13:
        print('YYMM')
    elif b>0:
        print('NA')
if b==0:
    if a<13:
        print('MMYY')
    elif a>0:
        print('NA')

if a>12:
    if b>12:
        print('NA')
    elif b>0:
        print('YYMM')
elif a>0:
    if b>12:
        print('MMYY')
    elif b>0:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])

if a==0 & b==0:
    print('NA')

if a==0:
    if b<13:
        print('YYMM')
    else:
        print('NA')
if b==0:
    if a<13:
        print('MMYY')
    else:
        print('NA')

if a>12:
    if b>12:
        print('NA')
    elif b>0:
        print('YYMM')
else:
    if b>12:
        print('MMYY')
    elif b>0:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=input()
a=int(s[:2])
b=int(s[2:])

if a==0 & b==0:
    print('NA')

if a==0:
    if b<13:
        print('YYMM')
    else:
        print('NA')
if b==0:
    if a<13:
        print('MMYY')
    else:
        print('NA')

if a>12:
    if b>12:
        print('NA')
    else:
        print('YYMM')
else:
    if b>12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
ju1, ju2 = S[:2],S[2:]

if (int(ju1) >= 0 and int(ju1) <= 12) or (int(ju2) >= 0 and int(ju2) <= 12):
    if (int(ju1) > 0 and int(ju1) <= 12) and (int(ju2) > 0 and int(ju2) <= 12):
        print('AMBIGUOUS')
    elif (int(ju1) > 0 and int(ju1) <= 12) and int(ju2) > 0:
        print('MMYY')
    elif int(ju1) >= 0 and (int(ju2) > 0 and int(ju2) <= 12):
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
ju1, ju2 = S[:2],S[2:]

if (int(ju1) > 0 and int(ju1) <= 12) or (int(ju2) > 0 and int(ju2) <= 12):
    if (int(ju1) > 0 and int(ju1) <= 12) and (int(ju2) > 0 and int(ju2) <= 12):
        print('AMBIGUOUS')
    elif (int(ju1) > 0 and int(ju1) <= 12) and int(ju2) > 0:
        print('MMYY')
    elif int(ju1) > 0 and (int(ju2) > 0 and int(ju2) <= 12):
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
ju1, ju2 = S[:2],S[2:]

if (int(ju1) > 0 and int(ju1) <= 12) or (int(ju2) > 0 and int(ju2) <= 12):
    if int(ju1) <= 12 and int(ju2) > 12:
        print('MMYY')
    if int(ju1) > 12 and int(ju2) <= 12:
        print('YYMM')
    if int(ju1) <= 12 and int(ju1) <= 12:
        print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

first = s[:2]
second = s[2:]

if int(first) > 12:
    first_m = False
else:
    first_m = True

if int(second) > 12:
    second_m = False
else:
    second_m = True

if first == "00" and not second_m:
    print("NA")
elif second == "00" and not first_m:
    print("NA")
elif first_m and second_m:
    print("AMBIGUOUS")
elif first_m:
    print("MMYY")
elif second_m:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

first = s[:2]
second = s[2:]

if int(first) > 12:
    first_ans = False
else:
    first_ans = True

if int(second) > 12:
    second_ans = False
else:
    second_ans = True

if first == "00" or second == "00":
    print("NA")
elif first_ans and second_ans:
    print("AMBIGUOUS")
elif first_ans:
    print("MMYY")
elif second_ans:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=input()

a=int(S[:2])
b=int(S[2:])

if(1<=a<=12 and 1<=b<=12):
  print("AMBIGUOUS")
elif(1<=a<=12):
  print("mmyy")
elif(1<=b<=12):
  print("yymm")
else:
  print("na")

Submission status: Wrong Answer

Solution code:
def mmyy():
  S=input()
  
  a=int(S[:2])
  b=int(S[2:])
  
  if(1<=a<=12 and 1<=b<=12):
    print("AMBIGUOUS")
  elif(1<=a<=12):
    print("mmyy")
  elif(1<=b<=12):
    print("yymm")
  else:
    print("na")

if __name__ =="__main__":
  mmyy()

Submission status: Wrong Answer

Solution code:
def mmyy():
  S=input()
  
  former=S[:2]
  later=S[2:]
  
  if(int(former)>0 and int(former)<13):
    #前半:mm かも
    if(int(later)>0 and int(later)<13):
      print("AMBIGUOUS")
    else:
      print("MMYY")
      
  else:
    if(int(later)>0 and int(later)<13):
      print("YYMM")
    else:
      print("NA")

Submission status: Wrong Answer

Solution code:
def mmyy():
  S=input()
  
  former=S[:2]
  later=S[2:]
  
  if(int(former)>0 and int(former)<13):
    #前半:mm かも
    if(int(later)>0 and int(later)<13):
      print("AMBIGUOUS")
    else:
      print("mmyy")
      
  else:
    if(int(later)>0 and int(later)<13):
      print("yymm")
    else:
      print("NA")

if __name__ =="__main__":
  mmyy()

Submission status: Wrong Answer

Solution code:
S=input()
a,b=int(S[:2]),int(S[2:])
if 1<=a<=12 and 1<=b<=12:
    print("AMBIGUOUS")
elif 1<=a<=12 or 1<=b<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
Fa = int(S[:2])
Se = int(S[2:])
if 1 <= Fa <= 12 and 1 <= Se <= 12:
	print("AMBIGIOUS")
elif 1 <= Fa <= 12:
	print("MMYY")
elif 1 <= Se <= 12:
	print("YYMM")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import re
S = input()
ans = ''
YYMMFlag = False
MMYYFlag = False
YYMM = '[0-9][0-9]0[0-9] | [0-9][0-9]1[0-9]'
MMYY = '0[0-9][0-9][0-9] | 1[0-9][0-9][0-9]'
if re.match(YYMM, S):
    YYMMFlag = True
elif re.match(MMYY, S):
    MMYYFlag = True

if YYMMFlag and MMYYFlag:
    print("AMBIGUOUS")
elif YYMMFlag:
    print("YYMM")
elif MMYYFlag:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
first = int(S[:2])
second = int(S[2:])

def month(num):
  if first <= 12:
    return True
  else:
    return False

if month(first) and month(second):
  print('AMBIGUOUS')

elif month(first) and month(second) == False:
  print('MMYY')

elif month(first) == False and month(second):
  print('YYMM')

else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[0:2])
b = int(s[2:])

if a == 0 or b == 0:
  print("NA")

elif a <= 12 and b <= 12:
  print("AMBIGUOUS")
elif a <= 12:
  print("MMYY")
elif b <= 12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[0:2])
b = int(s[2:])

if a == 0 or b == 0:
  print("NA")

elif a <= 12 and b <= 12:
  print("AMBIGUOUS")
elif a <= 12:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
S = input()

if(int(S[:2])<=12 and int(S[2:])<=12):
    print("AMBIGUOUS")
elif(int(S[:2])<=12):
    print("MMYY")
elif(int(S[2:])<12):
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s=str(input())

s1="".join(s[:2])
s1i=int(s1)
s2="".join(s[2:])
s2i=int(s2)

if s1i <=12 and s2i <=12:
    print("AMBIGUOUS")
elif s1i >12 and s2i >12:
    print("NA")
elif s1i == 0 or s2i ==0:
    print("NA")  
elif s1i >12 and s2i <= 12:
    print("YYMM")
elif s1i <= 12 and s2i > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = input()
ff = int(S[:2])
ll = int(S[2:])
if 0<ff<=12 and 0<ll<=12:
    print("AMBIGUOUS")
elif ff == 0 or ff>12 and 0<ll<=12:
    print("YYMM")
elif 0<ff<=12 and ll>12 or ll== 0:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
ff = int(S[:2])
ll = int(S[2:])
if 0<ff<=12 and 0<ll<=12:
    print("AMBIGUOUS")
elif ff>12 and 0<ll<=12:
    print("YYMM")
elif 0<ff<=12 and ll>12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
ff = int(S[:2])
ll = int(S[3:])
if 0<ff<=12 and 0<ll<=12:
    print("AMBIGUOUS")
elif ff>12 and 0<ll<=12:
    print("YYMM")
elif 0<ff<=12 and ll>12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

ans = "NA"
if int(S[:2]) <= 12 and int(S[2:]) <= 12:
  ans = "AMBIGUOUS"
elif 1 <= int(S[:2]) <= 12 and int(S[2:]) > 12:
  ans = "MMYY"
elif int(S[:2]) > 12 and 1 <= int(S[2:]) <= 12:  
  ans = "YYMM"

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

left = int(s[:2])
right = int(s[2:])

if 0 < left <= 12 and 0 < right <= 12:
    print('AMBIGUOUS')
elif 0 < left <= 12 < right:
    print('MMYY')
elif left > 12 >= right > 0:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import sys
a=input()
b=a[0]+a[1]
c=a[2]+a[3]
if int(b)==0 or int(c)==0:
  print('NA')
  sys.exit()
else:
  pass
if int(b)>=13 and int(c)>=13:
  print('NA')
elif int(b)>=13 and int(c)<13:
  print('YYMM')
elif int(b)<13 and int(c)>=13:
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
import sys
a=input()
b=a[0]+a[1]
c=a[2]+a[3]
if int(b)==0 or int(c)==0:
  print('NA')
  sys.exit()
else:
  pass
if int(b)>=13 and int(c)>=13:
  print('NA')
elif int(b)>=13 and int(c)<13:
  print('MMYY')
elif int(b)<13 and int(c)>=13:
  print('YYMM')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if ((0 < f and f <= 12) and (b > 12 or b == 0)): print("MMYY")
elif ((0 < b and b <= 12) and (f > 12 or f == 0)): print("YYMM")
elif (f == 0 and b == 0 or (f > 12 and b > 12)): print("NA")
else: print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if ((0 < f and f <= 12) and (b > 12 or b == 0)): print("MMYY")
elif ((0 < b and b <= 12) and (f > 12 or f == 0)): print("YYMM")
if (f == 0 and b == 0 or (f > 12 and b > 12)): print("NA")
else: print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if (f == 0 or b == 0 or (f > 12 and b > 12)): print("NA")
elif ((0 < f and f <= 12) and (b > 12)): print("MMYY")
elif ((0 < b and b <= 12) and (f > 12)): print("YYMM")
else: print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if (f == 0 or b == 0): print("NA")
elif (f <= 12 and b <= 12): print("AMBIGUOUS")
elif (f > 12 and b > 12): print("NA")
elif (f > 12): print("YYMM")
elif(b > 12): print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if (f == 0 or b == 0): print("NA")
elif (f <= 12 and b <= 12): print("AMBIGUOUS")
elif (f > 12 and b > 12): print("WA")
elif (f > 12): print("YYMM")
elif(b > 12): print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if (f == 0 or b == 0): print("NA")
elif (f > 12 and b > 12): print("NA")
elif(f < 13 and b < 13): print("AMBIGUOUS")
elif (f > 12): print("YYMM")
elif (b > 12): print("MMYY")
else: print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
f, b = int(s[:2]), int(s[2:])
if (f == 0 or b == 0): print("NA")
elif (f > 12 and b > 12): print("NA")
elif (f > 12): print("YYMM")
elif (b > 12): print("MMYY")
else: print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    import os
    input = sys.stdin.readline
    
    S = input().rstrip(os.linesep)
    pre = S[:2]
    suf = S[2:]

    if (pre == "00") or (suf == "00"):
        print("NA")
        return
    
    if int(pre) <= 12 and int(pre) >= 1: # MM or YY
        if int(suf) <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else: # YY only
        if int(suf) <= 12:
            print("YYMM")
        else:
            print("NA")


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    import os
    input = sys.stdin.readline
    
    S = input().rstrip(os.linesep)
    pre = S[:2]
    suf = S[2:]

    if (pre == "00") or (suf == "00"):
        print("NA")
        return
    
    if int(pre) <= 12:
        if int(suf) <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if int(suf) <= 12:
            print("YYMM")
        else:
            print("NA")


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
def resolve():
    import sys
    input = sys.stdin.readline
    
    S = input()
    pre = S[:2]
    suf = S[2:]
    if pre == "00" or suf == "00":
        print("NA")
        return
    
    if int(pre) <= 12:
        if int(suf) <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if int(suf) <= 12:
            print("YYMM")
        else:
            print("NA")


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32


def solve(S: str):
    u = int(S[:2])
    d = int(S[2:])
    
    if u > 12 and 0 < d <= 12:
        print('YYMM')
    elif 0 < u <= 12 and d > 12:
        print('MMYY')
    elif 0 < u <= 12 and 0 < d <= 12:
        print('AMBIGUOUS')
    else:
        print('NA')
        
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = str(next(tokens))  # type: int
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=str(input())
a,b=int(s[:2]),int(s[2:])
if (a>12 and b>12) or min(a,b)==0 :
  print("NA")
elif a>12 and b<12:
  print("YYMM")
elif a<12 and b>12:
  print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s=str(input())
a,b=int(s[:2]),int(s[2:])
print(a,b)
if (a>12 and b>12) or min(a,b)==0 :
  print("NA")
elif a>12 and b<12:
  print("YYMM")
elif a<12 and b>12:
  print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
#126 b
def change(x):
    if 1<=x<=12:
        return 0
    else:
        return 1
ans=["AMBIGOUS","NA","MMYY","YYMM"]#[00,11,01,10]
s=input()
a=change(int(s[:2]))
b=change(int(s[2:]))
if a==b:
    print(ans[a])
else:
    print(ans[a+2])

Submission status: Wrong Answer

Solution code:
s=str(input())
a,b=int(s[:2]),int(s[2:])
if (a>12 and b>12) or min(a,b)==0 :
  print("NA")
elif a>12 and b<=12:
  print("YYMM")
elif a<=12 and b>12:
  print("MMYY")
else:
  print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0 or (former>12 and later>12):
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13:
  print("MMYY")
elif later<13:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0 or (former>31 and later>31):
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13 and later<32:
  print("MMYY")
elif former<32 and later<13:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0 or (former>31 and later>31):
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13 and later<32:
  print("MMYY")
elif former<32 and later<13:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0 or (former>31 and later>31):
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13 or later<32:
  print("MMYY")
elif former<32 and later<13:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()

former = int(s[:2])
later = int(s[2:])

if former==0 or later==0:
  print("NA")
elif former<13 and later<13:
  print("AMBIGUOUS")
elif former<13:
  print("MMYY")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
S = str(input())
S1 = list(S)
S2 = (10*int(S[0])+int(S[1]),10*int(S[2])+int(S[3]))
if 0 < S2[0] <= 12 and S2[1] <= 12:
    print('AMBIGUOUS')
elif 0 < S2[0] <= 12 and S2[1] > 12:
    print('MMYY')
elif S2[0] > 12 and 0 < S2[1] <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = str(input())
S1 = list(S)
S2 = (10*int(S[0])+int(S[1]),10*int(S[2])+int(S[3]))
if S2[0] <= 12 and S2[1] <= 12:
    print('AMBIGUOUS')
elif S2[0] <= 12 and S2[1] > 12:
    print('MMYY')
elif S2[0] > 12 and S2[1] <= 12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def YorM(x):                                                                                                                                                        
        #1...YorM                                                                                                                                                   
        #0...Y                                                                                                                                                      
    if((1<=x)and(x<=12)):                                                                                                                                           
        return 1                                                                                                                                                    
    else:                                                                                                                                                           
        return 0                                                                                                                                                    
                                                                                                                                                                    
def D(a,b):                                                                                                                                                         
    n1 = YorM(a)                                                                                                                                                    
    n2 = YorM(b)                                                                                                                                                    
    #print(n1, n2)                                                                                                                                                  
    if(n1==0 and n2==0):                                                                                                                                            
        print("NA")                                                                                                                                                 
    elif(n1==0 and n2==1):                                                                                                                                          
        print("YYMM")                                                                                                                                               
    elif(n1==1 and n2==0):                                                                                                                                          
        print("MMYY")                                                                                                                                               
    else:                                                                                                                                                           
        print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = int(s[0:2])
s2 = int(s[2:4])
ans = [False, False]
if s1 != 0 and 1 <= s2 <= 12:
    ans[0] = True
if s2 != 0 and 1 <= s1 <= 12:
    ans[1] = True
if ans == [False, False]:
    print("NA")
elif ans == [True, True]:
    print("AMBIGUOUS")
elif ans == [True, False]:
    print("YYMM")
elif ans == [False, True]:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
s = input()
front, back = map(int, [s[:2], s[2:]])

yymm = False
mmyy = False
if 1 <= front and front <= 12:
  mmyy = True
  if 1 <= back and back <= 12:
    yymm = True
else:
  if 1 <= back and back <= 12:
    mmyy = True
  else:
    pass
    

if yymm and mmyy:
  print('AMBIGUOUS')
elif yymm:
  print('YYMM')
elif mmyy:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if s[0:2] > '12' and s[2:4] > '12':
  print('NA')
elif s[0:2] == '00' or s[2:4] == '00':
  print('NA')
elif s[0:2] > '12' and s[2:4] <= '12':
  print('YYMM')
elif s[0:2] <= '12' and s[2:4] > '12':
  print('MMYY')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

mod = 1000000007
inf = 1 << 60

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

s = ns()
x, y = int(s[:2]), int(s[2:])

if y != 0 and x > 12 and y <= 12:
	print("YYMM")
elif x != 0 and x <= 12 and y > 12:
	print("MMYY")
elif x != 0 and y != 0 and x <= 12 and y <= 12:
	print("AMBIGUOUS")
else:
	print("NA")

Submission status: Wrong Answer

Solution code:
import sys
import math

s=input()

if (s[2]=="1" and (s[3]=="1" or s[3]=="2" or s[3]=="0")) or s[2]=="0":
	if (s[0]=="1" and (s[1]=="1" or s[1]=="2" or s[1]=="0") or s[0]=="0"):
		print("AMBIGUOUS")
		sys.exit()
	print("YYMM")
	sys.exit()

else:
	if (s[0]=="1" and (s[1]=="1" or s[1]=="2" or s[1]=="0") or s[2]=="0"):
		print("YYMM")
		sys.exit()
print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
h = s[:2]
t = s[2:]
print(h, t)
def montheable(p):
    return '00' < p < '13'
if montheable(h) and montheable(t):
    print('AMBIGUOUS')
elif montheable(h):
    print('MMYY')
elif montheable(t):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    first = int(S[0:2])
    last = int(S[2:4])

    if(first>12 and last<=12):
        print("YYMM")
    elif(last>12 and first<=12):
        print("MMYY")
    elif(last<=12 and first<=12):
        print("AMBIGUOUS")
    else:
        print("NA")
    
    return
main()

Submission status: Wrong Answer

Solution code:
S = input()
s1,s2 = int(S[0:2]),int(S[2:4])

def f(n):
  if n >= 1 and n <= 12:
    return True
  else:
    return False

if f(s1) and f(s2):
  print("AMBIGUOUS")
elif f(s1) and s2 > 12 or s2 ==0:
  print("MMYY")
elif f(s2) and s1 > 12 or s1 ==0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
s1,s2 = int(S[0:2]),int(S[2:4])

def f(s1):
  if s1 >= 1 and s1 <= 12:
    return True
  else:
    return False

if f(s1) and f(s2):
  print("AMBIGUOUS")
elif f(s1) and s2 > 12:
  print("MMYY")
elif f(s2) and s1 > 12:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
#INPUT
#S

#S は長さ 4 の数字列

#長さ 4 の数字列 S が与えられます。
#あなたは、この数字列が以下のフォーマットのどちらであるか気になっています。
#YYMM フォーマット: 西暦年の下 2 桁と、月を 2 桁で表したもの 
#                (例えば 1 月なら 01) をこの順に並べたもの
#MMYY フォーマット: 月を 2 桁で表したもの 
#                (例えば 1 月なら 01) と、西暦年の下 2 桁をこの順に並べたもの
#与えられた数字列のフォーマットとして考えられるものが
#YYMM フォーマットのみである場合 YYMM を、 
#MMYY フォーマットのみである場合 MMYY を、 
#YYMM フォーマット と MMYY フォーマットのどちらの可能性もある場合
#AMBIGUOUS を、 
#どちらの可能性もない場合 NA を出力してください。

#YYMM, MMYY, AMBIGUOUS, NA のうち正しいものを出力せよ。

def isMonth(x):
    num = int(x)
    return (1 <= num and num <= 12)

def isYear(x):
    num = int(x)
    return (0 <= num and num <= 99)

def isYYMM(head, tail):
    return (isYear(head) and isMonth(tail))

def isMMYY(head, tail):
    return (isMonth(head) and isYear(tail))

S = input()
head = S[0:2]
tail = S[2:4]

if (isYYMM(head, tail) and isMMYY(head, tail)):
    res = 'AMBIGOUS'
elif isYYMM(head, tail):
    res = 'YYMM'
elif isMMYY(head, tail):
    res = 'MMYY'
else:
    res = 'NA'

print(res)

Submission status: Wrong Answer

Solution code:
s=list(input())
fst=int(s[0])*10+int(s[1])
scd=int(s[2])*10+int(s[3])
if fst==0 or scd==0:
	print("NA")
elif fst>12 and scd>12:
	print("NA")
elif fst>12 and scd<=12:
	print("YYMM")
elif fst<=12 and scd>12:
	print("MMYY")
else:
	print("AMBIGOUS")

Submission status: Wrong Answer

Solution code:
s=list(input())
fst=int(s[0])*10+int(s[1])
scd=int(s[2])*10+int(s[3])
if fst>12 and scd>12:
	print("NA")
elif fst>12 and scd<=12:
	print("YYMM")
elif fst<=12 and scd>12:
	print("MMYY")
else:
	print("AMBIGOUS")

Submission status: Wrong Answer

Solution code:

s = list(input())
a = int(s[0] + s[1])
b = int(s[2] + s[3])

if (a == 0 or 13 <= a <= 99) and (b !=0 or 13 <= b <= 99):
    print("YYMM")
elif (1 <= a <= 12) and (b == 0 or 13 <= b <=99):
    print("MMYY")
elif 1 <= a <= 12 and 1 <= b <= 12:
    print("AMBIGUOUS")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

def is_month(n):
    return 1 <= n <= 12
def is_year(n):
    return 13 <= n

def main():
    s = input()
    s1 = int(s[:2])
    s2 = int(s[2:])

    if is_month(s1) and is_month(s2):
        print('AMBIGUOUS')
    elif is_month(s1) and is_year(s2):
        print('MMYY')
    elif is_year(s1) and is_month(s2):
        print('YYMM')
    elif is_year(s1) and is_year(s2):
        print('NA')
    else:
        print('NA')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[0]+s[1])
b = int(s[2]+s[3])
if (a == 0 or b == 0 or (a > 12 and b > 12)):
   print('NA')
elif (a > 12):
   print('YYMM')
elif (b > 12):
   print('MMYY')
else:
   print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s = input()

a = int(s[0]+s[1])
b = int(s[2]+s[3])
if (a == 0 or b == 0 or (a > 12 and b > 12)):
   print('NA')
elif (a > 12 and b <= 12):
   print('YYMM')
elif (a <= 12 and b > 12):
   print('MMYY')
else:
   print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    mm1 = False
    mm2 = False

    if 0 < int(s[:2]) < 13:
        mm1 = True
    if 0 < int(s[-2:]) < 13:
        mm2 = True
    
    if mm1 == True and mm2 == True:
        print("AMBIGUOUS")
        return 
    if mm1 == False and mm2 == False:
        print("NA")
        return
    if mm1 == True and mm2 == False:
        print("MMYY")
        return
    if mm1 == True and mm2 == True:
        print("YYMM")
        return
    print("NA")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s = input()
if 0<int(s[0:2])<=12 and 0<int(s[2:4])<=12:
    print('AMBIGUOUS')
elif 0<int(s[0:2])<=99 and 0<int(s[2:4])<=12:
    print('YYMM')
elif 0<int(s[0:2])<=12 and 0<int(s[2:4])<=99:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
if 0<int(s[0:2])<=12 and 0<int(s[2:4])<=12:
    print('AMBIGUOUS')
elif 0<int(s[0:2])<=12 and 0<int(s[2:4])<=99:
    print('MMYY')
elif 0<int(s[2:4])<=12 and 0<int(s[0:2])<=99:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:


S = input()

try:
    first = int(S[:2])
except ValueError:
    first = -1

try:
    end = int(S[2:])
except ValueError:
    end = -1

def judgeYM(num):
    if num >= 1 and num <= 12:
        return "M"
    elif num >= 0 and num <=99:
        return "Y"
    else:
        return "N"

fj = judgeYM(first)
ej = judgeYM(end)

if fj == "N" or ej == "N":
    print("NA")
elif fj == "M" and ej == "M":
    print("AMBIGUOUS")
elif fj == "M":
    print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
ans=""
if s1>12 or s1<=0:
	if s2>12 or s2<=0:
		ans="NA"
	else:
		ans="YYMM"
else:
	if s2>12:
		ans="MMYY"
	else:
		ans="AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
ans=""
if s1>12 or s1==0:
	if s2>12 or s2==0:
		ans="NA"
	else:
		ans="YYMM"
else:
	if s2>12:
		ans="MMYY"
	else:
		ans="AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
ans=""
if s1>12:
	if s2>12 or s2==0:
		ans="NA"
	else:
		ans="YYMM"
elif s1==0:
		ans="NA"
else:
	if s2>12:
		ans="MMYY"
	else:
		ans="AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
s1=int(s[0]+s[1])
s2=int(s[2]+s[3])
ans=""
if s1>12:
	if s2>12:
		ans="NA"
	else:
		ans="YYMM"
else:
	if s2>12:
		ans="MMYY"
	else:
		ans="AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
f = int(S[:2])
s = int(S[2:])

if 1 <= f <= 12 and 1 <= s <= 12:
    print("AMBIGUOUS")
elif 1 <= f <= 12:
    print("YYMM")
elif 1 <= s <= 12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
#input
S = str(input())

#output
S1 = int(S[:2])
S2 = int(S[2:])

if S1 == 0 and S2 > 12:
    print("NA")
elif S1 ==0 and 0 < S2 <= 12:
    print("YYMM")
elif S1 == 0 and S2 == 0:
    print("NA")
elif S2 == 0 and S1 > 12:
    print("NA")
elif S2 == 0 and 0 < S1 <= 12:
    print("MMYY")
elif 0 < S1 <= 12 and 0 < S2 <= 12:
    print("AMBIGUOUS")
elif S1 > 12 and 0 < S2 <= 12:
    print("YYMM")
elif 0 < S1 <= 12 and S2 > 12:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
#input
S = str(input())

#output
S1 = int(S[:2])
S2 = int(S[2:])

if S1*S2 == 0:
    print("NA")
elif 0 < S1 <= 12 and 0 < S2 <= 12:
    print("AMBIGUOUS")
elif S1 > 12 and 0 < S2 <= 12:
    print("YYMM")
elif 0 < S1 <= 12 and S2 > 12:
    print("MMYY")