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:
# coding: utf-8
# Your code here!

s = input()

fs = s[:2]
bs = s[2:]

if fs>"00" and fs<="12":
    if bs>"00" and bs<="12":
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if bs>"00" and bs<="12":
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
sb=int(s[:2])
sa=int(s[2:])
if sb<=12 and sa!=0:
  if sa<=12 and sa!=0:
    print('AMBIGOUS')
  else:
    print('MMYY')
elif sa<=12 and sa!=0:
  if sb<=12 and sa!=0:
    print('AMBIGOUS')
  else:
    print('YYMM')
else:
  print('NA')

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    a = int(s[:2])
    b = int(s[2:])
    if a == 0 or b == 0:
        ans = 'NA'
    elif a <= 12:
        if b <= 12:
            ans = 'AMBIGUOUS'
        else:
            ans = 'MMYY'
    elif b <= 12:
        ans = 'YYMM'
    else:
        ans = 'NA'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
S = input()
def is_year(ss):
    return 1 <= int(ss) <= 99

def is_month(ss):
    return 1 <= int(ss) <= 12

pre = S[:2]
suf = S[2:]
try:
    is_yymm = is_year(pre) and is_month(suf)
    is_mmyy = is_year(suf) and is_month(pre)
    if is_yymm and is_mmyy:
        print('AMBIGUOUS')
    elif is_yymm and not is_mmyy:
        print('YYMM')
    elif not is_yymm and is_mmyy:
        print('MMYY')
    else:
        assert False
except:
    print('NA')

Submission status: Wrong Answer

Solution code:
s=int(input())
s1=int(s/100)
s2=s%100
if s1==0 or s2==0:
    print("NA")
elif 0<s1<=12 and 0<s2<=12:
    print("AMBIGUOUS")
elif 0<s1<=12:
    print("MMYY")
elif 0<s2<=12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
s = input()
a, b = int(s[0:2]), int(s[2:4])
if 1 <= a <= 12 and 1 <= b <= 12:
    print("AMBIGUOUS")
elif 1 <= a <= 12:
    print("MMYY")
elif 1 <= b <= 12:
    print("YYMM")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
s = input()
ftwo = int(s[:2])
ltwo = int(s[2:])

if ftwo > 12 and ltwo > 12:
    print('NA')
elif ltwo == 0 and 0 < ftwo <= 12:
    print('MMYY')
elif 0 < ltwo <=12 and ftwo == 0:
    print('YYMM')
elif ltwo == 0 or ftwo == 0:
    print('NA')
elif ftwo > 12 and 0 < ltwo <=12:
    print('YYMM')
elif 0 < ftwo <= 12 and ftwo > 12:
    print('MMYY')
else:
    print("AMBIGUOUS")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

S = str(input())

if 0 < int(S[0:2]) < 13 and 0 < int(S[2:]) < 13:
    ans = "AMBIGIOUS"
elif 0 < int(S[:2]) < 13:
    ans = "MMYY"
elif 0 < int(S[2:]) < 13:
    ans = "YYMM"
else:
    ans = "NA"

print(ans)

Submission status: Wrong Answer

Solution code:
s = s=input()
left = int(s[:2])
right = int(s[2:])

if left > 0 and left <= 12:
    if right > 0 and right <= 12:
        print('AMBIGUOUS')
    elif right > 0:
        print('MMYY')
elif left > 0:
    if right > 0 and right <= 12:
        print('YYMM')
    else:
        print('NA')
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 = "AMBISUOUS"
		else:
			ans = "MMYY"
	else:
		if bb > 12 or bb == 0:
			ans = "NA"
		else:
			ans = "YYMM"
	print(ans)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

AA = S[:2]
BB = S[2:]
a = []
AA = ''.join(AA)
BB = ''.join(BB)
for i in range(1, 13):
    if 1 <= i <= 9:
        a.append('0' + str(i))
    else:
        a.append(str(i))
if AA in a and BB in a:
    print('AMBIGUOUS')
elif AA in a and not BB in a:
    print('MMYY')
elif BB in a and not AA in a:
    print('YYMM')
else:
    print('WA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#B問題
S=list(str(input()))
mae=S[0]+S[1]
ato=S[2]+S[3]
intmae=int(mae)
intato=int(ato)
if intmae >= 13 and intato >= 13:
    print("NA")
elif intmae <= 12 and intato <= 12:
    if intmae > 0 and intato > 0:
        print("AMBIGUOUS")
    elif intmae == 0:
        print("YYMM")
    elif intato == 0:
        print("MMYY")
    else:
        print("NA")
else:
    if intmae <= 12:
        if intmae != 0:
            print("MMYY")
        else:
            print("NA")
    else:
        if intato != 0:
            print("YYMM")
        else:
            print("NA")

Submission status: Wrong Answer

Solution code:
s=int(input())
a=s//100
b=s%100
if 0<a<13 and 0<b<13:
    print("AMBIGUOUS")
elif a==b==0 or (a>12 and b>12) or (a==0 and b>12) or (a>12 and b==0):
    print("NA")
elif a>12 and b<13:
    print("YYMM")
elif b>12 and a<13:
    print("MMYY")

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
import fractions
from collections import deque

INF = 10 ** 10

S = stdin.readline().rstrip()

A = S[:2]
B = S[2:]

isYYMM = False
isMMYY = False

if int(B) <= 12 and int(B) >= 1 and int(A) >= 1:
    isYYMM = True

if int(A) <= 12 and int(A) >= 1 and int(B) >= 1:
    isMMYY = True

if isMMYY and isYYMM:
    print("AMBIGUOUS")
elif isMMYY:
    print("MMYY")
elif isYYMM:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
S = input()

front = S[:2]
back =  S[2:]

# 諸々の判定
if front == '00':
  out_front = 'NA'
elif int(front) >= 13:
  out_front = 'YY'
else:
  out_front = 'AMBIGUOUS'
  
if back == '00':
  out_back = 'NA'
elif int(back) >= 13:
  out_back = 'YY'
else:
  out_back = 'AMBIGUOUS'
  

## 出力結果
if out_front == 'NA' or out_back == 'NA':
  out = 'NA'
elif out_front == 'YY' and out_back == 'YY':
  out = 'NA'
elif out_front == 'YY' and out_back == 'AMBIGUOUS':
  out =  'YYMM'
elif out_front == 'AMBIGUOUS' and out_back == 'YY':
  out =  'MMYY'
elif out_front == 'AMBIGUOUS' and out_back == 'AMBIGUOUS':
  out =  'AMBIGUOUS'
else:
  out = 'hoge'
  
print(out)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = str(input())
s1 = s[:2]
s2 = s[2:]

ans = 'NA'
if 0 < int(s1) <= 12 and 0 < int(s2) <= 12:
    ans = 'AMBIGUOUS'
if 0 < int(s1) <= 12 and int(s2) > 12:
    ans = 'MMYY'
if int(s1) > 12 and 0 < int(s2) <= 12:
    ans = 'YYMM'

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()

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

yymm, mmyy = True, True
if s1 > 13 or s1 == 0:
    mmyy = False

if s2 > 13 or s2 == 0:
    yymm = False

print("AMBIGUOUS" if yymm == True and mmyy == True else "YYMM" if yymm == True
        else "MMYY" if mmyy == True else "NA")

Submission status: Wrong Answer

Solution code:
S = input()

front = int(S[:2])
back = int(S[2:])

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

Submission status: Wrong Answer

Solution code:
s = input()

pre = int(s[:2])
suf = int(s[3:])

if suf >= 1 and suf <= 12:
    if pre >= 1 and pre <= 12:
        print('AMBIGUOUS')
    else:
        print('YYMM')
    
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsm = lambda: map(str, sys.stdin.readline().split())

s = ns()
lisy = [str(i).zfill(2) for i in range(0, 100)]
lism = [str(i).zfill(2) for i in range(1, 13)]

if str(s[:2]) in lisy and str(s[2:]) in lism:
    if str(s[:2]) in lism and str(s[2:]) in lisy:
        print('AMBIGUOUS')
        exit()
    else:
        print('YYMM')
        exit()
if str(s[:2]) in lism and str(s[2:]) in lisy:
    if str(s[:2]) in lism and str(s[2:]) in lisy:
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()
print('NA')

Submission status: Wrong Answer

Solution code:
# 2019/05/19
# AtCoder Beginner Contest 126 - B

# Input
s = input()

# Calc
mae = int(s[0] * 10) + int(s[1])
ato = int(s[2] * 10) + int(s[3])

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

# Output
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

s = input()

fs = s[:2]
bs = s[2:]

if fs>"00" and fs<="12":
    if bs>"00" and bs<="12":
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    if bs>"00" and bs<="12":
        print("YYMM")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
#	!/usr/bin/env python3
#	encoding: UTF-8
#	Modified: <19/May/2019 05:42:45 PM>


#	✪ H4WK3yE乡
#	Mohd. Farhan Tahir
#	Indian Institute Of Information Technology (IIIT), Gwalior


import sys


def get_array(): return list(map(int, sys.stdin.readline().split()))


def get_ints(): return map(int, sys.stdin.readline().split())


def input(): return sys.stdin.readline().strip()


def main():
    s = input()
    a = int(s[:2])
    b = int(s[2:])
    if (a > 12 and b > 12) or (a > 12 and b == 0) or (a == 0 and b > 12):
        print('NA')
        return
    if a == 0 and b <= 12:
        print("YYMM")
        return
    if (b == 0 and a <= 12):
        print("MMYY")
        return

    if a <= 12 and b <= 12:
        print('AMBIGUOUS')
        return

    if a <= 12 and a != 0:
        print("MMYY")
        return
    if b <= 12 and b != 0:
        print("YYMM")
        return
    print('NA')


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
S = input()

if 0 < int(S[0:2]) < 20 and 0 < int(S[2:4]) < 13:
    if 0 < int(S[2:4]) < 20 and 0 < int(S[0:2]) < 13:
        print('AMBIGUOUS')
    else:
        print('YYMM')
elif 0 < int(S[2:4]) < 20 and 0 < int(S[0:2]) < 13:
    if 0 < int(S[0:2]) < 20 and 0 < int(S[2:4]) < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = list(input())
left = int(''.join(s[:2]))
right = int(''.join(s[2:]))
lyy = False
lmm = False
ryy = False
rmm = False
if 0 <= left <= 19:
    lyy = True
    if 1<= left <= 12:
        lmm = True

if 0 <= right <= 19:
    ryy = True
    if 1<= right <= 12:
        rmm = True

if lyy and lmm and ryy and rmm:
    print('AMBIGUOUS')
elif lyy and rmm:
    print('YYMM')
elif lmm and ryy:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
s = int(input())
sd = s%100
su = s//100
if sd >= 14 or sd == 0 :
    if su >= 14 or su == 0:
        print("NA")
    else :
        print("MMYY")
else :
    if su >= 14 or su == 0 :
        print("YYMM")
    else :
        print("AMBIGUOUS")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
S = list(str(input()))
F1 = int(str(S[0]) + str(S[1]))
F2 = int(str(S[2]) + str(S[3]))
#print(F1)
FLAG_MMYY = 1
FLAG_YYMM = 1
if F1 >= 13:
    FLAG_MMYY = 0
if F2 >= 13:
    FLAG_YYMM = 0
if F1 == 0 or F2 == 0:
    FLAG_MMYY = 0
    FLAG_YYMM = 0

if FLAG_MMYY == 1 and FLAG_YYMM == 1:
    print("AMBIGUOUS")
elif FLAG_MMYY == 1:
    print("MMYY")
elif FLAG_YYMM == 1:
    print("YYMM")
else:
    print("NA")

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:
import itertools
import math

def judY(y):
    if  0<=y and y < 20:
        return True
    else:
        return  False

def judM(m):
    if  0<m and m <=12:
        return True
    else:
        return  False



s1 = input()
zenhan = int (s1[0:2])
kohan  = int(s1[2:])

zenhanY = False
zenhanM = False
kohanY = False
kohanM = False
if judY(zenhan):
    zenhanY = True

if judM(zenhan):
    zenhanM = True

if judM(kohan):
    kohanM = True

if judY(kohan):
    kohanY = True


YYMM = False
MMYY = False
if zenhanY and kohanM:
    YYMM = True

if zenhanM and kohanY:
    MMYY = True

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
YYMM = 0
MMYY = 0
if not (1 <= int(s[:2]) <= 12):
    if 1 <= int(s[2:]) <= 12:
        print('YYMM')
    else:
        print('NA')
else:
    if 1 <= int(s[2:]) <= 12:
        print('AMBIGUOUS')
    else:
        print(MMYY)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = n//100
b = n%100
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[:2])
b = int(s[2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  s=S()
  a=s[:2]
  b=s[2:]
  if a=='00' and int(b)>12:
    print('NA')
  elif int(a)>12 and b=='00':
    print('NA')
  elif int(a)>12 and int(b)>12:
    print('NA')
  elif int(a)<=12 and int(b)>12:
    print('MMYY')
  elif int(a)>12 and int(b)<=12:
    print('YYMM')
  else:
    print('AMBIGUOUS')

main()
# print(main())

Submission status: Wrong Answer

Solution code:
s=input()
S=list(s)
m1=0
m2=0
if S[0]=='0':
    m1=1
elif S[0]=='1':
    if S[1]=='0' or S[1]=='1' or S[1]=='2':
        m1=1
    else:
        m1=0
else:
    m1=0

if S[2]=='0':
    m2=1
elif S[2]=='1':
    if S[3]=='0' or S[3]=='1' or S[3]=='2':
        m2=1
    else:
        m2=0
else:
    m2=0

if m1==1 and m2==1:
    print('AMBIGUOUS')

elif m1==1:
    print('MMYY')

elif m2==1:
    print('YYMM')

else:
    print('NA')

Submission status: Wrong Answer

Solution code:
S = input()
SL = []
for i in range(1,13):
    SL.append("0"+str(i) if len(str(i)) == 1 else str(i))
 
 
if S[2:] in SL:
    if S[:2] in SL or S[:2] == "00":
        print("AMBIGOUS")
    else:
        print("YYMM")
    
else:
    if S[:2] in SL or SL[:2] == "00":
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = input()

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(s):
    if int(s[0:2]) == 0 or int(s[2:4]) == 0:
        print("NA")
        return 0
    if int(s[0:2]) > 13 and int(s[2:4]) > 13:
        print("NA")
        return 0
    if int(s[0:2]) < 13 and int(s[2:4]) < 13:
        print("AMBIGUOUS")
        return 0
    if int(s[2:4]) < 13:
        print("YYMM")
        return 0
    if int(s[0:2]) < 13:
        print("MMYY")
        return 0


if __name__ == "__main__":
    S = input()
    solve(S)

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
        print('AMBIGUOUS')
    elif 13 <= int(S[:2]) and 1 <= int(S[2:]) <= 12:
        print('YYMM')
    elif 1 <= int(S[:2]) <= 12 and 13 <= int(S[2:]):
        print('MMYY')
    else:
        print('NA')


main()

Submission status: Wrong Answer

Solution code:
s = input().strip()
left = int(s[:2])
right = int(s[2:])
if left > 12 and 1 <= right <= 12:
    print('YYMM')
elif 1 <= left <= 12 and right > 12:
    print('MMYY')
elif 1 <= left <= 12 and 1 <= right <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def judge_format(text):
    former, latter = int(text[:2]), int(text[2:])
    if 1 <= former <= 12 and latter > 12:
        return 'MMYY'
    elif 1 <= latter <= 12 and former > 12:
        return 'YYMM'
    elif 1 <= former <= 12 and 1 <= latter <= 12:
        return 'AMBIGUOUS'
    else:
        return 'NA'
    

def main():
    s = input()
    print(judge_format(s))


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve(yy, mm):
    if 1 <= yy <= 12:
        if 1 <= mm <= 12:
            return 'AMBIGUOUS'
        elif 1 <= mm:
            return 'MMYY'
        else:
            return 'NA'
    else:
        if 1 <= mm <= 12:
            return 'YYMM'
        else:
            return 'NA'


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

Submission status: Wrong Answer

Solution code:

s = input()
mae = int(s[:2])
ato = int(s[2::])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
a = int(S[:2])
b = int(S[2:])
if a == 0 or b == 0:
	print("NA")
else:
	if 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 = list(input())

if S[0] != 0: a = int(''.join(S[:2]))
else: a = int(S[1])
if S[2] != 0: b = int(''.join(S[2:]))
else: b = int(S[3])

if a > 12:
    if b > 12 or b == 0:
        ans = 'NA'
    else:
        ans = 'YYMM'
else:
    if b > 12 or b == 0:
        ans  ='MMYY'
    else:
        ans  = 'AMBIGUOUS'

print(ans)

Submission status: Wrong Answer

Solution code:
S = input()

MMYY_flag = False
YYMM_flag = False
if 1 <= int(S[:2]) <= 12:
    MMYY_flag = True
if 1 <= int(S[3:]) <= 12:
    YYMM_flag = True
if MMYY_flag and YYMM_flag:
    print('AMBIGUOUS')
elif MMYY_flag:
    print('MMYY')
elif YYMM_flag:
    print('YYMM')
else:
    print('NA')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

S = input()
S[:2], S[2:]

def isM(str):
    return 1 <= int(str) <= 12

def isY(str):
    return 1 <= int(str)

def isYYMM(str):
    YY, MM = str[:2], str[2:]
    return isY(YY) and isM(MM)

def isMMYY(str):
    MM, YY = str[:2], str[2:]
    return isM(MM) and isY(YY)

if isYYMM(S) and isMMYY(S):
    print('AMBIGUOUS')
elif isYYMM(S):
    print('YYMM')
elif isMMYY(S):
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
if (int(s[:2]) >=13 and int(s[2:]) >= 130 or (s[:2] == '00' or s[2:] == '00')) :
    print('NA')
elif int(s[:2]) >=13:
    print('YYMM')
elif int(s[2:]) >= 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Submission status: Wrong Answer

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

m = [False, False]
y = [False, False]

if a in ["0"+str(i) for i in range(1, 10)]+["10","11","12"]:
    m[0] = True
if b in ["0"+str(i) for i in range(1, 10)]+["10","11","12"]:
    m[1] = True
if a in ["0"+str(i) for i in range(10)]+[str(i) for i in range(10, 100)]:
    y[0] = True
if b in ["0"+str(i) for i in range(10)]+[str(i) for i in range(10, 100)]:
    y[1] = True
if all(m+y):
    print("AMBIGUOUS")
elif y[0]:
    if m[1]:
        print("YYMM")
    else:
        print("NA")
else:
    if m[0] == False:
        print("NA")
    elif y[1]:
        print("MMYY")
    else:
        print("NA")

Submission status: Wrong Answer

Solution code:
s = input().rstrip()

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

if 1 <= a <= 12 and 1 <= b <= 12:
    ans = 'AMBIGUOUS'
elif 1 <= a <= 12:
    ans = 'MMDD'
elif 1 <= b <= 12:
    ans = 'YYMM'
else:
    ans = 'NA'

print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    s = int(input())
    y, m = s // 100, s % 100
    if y == 0 or m == 0 or (y > 12 and m > 12):
        print('NA')
    elif y > 12:
        print('YYMM')
    elif m > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')

Submission status: Wrong Answer

Solution code:
s=list(input())
ss=s[:3]
sss=s[3:]
x=int("".join(ss))
y=int("".join(sss))
if x==0 and y==0:
    print("NA")
elif x>=13 and y==0:
    print("NA")
elif x==0 and y>=13:
    print("NA")
elif x>=13 and y>=13:
    print("NA")
elif x<=12 and y<=12:
    print("AMBIGUOUS")
elif x<=12 :
    print("MMYY")
elif y<=12:
    print("YYMM")

Submission status: Wrong Answer

Solution code:
def solve():
  S = input()
  front = int(S[0:2])
  back = int(S[2:4])
  if front == 0 or back == 0: return 'NA'
  f, b = False, False
  if front in range(1, 13): f = True
  if back in range(1, 13): b = True
  if f and b: return 'AMBIGUOUS'
  if not f and not b: return 'NA'
  return 'MMYY' if f else 'YYMM'

print(solve())

Submission status: Wrong Answer

Solution code:
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
# import statistics
import bisect
import copy
import fractions
import math
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers):
    return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers):
    return reduce(LCM, numbers)
def LCM(m, n):
    return (m * n // fractions.gcd(m, n))
def unite(x, y):
    # それぞれのノードの根を求める
    x = root(x)
    y = root(y)
    if x == y:
        return
    # node[x]の根をyに変更する
    node[x] = y
def same(x,y): return bool(root(x) == root(y))
def root(x):
    if node[x] == x:  # xが根の場合
        return x
    else:
        node[x] = root(node[x])  # 経路圧縮
        return node[x]
def dfs(v):
    # ノードに訪れた
    visited[v] = True
    for v2 in range(n):
        if graph[v][v2] == False:  # そもそもvとv2が辺でつながっていない
            continue
        if visited[v2] == True:  # もう見た
            continue
        dfs(v2)

s = IS()
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()
l = int(s[:2])
r = int(s[2:])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
front = int(S[0:2])
back = int(S[2:4])
if 0 <= front <= 12:
    if 0 <= back <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
elif 0 <= back <= 12:
    print("YYMM")
else:
    print("NA")

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
AtCoder C
"""
 
# N = int(input())
# A = list(map(int,input().split())) # N row 1 column
# A = int(input()) for _ in range(N) # 1 row N column
 
# S = str(input()) # str(input()) == input() -> 'abc'
# S = list(input()) # abc -> ['a','b','c']
 
def main():
    N = int(input())
    A= N//100
    B= N%100
    if (A==0 and B== 0) or (A==0 and B>12) or (A>12 and B==0)  or (A>12 and B>12):
        print("NA")
    elif( A<13 and B<13):
        print("AMBIGUOUS")
    elif ( A>12 or A==0) and(B<13):
        print("YYMM")
    elif(A<13) and(B>12 or B==0):
        print("MMYY")

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
s = list(input())

A = int("".join(s[:2]))
B = int("".join(s[2:]))

if A <= 12 and B <= 12 and (A!=0 or B!=0):
    print('AMBIGUOUS')
elif A > 12 and B <= 12 and B != 0:
    print('YYMM')
elif A <= 12 and B > 12 and A != 0:
    print('MMYY')
else:
    print('NA')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

foward = int(S[0 : 2])
back = int(S[2 : 4])

foward_MM = False
back_MM = False

if foward >= 1 and foward <= 12:
  foward_MM = True
if back >= 1 and back <= 12:
  back_MM = True

if foward_MM and back_MM:
  print("AMBIGOUS")
elif foward_MM and not back_MM:
  print("MMYY")
elif not foward_MM and back_MM:
  print("YYMM")
else:
  print("NA")

Submission status: Wrong Answer

Solution code:
s=input()

n1=int(s[:2])
n2=int(s[2:])

if n1<=12 and n2<=12:
    print("AMBIGUOUS")
elif 0<n1<=12:
    print("MMYY")
elif 0<n2<=12:
    print("YYMM")
else:
    print("NA")