ZhenlongDai/ACPR huggingface dataset:
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):




def main():
    S = input()

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

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


if __name__ == '__main__':
    main()

    

Failing test case input:
3454

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):




def main():
    S = input()

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

    
    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")
    elif bb >= 1 and bb <= 12:
        print("YYMM")
    else:
        print("NA")


if __name__ == '__main__':
    main()

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

Failing test case input:
1016

Expected output:
MMYY


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
S=input()
ym=False
my=False
if 1<=int(S[0:2])<=12:
    my=True
if 1<=int(S[2:4])<=12:
    ym=True
if my and ym:
    print('AMBIGUOUS')
elif my:
    print('MMYY')
elif ym:
    print('YYMM')
else:
    print('NA')

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

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

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

Failing test case input:
6620

Expected output:
NA


Actual output:
YYMM


Fixed submission (verdict: Accepted):
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) or (mae == 0 and ato == 0):
    ans = "NA"
elif mae > 12 or mae == 0:
    ans = "YYMM"
elif ato > 12 or ato == 0:
    ans = "MMYY"
else:
    ans = "AMBIGUOUS"
print(ans)

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

i1 = int(s1)
i2 = int(s2)
 
if i1 == 0 or i2 == 0: res ="NA"
if i1 <=12:
    if i2 <= 12:
        res = "AMBIGUOUS"
    else:
        res = "MMYY"
elif 12 < i1:
    if i2 <= 12:
        res = "YYMM"
    else:
        res = "NA"

print(res)


Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = input()
s1 = s[0:2]
s2 = s[2:4]

i1 = int(s1)
i2 = int(s2)
 
if 1 <= i1 <=12 and 1 <= i2 <= 12:
    res = "AMBIGUOUS"
elif 1 <= i1 <= 12:
    res = "MMYY"
elif 1 <= i2 <= 12:
    res = "YYMM"
else:
    res = "NA"

print(res)
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
elif first_half[0] is True and second_half[1] is True:
  print('MMYY')
elif first_half[1] == False and second_half[0] is True:
  print('YYMM')
else:
  print('NA')

Failing test case input:
4704

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
def is_month(input_str):
  if 1 <= int(input_str) and int(input_str) <= 12:
    return True
  else:
    return False
    
def is_year(input_str):
  if 0 <= int(input_str) and int(input_str) <= 99:
    return True
  else:
    return False

s=input().strip()
first_half = [is_month(s[:2]), is_year(s[:2])]
second_half = [is_month(s[2:]), is_year(s[2:])]

if (first_half == [True, True] and second_half == [True, True]):
  print('AMBIGUOUS')
elif first_half[0] is True and second_half[1] is True:
  print('MMYY')
elif first_half[1] is True and second_half[0] is True:
  print('YYMM')
else:
  print('NA')

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
a = S[0:2]
b = S[2:4]
print(a)
print(b)


def mm(s):
    if int(s) <= 12 and 1 <= int(s):
        return True
    return False


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


Failing test case input:
5498

Expected output:
NA


Actual output:
54
98
NA


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


def mm(s):
    if int(s) <= 12 and 1 <= int(s):
        return True
    return False


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

Problem: p03042
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = list(input())
ab = int(s[0]+s[1])
cd = int(s[2]+s[3])
ans = ""
if 1 <= ab <= 12 and (cd == 0 or 13 <= cd):
    ans = "MMYY"
elif 1 <= cd <= 12 and (ab == 0 or 13 <= ab):
    ans = "YYNN"
elif 1 <= ab <= 12 and 1 <= cd <= 12:
    ans = "AMBIGUOUS"
else:
    ans = "NA"
print(ans)


Failing test case input:
7110

Expected output:
YYMM


Actual output:
YYNN


Fixed submission (verdict: Accepted):
s = list(input())
ab = int(s[0]+s[1])
cd = int(s[2]+s[3])
ans = ""
if 1 <= ab <= 12 and (cd == 0 or 13 <= cd):
    ans = "MMYY"
elif 1 <= cd <= 12 and (ab == 0 or 13 <= ab):
    ans = "YYMM"
elif 1 <= ab <= 12 and 1 <= cd <= 12:
    ans = "AMBIGUOUS"
else:
    ans = "NA"
print(ans)
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
if 0<int(a[:2])<=12:
  if 0<int(a[2:])<=12:
    print("AMBIGIUOUS")
  else:
    print("MMYY")
else:
  if 0<int(a[2:])<=12:
    print("YYMM")
  else:
    print("NA")

Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGIUOUS


Fixed submission (verdict: Accepted):
a = input()
if 0<int(a[:2])<=12:
  if 0<int(a[2:])<=12:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  if 0<int(a[2:])<=12:
    print("YYMM")
  else:
    print("NA")

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

aa = day[:2]
bb = day[2:]

if 1 <= int(aa) <= 12 and 0 <= int(bb) <= 99:
  print('MMYY')
elif 0 <= int(aa) <= 99 and 1 <= int(bb) <= 12:
  print('YYMM')
elif 1 <= int(aa) <= 12 and 1 <= int(bb) <= 12:
  print('AMBIGUOUS')
else:
  print('NA')

Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
MMYY


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

aa = day[:2]
bb = day[2:]

if 1 <= int(aa) <= 12 and 1 <= int(bb) <= 12:
  print('AMBIGUOUS')
elif 1 <= int(aa) <= 12 and 0 <= int(bb) <= 99:
  print('MMYY')
elif 0 <= int(aa) <= 99 and 1 <= int(bb) <= 12:
  print('YYMM')
else:
  print('NA')

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

s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12 and 1 <= y <= 12:
    print("AMBIGUOUS")
elif 1 <= x <= 12 and 13 <= y <= 31:
    print("MMYY")
elif 13 <= x <= 31 and 1 <= y <= 12:
    print("YYMM")
else:
    print("NA")

Failing test case input:
5002

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):

s = input()
x, y = int(s[:2]), int(s[2:])
if 1 <= x <= 12:
    if 1 <= y <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= y <= 12:
        print("YYMM")
    else:
        print("NA")

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

head = S[:2]
tail = S[2:]


if 12>=int(head)>=1 and 12>=int(tail)>=1:
    print("AMBIGUOUS")
elif 12>=int(head)>=1:
    print("YYMM")
elif 12>=int(tail)>=1:
    print("MMYY")
else:
    print("NA")

Failing test case input:
2206

Expected output:
YYMM


Actual output:
MMYY


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

head = S[:2]
tail = S[2:]


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

Failing test case input:
3708

Expected output:
YYMM


Actual output:
NA


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

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

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

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if S[0:2] in M and not(S[2:] in M):
    print("MMYY")
elif not(S[0:2] in M) and S[2:] in M:
    print("YYMM")
elif S[0:2] in M and S[2:] in M:
    print("AMBIGUOUS")
else:
    print("NA")

Failing test case input:
1291

Expected output:
MMYY


Actual output:
NA


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

M = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]

if "".join(S[0:2]) in M and not("".join(S[2:]) in M):
    print("MMYY")
elif not("".join(S[0:2]) in M) and "".join(S[2:]) in M:
    print("YYMM")
elif "".join(S[0:2]) in M and "".join(S[2:]) in M:
    print("AMBIGUOUS")
else:
    print("NA")

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

if 0 < int(a[:2]) and int(a[:2]) <= 12:
    if 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("MMYY")

elif 0 < int(a[2:]) and int(a[2:]) <= 12:
    if 0 < int(a[:2]) and int(a[:2]) <= 12:
        print("AMBIGUOUSS")
    else:
        print("YYMM")
else:
    print("NA")


Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGUOUSS


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

if 0 < int(a[:2]) and int(a[:2]) <= 12:
    if 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")

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

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

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

Failing test case input:
1905

Expected output:
YYMM

Actual output:
NA


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

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

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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
front = int(s[:2])
back = int(s[2:4])
if front <= 12 and back <= 12:
    print('AMBIGUOUS')
elif (front <=12 and back > 12):
    print('MMYY')
elif front > 12 and back <=12:
    print('YYMM')
else:
    print('NA')

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
s = input()
front = int(s[:2])
back = int(s[2:4])
if 0 < front <= 12 and 0 < back <= 12:
    print('AMBIGUOUS')
elif 0 < front <=12 and (back > 12 or back == 0):
    print('MMYY')
elif (front > 12 or front == 0) and  0 < back <=12:
    print('YYMM')
else:
    print('NA')

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

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
n=input()
l,r=int(n[:2]),int(n[2:])
if (r>12 or r==0) and l<=12 and l>0:
  print("MMYY")
elif r<=12 and r>0 and (l>12 or l==0):
  print("YYMM")
elif r<=12 and l<=12 and r>0 and l>0:
  print("AMBIGUOUS")
else:
  print("NA")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(input()) 
for i in range(len(a)):
    a[i] = int(a[i])
ue = a[0]*10 + a[1]
sita = a[2]*10 + a[3]
if (ue >= 12) & (sita >= 12):
    print('NA')
elif (ue <= 12) & (sita <= 12):
    if (sita == 0) & (ue == 0):
        print('NA')
    else:
        ('AMBIGUOUS')
elif ue >= 12:
    if (sita <= 12) & (sita >= 0):
        print('YYMM')
    else:
        print('NA')
elif sita >= 12:
    if (ue <= 12) & (ue >= 0):
        print('MMYY')
    else:
        print('NA')

Failing test case input:
1291

Expected output:
MMYY


Actual output:
NA


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

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

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


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

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


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

if a > 12:
	if b > 12:
		print("NA")
	elif b > 0:
		print("YYMM")
	else:
		print("NA")

if 0 < a <= 12:
	if b > 12 or b == 0:
		print("MMYY")
	else:
		print("AMBIGUOUS") 

if a == 0:
	if b > 12:
		print("NA")
	elif 0 < b <= 12:
		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 bef>12 and 0<aft<32:
  ans='YYMM'
elif aft>31 and 0<bef<13:
  ans='MMYY'
elif 0<aft<13 and 0<bef<13:
  ans='AMBIGUOUS'
else:
  ans='NA'
print(ans)


Failing test case input:
6718

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 (Python (3.4.3), verdict: Wrong Answer):
s = str(input())
a = int(s[:2])
b = int(s[2:])

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

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


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

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

Problem: p03042
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

s = input()

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'

elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'
elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    print(n2)
    if int(n2) == 0:
        out_print = 'NA'

print(out_print)

Failing test case input:
2307

Expected output:
YYMM


Actual output:
07
YYMM


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

n1 = s[0:2]
n2 = s[2:4]

if int(n1) > 12 and int(n2) > 12:
    out_print = 'NA'

elif int(n1) <= 12 and int(n2) <= 12:
    out_print = 'AMBIGUOUS'
    if int(n1) == 0 and int(n2)!=0:
        out_print = 'YYMM'
    elif int(n1) != 0 and int(n2) == 0:
        out_print = 'MMYY'
    elif int(n1)==0 and int(n2)==0:
        out_print = 'NA'

elif int(n1) <= 12 and int(n2) >12:
    out_print = 'MMYY'
    if int(n1) == 0:
        out_print = 'NA'

elif int(n1) > 12 and int(n2) <= 12:
    out_print = 'YYMM'
    if int(n2) == 0:
        out_print = 'NA'
print(out_print)

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

if F < 12 and SE < 12:
  print("NA")

if F > 12 and SE <= 12:
  print("YYMM")

if F <= 12 and SE > 12:
  print("MMYY")

if F <= 12 and SE <= 12:
  print("AMBIGUOUS")


  

Failing test case input:
6620

Expected output:
NA


Actual output:

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


if F > 12 and 1 <= SE <= 12:
  print("YYMM")
elif 1 <= F <= 12 and SE > 12:
  print("MMYY")
elif 1 <= F <= 12 and 1 <= SE <= 12:
  print("AMBIGUOUS")
elif F == 0 and 1 <= SE <= 12:
  print("YYMM")
elif 1 <= F <= 12 and SE == 0:
  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:])

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


Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
AMBIGOUS


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


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

elif a<=12 and (b == 0 or b > 12) and a > 0:
  print("MMYY")
  
elif b<=12 and b > 0 and (a == 0 or a > 12):
  print("YYMM")
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 n1 <= 12 and n2 <= 12:
    print('AMBIGUOUS')
elif n1 <= 12:
    print('MMYY')
elif n2 <= 12:
    print('YYMM')
else:
    print('NA')

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


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 (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()
a, b = int(S[:2]), int(S[2:])
if (1 <= a <= 12):
    if (1 <= b <= 12):
        print('AMBIGUIOUS')
    else:
        print('MMYY')
else:
    if (1 <= b <= 12):
        print('YYMM')
    else:
        print('NA')


Failing test case input:
0112

Expected output:
AMBIGUOUS

Actual output:
AMBIGUIOUS


Fixed submission (verdict: Accepted):
S = input()
a, b = int(S[:2]), int(S[2:])
if (1 <= a <= 12):
    if (1 <= b <= 12):
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if (1 <= b <= 12):
        print('YYMM')
    else:
        print('NA')

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

Failing test case input:
1700

Expected output:
NA

Actual output:
YYMM


Fixed submission (verdict: Accepted):
S = input()
Y = int(S[:2])
M = int(S[2:])

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

Failing test case input:
1179

Expected output:
MMYY


Actual output:
NA


Fixed submission (verdict: Accepted):
s = input()
j = int(s[:2])
k = int(s[2:])
if 0 < j <= 12 and 0 < k <= 12:
    print("AMBIGUOUS")
elif 0 <= j <= 99 and 0 < k <= 12:
    print("YYMM")
elif 0 <= k <= 99 and 0 < j <= 12:
    print("MMYY")
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])

print(A)
print(B)

flag_YYMM = 0
flag_MMYY = 0

if 1 <= A and A <= 12 and 1 <= B : 
    flag_MMYY += 1
if 1 <= B and B <= 12 and 1 <= A : 
    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:
3341

Expected output:
NA


Actual output:
33
41
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()
a = int(S[0]+S[1])
b = int(S[2]+S[3])
isyymm = 0
ismmyy = 0
if a>0 and b>0 and a<=19 and b<=19:
    if a<=12:
        ismmyy = 1
    if b<=12:
        isyymm = 1

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


Failing test case input:
2206

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
S = input()
a = int(S[0]+S[1])
b = int(S[2]+S[3])
isyymm = 0
ismmyy = 0
if a>=0 and b>=0:
    if a<=12 and a>0:
        ismmyy = 1
    if b<=12 and b>0:
        isyymm = 1

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

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

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

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

Failing test case input:
2233

Expected output:
NA


Actual output:
AMBIGUOUS


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

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

if yy <= 12 and mm <= 12 and yy != 0 and mm != 0:
    print('AMBIGUOUS')
elif mm <= 12 and mm != 0:
    print('YYMM')
elif yy <= 12 and yy != 0:
    print('MMYY')
else:
    print('NA')
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
X = input()

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])

if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X2 > 12) or (X2 == 0)) and (1 <= X1 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

Failing test case input:
5002

Expected output:
YYMM


Actual output:
NA


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

X1 = 10*int(X[0]) + int(X[1])
X2 = 10*int(X[2]) + int(X[3])
if (1 <= X1 <= 12) and ((X2 > 12) or (X2 == 0)):
    print("MMYY")
elif ((X1 > 12) or (X1 == 0)) and (1 <= X2 <= 12):
    print("YYMM")
elif (1 <= X1 <= 12) and (1 <= X2 <= 12):
    print("AMBIGUOUS")
else:
    print("NA")

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

Failing test case input:
3708

Expected output:
YYMM


Actual output:
NA


Fixed submission (verdict: Accepted):
s = input()
 
a=int(s[0]+s[1])
b=int(s[2]+s[3])
 
if 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")

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


S12 = int(S_list[0]+S_list[1])
S34 = int(S_list[2]+S_list[3])

flagYYMM = 0
flagMMYY = 0

if S12 == 00 or S34 == 00:
    print("NA")
    exit()

if S34 <= 12:
    flagYYMM = 1

if S12 <= 12:
    flagMMYY = 1

if flagYYMM == 1 and flagMMYY == 1:
    print("AMBIGUOUS")

elif flagYYMM == 1:
    print("YYMM")

elif flagMMYY == 1:
    print("MMYY")


Failing test case input:
6757

Expected output:
NA


Actual output:

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


S12 = int(S_list[0]+S_list[1])
S34 = int(S_list[2]+S_list[3])

flagYYMM = 0
flagMMYY = 0

if 1 <= S34 <= 12:
    flagYYMM = 1

if 1 <= S12 <= 12:
    flagMMYY = 1

if S12 > 13 and S34 == 00:
    flagMMYY = 0

if S34 > 13 and S12 == 00:
    flagYYMM = 0

if flagYYMM == 1 and flagMMYY == 1:
    print("AMBIGUOUS")

elif flagYYMM == 1:
    print("YYMM")

elif flagMMYY == 1:
    print("MMYY")

else:
    print("NA")

Problem: p03042
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
  s=input()
  sa=int(s[:2])
  sb=int(s[2:])
  if (1 <= sa and sa <= 12) and (1 <= sb and sb <= 12):
    print('AMBIGUOUS')
  elif (sa == 0 or sb ==0):
    print('NA')
  elif (sa > 12) and (1 <= sb and sb <= 12):
    print('YYMM')
  else:
    print('MMYY')
main()

Failing test case input:
2180

Expected output:
NA


Actual output:
MMYY


Fixed submission (verdict: Accepted):
def main():
  s=input()
  sa=int(s[:2])
  sb=int(s[2:])
  if 1 <= sa and sa <= 12:
    if 1 <= sb and sb <= 12:
      print('AMBIGUOUS')
    else:
      print('MMYY')
  else:
    if 1 <= sb and sb <= 12:
      print('YYMM')
    else:
      print('NA')
main()
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if 1 <= int(s[:2]) <= 12 and 1 <= int(s[2:]):
    print('AMBIGUOUS')
elif 1 <= int(s[:2]) <= 12:
    print('MMYY')
elif 1 <= int(s[2:]) <= 12:
    print('YYMM')
else:
    print("NA")


Failing test case input:
1016

Expected output:
MMYY


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
s = input()
if 1 <= int(s[:2]) <= 12:
    if 1 <= int(s[2:]) <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= int(s[2:]) <= 12:
        print('YYMM')
    else:
        print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 0 < A < 13:
    if 0 < B < 13:
        print("AMBIGUOS")
    else:
        print("MMYY")
else:
    if 0 < B < 13:
        print("YYMM")
    else:
        print("NA")

Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
AMBIGUOS


Fixed submission (verdict: Accepted):
S = list(input())
A = int("".join([S[0],S[1]]))
B = int("".join([S[2],S[3]]))


if 1 <= A <= 12:
    if 1 <= B <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if 1 <= B <= 12:
        print("YYMM")
    else:
        print("NA")

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

Failing test case input:
3948

Expected output:
NA


Actual output:
AMBIGUOUS


Fixed submission (verdict: Accepted):
s = input()
yy = int(s[:2])
mm = int(s[2:])
if  0 < yy <= 12 and 0 < mm <= 12:
    print("AMBIGUOUS")
elif 0 < yy <= 12:
    print("MMYY")
elif 0 < mm <= 12:
    print("YYMM")
else:
    print("NA")

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<20:
    if M>0 and M<13:
        code=1

if M<20:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2
        
if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")

Failing test case input:
1297

Expected output:
MMYY


Actual output:
NA


Fixed submission (verdict: Accepted):


A=input()
Y=int(A[0])*10+int(A[1])
M=int(A[2])*10+int(A[3])
code=0
if Y<100:
    if M>0 and M<13:
        code=1

if M<100:
    if Y>0 and Y<13:
        if code==1:
            code=3
        else:
            code=2

if code == 0:
    print("NA")
if code ==1:
    print("YYMM")
if code ==2:
    print("MMYY")
if code == 3:
    print("AMBIGUOUS")
Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
S_a = int(S[0] + S[1])
S_b = int(S[2] + S[3])
if((S_a >= 1 and S_a <= 12) and (S_b < 1 or S_b > 12)):
  print('MMYY')
elif((S_a < 1 or S_a > 12) and (S_b >= 1 and S_b <= 12)):
  print('YYMM')
elif((S_a >= 1 and S_a <= 12) and (S_b >= 1 and S_b <= 12)):
  print('AMBIGUOUS')
else:
  print('NO')

Failing test case input:
2180

Expected output:
NA


Actual output:
NO


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

Problem: p03042
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ls=list(input())
first=[ls[0],ls[1]]
second=[ls[2],ls[3]]

if ls[0]=="0":
    del first[0]
if ls[2]=="0":
    del second[0]

a=int("".join(first))
b=int("".join(second))

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

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

Failing test case input:
1211

Expected output:
AMBIGUOUS


Actual output:
ANBIGUOUS


Fixed submission (verdict: Accepted):
ls=list(input())
first=[ls[0],ls[1]]
second=[ls[2],ls[3]]

if ls[0]=="0":
    del first[0]
if ls[2]=="0":
    del second[0]

a=int("".join(first))
b=int("".join(second))

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

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

Problem: p03042
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda: sys.stdin.readline().rstrip()

S = input()

f = int(S[:2])
s = int(S[2:])

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


Failing test case input:
13652

Expected output:
NA


Actual output:

Fixed submission (verdict: Accepted):
import sys
input = lambda: sys.stdin.readline().rstrip()

S = input()

f = int(S[:2])
s = int(S[2:])

if (f <= 0 and s > 12) or (f > 12 and s <= 0) or (f <= 0 and s <= 0) or (f > 12 and s > 12):
    print("NA")  
elif (f > 12 and 0 < s <= 12) or (f <= 0 and 0 < s <= 12):
    print("YYMM")
elif (0 < f <= 12 and s > 12) or (0 < f <= 12 and s <= 0):
    print("MMYY")
elif 0 < f <= 12 and 0 < s <= 12:
    print("AMBIGUOUS")
Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:0}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0])



Failing test case input:
8 5
3 6 2 8 7 11 1 9

Expected output:
16


Actual output:
0


Fixed submission (verdict: Accepted):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:1}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0]-1)

Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:2}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0]-2)



Failing test case input:
33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 0 0 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3

Expected output:
1073741823


Actual output:
2147483646


Fixed submission (verdict: Accepted):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:1}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0]-1)

Problem: p04015
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from collections import defaultdict

n, a = map(int, input().split())
x = list(map(int, input().split()))
y = [xi - a for xi in x]


dp = [defaultdict(int) for i in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    for j in dp[i]:
        dp[i + 1][j + y[i]] += dp[i][j]
        dp[i + 1][j] += dp[i][j]
        print(dp[i][j],dp[i+1][j+y[i]],dp[i + 1][j])
print(dp[n][0] - 1)


Failing test case input:
8 8
3 10 2 3 3 2 5 10

Expected output:
0


Actual output:
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
1 2 1
1 2 1
1 2 1
1 2 1
1 1 1
2 3 2
1 1 1
2 3 2
1 1 1
2 3 2
1 1 1
2 3 2
1 3 1
1 3 1
1 3 1
1 3 1
1 1 1
3 3 3
3 3 3
1 2 1
3 6 3
3 6 3
1 1 1
3 3 3
3 3 3
1 2 4
3 6 3
3 6 3
1 4 1
1 2 1
1 1 1
1 2 1
1 1 1
2 2 2
3 3 3
6 6 6
4 4 4
6 6 6
1 1 1
3 3 3
3 3 3
1 1 1
2 2 2
3 4 5
6 8 7
3 6 9
6 12 9
4 5 4
3 6 3
2 2 2
1 1 1
1 5 7
2 8 5
1 4 1
1 1 1
4 4 4
5 5 5
8 8 8
3 3 7
6 6 11
9 9 17
12 12 12
4 4 10
5 5 14
7 7 19
8 8 8
7 19 11
5 5 10
9 17 14
6 6 6
5 5 11
4 4 4
1 2 1
1 5 1
2 7 2
2 10 5
4 10 11
3 7 3
2 5 10
2 2 7
1 1 5
1 1 1
1 2 1
0


Fixed submission (verdict: Accepted):
from collections import defaultdict

n, a = map(int, input().split())
x = list(map(int, input().split()))
y = [xi - a for xi in x]


dp = [defaultdict(int) for i in range(n + 1)]
dp[0][0] = 1

for i in range(n):
    for j in dp[i]:
        dp[i + 1][j + y[i]] += dp[i][j]
        dp[i + 1][j] += dp[i][j]

print(dp[n][0] - 1)
Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[0 for _ in range(A)] for _ in range(N + 1)]  
dp[0][0] = 1

for i in range(N):
    for mod in range(A):
        dp[i + 1][mod] += dp[i][mod]
        dp[i + 1][(mod + X[i]) % A] += dp[i][mod]

print(dp[N][0] - 1)

Failing test case input:
3 11
15 0 20

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
N, A = map(int, input().split())
X = list(map(int, input().split()))
Y = [x - A for x in X]

dp = [[0 for _ in range(20000)] for _ in range(N + 1)]

def bias(n):
    return n + 5000

dp[0][bias(0)] = 1

for i in range(N):
    for s in range(-5000, 5000):
        dp[i + 1][bias(s)] += dp[i][bias(s)]
        dp[i + 1][bias(s + Y[i])] += dp[i][bias(s)]

print(dp[N][bias(0)] - 1)

Problem: p04015
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N , A = map(int, input().split())
x = [0] + list((map(int, input().split())))

ans = 0
for num in range(1, N+1): 
    goal = num * A
    dp = [[0 for _ in range(goal + 1)] for _ in range(N+1)] 
    dp[0][0] = 1
    for i in range(1, N+1):
        for j in range(goal+1):
            dp[i][j] += dp[i-1][j]
            if j >= x[i]:
                dp[i][j] += dp[i-1][j-x[i]]
    
    ans += dp[N][goal]

print(ans)

Failing test case input:
8 5
3 6 2 8 7 2 5 16

Expected output:
17


Actual output:
48


Fixed submission (verdict: Accepted):
N , A = map(int, input().split())
x = [0] + list((map(int, input().split())))

ans = 0

dp = [[[0 for _ in range(N*A + 1)] for _ in range(N+1)] for _ in range(N+1)] 
dp[0][0][0] = 1
for i in range(1, N+1):
    for num in range(i+1):
        for j in range(N * A+1):
            dp[i][num][j] += dp[i-1][num][j]
            if j >= x[i]:
                dp[i][num][j] += dp[i-1][num-1][j-x[i]]

for num in range(1, N+1):
    ans += dp[N][num][num * A]

print(ans)

Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:0}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0]-1)


Failing test case input:
8 8
0 10 0 3 0 2 5 1

Expected output:
0


Actual output:
-1


Fixed submission (verdict: Accepted):
n,a=map(int, input().split())
x=list(map(int, input().split()))
x=[i-a for i in x]
d={0:1}
for i in x:
    for j,k in list(d.items()):
        d[i+j]=d.get(i+j,0)+k
print(d[0]-1)

Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=map(int,input().split())
dp=[0]*(5300)
l=list(map(int,input().split()))
dp[l[0]-a]=1

for x in l[1:]:
    b=x-a
    for i in range(2550,-2550,-1):
            dp[i]+=dp[i-b]
    dp[b]+=1

print(dp[0])

Failing test case input:
3 8
15 6 9

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n,a=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*5300
dp[l[0]-a]=1

for x in l[1:]:
  b=x-a
  if b>=0:
    for i in range(2500,-2501,-1):
      dp[i+b]+=dp[i]
  else:
    for i in range(-2500,2501):
      dp[i+b]+=dp[i]
  dp[b]+=1
print(dp[0])
Problem: p04015
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in x:
  y.append(i-a)
s=2*n*a
dp=[[0 for i in range(s+1)] for j in range(n+1)]
dp[0][n*a]=1
for i in range(n):
  for j in range(s+1):
    x=j-y[i]
    if(0<=x and x<=2*n*a):
      dp[i+1][j]=dp[i][j-y[i]]+dp[i][j]
    else:
      dp[i+1][j]=dp[i][j]

print(dp[n][n*a])

Failing test case input:
8 8
3 6 2 3 3 2 5 10

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n,a=map(int,input().split())
x=list(map(int,input().split()))
y=[]
for i in x:
  y.append(i-a)
s=2*n*a
dp=[[0 for i in range(s+1)] for j in range(n+1)]
dp[0][n*a]=1
for i in range(n):
  for j in range(s+1):
    x=j-y[i]
    if(0<=x and x<=2*n*a):
      dp[i+1][j]=dp[i][j-y[i]]+dp[i][j]
    else:
      dp[i+1][j]=dp[i][j]

print(dp[n][n*a]-1)
Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,M = list(map(int,"1 30".split()))

ref = [i+1 for i in range(M)]
LIKE = [i+1 for i in range(M)]

for i in range(N):
    myLIKE = list(map(int,"3 5 10 30".split()[1:]))
    for j in ref:
        if j not in myLIKE:
            LIKE.remove(j)
print(len(LIKE))

Failing test case input:
5 5
4 2 3 4 5
4 1 3 4 5
4 1 2 4 5
4 1 2 3 5
4 1 2 3 4

Expected output:
0

Actual output:
3


Fixed submission (verdict: Accepted):
N,M = list(map(int,input().split()))

ref = [i+1 for i in range(M)]
LIKE = [i+1 for i in range(M)]

for i in range(N):
    myLIKE = list(map(int,input().split()[1:]))
    for j in ref:
        try:
            if j not in myLIKE:
                LIKE.remove(j)
        except ValueError:
            pass
            
print(len(LIKE))

Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(list(map(int,input().split()))[1:])
print(len([None for v in ctr.values() if v == M]))

Failing test case input:
3 7
4 1 3
3 1 2 3
2 3 2

Expected output:
1


Actual output:
0


Fixed submission (verdict: Accepted):
from collections import Counter
ctr = Counter()
N, M = map(int,input().split())
for _ in range(N):
  ctr.update(list(map(int,input().split()))[1:])
print(len([None for v in ctr.values() if v == N]))

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

data = input().split()
n = int(data[0]) 
m = int(data[1]) 
ans = 0


j = 1 
i = 1 
c = [0] * (m  *2)
    

while i <= n:
    tmp = input()
    td = tmp[1:] 
    tn = tmp[0]  
    
    
    while j <= m: 
        j = str(j)
        if j in td: 
            j = int(j) 
            c[j] += 1 
        j = int(j) 
        j += 1
    j = 1    
    i += 1 



for x in c:
    if x == n:
        ans += 1



print(ans)


Failing test case input:
1 30
5 2 4 15

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):

data = input().split()
n = int(data[0]) 
m = int(data[1]) 
ans = 0


j = 1 
i = 1 
c = [0] * (m  *2)
    

while i <= n:
    tmp = [int(s) for s in input().split()]
    td = tmp[1:] 
    tn = tmp[0]  
    
    
    while j <= m: 
        
        if j in td: 
            j = int(j) 
            
            c[j] += 1 
        j = int(j) 
        j += 1
    j = 1    
    i += 1 



for x in c:
    if x == n:
        ans += 1



print(ans)
Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N, M = map(int, input().split())

List = []
all_and = []
for i in range(N):
    l = list(map(int, input().split()))
    print(l)
    del l[0]
    print(l)
    List.append(l)
    print(List[i])
    print(List)

    if i ==0:
        all_and = List[0]
    else:
        all_and = set(all_and) & set(List[i])
        all_and = list(all_and)
    print(all_and)
    print()


print(len(all_and))


Failing test case input:
1 30
3 4 10 30

Expected output:
3


Actual output:
[3, 4, 10, 30]
[4, 10, 30]
[4, 10, 30]
[[4, 10, 30]]
[4, 10, 30]

3


Fixed submission (verdict: Accepted):


N, M = map(int, input().split())

List = []
all_and = []
for i in range(N):
    l = list(map(int, input().split()))
    del l[0]
    List.append(l)

    if i ==0:
        all_and = List[0]
    else:
        all_and = set(all_and) & set(List[i])
        all_and = list(all_and)


print(len(all_and))

Problem: p03126
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
z=0
for i in range(n):
    if len(l[i])==n+1:
        z+=1
print(z)

Failing test case input:
3 9
1 0 3
3 0 2 3
0 2 1

Expected output:
0


Actual output:
1


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(n)]
z=[0 for _ in range(m)]
for t in l:
    for i in range(1,len(t)):
        z[t[i]-1]+=1
print(z.count(n))

Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=map(int,input().split())
k=[list(map(int,input().split())) for i in range(n)]
k.sort(key=lambda x: x[0])
cnt=0

for i in k[0][1:]:
    
    c=1
    for j in range(n):
        if i in k[j][1:]:
            c+=1
    
    if c==n:
        cnt+=1
print(cnt)


Failing test case input:
5 5
4 2 3 4 5
4 1 3 4 5
4 1 2 4 5
4 1 2 3 5
4 1 2 3 4

Expected output:
0

Actual output:
4


Fixed submission (verdict: Accepted):
n,m=map(int,input().split())
k=[list(map(int,input().split())) for i in range(n)]
k.sort(key=lambda x: x[0])
cnt=0

for i in k[0][1:]:
    
    c=0
    for j in range(n):
        if i in k[j][1:]:
            c+=1
    
    if c==n:
        cnt+=1
print(cnt)

Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int,input().split())
likes = set([])
for i in range(n):
  like = list(input().split())
  like.pop(0)
  likes = likes & set(like)
print(len(likes))

Failing test case input:
1 52
5 9 10 30

Expected output:
3


Actual output:
0


Fixed submission (verdict: Accepted):
n,m = map(int,input().split())
likes = set(list(input().split())[1:])
for i in range(n-1):
  like = list(input().split()[1:])
  likes = likes & set(like)
print(len(likes))
Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m=[int(i) for i in input().split()]
ans=[0]*m
a=[]
for i in range(n):
    hoge=[int(i) for i in input().split()[1:]]
    a.append(hoge)
for i in range(n):
    for j in range(len(a[i])):
        ans[a[i][j]-1]+=1
print(ans)
print(ans.count(n))

Failing test case input:
1 43
5 9 4 30

Expected output:
3


Actual output:
[0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
3


Fixed submission (verdict: Accepted):
n,m=[int(i) for i in input().split()]
ans=[0]*m
a=[]
for i in range(n):
    hoge=[int(i) for i in input().split()[1:]]
    a.append(hoge)
for i in range(n):
    for j in range(len(a[i])):
        ans[a[i][j]-1]+=1
print(ans.count(n))

Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,m = map(int, input().split())

listA = [list(map(int, input().split())) for j in range(n)]

ans = 0


for a in range(1, m):
    ok = True
    for i in range(n):
        if a not in listA[i][1:]:
            ok = False
    if ok:
        ans += 1



print(ans)

Failing test case input:
1 30
5 4 2 30

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,m = map(int, input().split())

listA = [list(map(int, input().split())) for j in range(n)]

ans = 0


for a in range(1, m+1):
    ok = True
    for i in range(n):
        if a not in listA[i][1:]:
            ok = False
    if ok:
        ans += 1



print(ans)

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


n,m = map(int,input().split() )
b = [0]*m
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, len(a)):
		print(j)
		b[a[j]-1] += 1
ans = b.count(n)
print(ans)



Failing test case input:
1 55
1 5 20 30

Expected output:
3


Actual output:
1
2
3
3


Fixed submission (verdict: Accepted):


n,m = map(int,input().split() )
b = [0]*m
for i in range(n):
	a = list(map(int, input().split()))
	for j in range(1, len(a)):
		b[a[j]-1] += 1
ans = b.count(n)
print(ans)

Problem: p03126
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import collections
n, m = map(int, input().split())
a_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])
col = collections.Counter(a_list)
print(sum([k for k, v in col.items() if v == n]))

Failing test case input:
1 53
2 9 2 30

Expected output:
3


Actual output:
41


Fixed submission (verdict: Accepted):
import collections
n, m = map(int, input().split())
a_list = sum([list(map(int, input().split()))[1:] for _ in range(n)], [])
col = collections.Counter(a_list)
print(len([k for k, v in col.items() if v == n]))