TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = [int(x) for x in input().split()]
s = input()

k -= 1

if s[k] == "A":
  s[k] = "a"
elif s[k] == "B":
  s[k] = "b"
elif s[k] == "C":
  s[k] = "c"

print(s)

n,k = [int(x) for x in input().split()]
s = input()
 
k -= 1
s = list(s)

if s[k] == "A":
  s[k] = "a"
elif s[k] == "B":
  s[k] = "b"
elif s[k] == "C":
  s[k] = "c"
 
print("".join(s))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower+s[k:])

n, k = map(int, input().split())
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()
ans = s[:k-1] + s[k-1].lower() + s[k-1:]
print(ans)

n, k = map(int, input().split())
s = input()
ans = s[:k-1] + s[k-1].lower() + s[:k-1]
print(ans)

n, k = map(int, input().split())
s = input()
ans = s[:k-1] + s[k-1].lower() + s[k:]
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int,input().split())
S = input()

S_list = list(S)
S_list[K-1] = S_list[K-1].lower()
print(S_list)


N, K = map(int,input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print(''.join(S))


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
from collections import defaultdict
from operator import itemgetter


def solve():
    N, M = map(int, input().split())
    xy_dict = defaultdict(int)
    xy = [[] for _ in range(N)]
    for _ in range(M):
        x, y, z = map(lambda j: int(j)-1, input().split())
        xy_dict[x] += 1
        xy_dict[y] += 1
        xy[x].append(y)
        xy[y].append(x)
    
    xy_sorted = sorted(xy_dict.items(), key=itemgetter(1), reverse=True)
    opened = [0 for _ in range(N)]
    ans = N
    length = len(xy_sorted)
    for i in range(length):
        parent = xy_sorted[i][0]
        if opened[parent] == 1:
            for child in xy[parent]:
                if opened[child] == 0:
                    opened[child] = 1
                    ans -= 1
            continue
        opened[parent] = 1
        for child in xy[parent]:
            opened[child] = 1
        ans -= xy_dict[parent]
    print(ans)


if __name__ == '__main__':
    solve()


def solve():
    N, K = map(int, input().split())
    s = input()
    s_lower = s.lower()
    s = list(s)
    s[K-1] = s_lower[K-1]
    print(''.join(s))

if __name__ == '__main__':
    solve()

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=str(input())
k-=1
if s[k]=="A":
  s[k]="a"
elif s[k]=="B":
  s[k]="b"
elif s[k]=="C":
  s[k]="c"
else
print(s)

n,k=map(int,input().split())
s=str(input())
k-=1
if s[k]=="A":
  s[k]="a"
elif s[k]=="B":
  s[k]="b"
elif s[k]=="C":
  s[k]="c"

print(s)

n,k=map(int,input().split())
s=str(input())
if s[k]=="A":
  s[k]="a"
elif s[k]=="B":
  s[k]="b"
elif s[k]=="C":
  s[k]="c"
print(s)

n,k=map(int,input().split())
s=list(str(input()))
k-=1
if s[k]=="A":
  s[k]="a"
elif s[k]=="B":
  s[k]="b"
elif s[k]=="C":
  s[k]="c"

print("".join(s))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
map=input()

s = list(map)


x=s[k-1].lower()

s.pop(k-1)
s.insert(k-1,x)

print(" ".join(s))

n,k=map(int,input().split())
map=input()

s = list(map)


x=s[k-1].lower()

s.pop(k-1)
s.insert(k-1,x)

print(" ".join(s))

n,k=map(int,input().split())
map=input()

s = list(map)


x=s[k-1].lower()

s.pop(k-1)
s.insert(k-1,x)

print("".join(s))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N,K = map(int,input().split())
S = input()
answer = 0
print(type(S))

if S[K-1] == 'A':
    S = S[:K-1] + 'a' + S[K:]
    print(S)
elif S[K-1] == 'B':
    S = S[:K-1] + 'b' + S[K:]
    print(S)
elif S[K-1] == 'C':
    S = S[:K-1] + 'c' + S[K:]
    print(S)

N,K = map(int,input().split())
S = input()
answer = 0


if S[K-1] == 'A':
    S = S[:K-1] + 'a' + S[K:]
    print(S)
elif S[K-1] == 'B':
    S = S[:K-1] + 'b' + S[K:]
    print(S)
elif S[K-1] == 'C':
    S = S[:K-1] + 'c' + S[K:]
    print(S)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
s=input()
first=int(s[0]+s[1])
second=int(s[2]+s[3])
if 1<=first<=12 and 1<=second<=12:
	print("AMBIGUOUS")
elif 1<=first<=12 and (second==0 or second>=13):
		print("MMYY")
elif (first==0 or first>=13) or 1<=second<=12:
		print("YYMM")
else:
		print("NA")

n,k=map(int,input().split())
s=input()
if s[k-1]=="A":
	print(s[0:k-1]+"a"+s[k:n])
elif s[k-1]=="B":
	print(s[0:k-1]+"b"+s[k:n])
else:
	print(s[0:k-1]+"c"+s[k:n])
	


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
a,b=map(int, input().split())
s=str(input())
if s[b]=="A":
  s[b]=="a"
if s[b]=="B":
  s[b]=="b"
if s[b]=="C":
  s[b]=="c"
print(s)

a,b=map(int, input().split())
s=str(input())
b=b-1
slist=list(s)
if slist[b]=="A":
  slist[b]="a"
if slist[b]=="B":
  slist[b]="b"
if slist[b]=="C":
  slist[b]="c"
s="".join(slist)
print(s)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int), input().split())
S = list(input())
S[K - 1] = S[K - 1].lower()
print(''.join(S))


N, K = map(int, input().split())
S = list(input())
S[K - 1] = S[K - 1].lower()
print(''.join(S))


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
Nstr,Kstr=input().split()
S=input()
N=int(Nstr)
K=int(Kstr)-1
#print(X)
ans=""
i=0
for v in S:
	if(K==i):
		if (S[K]=="A"):
			print(ans)
			ans=ans+"a"
		if (S[K]=="B"):
			ans=ans+"b"
		if (S[K]=="C"):
			ans=ans+"c"
	else:
		ans=ans+v
	i=i+1
print(ans)

Nstr,Kstr=input().split()
S=input()
N=int(Nstr)
K=int(Kstr)-1
#print(X)
ans=""
i=0
for v in S:
	if(K==i):
		if (S[K]=="A"):
			ans=ans+"a"
		if (S[K]=="B"):
			ans=ans+"b"
		if (S[K]=="C"):
			ans=ans+"c"
	else:
		ans=ans+v
	i=i+1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
x=s.replace(s[k-1],s[k-1].upper())
print(x)

n,k=input().split()
k=int(k)
x=n.replace(n[k-1],n[k-1].upper())
print(x)

n,k=map(int,input().split())
s=input()
print(s.replace(s[k-1],s[k-1].upper()))

n,k=map(int,input().split())
s=input()
s=s[:k-1]+s[k-1].lower()+s[k:]
print(s)

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
s=input()
s1=int(s[0:2])
s2=int(s[2:4])

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

n,k=map(int,input().split())
s=list(input())
s[k-1]=s[k-1].lower()
print(''.join(s))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int,input().split())
S = input()
S = list(S)
S[K-1] = S[K-1].lower()
print(''.join(S)

N, K = input().split()
N = list(N)
N[int(K)] = N[int(K)].lower()
print(N)


N, K = input().split()
N[K] = N[K].lower()
print(N)


N, K = input().split()
N[int(K)] = N[int(K)].lower()
print(N)


N, K = map(int,input().split())
S = input()
S = list(S)
S[K-1] = S[K-1].lower()
print(S)

N, K = input().split()
N = list(N)
N[int(K)] = N[int(K)].lower()
print(''.join(N))


N, K = map(int,input().split())
S = input()
S = list(S)
S[K] = S[K].lower()
print(S)

N, K = input().split()
N = list(N)
N[int(K)] = N[int(K)].lower()
print(str(N))


N, K = map(int,input().split())
S = input()
S = list(S)
S[K-1] = S[K-1].lower()
print(''.join(S))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
 N,K= map(int, input().split())
 S = list(str(input()))

 S[K-1] = S[K-1].lower()
 print(''.join(S))

N,K= map(int, input().split())
S = list(str(input()))

S[K-1] = S[K-1].lower()
print(''.join(S))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
def main():
    n,k = map(int,input().split())
    s = list(input())
    s[k - 1] = chr(ord(s[k]) + 32)
    t = ''
    for i in s:
        t = t + i
    print(t)
main()

def main():
    n,k = map(int,input().split())
    s = list(input())
    s[k] = chr(ord(s[k]) + 32)
    t = ''
    for i in s:
        t = t + i
    print(t)
main()

def main():
    n,k = map(int,input().split())
    s = list(input())
    s[k - 1] = chr(ord(s[k - 1]) + 32)
    t = ''
    for i in s:
        t = t + i
    print(t)
main()

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
#ABC126 B

S = list(map(int,input()))
if 1 <= S[0]*10 + S[1] <= 12 and 1 <= S[2]*10 + S[3] <= 12:
    print("AMBIGUOUS")
elif 1 <= S[0]*10 + S[1] <= 12 and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("MMYY")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0)  and  1 <= S[2]*10 + S[3] <= 12:
    print("YYMM")
elif (S[0]*10 + S[1] > 12 or S[0]*10 + S[1] == 0) and (S[2]*10 + S[3] > 12 or S[2]*10 + S[3] == 0):
    print("NA")

N,K = map(int,input().split())
S = str(input())
T = list(map(str,S))

for i in range(N):
    if i == K-1:
        T[i] = str.lower(T[i])

print("".join(T))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
a,b=input().split()
c=input()
c[b-1]=c[b-1].upper()
print(c)


n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):

n,k = map(int,input().split())
s = input()
cnt = 0
ans = []
for i in s:
  cnt += 1
  print(i.lower())
  if cnt == k:
    ans.append(i.lower())
  else:
    ans.append(i)
print("".join(ans))


n,k = map(int,input().split())
s = input()
cnt = 0
ans = []
for i in s:
  cnt += 1

  if cnt == k:
    ans.append(i.lower())
  else:
    ans.append(i)
print("".join(ans))

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
#st = "".join(s)
#print(st)
print(s)

n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
st = "".join(s)
print(st)

n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
st = "".join(s)
print(st)


n,k = map(int,input().split())
s = list(input())
s[k] = s[k].lower()
str = "".join(s)
print(str)

n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
st = "".join(s)
print(st)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int,input(),split())
s = input()
print(s[k].lower())

n, k = map(int,input(),split())
print(n[k].lower())

n, k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()
s[k] = s[k].lower()

n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int, input().split())
S = input()
ans = ''
for i in range(N):
    if i == K:
        if S[i] == 'A':
            ans += 'a'
        elif S[i] == 'B':
            ans += 'b'
        else:
            ans += 'c'
    else:
        ans += S[i]
print(ans)

N, K = map(int, input().split())
S = input()
ans = ''
for i in range(N):
    if i == K-1:
        if S[i] == 'A':
            ans += 'a'
        elif S[i] == 'B':
            ans += 'b'
        else:
            ans += 'c'
    else:
        ans += S[i]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = map(int, input().split())
s = input()

ans = ""
for i in range(n):
    if i+1 == k:
        print(ans + s[i].lower())
    else:
        print(ans + s[i])

print(ans)

n, k = map(int, input().split())
s = input()

ans = ""
for i in range(n):
    if (i+1 == k):
        ans = ans + s[k-1].lower()
    else:
        ans = ans + s[i]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c'
print(s)


n,k=map(int,input().split())
s=input()
if s[k-1]=='A':
  s[k-1]='a'
elif s[k-1]=='B':
  s[k-1]='b'
else:
  s[k-1]='c':
print(s)

n, k = map(int, input().split())
s = input()

print(s[:k-1]+s[k-1].lower()+s[k:])


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n = int(input())
k = int(input())
s = input()
result = ''
for i in range(n):
    if i == k-1:
        result += chr(ord(s[i]) + 32)
    else:
        result += s[i]
print(result)

n, k = input().split()
a = int(n)
b = int(k)
s = input()
result = ''
for i in range(a):
    if i == b-1:
        result += chr(ord(s[i]) + 32)
    else:
        result += s[i]
print(result)

Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
input1 = list(map(int, input().split()))

tar_str = input()

output_str = ''

for i in range(len(tar_str)):
    if i == input1[1]:
        output_str += tar_str[i].lower()
    else:
        output_str += tar_str[i]

print(output_str)


input1 = list(map(int, input().split()))

tar_str = input()

output_str = ''

for i in range(len(tar_str)):
    if i == input1[1] - 1:
        output_str += tar_str[i].lower()
    else:
        output_str += tar_str[i]

print(output_str)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
N, K = map(int, input().split())
s = input()
print(s[:K] + s[K:].capitalize.swapcase)

N, K = map(int, input().split())
M = 0
def coin(x):
  k = 1
  while k < x:
    k *= 2
  return 1/k
for i in range(N):
  M += coin(K/(i + 1))
print(M / N)

N, K = map(int, input().split())
s = input()
print(s[:K-1] + s[K-1:].capitalize().swapcase())

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given a string S of length N consisting of `A`, `B` and `C`, and an integer K which is between 1 and N (inclusive). Print the string S after lowercasing the K-th character in it.

Submission attempts (in order):
n, k = list(map(int, input().split()))
s = input()

print(s[:k] + s[k].lower() + s[k+1:])


n, k = list(map(int, input().split()))
s = input()

print(s[:k-1] + s[k-1].lower() + s[k:])


Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
s = input()
yymm = False
mmyy = False
first = int(s[:2])
last = int(s[2:])
if first<=12 and first >0:
  mmyy = True
if last <=12 and last>0:
  yymm = True
if mmyy == True and yymm = True:
  print('AMBIGUOUS')
elif mmyy == True and yymm = False:
  print('MMYY')
elif mmyy == False and yymm = True:
  print('YYMM')
else:
  print('NA')

s = input()
yymm = False
mmyy = False
first = int(s[:2])
last = int(s[2:])
if first<=12 and first >0:
    mmyy = True
if last <=12 and last>0:
    yymm = True
if mmyy == True and yymm == True:
    print('AMBIGUOUS')
elif mmyy == True and yymm == False:
    print('MMYY')
elif mmyy == False and yymm == True:
    print('YYMM')
else:
    print('NA')

Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S = input()
f = int(S[:2])
s = int(S[2:])

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


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

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


Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
s = int(input())
a, b = s//100, s%100
boos = int(input())
a, b = s//100, s%100
p = bool(1 <= a <= 12)
q = bool(1 <= b <= 12)
if p & q:
    print("AMBIGUOUS")
elif p:
    print("MMYY")
elif q:
    print("YYMM")
else:
    print("NA")

s = int(input())
a, b = s//100, s%100
p = bool(1 <= a <= 12)
q = bool(1 <= b <= 12)
if p & q:
    print("AMBIGUOUS")
elif p:
    print("MMYY")
elif q:
    print("YYMM")
else:
    print("NA")

Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
def main():
    S = input()
    if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
        return "AMBIGUOUS"
    elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0:
        return "YYMM"
    elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0):
        return "MMYY"
    else:
        return "NA"


if __name__ == '__main__':
    main()


def main():
    S = input()
    if 0 < int(S[:2]) <= 12 and 0 < int(S[2:]) <= 12:
        return "AMBIGUOUS"
    elif (int(S[:2]) > 12 or int(S[:2]) == 0) and 12 >= int(S[2:]) > 0:
        return "YYMM"
    elif 0 < int(S[:2]) <= 12 and (12 < int(S[2:]) or int(S[2:]) == 0):
        return "MMYY"
    else:
        return "NA"


if __name__ == '__main__':
    print(main())


Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S = input()

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

print(a, b)

isYYMM = 1 <= b <= 12
isMMYY = 1 <= a <= 12

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


S = input()

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

print(a, b)

isYYMM = 1 <= b <= 12
isMMYY = 1 <= a <= 12

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


S = input()

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

print(a, b)

isYYMM = 1 <= b <= 12
isMMYY = 1 <= a <= 12

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


S = input()

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

isYYMM = 1 <= b <= 12
isMMYY = 1 <= a <= 12

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S = input()

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

print(judge_list_MM)


if S_zen ==0 or S_go ==0:
    print("NA")
if S_zen in judge_list_MM :
    print("MMYY")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")


S = input()

S_zen =int(S[0:2])
S_go = int(S[2:4])

judge_list_MM = [1+i for i in range(12)]

#print(judge_list_MM)

if S_zen in judge_list_MM and S_go in judge_list_MM :
    print("AMBIGUOUS")
elif S_go in judge_list_MM :
    print("YYMM")
elif S_zen in judge_list_MM :
    print("MMYY")
else :
    print("NA")

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
x = list(input())
first = 10 * x[0] + x[1]
second = 10 * x[2] + x[3]


def mc(num):
    if 1 <= num <= 12:
        return True
    else:
        return False


def yc(num):
    if 1 <= num <= 99:
        return True
    else:
        return False


if yc(first):
    if mc(second):
        if yc(second):
            if mc(first):
                print("AMBIGUOUS")
            else:
                print("YYMM")
        else:
            print("YYMM")
    elif yc(second):
        if mc(first):
            print("MMYY")
        else:
            print("NA")
    else:
        pirnt("NA")
elif yc(second):
    if mc(first):
        print("MMYY")
    else:
        print("NA")
else:
    print("NA")

x = list(input())
first = 10 * int(x[0]) + int(x[1])
second = 10 * int(x[2]) + int(x[3])


def mc(num):
    if 1 <= num <= 12:
        return True
    else:
        return False


def yc(num):
    if 0 <= num <= 99:
        return True
    else:
        return False


if yc(first):
    if mc(second):
        if yc(second):
            if mc(first):
                print("AMBIGUOUS")
            else:
                print("YYMM")
        else:
            print("YYMM")
    elif yc(second):
        if mc(first):
            print("MMYY")
        else:
            print("NA")
    else:
        print("NA")
elif yc(second):
    if mc(first):
        print("MMYY")
    else:
        print("NA")
else:
    print("NA")


Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S = input()
ls = ['01','02','03','04','05','06','07','08','09','10','11','12']
for x in ls:
    if x == S[:2]:
        for x in ls:
            if x == S[2:]:
                print('AMBIGUOUS')
            else:
                print('MMYY')
    else:
        for x in ls:
            if x == S[2:]:
                print('YYMM')
            else:
                print('NA')

S = input()
ls = ['01','02','03','04','05','06','07','08','09','10','11','12']

if S[:2] in ls:
    if S[2:] in ls:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if S[2:] in ls:
        print('YYMM')
    else:
        print('NA')

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
n,k=map(int,input().split())
s=input()
print(s[:k-1]+s[k-1].lower()+s[k:])

s=input()
l=int(s[:2])
r=int(s[2:])
if 1<=l<=12 and 1<=r<=12:
    print("AMBIGUOUS")
elif 1<=l<=12:
    print("MMYY")
elif 1<=r<=12:
    print("YYMM")
else:
    print("NA")

Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

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


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


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

    return "MMYY"
    
    

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


Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S=int(input())
A,B=S//100,S%100
print(A,B)
if A < 13 and B < 13 and A != 0 and B != 0:
  print("AMBIGUOUS")
elif A < 13 and A > 0:
  print("MMYY")
elif B < 13 and B > 0:
  print("YYMM")
else:
  print("NA")

S=int(input())
A,B=S//100,S%100
if A < 13 and B < 13 and A != 0 and B != 0:
  print("AMBIGUOUS")
elif A < 13 and A > 0:
  print("MMYY")
elif B < 13 and B > 0:
  print("YYMM")
else:
  print("NA")

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
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')

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')

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
s=input()
if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
  if 10*int(s[0])+int(s[1])<=12:
    print("AMBIGUOUS")
  else:
    print("YYMM")
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:
    print("AMBIGUOUS")
  else:
    print("MMYY")
else:
  print("NA")

s=input()
if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
  if 10*int(s[0])+int(s[1])<=12 and int(s[0])+int(s[1])!=0:
    print("AMBIGUOUS")
  else:
    print("YYMM")
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")
else:
  print("NA")

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

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")

s=input()
if 10*int(s[2])+int(s[3])<=12 and int(s[2])+int(s[3])!=0:
  if 10*int(s[0])+int(s[1])>=13:
    print("YYMM")
  else:
    print("AMBIGUOUS")
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])>=13:
    print("MMYY")
  else:
    print("AMBIGUOUS")
else:
  print("NA")

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

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")

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):

def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])
    print(A, B)

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()



def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])

    if 1 <= A and A <= 12 and 1 <= B and B <= 12:
        print("AMBIGUOUS")

    elif 1 <= A and A <= 12 and (0 == B or 12 < B):
        print("YYMM")

    elif 1 <= B and B <= 12 and (0 == A or 12 < A):
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()



def main():
    S = input()

    A = int(S[:2])
    B = int(S[2:])

    if A != 0 and B <= 12 and B != 0 and A <= 12:
        print("AMBIGUOUS")

    elif (A != 0 and B <= 12) and B != 0:
        print("YYMM")

    elif (B != 0 and A <= 12) and A != 0:
        print("MMYY")

    elif (A == 0 and 1 <= B and B <= 12):
        print("YYMM")

    elif (B == 0 and 1 <= A and A <= 12):
        print("MMYY")

    else:
        print("NA")


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S = input()
a = int(S[:2])
b = int(S[2:])

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


from datetime import datetime

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

def is_month(m):
    m = int(m)
    return 0 < m < 13

def is_year(y):
    y = int(y)
    return True

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


Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
S=input()
S1=int(S[0]+S[1])
S2=int(S[2]+S[3])

if 1<=S1<=12:
    
    if S2==0:
        print("NA")
    
    if 1<=S2<=12:
        print('AMBIGUOUS')
        
    elif 12<=S2<=31:
        print('YYMM')

elif 12<S1<=31 and S2 !=0 :
    print("MMYY")

else:
    print('NA')    

S=input()
S1=int(S[0]+S[1])
S2=int(S[2]+S[3])

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')

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
s = input()
a = int(s[:2])
b = int(s[2:])

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

s = input()
a = int(s[:2])
b = 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")

Verdicts: Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
a = int(input())  
b = a%100
a = int(a/100)

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

a = int(input())  
b = a%100
a = int(a/100)

if a<=12:
    if b<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if b<=12:
        print("YY<<")
    else:
        print("NA")

a = int(input())  
b = int(a/100)
c = a%100
if b>0 and b<=12:
    if c>0 and c<=12:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if c>0 and c<=12:
        print("YYMM")
    else:
        print("NA")

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
N = input()
n = [int(N[:1]), int(N[1:])]
a = ['YYMM', 'MMYY', 'AMBIGUOUS', 'NA']
if a[0] > 12:
  if a[1] == 0:
    print(a[3])
  else:
    print(a[0])
elif a[1] > 12:
  if a[0 == 0:
    print(a[3])
  else:
    print(a[1])
else:
  print(a[2])

N = input()
n = [int(N[:2]), int(N[2:])]
a = ['YYMM', 'MMYY', 'AMBIGUOUS', 'NA']
if n[0] > 12 or n[0] == 0:
  del a[1]
  del a[1]
  if n[1] > 12 or n[1] == 0:
    del a[0]
elif n[1] > 12 or n[1] == 0:
  del a[0]
  del a[1]
else:
  a = [a[2]]
print(a[0])

Verdicts: Runtime Error

Accepted
Problem: You have a digit sequence S of length 4. You are wondering which of the following formats S is in:    * YYMM format: the last two digits of the year and the two-digit representation of the month (example: `01` for January), concatenated in this order   * MMYY format: the two-digit representation of the month and the last two digits of the year, concatenated in this order  If S is valid in only YYMM format, print `YYMM`; if S is valid in only MMYY format, print `MMYY`; if S is valid in both formats, print `AMBIGUOUS`; if S is valid in neither format, print `NA`.

Submission attempts (in order):
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('YMMM')
else:
  print('NA')
  

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

if 1 <= s1 <= 12 and 1 <= s2 <= 12:
  print('AMBIGUOUS')
elif 1 <= s1 <= 12 and (s2 == 0 or s2 >= 13):
  print('MMYY')
elif (s1 == 0 or s1 >= 13) and 1 <= s2 <= 12:
  print('YMMM')
elif (s1 == 0 or s1 >= 13) and (s2 == 0 or s2 >= 13)
  print('NA')

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

def may_month(s):
  return 1<=s<=12


if may_month(s1) and may_month(s2):
  print("AMBIGUOUS")
  

elif not (may_month(s1) or may_month(s2)):
  print("NA")


elif may_month(s1):
  print("MMYY")
  

elif may_month(s2):
  print("YYMM")

Verdicts: Wrong Answer

Runtime Error

Accepted