ZhenlongDai/ACPR huggingface dataset:
Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()

def dfs(now):
    if int(now) > int(n):
        return 1 if ("7" in now and "5" in now and "3" in now) else 0

    counter = 0
    for i in "753":
        counter += dfs(i + now)

    counter += 1 if ("7" in now and "5" in now and "3" in now) else 0
    return counter

print(dfs("0"))

Failing test case input:
3750

Expected output:
14


Actual output:
17


Fixed submission (verdict: Accepted):
n = input()

def dfs(now):
    if int(now) > int(n):
        return 0

    counter = 1 if ("7" in now and "5" in now and "3" in now) else 0
    for i in "357":
        counter += dfs(now + i)

    return counter

print(dfs("0"))

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import queue

n=int(input())

q=queue.Queue()

q.put(3)
q.put(5)
q.put(7)

c=0
num=0
while num<=n:
    num=q.get()
    if "3" in str(num) and "5" in str(num) and "7" in str(num):
        c+=1
    q.put(num*10+3)
    q.put(num*10+5)
    q.put(num*10+7)

print(c)

Failing test case input:
536671710

Expected output:
15714


Actual output:
15715


Fixed submission (verdict: Accepted):
import queue

n=int(input())

q=queue.Queue()

q.put(3)
q.put(5)
q.put(7)

c=0
num=q.get()
while num<=n:
    if "3" in str(num) and "5" in str(num) and "7" in str(num):
        c+=1
    q.put(num*10+3)
    q.put(num*10+5)
    q.put(num*10+7)
    num=q.get()

print(c)

Problem: p03212
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=input()
a = lambda x,y:3**x - y*2**x + y -1+(y%3==0)
ans = 0
ln = len(n)
s = set()
b = True
for p, i in enumerate(n):
    m = int(i) 
    if b:
        if m > 7:
            ans += a(ln-p-1,3-len(s|{7}))
        if m > 5:
            ans += a(ln-p-1,3-len(s|{5}))
        if m > 3:
            ans += a(ln-p-1,3-len(s|{3}))
        if m in (7,5,3):
            s.add(m)
            if ln > p+1:
                ans += len(s)==3
        else:
            b = False
    if ln > p +1:
        ans += a(ln - p -1,3)
print(ans)


Failing test case input:
3750

Expected output:
14


Actual output:
15


Fixed submission (verdict: Accepted):
n=input()
a = lambda x,y:3**x - y*2**x + y -1+(y%3==0)
ans = 0
ln = len(n)
s = set()
b = True
for p, i in enumerate(n):
    m = int(i) 
    if b:
        if m > 7:
            ans += a(ln-p-1,3-len(s|{7}))
        if m > 5:
            ans += a(ln-p-1,3-len(s|{5}))
        if m > 3:
            ans += a(ln-p-1,3-len(s|{3}))
        if m in (7,5,3):
            s.add(m)
            if ln == p+1:
                ans += len(s)==3
        else:
            b = False
    if ln > p +1:
        ans += a(ln - p -1,3)
print(ans)
Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
n = int(s)
dg = len(s)

all_list = []

for i in '753':
    for j in '753':
        for k in '753':
            all_list.append(''.join([i,j,k]))

for i in range(4,dg+1):
    add_list = []
    for c in '753':
        add_list += [''.join(c+e) for e in all_list]
    all_list += add_list

count = 0
test = []

res = sum([True for _ in all_list if set(list(_))=={'7','5','3'} and int(_) <= n])
print(res)


Failing test case input:
26435227

Expected output:
2538


Actual output:
16116


Fixed submission (verdict: Accepted):
s = input()
n = int(s)
dg = len(s)

all_list = []

for i in '753':
    for j in '753':
        for k in '753':
            all_list.append(''.join([i,j,k]))

for i in range(4,dg+1):
    add_list = []
    for c in '753':
        add_list += [''.join(c+e) for e in all_list]
    all_list += add_list

all_list = set(all_list)
res = sum([True for _ in all_list if set(list(_))=={'7','5','3'} and int(_) <= n])
print(res)

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
def dfs(s): 
  if int(s) > N:
    return 0
  ret = 1 if all(s.count(c) > 0 for c in '753') else 0 
  for c in '753':
    ret += dfs(s + c)
    return ret
print(dfs('0')) 


Failing test case input:
3972

Expected output:
18


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
 
def dfs(s):
  if int(s)>n:
    return 0
  cnt=1 if all(s.count(i)>0 for i in '753') else 0
  for j in '753':
    cnt+=dfs(s+j)
  return cnt
  
print(dfs('0'))

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import queue

n=int(input())

q=queue.Queue()

q.put(3)
q.put(5)
q.put(7)

c=0
num=0
while num<n:
    num=q.get()
    if "3" in str(num) and "5" in str(num) and "7" in str(num):
        c+=1
    q.put(num*10+3)
    q.put(num*10+5)
    q.put(num*10+7)

print(c)

Failing test case input:
3750

Expected output:
14


Actual output:
15


Fixed submission (verdict: Accepted):
import queue

n=int(input())

q=queue.Queue()

q.put(3)
q.put(5)
q.put(7)

c=0
num=q.get()
while num<=n:
    if "3" in str(num) and "5" in str(num) and "7" in str(num):
        c+=1
    q.put(num*10+3)
    q.put(num*10+5)
    q.put(num*10+7)
    num=q.get()

print(c)

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
import collections
n=int(input())
l=len(str(n))
cnt=0
if l<3:
  print(0)
  exit()
for i in range(3,l):
  for k in itertools.product(['7','5','3'],repeat=i):
    j=int(''.join(k))
    c=collections.Counter(k)
    cv=c.values()
    if all(vv!=0 for vv in cv) and j<=n:
      cnt+=1
print(cnt)

Failing test case input:
848

Expected output:
6


Actual output:
0


Fixed submission (verdict: Accepted):
import itertools
import collections
n=int(input())
l=len(str(n))
cnt=0
if l<3:
  print(0)
  exit()
for i in range(3,l+1):
  for k in itertools.product(['7','5','3'],repeat=i):
    j=int(''.join(k))
    k=list(k)
    x=k.count('7')
    y=k.count('5')
    z=k.count('3')
    if all(vv!=0 for vv in [x,y,z]) and j<=n:
      cnt+=1
print(cnt)
Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
n=int(input())

keta=len(str(n))
hako=[]
for i in range(3,keta+1):
    for c in list(itertools.product(["7","5","3"],repeat=i)):
        if len(set(c))==3:
            a=int("".join(c))
            hako.append(a)
if n in hako:
    hako.sort()
    k=hako.index(n)
    b=hako[:k]
    print(len(b)) 
else:
    hako.append(n)
    hako.sort()
    k=hako.index(n)
    b=hako[:k]
    print(int(len(b))+1)

Failing test case input:
80751

Expected output:
192


Actual output:
193


Fixed submission (verdict: Accepted):
import itertools
n=int(input())

keta=len(str(n))
hako=[]
for i in range(3,keta+1):
    for c in list(itertools.product(["7","5","3"],repeat=i)):
        if len(set(c))==3:
            a=int("".join(c))
            hako.append(a)
if n in hako:
    hako.sort()
    k=hako.index(n)
    b=hako[:k]
    print(len(b)+1) 
else:
    hako.append(n)
    hako.sort()
    k=hako.index(n)
    b=hako[:k]
    print(int(len(b)))

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    else:
        ret = 1 if all(s.count(c) > 0 for c in '753') else 0
        for c in '753':
            ret = dfs(s + c)
        return ret

print(dfs('0'))


Failing test case input:
563

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())

def dfs(s):
    if int(s) > N:
        return 0
    ret = 1 if all(s.count(c) > 0 for c in '753') else 0
    for c in '753':
        ret += dfs(s + c)
    return ret

print(dfs('0'))

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from itertools import product


l753 = []
for i in range(3, 10):
    l = ['753'] * i
    for s in product(*l):
        if '7' in s and '3' in s and '5' in s:
            l753.append(int("".join(s)))
sorted(l753)
N = int(input())
count = 0
for i in l753:
    if i > N:
        break
    count += 1
print(count)



Failing test case input:
363

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
from itertools import product


l753 = []
for i in range(3, 10):
    l = ['753'] * i
    for s in product(*l):
        if '7' in s and '3' in s and '5' in s:
            l753.append(int("".join(s)))
l753 = sorted(l753)
N = int(input())
count = 0
for i in l753:
    if i > N:
        break
    count += 1
print(count)

Problem: p03212
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
for i in range(3,6):
    for j in list(itertools.product("753",repeat=i)):
        if int("".join(j)) <= N and len(set("".join(j)))==3:
            ans+=1
print(ans)

Failing test case input:
5223462

Expected output:
1334


Actual output:
192


Fixed submission (verdict: Accepted):
import itertools
from sys import stdin
N=int(stdin.readline().rstrip())
ans=0
for i in range(3,11):
    for j in list(itertools.product("753",repeat=i)):
        if int("".join(j)) <= N and len(set("".join(j)))==3:
            ans+=1
print(ans)
Problem: p03212
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

from bisect import bisect_right
def comb (n,s):
    capt = []; ind = n; 
    stp = n+1; boo = ""
    while bk[0] < 1:
        if bk[ind] < s:
            boo += dip[bk[ind]];
            bk[ind]+=1; 
            if ind + 1 == stp:
                if '7' in boo and '3' in boo and '5' in boo:
                    capt.append(boo); 
                boo = boo[:len(boo)-1];
            ind += 1 if ind + 1 < stp else 0
        else: bk[ind] = 0;ind -= 1; boo = boo[:len(boo)-1]
    return bisect_right(capt,val)
val = input()
bk = [0]*(len(val)+1); dip = ['3','5','7']
print(comb(len(val),3))

Failing test case input:
165921475

Expected output:
8334


Actual output:
0


Fixed submission (verdict: Accepted):

from bisect import bisect_right
def comb (n,s):
    capt = []; ind = n; 
    stp = n+1; boo = ""
    while bk[0] < 1:
        if bk[ind] < s:
            boo += dip[bk[ind]];
            bk[ind]+=1; 
            if ind + 1 == stp:
                if '7' in boo and '3' in boo and '5' in boo:
                    capt.append(int(boo)); 
                boo = boo[:len(boo)-1];
            ind += 1 if ind + 1 < stp else 0
        else: bk[ind] = 0;ind -= 1; boo = boo[:len(boo)-1]
    return bisect_right(capt,int(val))
val = input()
bk = [0]*(len(val)+1); dip = ['3','5','7']
print(comb(len(val),3))
Problem: p02715
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int,input().split())
ans = 0
cnt_seq = [0]*(K+1) 
MOD = 10**9 + 7
for i in range(K,0,-1):
    
    n = K
    cnt_seq[i] = pow(n,N,MOD)
    ans += (i*cnt_seq[i])%MOD
    ans %= MOD
    for j in range(2*i,K+1,i):
        ans -= (i*cnt_seq[j])%MOD
        ans %= MOD
print(ans)


Failing test case input:
0 406

Expected output:
50154


Actual output:
29482


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
ans = 0
cnt_seq = [0]*(K+1) 
MOD = 10**9 + 7
ans = 0
for i in range(K,0,-1):
    cnt_seq[i] = pow(K
    for j in range(2*i,K+1,i):
        cnt_seq[i] -= cnt_seq[j]%MOD
    ans += i*cnt_seq[i]%MOD
print(ans%MOD)
Problem: p03548
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X, Y, Z = map(int, input().split())
print((X-Z)%(Y+Z))

Failing test case input:
3132 6 12

Expected output:
173


Actual output:
6


Fixed submission (verdict: Accepted):
X, Y, Z = map(int, input().split())
print((X-Z)

Problem: p03548
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x, y, z = map(int, input().split())

ans = (x-2)
print(ans)

Failing test case input:
126587 27 549

Expected output:
218


Actual output:
126585


Fixed submission (verdict: Accepted):
x, y, z = map(int, input().split())

print((x-z)

Problem: p03548
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
X,Y,Z = map(int,input().split())
print((X-Z/(Y+Z)))

Failing test case input:
60156 3 549

Expected output:
107


Actual output:
60155.00543478261


Fixed submission (verdict: Accepted):
X,Y,Z = map(int,input().split())
print((X-Z)

Problem: p03548
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
X,Y,Z = map(int,input().split())
print((X-Z)/(Y+Z))

Failing test case input:
100100 1 1

Expected output:
50049


Actual output:
50049.5


Fixed submission (verdict: Accepted):
X,Y,Z = map(int,input().split())
print((X-Z)

Problem: p03548
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
 
x, y, z = stdin.readline().split()

print ( ( int(x)-int(z) ) / ( int(y) + int(z) ) )


Failing test case input:
77524 27 137

Expected output:
471


Actual output:
471.8719512195122


Fixed submission (verdict: Accepted):
from sys import stdin
import math
 
x, y, z = stdin.readline().split()
 
print (math.floor(( ( int(x)-int(z) ) / ( int(y) + int(z) ) )))

Problem: p03548
Buggy submission (Python (3.8.2), verdict: Wrong Answer):







import math
x,y,z = map(int,input().split())
t = (x-1)/(y+z)
print(math.floor(t))




Failing test case input:
4203 -1 3

Expected output:
2100


Actual output:
2101


Fixed submission (verdict: Accepted):









import math
x,y,z = map(int,input().split())
t = (x-z)/(y+z)
print(math.floor(t))

Problem: p03548
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


line_list = input().split(" ")

x = int(line_list[0])
y = int(line_list[1])
z = int(line_list[2])

print(round((x-z)/(y+z)))


Failing test case input:
264487 721 6

Expected output:
363


Actual output:
364


Fixed submission (verdict: Accepted):

import math

line_list = input().split(" ")

x = int(line_list[0])
y = int(line_list[1])
z = int(line_list[2])

print(int(math.floor((x-z)/(y+z))))

Problem: p03548
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x, y, z = [int(m) for m in input().split(" ")]

print((x+z) % (y+z))

Failing test case input:
3132 6 12

Expected output:
173


Actual output:
12


Fixed submission (verdict: Accepted):
x, y, z = [int(m) for m in input().split(" ")]

print((x-z)
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
f = int(s[0]+s[1])
b = int(s[2]+s[3])
if (f <= 12) & (f >= 1):
    if (b <= 12) & (b >= 1):
        print("AMBIGUOUS")
    elif (b <= 99) & ((b >= 13)or(b == 0)):
        print('MMYY')
    else:
        print('NA')
else:
    if (b <= 12) & ((b >= 1)or(b == 0)):
        print("YYMM")
    else:
        print("NA")


Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = input()
f = int(s[0]+s[1])
b = int(s[2]+s[3])
if (f <= 12) & (f >= 1):
    if (b <= 12) and (b >= 1):
        print("AMBIGUOUS")
    else:
        print('MMYY')
        
else:
    if (b <= 12) and (b >= 1):
        print("YYMM")
    else:
        print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()


def yymm(S):
    yy = int(S[:2])
    mm = int(S[3:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


def mmyy(S):
    mm = int(S[:2])
    yy = int(S[3:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


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


Failing test case input:
8268

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
S = input()


def yymm(S):
    yy = int(S[:2])
    mm = int(S[2:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


def mmyy(S):
    mm = int(S[:2])
    yy = int(S[2:])
    return yy >= 0 and (mm >= 1 and mm <= 12)


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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
num1 = S[:2]
num2 = S[2:]
if 0 < int(num1) <= 12 and 0 < int(num2) <= 12:
    print("AMBIGUOUS")
elif int(num1) == 0 and 12 < int(num1) <= 99 and 0 < int(num2) <= 12:
    print("YYMM")
elif 0 < int(num1) <= 12 and 12 < int(num2) <= 31:
    print("MMYY")
elif int(num1) > 12 and int(num2) > 12:
    print("NA")
else:
    print("NA")

Failing test case input:
1055

Expected output:
MMYY


Actual output:
NA


Fixed submission (verdict: Accepted):
S = input()
num1 = S[:2]
num2 = S[2:]
if 0 < int(num1) <= 12 and 0 < int(num2) <= 12:
    print("AMBIGUOUS")
elif 0 <= int(num1) <= 99 and 0 < int(num2) <= 12:
    print("YYMM")
elif 0 < int(num1) <= 12 and 0 <= int(num2) <= 99:
    print("MMYY")
else:
    print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputS = input()
s = inputS

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



Failing test case input:
3545

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
inputS = input()
s = inputS

def month(tuki):
    return 0 < tuki <= 12 

mae = int(s[:2])
ushiro = int(s[-2:])

if month(mae) and month(ushiro):
    print("AMBIGUOUS")
elif month(mae):
    print("MMYY")
elif month(ushiro):
    print("YYMM")
else:
    print("NA")
Problem: p03042
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
s=input()
f1=int(s[:2])<=12
f2=int(s[2:4])<=12
if f1 and f2:print("AMBIGUOUS")
elif not f1 and not f2:print("NA")
elif f1:print("MMYY")
else:print("YYMM")

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s=input()
f1=1<=int(s[:2])<=12
f2=1<=int(s[2:4])<=12
if f1 and f2:print("AMBIGUOUS")
elif not f1 and not f2:print("NA")
elif f1:print("MMYY")
else:print("YYMM")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
x=int(S[0:2])
y=int(S[2:4])
if x>0 & y>0 & x<13 & y<13: print('AMBIGUOUS')
elif x>0 & x<13 & y>13: print('MMYY')
elif y>0 & y<13 & x>13: print('YYMM')
else: print('NA')

Failing test case input:
1701

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
S=input()
x=int(S[0:2])
y=int(S[2:4])
if (0<x<13) & (0<y<13): print('AMBIGUOUS')
elif (0<x<=12) & ((y>=13) | (y==0)): print('MMYY')
elif (0<y<=12) & ((x>=13) | (x==0)): print('YYMM')
else: print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import random

s = input()




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

print(s)

if len(s) != 4:
    print("NA 1")
elif (s1 == 0) or (s2 == 0):
    print("NA 2")
elif (s1 > 12) and (s2 > 12):
    print("NA 3")
elif s2 > 12:
    print("MMYY")
elif s1 > 12:
    print("YYMM")
else:
    print("AMBIGUOUS")


Failing test case input:
1055

Expected output:
MMYY


Actual output:
1055
MMYY


Fixed submission (verdict: Accepted):

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

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

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUAUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')
    


Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGUAUS


Fixed submission (verdict: Accepted):
s=input()
a=int(s[:2])
b=int(s[2:])
def f(a):
    a1,a2=0,0
    if 1<=a<=12:
        a1=1
    if 0<=a<=99:
        a2=1
    return (a1,a2)
a1,a2=f(a)
b1,b2=f(b)
if a1 and a2 and b1 and b2:
    print('AMBIGUOUS')
elif a1 and b2:
    print('MMYY')
elif a2 and b1:
    print('YYMM')
else:
    print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
before = int(S[0:2])
after = int(S[2::])
if 0 < before <= 12:
    print('MMYY')
elif 0 < after <= 12:
    print('YYMM')
elif (before == 0 and after == 0) or ((0 == before or before > 13) and (0 == after or after > 13)):
    print('NA')
else:
    print('AMBIGUOUS')

Failing test case input:
3813

Expected output:
NA


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
S = input()
before = int(S[0:2])
after = int(S[2::])
if 0 < before <= 12 and 0 < after <= 12:    
    print('AMBIGUOUS')
elif 0 < before <= 12:
    print('MMYY')
elif 0 < after <= 12:
    print('YYMM')
else:
    print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()



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


Failing test case input:
3895

Expected output:
NA


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
S = input()

L = int(S[:2])
R = int(S[2:])

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
a,b=int(s[:2]),int(s[2:])
if (a>12 and b>12) or min(a,b)==0 :
  print("NA")
elif a>12 and b<12:
  print("YYMM")
elif a<12 and b>12:
  print("MMYY")
else:
  print("AMBIGUOUS")

Failing test case input:
1291

Expected output:
MMYY


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
s=str(input())
a,b=int(s[:2]),int(s[2:])
f,g= 1<=a and a<=12, 1<=b and b<=12
if f and g:
  print("AMBIGUOUS")
elif f:
  print("MMYY")
elif g:
  print("YYMM")
else:
  print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
a = int(S[0:2])
b = int(S[2:4])

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

Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
AMBIGUOS


Fixed submission (verdict: Accepted):
S = input()
a = int(S[0:2])
b = int(S[2:4])

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")


Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12) or (int(f)>12 and l=="00") or (int(l)>12 and f=="00") :
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
l=s[0]+s[1]
m=s[2]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(l)==0:
    print('YYMM')
else:
    print('NA')

Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGOUS


Fixed submission (verdict: Accepted):
s=input()
l=s[0]+s[1]
m=s[2]+s[3]
month=['01','02','03','04','05','06','07','08','09','10','11','12']
if month.count(l)==1 and month.count(m)==1:
    print('AMBIGUOUS')
elif month.count(l)==1 and month.count(m)==0:
    print('MMYY')
elif month.count(m)==1 and month.count(l)==0:
    print('YYMM')
else:
    print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
if s[0] == "0":
    s[0] = ''
if s[2] == "0":
    s[2] = ''
x = int(s[0]+s[1])
y = int(s[2]+s[3])



if (x <= 12 and x >= 1) and (y >=1 and y <=12):
    print("AMBIGOUS")

elif(x >0 and (y >= 1 and y <= 12)):
    print("YYMM")

elif(y >0 and (x >= 1 and x <= 12)):
    print("MMYY")

else:
    print("NA")

Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
AMBIGOUS


Fixed submission (verdict: Accepted):
s = list(input())
if s[0] == "0":
    s[0] = ''
if s[2] == "0":
    s[2] = ''
x = int(s[0]+s[1])
y = int(s[2]+s[3])

if (x <= 12 and x >= 1) and (y >=1 and y <=12):
    print("AMBIGUOUS")

elif(x >= 0 and (y >= 1 and y <= 12)):
    print("YYMM")

elif(y >= 0 and (x >= 1 and x <= 12)):
    print("MMYY")

else:
    print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):





s = input()
pre = int(s[:2])
last = int(s[2:])

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

Failing test case input:
1291

Expected output:
MMYY


Actual output:
YYMM


Fixed submission (verdict: Accepted):





s = input()
pre = int(s[:2])
last = int(s[2:])

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('MMYY')
        exit()

if 1 <= int(S2) <= 12:
    if 1 <= int(S1) <= 12:
        print('AMBIGOUS')
        exit()
    else:
        print('YYMM')
        exit()

print('NA')

Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGOUS


Fixed submission (verdict: Accepted):
S = str(input())

S1 = S[0:2]
S2 = S[2:4]

if 1 <= int(S1) <= 12:
    if 1 <= int(S2) <= 12:
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()

if 1 <= int(S2) <= 12:
    if 1 <= int(S1) <= 12:
        print('AMBIGUOUS')
        exit()
    else:
        print('YYMM')
        exit()

print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    head = int(inputs[0][:2])
    tail = int(inputs[0][2:])

    if head == 0 or tail == 0:
        return "NA"

    if head >= 1 and head <= 12:
        if tail >= 1 and head <= 12:
            return "AMBIGUOUS"
        return "MMYY"

    if tail >= 1 and head <= 12:
        return "YYMM"


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


Failing test case input:
6718

Expected output:
NA


Actual output:
None


Fixed submission (verdict: Accepted):
import sys
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    head = int(inputs[0][:2])
    tail = int(inputs[0][2:])

    if head >= 1 and head <= 12:
        if tail >= 1 and tail <= 12:
            return "AMBIGUOUS"
        else:
            return "MMYY"

    if tail >= 1 and tail <= 12:
        return "YYMM"

    return "NA"


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
import copy

inputa = input().split()






a = inputa[0]
inputList = list(a)









tmptop = [inputList[0], inputList[1]]
tmpjointop = "".join(tmptop)
top = int(tmpjointop)

tmpbottom = [inputList[2], inputList[3]]
tmpjoinbottom = "".join(tmpbottom)
bottom = int(tmpjoinbottom)

flgFrontMM = 1
flgTermMM = 1

if top > 12 or top == 0:
    flgFrontMM = 0

if bottom > 12 or bottom == 0:
    flgTermMM = 0

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

Failing test case input:
1179

Expected output:
MMYY


Actual output:
YYMM


Fixed submission (verdict: Accepted):
import math
import copy

inputa = input().split()






a = inputa[0]
inputList = list(a)









tmptop = [inputList[0], inputList[1]]
tmpjointop = "".join(tmptop)
top = int(tmpjointop)

tmpbottom = [inputList[2], inputList[3]]
tmpjoinbottom = "".join(tmpbottom)
bottom = int(tmpjoinbottom)

flgFrontMM = True
flgTermMM = True

if top > 12 or top == 0:
    flgFrontMM = False

if bottom > 12 or bottom == 0:
    flgTermMM = False

if flgFrontMM and flgTermMM:
    print("AMBIGUOUS")
elif flgFrontMM == False and flgTermMM == False:
    print("NA")
elif flgFrontMM:
    print("MMYY")
elif flgTermMM:
    print("YYMM")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13 and int(s[0])+int(s[1])==0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("YYMM")
  else:
    print("NA")

Failing test case input:
2024

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
s=input()
if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("AMBIGUOUS")
  else:
    print("MMYY")
if 10*int(s[0])+int(s[1])>=13 or int(s[0])+int(s[1])==0:
  if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
    print("YYMM")
  else:
    print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
a = int(S[:2])
b = int(S[2:])

ym = False
my = False
if a > 0 and b>0 and b <= 12:
  ym = True
if b > 0 and a>0 and a <= 12:
  my = True

if ym and my:
  print("AMBIGOUS")
elif ym and not(my):
  print('YYMM')
elif not(ym) and ym:
  print('MMYY')
else:
  print('NA')

Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGOUS


Fixed submission (verdict: Accepted):
S = input()
a = int(S[:2])
b = int(S[2:])

ym = False
my = False
if a >= 0 and b>0 and b <= 12:
  ym = True
if b >= 0 and a>0 and a <= 12:
  my = True

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
a = int(S[0:2])
b = int(S[2:4])
print(a, b)
fym = False
fmy = False
if 1<=a<=12:
  fmy = True
if 1<=b<=12:
  fym = True
if fmy and fym:
  print("AMBIGUOUS")
elif fmy:
  print("MMYY")
elif fym:
  print("YYMM")
else:
  print("NA")

Failing test case input:
2255

Expected output:
NA


Actual output:
22 55
NA


Fixed submission (verdict: Accepted):
S = input()
a = int(S[0:2])
b = int(S[2:4])
fym = False
fmy = False
if 1<=a<=12:
  fmy = True
if 1<=b<=12:
  fym = True
if fmy and fym:
  print("AMBIGUOUS")
elif fmy:
  print("MMYY")
elif fym:
  print("YYMM")
else:
  print("NA")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

A = 10 * int(S[0]) + int(S[1])
B = 10 * int(S[2]) + int(S[3])




flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B and B <= 19: 
    flag_MMYY = 1
if 1 <= B and B <= 12 and 1 <= A and A <= 19: 
    flag_YYMM = 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Failing test case input:
3708

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
S = input()

A = 10 * int(S[0]) + int(S[1])
B = 10 * int(S[2]) + int(S[3])




flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 : 
    flag_MMYY = 1
if 1 <= B and B <= 12 : 
    flag_YYMM = 1
    
if flag_YYMM == 0 and flag_MMYY == 0 : 
    print("NA")
elif flag_YYMM == 0 and flag_MMYY == 1 : 
    print("MMYY")
elif flag_YYMM == 1 and flag_MMYY == 0 : 
    print("YYMM")
elif flag_YYMM == 1 and flag_MMYY == 1 : 
    print("AMBIGUOUS")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
head, tail = int(S[:2]), int(S[2:])

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

Failing test case input:
1297

Expected output:
MMYY


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
S = input()
head, tail = int(S[:2]), int(S[2:])
if 0 < head < 13:
    if 0 < tail < 13:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0 < tail < 13:
        print('YYMM')
    else:
        print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
read = input
s = read()
a, b = map(int , [s[:2], s[3:]])
YYMM = False
MMYY = False
if 1 <= b and b <= 12:
    YYMM = True
if 1 <= a and a <= 12:
    MMYY = True
if YYMM and MMYY :
    print('AMBIGUOUS')
elif YYMM and not MMYY:
    print('YYMM')
elif not YYMM and MMYY:
    print('MMYY')
else :
    print('NA')

Failing test case input:
3471

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
read = input
s = read()
a, b = map(int , [s[:2], s[2:]])
YYMM = False
MMYY = False
if 1 <= b and b <= 12:
    YYMM = True
if 1 <= a and a <= 12:
    MMYY = True
if YYMM and MMYY :
    print('AMBIGUOUS')
elif YYMM and not MMYY:
    print('YYMM')
elif not YYMM and MMYY:
    print('MMYY')
else :
    print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = int(input())
    f = s/100
    b = s%100

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

main()


Failing test case input:
1297

Expected output:
MMYY


Actual output:
NA


Fixed submission (verdict: Accepted):
def main():
    s = int(input())
    f = int(s/100)
    b = s%100
    
    if f > 0 and f <= 12:
        if b > 0 and b <= 12:
            print("AMBIGUOUS")
        else:
            print("MMYY")
    else:
        if b > 0 and b <= 12:
            print("YYMM")
        else:
            print("NA")

main()

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

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

if a == "00":
    if b == "00" or int(b) > 12:
        print("NA")
    else:
        print("YYMM")
elif b == "00":
    if a == "00" or int(a) > 12:
        print("NA")
    else:
        print("MMYY")
elif int(a) > 12:
    if int(b) >12:
        print("NA")
    else:
        print("YYMM")
elif int(b) > 12:
    if int(a) >12:
        print("NA")
    else:
        print("YYMM")
else:
    print("AMBIGUOUS")

Failing test case input:
1179

Expected output:
MMYY


Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = input()

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

if a == "00":
    if b == "00" or int(b) > 12:
        print("NA")
    else:
        print("YYMM")
elif b == "00":
    if  int(a) > 12:
        print("NA")
    else:
        print("MMYY")
elif int(a) > 12:
    if int(b) >12:
        print("NA")
    else:
        print("YYMM")
elif int(b) > 12:
    if int(a) >12:
        print("NA")
    else:
        print("MMYY")
else:
    print("AMBIGUOUS")

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
s = input()

l = int(s[:2])
r = int(s[2:])

is_yymm = False
is_mmyy = False

if l < 1 or 99 < l or r < 1 or 99 < r:
  print('NA')
  sys.exit()

if 1 <= l and l <= 12:
  is_mmyy = True

if 1 <= r and r <= 12:
  is_yymm = True

if is_mmyy and is_yymm:
  print('AMBIGUOUS')
elif is_mmyy:
  print('MMYY')
elif is_yymm:
  print('YYMM')

Failing test case input:
3459

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
s = input()

l = int(s[:2])
r = int(s[2:])

is_yymm = False
is_mmyy = False

if 1 <= l and l <= 12 and 0 <= r and r <= 99:
  is_mmyy = True

if 1 <= r and r <= 12 and 0 <= l and l <= 99:
  is_yymm = True

if is_mmyy and is_yymm:
  print('AMBIGUOUS')
elif is_mmyy:
  print('MMYY')
elif is_yymm:
  print('YYMM')
else:
  print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

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


Failing test case input:
16195

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = list(input())
bef=int(s[0])*10+int(s[1])
aft=int(s[2])*10+int(s[3])

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

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
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')


Failing test case input:
2131

Expected output:
NA


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
s = input()
l = int(s[:2])
r = int(s[2:])

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])
if 1 <= a <= 12 and 1 <= b <=12:
  print("AMBIGUOUS")
elif 13 <= a <= 99 and 1 <= b <= 12:
  print("YYMM")
elif 1 <= a <= 12 and 13 <= b <= 99:
  print("MMYY")
elif a == 0 or b == 0:
  print("NA")

Failing test case input:
8329

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
n = input()
a = int(n[0]+n[1])
b = int(n[2]+n[3])

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=n<13
b=m<13
ans='NA'
if a and b:
  ans='AMBIGUOS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)


Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s=input()
fo=s[0:2]
la=s[2:]
n=int(fo)
m=int(la)
a=(n<13) and (n>0)
b=(m<13) and (m>0)
ans='NA'
if a and b:
  ans='AMBIGUOUS'
elif a and not b:
  ans='MMYY'
elif not a and b:
  ans='YYMM'
else:
  ans='NA'
print(ans)

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
a=int(s[:2])
b=int(s[2:])
if 0<a<13 and 0<b<13:
    print("AMBIGUOUS")
elif 0<=a and 0<b<13:
    print("YYMM")
elif 0<=b and 0<a<13:
    print("YYMM")
else:
    print("NA")

Failing test case input:
1055

Expected output:
MMYY


Actual output:
YYMM


Fixed submission (verdict: Accepted):
s=input()
a=int(s[:2])
b=int(s[2:])
if 0<a<13 and 0<b<13:
    print("AMBIGUOUS")
elif 0<=a and 0<b<13:
    print("YYMM")
elif 0<=b and 0<a<13:
    print("MMYY")
else:
    print("NA")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
be=s[:2]
af=s[2:]

if int(af)<=12:
  if af=="00":
    print("NA")
  else:
    print("YYMM")
    
elif int(be)<=12:
  if be=="00":
    print("NA")
  else:
    print("MMYY")
    
elif int(be)<=12 and int(af)<=12:
  print("AMBIGUOUS")
  
else:
  print("NA")

Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s=input()
be=s[:2]
af=s[2:]

if s=="0000":
  print("NA")

elif int(be)<=12 and int(af)<=12 and be!="00" and af!="00":
  print("AMBIGUOUS")

elif int(af)<=12 and af!="00":
    print("YYMM")
    
elif int(be)<=12 and be!="00":
    print("MMYY")
  
else:
  print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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) and (S2 != 0):
  print('MMYY')
elif (12 >= S2 and S2 >= 2) and (S1 != 0):
  print('YYMM')
else :
  print('NA')

Failing test case input:
1701

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
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 >= 1):
  print('YYMM')
else :
  print('NA')

Problem: p03042
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S = str(input())
year = S[0] + S[1]
month = S[2] + S[3]
if int(year) > 12 and int(month) != 0:
    print('YYMM')
elif int(month) > 12 and int(month) != 0:
    print('MMYY')
elif int(year) <= 12 and int(month) <= 12:
    print('AMBIGUOUS')
else:
    print('NA')

Failing test case input:
5498

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
S = str(input())
year = int(S[0] + S[1])
month = int(S[2] + S[3])
if year <= 12 and year >= 1 and month >= 1 and month <= 12:
    print('AMBIGUOUS')
elif year >= 0 and year <= 99 and month >= 1 and month <= 12:
    print('YYMM')
elif year >= 1 and year <= 12 and month >= 0 and month <= 99:
    print('MMYY')
else:
    print('NA')

Problem: p03042
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
if 0 < int(s[:2]) and int(s[2:]) < 13:
    print("AMBIGUOUS")
elif 0 < int(s[:2]) < 13:
    print("MMYY")
elif 0 < int(s[2:]) < 13:
    print("YYMM")
else:
    print("NA")

Failing test case input:
6210

Expected output:
YYMM


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
s = input()
if 0 < int(s[:2]) <13 and 0< int(s[2:]) < 13:
    print("AMBIGUOUS")
elif 0 < int(s[:2]) < 13:
    print("MMYY")
elif 0 < int(s[2:]) < 13:
    print("YYMM")
else:
    print("NA")
Problem: p03042
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:-1])
count1 = 0
count2 = 0
if AA >12:
  count1 +=1
if BB >12:
  count2 +=2
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Failing test case input:
8393

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
NN = input()
AA = int(NN[0:2])
BB = int(NN[2:])

count1 = 0
count2 = 0
if AA > 12 or AA == 00:
  count1 +=1
if BB > 12 or BB == 00:
  count2 +=1
if count1 == 0 and count2 == 0:
  print('AMBIGUOUS')
elif count1 ==1 and count2 == 0:
  print('YYMM')
elif count1 ==0 and count2 == 1:
  print('MMYY')
else:
  print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
data = list( input() )
n1 = int( data[0] + data[1] )
n2 = int( data [2] + data[3] )

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

Failing test case input:
13652

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
data = list( input() )
n1 = int( data[0] + data[1] )
n2 = int( data [2] + data[3] )

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
b = 0 < int(S[0:2]) < 12
a = 0 < int(S[3:]) < 12

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

Failing test case input:
3984

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
S = input()
b = 0 < int(S[0:2]) <= 12
a = 0 < int(S[2:]) <= 12

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if S1 == 0 or S2 == 0:
    print('NA')
elif S1 > 13 and S2 < 13:
    print('YYMM')
elif S1 < 13 and S2 > 13:
    print('MMYY')
else:
    print('AMBIGUOUS')

Failing test case input:
8329

Expected output:
NA


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
S = input()
S1 = int(S[:2])
S2 = int(S[2:])

if 1<=S1<=12 and 1<=S2<=12:
    print('AMBIGUOUS')
elif 1<=S1<=12:
    print('MMYY')
elif 1<=S2<=12:
    print('YYMM')
else:
    print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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')


Failing test case input:
1291

Expected output:
MMYY


Actual output:
NA


Fixed submission (verdict: Accepted):
a = input()
b=int(a[0:2])
c=int(a[2:4])
if 1<=b<=12 and 1<=c<=12:
    print('AMBIGUOUS')
elif 1<=b<=12 :
    print('MMYY') 
elif 1<=c<=12:
    print('YYMM')
else:
    print('NA')

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input();
first = s[0:2]
second = s[2:4]

first = int(first)
second = int(second)

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("YYMM")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("YYMM")

else:
    if 0 < second and second < 13:
        print("YYMM")
    elif 13 <= second:
        print("NA")
    else:
        print("NA")

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = input();
first = s[0:2]
second = s[2:4]

first = int(first)
second = int(second)

if 0 < first and first < 13:
    if 0 < second and second < 13:
        print("AMBIGUOUS")
    elif (13 <= second):
        print("MMYY")
    else:
        print("MMYY")

elif 13 <= first:
    if 0 < second and second < 13:
        print("YYMM")
    elif (13 <= second):
        print("NA")
    else:
        print("NA")

else:
    if 0 < second and second < 13:
        print("YYMM")
    elif 13 <= second:
        print("NA")
    else:
        print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
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")

Failing test case input:
4353

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
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")