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 Check_Year(year):
    if str(year).isdecimal() :
        return 1
    else:
        return 0

def Check_Month(month):
    if 0 < month < 12:
        return 1
    else:
        return 0

input_data = list(input())
head_chrs = int(input_data[0] + input_data[1])
tail_chrs = int(input_data[2] + input_data[3])

# print(input_data)

# check for YYMM format
result1 = Check_Year(head_chrs) + Check_Month(tail_chrs)
# print('result1: ' , result1)
# Check for MMYY format
result2 = Check_Year(tail_chrs) + Check_Month(head_chrs)
# print('result2: ' , result2)

if result1 == 2 and result2 == 2 :
    print('AMBIGUOUS')
elif result1 == 2 and result2 != 2 :
    print('YYMM')
elif result1 != 2 and result2 == 2 :
    print('MMYY')
else :
    print('NA')

Submission status: Wrong Answer

Solution code:
def Check_Year(year):
    if str(year).isdecimal() :
        return 1
    else:
        return 0

def Check_Month(month):
    if 0 < month < 12:
        return 1
    else:
        return 0

input_data = list(input())
head_chrs = int(input_data[0] + input_data[1])
tail_chrs = int(input_data[2] + input_data[3])

print(input_data)

# check for YYMM format
result1 = Check_Year(head_chrs) + Check_Month(tail_chrs)
print('result1: ' , result1)
# Check for MMYY format
result2 = Check_Year(tail_chrs) + Check_Month(head_chrs)
print('result2: ' , result2)

if result1 == 2 and result2 == 2 :
    print('AMBIGUOUS')
elif result1 == 2 and result2 != 2 :
    print('YYMM')
elif result1 != 2 and result2 == 2 :
    print('MMYY')
else :
    print('NA')

Submission status: Wrong Answer

Solution code:
s=input()
f=int(s[:2])
b=int(s[3:])
if 0<f<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 0<b<13:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
a=input()
if 1<=int(a[2:4])<=12:
    if 12>=int(a[:2])>=1:
        print("AMBIGUOUS")
    elif 99>=int(a[:2])>=13:
        print("YYMM")
    else:
        print("YYMM")
elif int(a[:2])<=12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
def month(a):
  if 1<=a<=12:
    return 1
  else:
    return 0
  
def year(b):
  if b == 0:
    return 1
  else:
    return 0
  
S = input()
pre, post = int(S[:2]), int(S[2:])
ans = [month(pre) * year(post), month(post) * year(pre)]
if ans[0] ==1 & ans[1] == 1:
  print("AMBIGUOUS")
elif ans[0] == 1 & ans[1] == 0:
  print("MMYY")
elif ans[1] == 0 & ans[0] == 1:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 & 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=int(input());print(['NA','MMYY','YYMM','AMBIGUOUS'][(s<1300)-(0<s%100<13)*2])

Submission status: Wrong Answer

Solution code:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 & 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 & (c>=13 or c ==0) :
    print('MMYY') 
elif (b>=13 or b==0) & 1<=c<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
A = int(S[:2])
B = int(S[3:])
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:
s = list(str(input()))
A = int(s[0]+s[1])
B = int(s[2]+s[3])
if A > 12:
    if B > 12:
        ans = "NA"
    elif B == 0:
        ans = "NA"
    else:
        ans = "YYMM"
elif A == 0:
    ans = "NA"
elif 0 < A < 13:
    if B > 12:
        ans = "MMYY"
    elif B == 0:
        ans = "NA"
    else:
        ans = "AMBIGUOUS"
print(ans)

Submission status: Wrong Answer

Solution code:
s=input()
n=int(s[:2])
m=int(s[2:])
if 1<=n<=12:
  if 1<=m<=12:
    print("ambiguous".upper())
  else:
    print("MMYY")
    exit()
if 1<=m<13:
  print("YYMM")
  exit()
print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
front = int(S[:2])
back = int(S[2:])

checkMM = 0
checkYY = 0
if front >= 1 and front <= 12:
    checkMM = 1

if back >= 1 and back <= 12:
    checkYY = 1

if checkYY:
    if checkMM:
        print('AMBIGUOUS')
    else:
        print('YYMM')
else:
    if checkMM:
        print('MMYY')
    else:
        print('WA')

Submission status: Wrong Answer

Solution code:
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 & 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 & (c>12 or c ==0) :
    print('MMYY') 
elif (b>12 or b==0) & 1<=c<=12:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = [i for i in input()]
mae = S[0]+S[1]
ushiro = S[2]+S[3]
if int(mae)<=12 and int(ushiro)<=12:
    print("AMBIGUOUS")
elif int(mae)<=12 and int(ushiro)>12:
    print("MMYY")
elif int(mae)>12 and int(ushiro)<=12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
a=int(input())
b=a//100
c=a%100

if b > 12 and c > 12 or b == 0 or c == 0:
    print('NA')
elif b > 12:
    print('YYMM')
elif c > 12:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
a=input()
if int(a[2:4])<=12:
    if 12>=int(a[:2])>=1:
        print("AMBIGUOUS")
    elif 99>=int(a[:2])>=13:
        print("YYMM")
    else:
        print("YYMM")
elif int(a[:2])<=12:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
s_1 = int(S[:2])
s_2 = int(S[2:])


def judge(n):
    if 1 <= n <= 12:
        return 0
    elif 1 <= n:
        return 1
    else:
        return 2

s_1 = judge(s_1)
s_2 = judge(s_2)

if s_1 == 2 or s_2 == 2 or (s_1 == 1 and s_2 == 1):
    print("NA")
elif s_1 == 1:
    print("YYMM")
elif s_2 == 1:
    print("MMYY")
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
S=int(input())

a=S/100
b=S%100

if((a>12 or a==0) and 1<=b<=12):
        print("YYMM")

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

elif(1<=a<=12 and 1<=b<=12):
        print("AMBIGUOUS")

else:
    print("NA")

Submission status: Wrong Answer

Solution code:
s = input()
s1 = s[0:2]
s2 = s[2:4]
if s1[0] == "0":
    s1 = int(s1[1])
else:
    s1 = int(s1)
if s2[0] == "0":
    s2 = int(s2[1])
else:
    s2 = int(s2)
if 0 < s1 < 13 and 0 < s1 < 13:
    print("AMBIGUOUS")
elif 0 < s2 < 13:
    print("YYMM")
elif 0 < s1 < 13:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
n =  str(input())

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

c = int(a)
d = int(b)
print(c)
print(d)
yymm = False
mmyy = False
ambiguous = False
na = False

if (c < 1) or (12 < c):
    if (d < 1) or (12 < d):
        na = True

if (1 <= c) and (c <= 12):
    if (d < 1) or (12 < d):
        mmyy = True

if (1 <= d) and (d <= 12):
    if (c < 1) or (12 < c):
        yymm = True

if na == False and mmyy == False and yymm == False:
    ambiguous = True

if na == True:
    print("NA")
if mmyy == True:
    print("MMYY")
if yymm == True:
    print("YYMM")
if ambiguous == True:
    print("AMBIGUOUS")

Submission status: Wrong Answer

Solution code:
def solve():
    s = input()
    if len(str(s)) != 4:
        raise Exception('Error')
    if not (s.isdecimal()):
        print('NA')
    else:
        sl = list(s)
        st = int("".join(sl[:2]))
        end = int("".join(sl[3:4]))
        if st > 0 and st <= 12 and end > 0 and end <= 12:
            print('AMBIGUOUS')
        elif st > 0 and st <= 12 and (end == 0  or end > 12):
            print('MMYY')
        elif (st == 0 or st > 12) and end > 0 and end <= 12:
            print('YYMM')
        else:
            print('NA')

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
import numpy as np

suuji=int(input())

d=suuji%1000%100%10
c=int((suuji%1000%100-d)/10)
b=int((suuji%1000-10*c-d)/100)
a=int((suuji-100*b-10*c-d)/1000)
zenhan=10*a+b
kouhan=10*c+d

if (zenhan>=1 and zenhan <=12) and kouhan>=13:
    print("MMYY")

if (kouhan>=1 and kouhan <=12) and zenhan>=13:
    print("YYMM")
    
if (zenhan>=1 and zenhan <=12) and (kouhan>=1 and kouhan<=12):
    print("AMBIGUOUS")
    
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

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


def check(head, tail):
    if head <= 0 or tail <= 0:
        return 'NA'
    elif head > 12 and tail > 12:
        return 'NA'
    elif head > 12 and tail <= 12:
        return 'YYMM'
    elif head <= 12 and tail > 12:
        return 'MMYY'
    elif head <= 12 and tail <= 12:
        return 'AMBIGUOUS'


print(check(head, tail))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

s=input()


if (s[:2] == '00' and s[2:] == '00'):
    print('NA')
    sys.exit()

if(s[:2] == '00'):
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
    else:
        print('NA')
    sys.exit()

if(s[2:] == '00'):
    if s[0] == '0':
        print('MMYY')
    elif s[0] == '1':
        if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
                print('MMYY')
    else:
        print('NA')
    sys.exit()
                

if s[0] == '0':
    if s[2] == '0':
        print('AMBIGUOUS')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
            print('AMBIGUOUS')
    else:
        print('MMYY')

elif s[0] == '1':
    if(s[:2] == '10' or s[:2] == '11' or s[:2] == '12'):
        if s[2] == '0':
            print('AMBIGUOUS')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('AMBIGUOUS')
        else:
            print('MMYY')
    else:
        if s[2] == '0':
            print('YYMM')
        elif s[2] == '1':
            if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
        else:
            print('NA')


else:
    if s[2] == '0':
        print('YYMM')
    elif s[2] == '1':
        if(s[2:] == '10' or s[2:] == '11' or s[2:] == '12'):
                print('YYMM')
    else:
        print('NA')

Submission status: Wrong Answer

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 and n2==0) or (n1>12 and n2==0) or (n1==0 and n2>12):
    ans="NA"
elif (n1>12 or n1==0) and (n2<=12 and not(n2==0)):
    ans="YYMM"
elif (n1<=12 and not(n1==0)) and (n2>12 or n2==0):
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Wrong Answer

Solution code:
input = input()
listed = list(input)
first2 = listed[0:2]
last2 = listed[2:4]
first2 = ''.join(first2)
last2 = ''.join(last2)
m_possible = ["01","02","03","04","05","06","07","08","09","10","11","12"]

if str(first2) in m_possible:
  #Month_passed
  if str(last2) in m_possible:
    print("AMBIGUOUS")
  elif str(last2) != "00":
    print("MMYY")
  else:
    print("NA")
elif str(last2) in m_possible:
  if str(first2) == "00":
    print("NA")
  elif str(first2) in m_possible:
    print("AMBIGUOUS")
  else:
    print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = input().rstrip()
front = int(S[0:2])
back = int(S[2:4])

if 1 <= front <= 12:
    if 1 <= back <= 12:
        print('AMBIGUOUS')
    elif 0 < back:
        print('MMYY')
    else:
        print('NA')
elif 0 < front:
    if 1 <= back <= 12:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
data = input()

first = data[:2]
second = data[2:]

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
S = input()

s1 = int(S[0:2])
s2 = int(S[2:])
print(s1, s2, sep=":")

boolYYMM = False
boolMMYY = False

if s1 > 12:
    if s2 < 13:
        boolYYMM = True
if s1 < 13:
    if s2 > 12:
        boolMMYY = True

if boolYYMM and boolMMYY:
    print(AMBIGUOUS)
elif boolYYMM:
    print("YYMM")
elif boolMMYY:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
# 入力
s = input()
pre = int(s[0:2])
post = int(s[2:len(s)])
 
# 計算と出力
if ((pre == 0) and  (post > 12)) or ((pre > 12) and  (post == 0))  :
    print("NA")
elif (pre == 0) and (post == 0) :
    print("NA") 
elif (pre <= 12) and (post <= 12) :
    print("AMBIGUOUS")
elif (pre <= 12) and (post > 12) :
    print("MMYY")
elif (pre > 12) and (post <= 12) :
    print("YYMM")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S = list(str(1234))
pat1 = "YYMM"
pat2 = "MMYY"
pat3 = "AMBIGOUS"
pat4 = "NA"
mae =int(S[0] + S[1])
usiro = int(S[2] + S[3])
print(mae)
print(usiro)
if mae >= 13:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)
elif mae != 0:
    if usiro == 0 or usiro >= 13:
        print(pat2)
    else:
        print(pat3)
else:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)

Submission status: Wrong Answer

Solution code:
N = input()
first_half = int(N[:2])
latter_half = int(N[3:])
if first_half > 12:
    if latter_half > 0 and latter_half <= 12 and latter_half%10 <= 2:
        print('YYMM')
    else:
        print('NA')
elif first_half > 0 and first_half <= 12:
    if latter_half > 0  and latter_half <= 12:
        print('AMBIGUOUS')
    elif latter_half > 12:
        print('MMYY')
    else:
        print('NA')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
data = input()

first = data[:2]
second = data[2:]

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

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    S = int(input())
    shimo2 = S % 100
    ue2 = S // 100
    if ((0 < shimo2) & (shimo2 < 13) & (0 < ue2) & (ue2 < 13)):
        print('AMBIGUOUS')
    elif ((0 < shimo2 <= 12) & (ue2 != 0)):
        print("YYMM")
    elif ((0 < ue2 <= 12) & (shimo2 != 0)):
        print("MMYY")
    else:
        print("NA")


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """1905"""
        output = """YYMM"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """0112"""
        output = """AMBIGUOUS"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1700"""
        output = """NA"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
S = list(str(1234))
pat1 = "YYMM"
pat2 = "MMYY"
pat3 = "AMBIGOUS"
pat4 = "NA"
mae =int(S[0] + S[1])
usiro = int(S[2] + S[3])
print(mae)
print(usiro)
if mae >= 13:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)
elif mae != 0:
    if usiro == 0 or usiro >= 13:
        print(pat2)
    else:
        print(pat1)
else:
    if usiro >= 13 or usiro == 0:
        print(pat4)
    else:
        print(pat1)

Submission status: Wrong Answer

Solution code:
S = input()

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

elif int(S[0:2]) >= 13 or int(S[0:2]) == 0:
    if int(S[2:4]) == 0:
        print("NA")

elif int(S[2:4]) >= 13 or int(S[2:4]) == 0:
    if int(S[0:2]) == 0:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = list(input())
f = int(''.join(s[:2]))
b = int(''.join(s[2:]))

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

Submission status: Wrong Answer

Solution code:
S = input()

F_NA = 0
F_Y = 1
F_YM = 3

s = [0, 0]
s[0] = int(S[:2])
s[1] = int(S[2:])

flg = [0, 0]
for i in range(2):
    if s[i] >= 1 and s[i] <=12:
        flg[i] = F_YM
    elif s[i] >= 1:
        flg[i] = F_Y
    else:
        print("NA")
        exit()

if flg[0] == F_YM:
    if flg[1] == F_YM:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else: #flg[0] == F_Y
    if flg[1] == F_YM:
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
n = int(input()[:4])
a = n//100
b = n%100
if 0<a<=12 and 0<b<=12:
    print('AMBIGUOUS')
elif 1<=a<=12 and b>=13:
    print('MMYY')
elif 1<=b<=12 and 13<=a:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

YY = int(S[0]) * 10 + int(S[1])
MM = int(S[2]) * 10 + int(S[3])

if YY == 0 or MM == 0:
  print("NA")
  exit(0)
elif MM <= 12 and YY <= 12:
  print("AMBIGUOUS")
  exit(0)

if MM >= 13 and YY >= 13:
    print("NA")
    exit(0)

if YY > 12:
  print("YYMM")
elif MM > 12:
  print("MMYY")

Submission status: Wrong Answer

Solution code:
S = input()
ans = ''
if (S[0] + S[1] == '00' or S[2] + S[3] == '00') and (int(S[0] + S[1]) > 12 or int(S[2] + S[3]) > 12):
    ans = 'NA'
elif 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    ans = 'AMBIGUOUS'
elif int(S[:2]) > 12 and 1 <= int(S[2:]) <= 12:
    ans = 'YYMM'
elif 1 <= int(S[:2]) <= 12 and int(S[2:]) > 12:
    ans = 'MMYY'
else:
    ans = 'NA'
print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
time_1 = int(s[0:2])
time_2 = int(s[2:])
if time_1 == 0 and time_2 >= 13 or time_1>=13 and time_2 ==0:
    print("NA")
elif time_1 <=12 and time_2 <=12:
    print("AMBIGUOUS")
elif time_1 <=12 and time_2 >=13 or time_1 >=13 and time_2 <= 12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:

ans=""
S=input()
s1=S[:2]
s2=S[2:]
n1=int(s1)
n2=int(s2)

if (n1>12 and n2>12) or (n1==0 and n2==0) or (n1>12 and n2==0) or (n1==0 and n2>12):
    ans="NA"
elif (n1>12 or n1==0) and n2<=12:
    ans="YYMM"
elif n1<=12 and (n2>12 or n2==0):
    ans="MMYY"
elif n1<=12 and n2<=12:
    ans="AMBIGUOS"


print(ans)

Submission status: Wrong Answer

Solution code:
S = input()
if (S[0] == '0'and S[0]!='0') or (S[0] == '1'and (S[1] == '0' or S[1] == '1' or S[1]=='2')):
  if (S[2] == '0'and S[3]!='0') or (S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2')):
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif (S[2] == '0'and S[3]!='0') or (S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2')):
  print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
data = input()

first = data[:2]
second = data[2:]

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

Submission status: Wrong Answer

Solution code:
s = str(input())
first = int(s[0:2])
last = int(s[2:5])
is_yymm = False
is_mmyy = False

if first >= 1:
    if first <= 12:
        if last >= 1:
            if last <= 12:
                is_mmyy = True
                is_yymm = True
            else:
                is_mmyy = True
        if last == 0:
            is_mmyy = True

    if last >= 1 and last <= 12:
        is_yymm = True

elif first == 0:
    if last >= 1 and last <= 12:
        is_mmyy = True

if is_yymm:
    if is_mmyy:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if is_mmyy:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
YY = S[:2]
MM = S[2:]

def main():
    if int(YY)>0 and int(YY)<13:
        if int(MM)>0 and int(MM)<13:
            print("AMBIGUOUS")
            return 

    if int(YY)>0:
        if int(MM)>0 and int(MM)<13:
            print("YYMM")
            return 

    if int(MM)>0 and int(MM)<13:
        if int(YY)>0:
            print("MMYY")
            return
        else:
            print("NA")
    else:
        print("NA")
        return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    a = int(s[0] + s[1])
    b = int(s[2] + s[3])
 
    if 1 <= a and a <= 12 and 1 <= b and b <= 12:
        return "AMBIGUOUS"
    
    if (a == 0 or a >= 12) and 1 <= b and b <= 12:
        return "YYMM"
    
    if a <= 1 and a <= 12 and (b >= 12 or b == 0):
        return "MMYY"
 
    return "NA"
 
print(main())

Submission status: Wrong Answer

Solution code:
s=list(input())
h = int(s[0]+s[1])
t = int(s[2]+s[3])
y=0
m=0
yymm=False
mmyy=False
if 0<t<13:
    yymm=True
elif 0<h<13:
    mmyy=True
if yymm==True and mmyy==True:
    print("AMBIGUOUS")
elif yymm == True:
    print("YYMM")
elif mmyy == True:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()
S = [S[i: i+2] for i in range(0, len(S), 2) ]

L, R = int(S[0]), int(S[1])


if  1 <= L <= 12 and 1 <= R <= 12:
  print('AMBIGUOUS')
elif 1 <= L <= 99 and 1 <= R <= 12:
  print('YYMM')
elif 1 <= L <= 12 and 1 <= R <= 99:
  print('MMYY')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
a=input()
if int(a[2:4])<=12:
    if 12>=int(a[:2])>=1:
        print("AMBIGUOUS")
    elif 99>=int(a[:2])>=13:
        print("YYMM")
    else:
        print("NA")
elif int(a[:2])<=12:
    if int(a[2:4])>=1:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
S=str(input())
s=list(S)
# print(S[0:2])
# print(S[3:4])
s1 = int(''.join(S[0:2]))
s2 = int(''.join(S[2:4]))
# print(s1)
# print(s2)

stmp1=""
if s1 <=12 and s1 > 0:
    stmp1='MM'
elif (s1 > 0):
    stmp1='YY'
else:
    stmp1='NA'

stmp2=""
if s2 <=12 and s2 > 0:
    stmp2='MM'
elif (s2 > 0):
    stmp2='YY'
else:
    stmp2='NA'

if((stmp1=='NA' and not (stmp2=='MM')) or (stmp2=='NA' and not (stmp1=='MM')))or(stmp1=='YY' and stmp2=='YY'):
    print('NA')
elif(stmp1=='MM' and stmp2=='MM'):
    print('AMBIGUOUS')
elif(stmp1=='NA'):
    print('YY'+stmp2)
elif(stmp2=='NA'):
    print('YY'+stmp1)
else:
    print(stmp1+stmp2)

Submission status: Wrong Answer

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    S = int(input())
    shimo2 = S % 100
    ue2 = S // 100
    if ((0 < shimo2) & (shimo2 < 13) & (0 < ue2) & (ue2 < 13)):
        print('AMBIGUOUS')
    elif ((shimo2 >= 13) & (ue2 != 0)):
        print("MMYY")
    elif ((ue2 >= 13) & (shimo2 != 0)):
        print("YYMM")
    else:
        print("NA")


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """1905"""
        output = """YYMM"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """0112"""
        output = """AMBIGUOUS"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1700"""
        output = """NA"""
        self.assertIO(input, output)


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
 
# 入力
s = input()
pre = int(s[0:2])
post = int(s[2:len(s)])
 
# 計算と出力
if ((pre == 0) and (post > 12)) or ((pre > 12) and (post == 0)):
    print("NA")
elif (pre <= 12) :
    print("MMYY")
elif (post <= 12) :
    print("YYMM")
elif (pre <= 12) and (post <= 12) :
    print("AMBIGUOUS")
else :
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())
month=S%100
year=(S-S%100)//100
if year>=1 and year<=12:
  if month==0:
    print("NA")
  elif month>=1 and month<=12:
    print("AMBIGUOUS") 
  else:
    print("MMYY")
elif year>=13 and year<=99:
  if month>=1 and month<=12:
    print("YYMM")
  else:
    print("NA")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
S = int(input())
A = S//100
B = S-(A*100)
if B >= 13:
    if 1<= A <=12:    
        print("MMYY")
    else:
        print("NA")
elif 1<= B <=12:
    if 1<= A <=12:
        print("AMBIGUOUS")
    elif A >= 13:
        print("YYMM")
    elif A == 0:      
        print("YYMM")
    else:
        print("NA")
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 B == 0:
    print('NA')
elif 1 <= A and A <= 12:
    if 1 <= B and B <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
elif 1 <= B and B <= 12:
    if 1 <= A and A <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif A == 0:
    if 1 <=  B and B <= 12:
        print('MMYY')
elif B == 0:
    if 1 <=  A and A <= 12:
        print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = input()
YY = int(s[0] + s[1])
MM = int(s[2] + s[3])
if 0 < YY < 13 and 0 < MM < 13:
    print("AMBIGUOUS")
elif YY != 0 and 0 < MM < 13:
    print("YYMM")
elif 0 < YY < 13 and MM != 0:
    print("MMYY")
elif YY <= 0 or 13 <= YY or MM <= 0 or 13 <= MM:
    print("NA")

Submission status: Wrong Answer

Solution code:
X = input()
X_1=int(X[:2])
X_2=int(X[2:])
flag_1=(1 <= X_1 <=99 and 1 <= X_2 <= 12)
flag_2=(1 <= X_2 <=99 and 1 <= X_1 <= 12)
if flag_1 and flag_2:
    print("AMBIGUOUS")
elif flag_1:
    print("YYMM")
elif flag_2:
    print("MMYY")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    S = input()

    aa = int(S[:2])
    bb = int(S[2:])

    # print(aa,bb)
    if (aa > 12 and bb > 12) or (aa == 0 and bb == 0):
        print("NA")
    elif aa >= 1 and aa <= 12 and bb >= 1 and bb <= 12:
        print("AMBIGUOUS")
    elif aa >= 1 and aa <= 12:
        print("MMYY")
    else:
        print("YYMM")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np

suuji=int(input())

d=suuji%1000%100%10
c=int((suuji%1000%100-d)/10)
b=int((suuji%1000-10*c-d)/100)
a=int((suuji-100*b-10*c-d)/1000)
zenhan=10*a+b
kouhan=10*c+d

if (zenhan>=1 and zenhan <=12) and kouhan>=13:
    print("MMYY")

if (kouhan>=1 and kouhan <=12) and zenhan>=13:
    print("YYMM")
    
if (zenhan>=1 and zenhan <=12) and (kouhan>=1 and kouhan<=12):
    print("AMBIGUOUS")
    
if zenhan==0 or kouhan==0:
    print("NA")

if zenhan>=13 and kouhan>=13:
    print("NA")

Submission status: Wrong Answer

Solution code:
String=input()
String=list(String)
String=[(String[i:i+2]) for i in range(0, len(String),2)]
String[0]="".join(String[0])
String[1]="".join(String[1])
String[0]=int(String[0])
String[1]=int(String[1])
if(String[0]>=0 and String[0]<=12and String[1]>0 and String[1]<=12):
    print("AMBIGUOUS")
elif(String[0]==String[1]==0 or String[0]>12 and String[0]!=0 and String[1]>12 and String[1]!=0):
    print("NA")
elif(String[1]>0 and String[1]<13):
    print("YYMM")
elif(String[0]>0 and String[0]<13):
    print("MMYY")
elif(String[0]==0 and String[1]>12):
    print("NA")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S=int(input())
if (S%100>12 and 0<S//100<12) or (0<S//100<12 and S%100==0):
    print('MMYY')
elif (S//100>12 and 0<S%100<12) or (S//100==0 and 0<S%100<12):
    print('YYMM')
elif 0<S%100<=12 and 0<S//100<=12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if (S[0] == '0'and S[0]!='0') or (S[0] == '1'and (S[1] == '0' or S[1] == '1' or S[1]=='2')):
  if S[2] == '0' or (S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2')):
    print('AMBIGUOUS')
  else:
    print('MMYY')
elif (S[2] == '0'and S[3]!='0') or (S[2]=='1' and (S[3]=='0' or S[3]=='1' or S[3]=='2')):
  print('YYMM')
else:
  print('NA')