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:
def isyy(yy):
    yy = int(yy)
    if yy == 0:
        return False
    else:
        return True


def ismm(mm):
    mm = int(mm)
    if mm == 0 or mm > 12:
        return False
    else:
        return True


if __name__ == '__main__':
    S = input()
    s01 = S[0:2]
    s23 = S[2:4]

    yymm = isyy(s01) and ismm(s23)
    mmyy = isyy(s23) and ismm(s01)

    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()
x=int(s[0]+s[1])
y=int(s[2]+s[3])
if(x==0 or y==0):
    if(y<=12 and x<=12):
        if(x==0):
            print("YYMM")
        else:
            print("MMYY")
    else:
        print('NA')
else:
    if(x<=12 and y<=12):
        print("AMBIGUOUS")
    elif(x>=12 and y<=12):
        print("YYMM")
    elif(x<=12 and y>12):
        print("MMYY")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
S01 = int(S[0] + S[1])
S23 = int(S[2] + S[3])
if 0 < S01 < 13 and 0 < S23 < 13:
        print("AMBIGUOUS")
elif 0 < S01 < 13 and (S23 > 14 or S23 == 0):
        print("MMYY")
elif (S01 > 14 or S01 == 0) and 0 < S23 < 13:
        print("YYMM")
else:
        print("NA")

Submission status: Wrong Answer

Solution code:
l = list(input())

ab = l[0] + l[1]
cd = l[2] + l[3]

if ab[0] == "0":
    ab = ab[1]
if cd[0] == "0":
    cd = cd[1]

ab = int(ab)
cd = int(cd)
if ab < 13 and cd < 13 and ab != 0 and cd != 0:
    print("AMBIGUOUS")
elif ab >= 13 and cd < 13 and ab != 0 and cd != 0:
    print("YYMM")
elif cd >= 13 and ab < 13 and ab != 0 and cd != 0:
    print("MMYY")
elif ab == 0 or cd == 0:
    print("NA")
elif ab >= 13 and cd >= 13:
    print("NA")

Submission status: Wrong Answer

Solution code:
import sys

stdin = sys.stdin

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


s = ns()
s1 = int(s[:2])
s2 = int(s[2:])

if s1 == 0 and s2 > 12:
    ans = "NA"
elif s1 > 12 and s2 == 0:
    ans = "NA"
elif s1 > 12 and s2 > 12:
    ans = "NA"
elif s1 > 12:
    ans = "YYMM"
elif s2 > 12:
    ans = "MMYY"
else:
    ans = "AMBIGUOUS"

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

f = int(S[0]+S[1])
s = int(S[2]+S[3])

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

Submission status: Wrong Answer

Solution code:
import numpy as np
S = str(input()) #strでまず受けた方が楽
forward = S[:2]
back	= S[2:]

def str2int(str_):
  if str_[0] == "0":
    return int(str_[1])
  else:
    return int(str_)

# flagを作って、それで答えますかね
count = np.zeros((2)) # 0 : YYMM 1:MMYY
# 一発退場の00系
if (forward=="00") or (back=="00") :
  print("NA")
else:
  ## 西暦はなんでもオッケーなので、あとはMMに両方なれるかどうか
  ## 1以上も確定なので、12以下かだけでよい
  if str2int(forward) <= 12:
    count[0] += 1
  if str2int(back) <= 12:
    count[1] += 1 
  ## あとは条件分岐
  if np.sum(count) == 2:
    print("AMBIGUOUS")
  elif np.sum(count) == 1 and count[0] == 1:
    print("MMYY")
  elif np.sum(count) == 1 and count[1] == 1:
    print("YYMM")
  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 int(s[0:2]) > 12 and int(s[2:4]) > 12 or int(s[0:2]) == 0 or int(s[2:4]) == 0:
    print('NA')
elif 0 < int(s[0:2]) <= 12 and int(s[2:4]) > 12:
    print('MMYY')
else:
    print('YYMM')

Submission status: Wrong Answer

Solution code:
#B問題
S =input()
if "00" < S[0:2] <="12" and "13" <= S[2:4] <= "99":
    print("MMYY")
elif "13" <= S[0:2] <= "99" and "00" <S[2:4] <= "12":
    print("YYMM")
elif "00" < S[0:2] <= "12" and "00" < S[2:4] <= "12":
    print("AMBIGUOUS")
elif "00" == S[0:2] and "00" < S[2:4] <= "12":
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

ans=''
if bef>12 and 0<aft<32:
  ans='YYMM'
elif aft>31 and 0<bef<13:
  ans='MMYY'
elif 0<aft<13 and 0<bef<13:
  ans='AMBIGUOUS'
else:
  ans='NA'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
u = int(s[0] + s[1])
l = int(s[2] + s[3])

if l == 0 or u == 0:
    print('NA')

elif 0 < l and l < 13:

    if 0 < u and u < 13:
        print('AMBIGUOUS')
    else:
        print("YYMM")


elif 0 < u and u < 13:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
S = int(input())
#print(S)

YYMM_flag = 0
MMYY_flag = 0

former = int((S / 1000)) * 10 + int((S / 100))
S = S % 100
latter = S

if(1 <= former and former <= 12):
    if(latter > 0):
        MMYY_flag = 1

if(1 <= latter and latter <= 12):
    if(former > 0):
        YYMM_flag = 1

if(YYMM_flag == 1):
    if(MMYY_flag == 1):
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if(MMYY_flag == 1):
        print('MMYY')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:
#B
# S = input()
S = "1700"
str_1 = int(S[:2])
str_2 = int(S[2:])

def judge_month(i):
    if i >= 1 and i <= 12:
        judge = True
    else:
        judge = False
    return judge
judge_1 = judge_month(str_1)
judge_2 = judge_month(str_2)
if judge_1 and judge_2:
    print("AMBIGUOUS")
elif judge_1:
    print("MMYY")
elif judge_2:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
v = input()
h = int(v[0:2])
t = int(v[2:4])
if h > 12:
    if t > 12:
        print('NA')
    elif t == 0:
        print('NA')
    else:
        print('YYMM')
else:
    if t > 12:
        if h == 0:
            print('NA')
        else:
            print('MMYY')
    else:
        if h == 0 and t == 0:
            print('NAt')
        elif h > 0:
            print('MMYY')
        elif t > 0:
            print('YYMM')
        else:
            print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S=int(input())
head=int(S/100)
tail=S-head*100
head_can_month = head<=12 and head>=1
tail_can_month = tail<=12 and tail>=1
if head_can_month:
    if tail_can_month:
        print("AMNIGUOUS")
    else:
        print("MMYY")
else:
    if tail_can_month:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def can_be_month(n):
    if 0 < int(n) < 13:
        return True
    return False


S = input()

if can_be_month(S[:2]) or can_be_month(S[2:]) is False:
    print('NA')
elif can_be_month(S[:2]) and can_be_month(S[2:]):
    print('AMBIGUOUS')
elif can_be_month(S[:2]):
    print('MMYY')
elif can_be_month(S[2:]):
    print('YYMM')

Submission status: Wrong Answer

Solution code:
#coding:utf-8

S = input()
count = 0
li = [(i+j) for (i,j) in zip(S[::2],S[1::2])]


if 1 <= int(li[0]) <= 12:
    count += 1
else:
    pass

if 1 <= int(li[1]) <= 12:
    count += 1
else:
    pass

if count == 2:
    print("AMBIGUOUS")
elif count == 1:
    print("YYMM")
elif count == 0:
    print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
s=[int(i) for i in s]
s=[s[0]*10+s[1],s[2]*10+s[3]]
if (s[0]==0 and s[1]==0) or (s[0]!=0 and s[1]==0) or (s[0]>12 and s[1]==0):
  print("NA")
elif (s[0]<=12 and s[0]!=0) and (s[1]<=12 and s[1]!=0):
  print("AMBIGUOUS")
elif (s[0]<=12 and s[0]!=0):
  print("MMYY")
elif (s[1]<=12 and s[1]!=0):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
f = "YYMM"
s = "MMYY"


s = input()

mm = int(s[:2])
yy = int(s[2:])

#print(mm, yy)

if mm > 0 and mm < 13:
    if yy > 0 and yy < 13:
        print("AMBIGUOUS")
    else:
        print(s)

elif yy > 0 and yy < 13:
    print(f)

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
a,b = int(s[0]+s[1]), int(s[2]+s[3])
def isY(a):
    if a > 0 and a < 100:
        return True
    return False
def isM(a):
    if a > 0 and a < 13:
        return True
    return False
c,d = isY(a) and isM(b), isM(a) and isY(b)
if c and d:
    print("AMBIGUOUS")
elif c:
    print("YYMM")
elif d:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=str(input())
F=S[0:2]
R=S[2:4]
if(int(F)<=12 and F!="00"):
  if(int(R)<=12 and F!="00"):
    print("ANBIGUOUS")
  else:
    print("MMYY")
elif(F=="00" and R=="00"):
  print("NA")
else:
  print("YYMM")

Submission status: Wrong Answer

Solution code:
s =input()
ym=0
my=0
print(s[0:2])
print(s[2:4])
if 0<int(s[0:2]):
    ym=1
    if int(s[0:2])<=12:
        my=1
if 0<int(s[2:4]):
    my+=1
    if int(s[2:4])<=12:
        ym+=1
        
if ym==2 and my==2:
    print("AMBIGUOUS")    
elif ym==2:
    print("YYMM")
elif my ==2:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S01 = int(S[0] + S[1])
S23 = int(S[2] + S[3])
if 1 < S01 < 13 and 1 < S23 < 13:
        print("AMBIGUOUS")
elif 1 < S01 < 13 and (S23 > 14 or S23 == 0):
        print("MMYY")
elif (S01 > 14 or S01 == 0) and 1 < S23 < 13:
        print("YYMM")
else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S=input()
A=int(S[:2])
B=int(S[2:])
YM=MY=False
if 0<A and 0<B<=12:
    YM=True
if 0<A<=12 and 0<B:
    MY=True

if MY and YM: print("AMBIGUOUS")
elif MY: print("MMYY")
elif YM: print("YYMM")
else: print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
A = int(S[:2])
B = int(S[2:])

def YorM(i):
  if 1 <= i and i <= 12:
    return "b"
  elif 12 < i:
    return "y"
  else:
    return "n"
  
isA = YorM(A)
isB = YorM(B)

if isA == "n" or isB == "n":
  print("NA")
elif isA == "b" and isB == "b":
  print("AMBIGUOUS")
elif isA == "y" and isB == "y":
    print("NA")
elif isA == "y":
  print("YYMM")
else:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = input()

s1 = int(S[:2])
s2 = int(S[2:])

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

Submission status: Wrong Answer

Solution code:
s = str(input())
if s[0] == "0" and s[1] == "0" and int(s[2]+s[3]) > 12:
    print("NA")
elif s[2] == "0" and s[3] == "0" and int(s[0]+s[1]) > 12:
    print("NA")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) > 12:
    print("NA")
elif s[0] == "0" and s[1] == "0":
    print("YYMM")
elif s[2] == "0" and s[3] == "0":
    print("MMYY")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) <= 12:
    print("YYMM")
elif int(s[2]+s[3]) > 12 and int(s[0]+s[1]) <= 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def check(S) :
    mae = int(S[:2])
    ato = int(S[2:])
    if mae == 0 :
        return "NA"
    if ato == 0 :
        return "NA"
    if mae < 13 and ato < 13 :
        return "AMBIGUOUS"
    if mae < 13 and ato >12 :
        return "MMYY"
    if mae > 12 and ato < 12 :
        return "YYMM"

S = input()
print(check(S))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

Solution code:
S = input()

if (S[0] == '0' and S[1] == '0') or (S[2] == '0' and S[3] == '0'):
    print("NA")
elif S[0] == '0' or (S[0] == '1' and (int(S[1]) <= 2)):
    if S[2] == '0' or (S[2] == '1' and (int(S[3]) <= 2)):
        print("AMBIGUOUS")
    else:
        print(int(S[3]))
        print("MMYY")
else:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
S = int(input())
YY = S // 100
MM = S % 100

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a > 0 and a < 13 and a > 0 and a < 13:
    print("AMBIGUOUS")
elif a > 0 and a < 13:
    print("MMYY")
elif b > 0 and b < 13:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n = input()

a = n[0:2]
b = n[2:4]

a = int(a)
b = int(b)

if 0 < a <= 12 and 0 < b <= 12:
    print("AMBIGUOUS")

elif 0 < a <= 12 and b > 12:
    print("MMYY")

elif 0 < b <= 12 and a > 12:
    print("YYMM")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())

before = S % 100
after = S //100

if after == 0 or before == 0:
  print("NA")
elif after >31 or before > 31:
  print("NA")
elif before <= 12 and after <= 12:
  print("AMBIGUOUS")
elif before <= 12 and after > 12 and after <= 31:
  print("YYMM")
elif before > 12 and before <= 31 and after <= 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
m2 = int(s[0] + s[1])
u2 = int(s[2] + s[3])

YM = False
MY = False

if m2 < 13:
  MY = True
if u2 < 13:
  YM = True
if m2 == 0 or u2 == 0:
  YM = False
  MY = False
  
if YM == False and MY == True:
  print('MMYY')
elif MY == False and YM == True:
  print('YYMM')
elif YM == MY == False:
  print('NA')
else:
  print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = raw_input().strip()
a, b = S[0:2], S[2:]

if a == '00' or b == '00':
    print('NA')
    exit()

ia = int(a)
ib = int(b)

if ia >= 1 and ia <= 12 and ib >=1 and ib <= 12:
    print('AMBIGUOUS')


elif ia >= 1 and ia <= 12 and ib > 12:
    print('MMYY')

elif ia > 12 and ib <= 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<=12 and b<=12 and a>0 and b>0:
  print('AMBIGOUS')
elif a<=12 and b >= 0 and a > 0:
  print("MMYY")
  
elif b<=12 and b > 0 and a >= 0:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
input_int = lambda:int(input())
input_ints = lambda:map(int,input().split())
input_ints_list = lambda:list(input_ints())
input_str = lambda:input()
input_strs = lambda:input().split()
input_lines = lambda n,input_func:[input_func() for _ in range(n)]

import importlib
import_module = lambda module_name:importlib.import_module(module_name)

init_array_1dim = lambda value,n:[value]*n # 1次元配列を生成
init_array_2dim = lambda value,n,m:[init_array_1dim(value,n) for _ in range(m)] # 2次元配列を生成

gcd_base = lambda value1,value2:import_module('fractions').gcd(value1,value2) # 最大公約数（2値)
gcd = lambda lst:import_module('functools').reduce(gcd_base,lst) # 最大公約数（リスト）
lcm_base = lambda value1,value2:(value1*value2)//gcd_base(value1,value2) # 最小公倍数(2値)
lcm = lambda lst:import_module('functools').reduce(lcm_base,lst,1) # 最小公倍数(リスト)

permutations = lambda lst,n:import_module('itertools').permutations(lst,n) # 順列
combinations = lambda lst,n:import_module('itertools').combinations(lst,n) # 組み合わせ
product = lambda lst1,lst2:import_module('itertools').product(lst1,lst2) # 二つのリストの直積

round = lambda value:round(value) # 四捨五入
ceil = lambda value:import_module('math').ceil(value) # 切り上げ
floor = lambda value:import_module('math').floor(value) # 切り捨て

# キュー
init_q = lambda lst: import_module('collections').deque(lst)
q_pop = lambda q: q.popleft() # 先頭から取り出し
q_push = lambda q,value:q.appendleft(value) # 先頭に追加（値）
q_pushlist = lambda q,lst:q.extendleft(lst) # 先頭に追加（リスト）
q_append = lambda q,value:q.append(value) # 末尾に追加（値）
q_appendlist = lambda q,lst:q.extend(lst) # 末尾に追加（リスト）

# プライオリティキュー
init_heap = lambda a:import_module('heapq').heapify(a)
heap_push = lambda a,v:import_module('heapq').heappush(a,v)
heap_pop = lambda a:import_module('heapq').heappop(a) # 最小値を取り出す

def solution():
    # ここに実装
    S = input_str()

    month_1 = False
    if '01'<=S[:2]<='12':month_1 = True
    month_2 = False
    if '01'<=S[2:]<='12':month_2 = True
    
    if S[:2] == '00' or S[2:] == '00':
        print('NA')
        return

    if month_1 and month_2:
        print('AMBIGUOUS')
        return
    if month_1:
        print('MMYY')
        return
    if month_2:
        print('YYMM')
        return
    print('NA')

if __name__ == '__main__':
    solution()

Submission status: Wrong Answer

Solution code:
S = input()

f = int(S[0]+S[1])
s = int(S[2]+S[3])

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

Submission status: Wrong Answer

Solution code:
S = input()

a = S[:2]
b = S[2:]

print(a,int(b))

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

Submission status: Wrong Answer

Solution code:
S = map(int, list(raw_input()))

large_num = S[0]*10 + S[1]
min_num = S[2]*10 + S[3]

if large_num <= 0 and min_num <= 0: print 'NA'
elif large_num <= 0 and min_num > 12: print 'NA'
elif min_num <= 0 and large_num > 12: print 'NA'
elif large_num <= 12 and min_num <= 12: print 'AMBIGUOUS'
elif large_num <= 12: print 'MMYY'
elif min_num <= 12: print 'YYMM'
else: print 'NA'

Submission status: Wrong Answer

Solution code:
S = input()


mae = int(S[0:2])
ato = int(S[2:4])

if mae >= 0 and mae <=12 and ato >= 0 and ato <= 12:
    print("AMBIGUOUS")
elif mae >= 0 and ato >= 1 and ato <=12:
    print("YYMM")
elif mae >= 1 and mae <=12  and ato >= 0:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

ue = int(s[0]+s[1])
sita = int(s[2]+s[3])

if ue == 0 and sita == 0:
    print('NA')
elif ue == 0 and sita > 0 and sita <= 12:
    print('YYMM')
elif sita == 0 and ue > 0 and ue <= 12:
    print('MMYY')
elif sita > 0 and sita <= 12 and ue > 0 and ue <= 12:
    print('AMBIGUOUS')
elif sita > 0 and sita <= 12 and ue > 12:
    print('YYMM')
elif ue > 0 and ue <= 12 and sita > 12:
    print('MMYY')
elif ue > 12 and sita > 12:
    print('NA')

Submission status: Wrong Answer

Solution code:
a = list(input())
for i in range(len(a)):
    a[i] = int(a[i])
ue = a[0]*10 + a[1]
sita = a[2]*10 + a[3]
if (ue >= 12) & (sita >= 12):
    print('NA')
elif (ue <= 12) & (sita <= 12):
    print('AMBIGUOUS')
elif ue >= 12:
    if sita <= 12:
        print('YYMM')
    else:
        print('MMYY')

Submission status: Wrong Answer

Solution code:
s=list(input())
s=[int(i) for i in s]
s=[s[0]*10+s[1],s[2]*10+s[3]]
if (s[0]==0 and s[1]==0) or (s[0]!=0 and s[1]==0) or (s[0]>12 and s[1]==0):
  print("NA")
if (s[0]<=12 and s[0]!=0) and (s[1]<=12 and s[1]!=0):
  print("AMBIGUOUS")
elif (s[0]<=12 and s[0]!=0):
  print("MMYY")
elif (s[1]<=12 and s[1]!=0):
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
l = s[0:2]
r = s[2:]
a = int(l)
b = int(r)
if 0 == a and 0 != b and b <13:
    print('YYMM')
elif 0 != a and a<13 and b ==0:
    print('MMYY')
elif a<13 and b <13:
    print('AMBIGUOUS')
elif a<13 and b>12:
    print('MMYY')
elif a>12 and b <13:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import numpy as np

#v = [int(d) for d in input().split()]
v= list(str(input()))


li = list(np.array_split(v,2))

mae = int(''.join(li[0]))
usiro = int(''.join(li[1]))

ma = 0
usi = 0

if int(usiro) >= 1:
    if int(usiro) <= 12:
        usi = 1
    else:
        usi = 2
else:
    print('NA')
    exit()
if int(mae) >= 1:
    if int(mae) <= 12:
        ma = 1
    else:
        ma = 2
else:
    print('NA')
    exit()
if usi == 0:
    print('NA')
    exit()
if ma == 0:
    print('NA')
    exit()
if usi ==1 & ma ==1:
    print('AMBIGUOUS')
if usi == 1 & ma == 2:
    print('YYMM')
if usi == 2 & ma == 1:
    print('MMYY')
if usi == 2 & ma == 2:
    print('NA')

Submission status: Wrong Answer

Solution code:
S=input()
A=int(S[:2])
B=int(S[2:])
YM=MY=False
if 0<A and 0<B<=12:
    YM=True
elif 0<A<=12 and 0<B:
    MY=True

if MY and YM: print("AMBIGUOUS")
elif MY: print("MMYY")
elif YM: print("YYMM")
else: print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
S1 = int("".join(S[0:2]))
S2 = int("".join(S[2:4]))

if (12 >= S1 and S1 >= 1) and (12 >= S2 and S2 >= 1):
  print('AMBIGUOUS')
elif (12 >= S1 and S1 >= 1) :
  print('MMYY')
elif (12 >= S2 and S2 >= 2) :
  print('YYMM')
else :
  print('NA')

Submission status: Wrong Answer

Solution code:
is_error = False


def isYear(s):
    try:
        s_int = int(s)
        if s_int == 0:
            return False
        else:
            return True
    except ValueError:
        is_error = True
        return False


def isMonth(s):
    try:
        s_int = int(s)
        if s_int == 0 or s_int > 12:
            return False
        else:
            return True
    except ValueError:
        is_error = True
        return False


if __name__ == '__main__':
    s = input()
    # MMは01-12 YY 01-99
    yy_1 = isYear(s[0:2])
    mm_1 = isMonth(s[0:2])
    yy_2 = isYear(s[2:4])
    mm_2 = isMonth(s[2:4])
    yymm = yy_1 and mm_2
    mmyy = mm_1 and yy_2

    if yymm and mmyy:
        print("AMBIGUOUS")
    elif yymm and not is_error:
        print("YYMM")
    elif mmyy and not is_error:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
a = int(S / 100)
b = S - a*100
if a <=12 and b <= 12 and a > 0 and b > 0:
    print("AMBIGUOUS")
elif a <= 12 and b >12 and a > 0:
    print("MMYY")
elif b<= 12 and a > 12 and b > 0:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

mae = int(S[:2])
ato = int(S[2:])

if mae <= 12 and ato <= 12:
    print("AMBIGUOUS")
elif mae > 12 and ato <= 12 and ato == "00":
    print("YYMM")
elif mae <= 12 and ato > 12 and mae == "00":
    print("MMYY")
else: 
    print("NA")

Submission status: Wrong Answer

Solution code:
def main():
	s = input()
	aa = int(s[:2])
	bb = int(s[2:])
	ans = ""
	if (aa <= 12) and (aa > 0):
		if (bb <= 12) and (bb > 0):
			ans = "AMBIGUOUS"
		else:
			ans = "MMYY"
	else:
		if (bb <= 12) or (bb > 0):
			ans = "YYMM"
		else:
			ans = "NA"
	print(ans)

main()

Submission status: Wrong Answer

Solution code:
s = input()

first = int(s[:2])
second = int(s[2:])

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

Submission status: Wrong Answer

Solution code:


s = input()
yy, mm = s[:2], s[2:]
yy = int(yy)
mm = int(mm)

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

Submission status: Wrong Answer

Solution code:
s=input()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = int(input())

before = S % 100
after = S //100

if after == 0 or before == 0:
  print("NA")
elif after >=31 or before >= 31:
  print("NA")
elif before <= 12 and after <= 12:
  print("AMBIGUOUS")
elif before <= 12 and after > 12 and after <= 31:
  print("YYMM")
elif before > 12 and before <= 31 and after <= 12:
  print("MMYY")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0]+S[1])
b = int(S[2]+S[3])
isyymm = 0
ismmyy = 0
if a>0 and b>0 and a<=19 and b<=19:
    if a<=12:
        ismmyy = 1
    if b<=12:
        isyymm = 1

ans = ['NA','YYMM','MMYY','AMBIGUOUS']
print(ans[isyymm+ismmyy*2])

Submission status: Wrong Answer

Solution code:
s = str(input())
if s[0] == "0" and s[1] == "0" and int(s[2]+s[3]) > 12:
    print("NA")
elif s[2] == "0" and s[3] == "0" and int(s[0]+s[1]) > 12:
    print("NA")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) > 12:
    print("NA")
elif s[0] == "0" and s[1] == "0":
    print("YYMM")
elif s[2] == "0" and s[3] == "0":
    print("MMYY")
elif int(s[0]+s[1]) > 12 and int(s[2]+s[3]) < 12:
    print("YYMM")
elif int(s[2]+s[3]) > 12 and int(s[0]+s[1]) < 12:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S = input()
f = int(S[:2])
l = int(S[3:5])

if (1 <= f <= 12 and (l > 12 or l == 0)):
    print('MMYY')
elif ((f > 12 or f == 0) and 1 <= l <= 12):
    print('YYMM')
elif ((f > 12 and l > 12) or (l == 0 and f == 0)):
    print('NA')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
import sys
from fractions import gcd
from functools import reduce
from itertools import combinations

import numpy as np

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def is_MM(s):
    num = int(s)
    return 0 < num <= 12


def is_YY(s):
    num = int(s)
    return 0 < num


def solve():
    N = ii(str)
    ans_pattern = ["NA", "YYMM", "MMYY", "AMBIGUOUS"]
    ans = 0
    pre = N[:2]
    post = N[2:]
    if is_YY(pre) and is_MM(post):
        ans += 1
    if is_YY(post) and is_MM(pre):
        ans += 2
    return ans_pattern[ans]


if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
S = input()

s = list(S)
num = []
for k in s:
    num.append(int(k))

num1 = 10*num[0] + num[1]

num2 = 10*num[2] + num[3]

ans1 = False
ans2 = False
if num1 < 13 and num1 >0:
    ans1 = True

if num2 < 13 and num2 >0:
    ans2 = True

if ans1 and ans2:
    print("AMBIGUROUS")
elif ans1 and not ans2:
    print("MMYY")
elif not ans1 and ans2:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(input())

p = S[0]+S[1]
q = S[2]+S[3]

p_flag = 0
q_flag = 0

if int(p) == 0 or int(q) == 0:
    print('NA')
else:
    if int(p) > 12:
        p_flag = 1
    if int(q) > 12:
        q_flag = 1

    if p_flag and q_flag:
        print('NA')
    elif p_flag:
        print('YYMM')
    elif q_flag:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[0:2])
b = int(S[3:5])

def YY(a):
    if 0 < a < 100:
        return True
    else: return False

def MM(a):
    if 0 < a <13:
        return True
    else:
        return False

if MM(a) and YY(b):
    if YY(a) and MM(b):
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif YY(a) and MM(b):
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:4]
res = ("1" if int(s[0:2]) <= 12 and int(s[0:2]) >= 0 else "0") + \
    ("1" if int(s[2:4]) <= 12 and int(s[2:4]) >= 0 else "0")

if(res == "11"):
    print("AMBIGUOUS")
elif(res == "10"):
    print("MMYY")
elif(res == "01"):
    print("YYMM")
elif(res == "00"):
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())

if S>1200 and S%100>12 or S<100 or S%100==0:
    print('NA')
elif S>1200 and S%100<=12:
    print('YYMM')
elif S<1300 and S%100>12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
s=input()
strdata=list(s)
data=list(map(int,strdata))
FF=10*data[0]+data[1]
LL=10*data[2]+data[3]
if 12<FF and LL<13 and 0<LL:
    print("YYMM")
elif 12<LL and FF<13 and 0<FF:
    print("MMYY")
elif FF<13 and LL<13 and 0<FF and 0<LL:
    print("AMBIGUOUS")
else:
    print("NA")