Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03250 (python)

Fixed submission:
l = list(map(int,input().split()))
l.sort(reverse=True)
print(l[0]*10+l[1]+l[2])

Buggy submission (verdict: Runtime Error):
s  = list(str(input()))
t  = list(str(input()))

sd = {}
td = {}

for k in range(ord('a'),ord('z')+1):   
    sd[chr(k)] = 0
    td[chr(k)] = 0

for i in range(len(s)) :
    if s[i] in sd :
        sd[s[i]] = sd[s[i]] + 1

    if t[i] in td :
        td[t[i]] = td[t[i]] + 1
""" 
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in sd :
        print(str(sd[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print()
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in td :
        print(str(td[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print() """

ta = []
sa = []
for k in range(ord('a'),ord('z')+1):
    if td[chr(k)] != sd[chr(k)] : 
        if td[chr(k)] > 0 :
            ta.append(td[chr(k)])
        if sd[chr(k)] > 0 :    
            sa.append(sd[chr(k)])
#print(ta)
#print(sa)

ta.sort()
sa.sort()

if ta == sa :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
s  = list(str(input()))
t  = list(str(input()))
s.sort()
t.sort()

for i in range(len(s)):
 
    if s[i] != t[i]:
 
        c1 = s[i]
        c2 = t[i]
 
        for j in range(len(s)):
            if s[j] == c1:
                s[j] = c2
            elif s[j] == c2:
                s[j] = c1

if "".join(s) == "".join(t) :
    print("Yes")        
else :
    print("No")
Problem p03252 (python)

Fixed submission:
s  = list(str(input()))
t  = list(str(input()))

sd = {}
td = {}

for k in range(ord('a'),ord('z')+1):   
    sd[chr(k)] = 0
    td[chr(k)] = 0

for i in range(len(s)) :
    if s[i] in sd :
        sd[s[i]] = sd[s[i]] + 1

    if t[i] in td :
        td[t[i]] = td[t[i]] + 1
""" 
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in sd :
        print(str(sd[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print()
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in td :
        print(str(td[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print() """

ta = []
sa = []
for k in range(ord('a'),ord('z')+1):
    if td[chr(k)] != sd[chr(k)] : 
        if td[chr(k)] > 0 :
            ta.append(td[chr(k)])
        if sd[chr(k)] > 0 :    
            sa.append(sd[chr(k)])
#print(ta)
#print(sa)

ta.sort()
sa.sort()

if ta == sa :
    print("Yes")
else :
    print("No")

Buggy submission (verdict: Runtime Error):
ss = str(input())
t  = str(input())

for i in range(len(ss)):

    if ss == t :
        print("Yes")
        exit(0)

    s  = list(ss)

    if s[i] != t[i]:
        c1 = s[i]
        c2 = t[i]
       
        ss = ss.replace(c1 ,"-")
        ss = ss.replace(c2 ,c1 )
        ss = ss.replace("-",c2 )
        print(ss)

print("No")
Problem p03108 (python)

Fixed submission:
def main():
    """http://drken1215.hatenablog.com/entry/2019/03/03/224600
    """
    N, M=map(int, input().split())
    A, B =[],[]
    for i in  range(M):
        a,b=map(int, input().split())
        A.append(a-1)
        B.append(b-1)
        
    uf=UnionFind(N)
    cur = N * (N-1) // 2
    res =[]
    for a,b in zip(A[::-1],B[::-1]):
        res.append(cur)

        if uf.issame(a, b):
            continue
        
        sa, sb = uf.size(a),  uf.size(b)
        cur -= sa * sb
        uf.merge(a, b)

    print(*res[::-1], sep="\n")


class UnionFind:
    def __init__(self, n):
        self.par = [-1] * n
    # void init(int n) { par.assign(n, -1); }

    def root(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def merge(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y: return False
        if self.par[x] > self.par[y]:
            x, y = y, x # merge technique
        self.par[x] += self.par[y]
        self.par[y] = x
        return True
    
    def size(self, x):
        return -self.par[self.root(x)]

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    """http://drken1215.hatenablog.com/entry/2019/03/03/224600
    """
    N, M=map(int, input().split())
    A, B =[],[]
    for i in  range(M):
        a,b=map(int, input().split())
        A.append(a-1)
        B.append(b-1)
        
    uf=UnionFind(N)
    cur = N * (N-1) // 2
    res =[]
    for a,b in zip(A[::-1],B[::-1]):
        res.append(cur)

        if uf.issame(a, b):
            continue
        
        sa = uf.size(a) * uf.size(b)
        cur -= sa * sb
        uf.merge(a, b)

    print(*res, sep="¥n")


class UnionFind:
    def __init__(self, n):
        self.par = [-1] * n
    # void init(int n) { par.assign(n, -1); }

    def root(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]
    
    def issame(self, x, y):
        return self.root(x) == self.root(y)
    
    def merge(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y: return False
        if self.par[x] > self.par[y]:
            x, y = y, x # merge technique
        self.par[x] += self.par[y]
        self.par[y] = x
        return True
    
    def size(self, x):
        return -self.par[self.root(x)]

if __name__ == "__main__":
    main()
Problem p03252 (python)

Fixed submission:
def main():
    """
    英小文字のみからなる文字列 S, T
    文字列 Sに対して、次の操作を何度でも行うことができます。

    操作
        2つの異なる英小文字 c1, c2を選び、
        Sに含まれる全ての 
        c1 を c2に、
        c2 を c1に、置き換える

    0回以上操作を行って、S を Tに一致させられるか判定

    1 <= |S| = |T| <= 2 * 10^5
    """
    S = input()
    T = input()

    ans = f(S, T)
    print(ans)


if False:
    import pytest

    @pytest.mark.randomize(S=str, T=str,
                           min_length=10, max_length=10,
                           str_attrs=("ascii_lowercase",))
    def test_f(S, T):
        assert f(S, T)


def f(S, T):
    """
    26文字存在しないとき
    S: abc
    T: def
        a -> d にしたい
        dbc
        dはSに存在しないので好きに変えられる, でよいか

    S: abc
    T: ddf
        a -> d: dbc
        b -> d: dが存在する
        bを存在しないものに変える: dzc, 状況は変わらない
        a,b入れ替えても意味がない
        a->x, b->x and x->b: bxc, 状況は変わらない

        割当がかぶっていると無理っぽい

    仮に3文字しか種類がない
    S: abc
    T: cab
        c->a, a->c: cba
        b->a, a->b: cab
    """
    import string
    ds = {c: set() for c in string.ascii_lowercase}
    dt = {c: set() for c in string.ascii_lowercase}
    for c1, c2 in zip(S, T):
        ds[c2].add(c1)
        dt[c1].add(c2)

    for c in string.ascii_lowercase:
        if len(ds[c]) >= 2 or len(dt[c]) >= 2:
            return "No"

    return "Yes"


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    """
    英小文字のみからなる文字列 S, T
    文字列 Sに対して、次の操作を何度でも行うことができます。

    操作
        2つの異なる英小文字 c1, c2を選び、
        Sに含まれる全ての 
        c1 を c2に、
        c2 を c1に、置き換える

    0回以上操作を行って、S を Tに一致させられるか判定

    1 <= |S| = |T| <= 2 * 10^5
    """
    S = input()
    T = input()

    ans = f(S, T)
    print(ans)


if True:
    import pytest

    @pytest.mark.randomize(S=str, T=str,
                           min_length=10, max_length=10,
                           str_attrs=("ascii_lowercase",))
    def test_f(S, T):

        assert f(S, T)


def f(S, T):
    """
    26文字存在しないとき
    S: abc
    T: def
        a -> d にしたい
        dbc
        dはSに存在しないので好きに変えられる, でよいか

    S: abc
    T: ddf
        a -> d: dbc
        b -> d: dが存在する
        bを存在しないものに変える: dzc, 状況は変わらない
        a,b入れ替えても意味がない
        a->x, b->x and x->b: bxc, 状況は変わらない

        割当がかぶっていると無理っぽい

    仮に3文字しか種類がない
    S: abc
    T: cab
        c->a, a->c: cba
        b->a, a->b: cab
    """
    import string
    ds = {c: set() for c in string.ascii_lowercase}
    dt = {c: set() for c in string.ascii_lowercase}
    for c1, c2 in zip(S, T):
        ds[c2].add(c1)
        dt[c1].add(c2)

    for c in string.ascii_lowercase:
        if len(ds[c]) >= 2 or len(dt[c]) >= 2:
            return "No"

    return "Yes"


if __name__ == '__main__':
    main()
Problem p03265 (python)

Fixed submission:
def main():
    x1, y1, x2, y2 = map(int, input().split())

    ans = editorial(x1, y1, x2, y2)
    # assert ans == twi(x1, y1, x2, y2)
    print(*ans)


def twi(x1, y1, x2, y2):
    """
    https://twitter.com/akensho/status/1035924165205716992
    https://twitter.com/hogeover30/status/1035903937830764545
    """
    import math
    cos90 = int(math.cos(math.pi / 2))
    sin90 = int(math.cos(math.pi / 2))

    x = x2 - x1
    y = y2 - y1
    x4 = x * cos90 - y * sin90 + x1
    y4 = x * sin90 + y * cos90 + y1

    x = x1 - x4
    y = y1 - y4
    x3 = x * cos90 - y * sin90 + x4
    y3 = x * sin90 + y * cos90 + y4

    return x3, y3, x4, y4


def editorial(x1, y1, x2, y2):
    x = x2 - x1
    y = y2 - y1

    x3 = x2 - y
    y3 = y2 + x
    x4 = x1 - y
    y4 = y1 + x

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    x1, y1, x2, y2 = map(int, input().split())

    ans = editorial(x1, y1, x2, y2)
    assert ans == twi(x1, y1, x2, y2)
    print(*ans)


def twi(x1, y1, x2, y2):
    """
    https://twitter.com/akensho/status/1035924165205716992
    https://twitter.com/hogeover30/status/1035903937830764545
    """
    import math
    cos90 = int(math.cos(math.pi / 2))
    sin90 = int(math.cos(math.pi / 2))

    x = x2 - x1
    y = y2 - y1
    x4 = x * cos90 - y * sin90 + x1
    y4 = x * sin90 + y * cos90 + y1

    x = x1 - x4
    y = y1 - y4
    x3 = x * cos90 - y * sin90 + x4
    y3 = x * sin90 + y * cos90 + y4

    return x3, y3, x4, y4


def editorial(x1, y1, x2, y2):
    x = x2 - x1
    y = y2 - y1

    x3 = x2 - y
    y3 = y2 + x
    x4 = x1 - y
    y4 = y1 + x

    return x3, y3, x4, y4


if __name__ == '__main__':
    main()
Problem p03329 (python)

Fixed submission:
def main():
    """
    1 <= N <= 10^5
    """
    N = int(input())

    ans = rec(N)
    print(ans)


def test_ans():
    N_ans = [
        (127, 4),
        (3, 3),
        (44852, 16),
    ]
    for N, ans in N_ans:
        assert rec(N) == ans


def rec(N):
    import sys
    sys.setrecursionlimit(10 ** 7)
    memo = [-1] * (N+1)

    def _rec(i):
        if i == 0:
            return 0
        if memo[i] != -1:
            return memo[i]

        ans = N
        p = 1
        while p <= i:
            #print(6, i, i-p)
            ans = min(ans, _rec(i-p) + 1)
            p *= 6
        p = 1
        while p <= i:
            #print(9, i, i-p)
            ans = min(ans, _rec(i-p) + 1)
            p *= 9

        memo[i] = ans

        return ans

    ans = _rec(N)
    return ans


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    """
    1 <= N <= 10^5
    """
    N = int(input())

    ans = f(N)
    print(ans)


def test_ans():
    N_ans = [
        (127, 4),
        (3, 3),
        (44852, 16),
    ]
    for N, ans in N_ans:
        assert rec(N) == ans


def rec(N):
    import sys
    sys.setrecursionlimit(10 ** 7)
    memo = [-1] * (N+1)

    def _rec(i):
        if i == 0:
            return 0
        if memo[i] != -1:
            return memo[i]

        ans = N
        p = 1
        while p <= i:
            #print(6, i, i-p)
            ans = min(ans, _rec(i-p) + 1)
            p *= 6
        p = 1
        while p <= i:
            #print(9, i, i-p)
            ans = min(ans, _rec(i-p) + 1)
            p *= 9

        memo[i] = ans

        return ans

    ans = _rec(N)
    return ans


if __name__ == '__main__':
    main()
Problem p03631 (python)

Fixed submission:
def main():
    N_str = input().strip()
    if N_str == N_str[::-1]:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input().strip())
    res = int(input().strip())
    if N == 1:
        print(res)
        return
    for _ in range(1, N):
        t = int(input().strip())
        res = lcm(res, t)
    print(res)


def lcm(a, b):
    return (a * b) / gcd(a, b)


def gcd(a, b):
    if b == 0:
        return a
    if b == 1:
        return 1
    if b > a:
        return gcd(b, a)
    else:
        return gcd(b, a % b)

if __name__ == '__main__':
    main()
Problem p03208 (python)

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()

print(min(h[i+k-1] - h[i] for i in range(n-k+1)))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
ans=[h[k+i]-h[i] for i in range(n-k+1)]
print(min(ans))
Problem p03317 (python)

Fixed submission:
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
tmp=min(a)
count_min=Counter(a)[tmp]
kazu=n-count_min
if kazu%(k-1)==0:
    print(kazu//(k-1))
else:
    print(kazu//(k-1)+1)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
tmp=min(a)
count_min=Counter(a)[tmp]
kazu=n-count_min
if kazu%(k-1)==0:
    print(kazu//(k-1))
else:
    print(kazu//(k-1)+1)
Problem p03041 (python)

Fixed submission:
n,k=map(int, input("").split(' '))
assert n>=k>=1
assert 1<=n<=50

s=input('')
assert ("a","b","c" in s)

z=list((s))
z[k-1]=z[k-1].swapcase()

for i in z:
    print(i, end='')

Buggy submission (verdict: Runtime Error):
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

Buggy submission (verdict: Runtime Error):
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

Buggy submission (verdict: Runtime Error):
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

Buggy submission (verdict: Runtime Error):
try:
    s1=(input(''))
    if len(s1)==4:
        check=list((s1))
    assert bool(int(check[0]+check[1])<=12) != bool(int(check[2]+check[3])<=12)
    if int(check[0]+check[1])<=12:
        print("MMYY")
    elif int(check[2]+check[3])<=12:
        print("YYMM")
except AssertionError:
    if int(check[0]+check[1])<=12 and int(check[2]+check[3])<=12:
        print("AMBIGUOUS")
    else:
        print("NA")

Buggy submission (verdict: Runtime Error):
n,k=map(int, input("").split(' '))
s=input('')
if len(s)=n:
  slist=lis((s))
  swapcase(slist[k-1])
 
for i in range(0,len(slist)-1):
  print(slist[i], end=' ')
Problem p03041 (python)

Fixed submission:
N, K = input().split()
S = input()
K = int(K)
li = list(S)
li[K-1] = chr(ord(S[K-1])+32)
print(''.join(li))

Buggy submission (verdict: Runtime Error):
  1 N, K = input().split()
  2 S = input()
  3 K = int(K)
  4 li = list(S)
  5 li[K-1] = chr(ord(S[K-1])+32)
  6 print(''.join(li))
Problem p03208 (python)

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
Problem p03075 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
x,y,z,k = map(int,input().split())
a,b,c = [],[],[]
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

ab = []

for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])

ab.sort()

abc = []

for i in range(min(len(ab),k)):
    for j in range(min(z,k)):
        abc.append(ab[-(i+1)] + c[j])

abc.sort()

for i in range(k):
    print(abc[-(i+1)])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort()
a.reverse()
b.sort()
b.reverse()
c.sort()
c.reverse()

cnum = []

takadaka = math.ceil(k ** 0.67)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

for i in range(k):
    print(cnum[i])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort()
b.sort()
c.sort()

cnum = []

takadaka = math.ceil(k ** 0.75)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

for i in range(k):
    print(cnum[i])
Problem p03077 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a = [0]*5
n = int(input())
a[0] = int(input())
a[1] = int(input())
a[2] = int(input())
a[3] = int(input())
a[4] = int(input())

bottle = min(a[0],a[1],a[2],a[3],a[4])

time = 0

if n % bottle == 0:
    time = int(n / bottle)
else:
    time = int(n // bottle) + 1

if bottle >= n:
    print(5)
else:
    print(time+4)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

x,y,z,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))

a.sort()
b.sort()
c.sort()

cnum = []

takadaka = math.ceil(k ** 0.75)

for i in range(min(takadaka,x)):
    for j in range(min(takadaka,y)):
        for l in range(min(takadaka,z)):
            cnum.append(a[i] + b[j] + c[l])

cnum.sort()
cnum.reverse()

for i in range(k):
    print(cnum[i])
Problem p03127 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())
a = list(map(int,input().split()))

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

if len(a) == 1:
    ans = a[0]
else:
    ans = gcd(a[0],a[1])
    for i in range(2,n):
        ans = gcd(ans,a[i])

print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math
from functools import reduce

n = int(input())
a = list(map(int,input().split()))
a = [0] + a

print(reduce(math.gcd, a[1:]))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math
from functools import reduce

n = int(input())
a = list(map(int,input().split()))
a = [0] + a

print(reduce(math.gcd, a[1:]))
Problem p03631 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n = int(input())

def digit_list(num):
    num = str(num)
    num = list(num)
    num = list(map(int,num))
    return num

n = digit_list(n)

if n[0] == n[-1]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

n = list(int(input()))

def digit_list(num):
    num = str(num)
    num = list(num)
    num = list(map(int,num))
    return num

n = digit_list(n)

if n[0] == n[-1]:
    print("Yes")
else:
    print("No")
Problem p03042 (python)

Fixed submission:
from sys import stdin
# stdin = open('./input.txt')
l = stdin.readline().rstrip()
month_possible = ['01','02','03','04','05','06','07','08','09','10','11','12']
year_possible = ['00']

fo = ''.join(l[0:2])
la = ''.join(l[2:])

if 0 < int(fo) <= 12:
    if 0 < int(la) <= 12:
        print("AMBIGUOUS")
    elif 0 <= int(la) < 100:
        print("MMYY")
    else:
        print("NA")
else:
    if 0 < int(la) <= 12:
        print("YYMM")
    else:
        print("NA")

Buggy submission (verdict: Runtime Error):
from sys import stdin
stdin = open('./input.txt')
l = stdin.readline().rstrip()
month_possible = ['01','02','03','04','05','06','07','08','09','10','11','12']
year_possible = ['00']

fo = ''.join(l[0:2])
la = ''.join(l[2:])

if 0 < int(fo) <= 12:
    if 0 < int(la) <= 12:
        print("AMBIGUOUS")
    elif 0 <= int(la) < 100:
        print("MMYY")
    else:
        print("NA")
else:
    if 0 < int(la) <= 12:
        print("YYMM")
    else:
        print("NA")
Problem p03041 (python)

Fixed submission:
N, K = map(int, raw_input().split())
word = raw_input()
newword = ""
for i in xrange(N):
  if i == K - 1:
    if word[i] == "A":
      newword += "a"
    elif word[i] == "B":
      newword += "b"
    else:
      newword += "c"
  else:
    newword += word[i]
    
print newword

Buggy submission (verdict: Runtime Error):
N, K = map(int, raw_input().split())
word = raw_input().split()
newword = ""
for i in xrange(N):
  if i == K - 1:
    if word[i] == "A":
      newword += "a"
    elif word[i] == "B":
      newword += "b"
    else:
      newword += "c"
  else:
    newword += word[i]
    
print newword
Problem p03307 (python)

Fixed submission:
n=int(input())
print(2*n) if n%2 != 0 else print(n)

Buggy submission (verdict: Runtime Error):
n=int(input())
import math
print((2*n)//math.gcd(2,n))

Buggy submission (verdict: Runtime Error):
n=int(input())
import math
print((2*n)//math.gcd(2,n))

Buggy submission (verdict: Runtime Error):
n=int(input())
import math
print(2*n//math.gcd(2,n))
Problem p03041 (python)

Fixed submission:
list1=input().split(" ")
num1=int(list1[0])
num2=int(list1[1])
list2=input()
strings=""
for i in range(num1):
	if i==num2-1:
		strings+=list2[i].lower()    
	else:
		strings+=list2[i]
print(strings)

Buggy submission (verdict: Runtime Error):
​list1=input().split(" ")
num1=int(list1[0])
num2=int(list1[1])
list2=input()
strings=""
for i in range(num1):
	if i==num2:
		strings+=list2[i].lower()    
	else:
		strings+=list2[i]
print(strings)
Problem p03042 (python)

Fixed submission:
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

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

Buggy submission (verdict: Runtime Error):
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0=< former <=12 and 0=< latter <=12:
	print("AMBIGUOUS")
elif 0=< former <=12 and 12< latter:
	print("MMYY")
elif 0=< latter <=12 and 12< former:
	print("YYMM")

else:
	print("NA")

Buggy submission (verdict: Runtime Error):
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0=< former <=12 and 0=< latter <=12:
	print("AMBIGUOUS")
elif 0=< former <=12 and 12=< latter:
	print("MMYY")
elif 0=< latter <=12 and 12=< former:
	print("YYMM")

else:
	print("NA")

Buggy submission (verdict: Runtime Error):
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0=< former <=12 and 0=< latter <=12:
	print("AMBIGUOUS")
elif 0=< former <=12 and 12=< latter:
	print("MMYY")
elif 0=< latter <=12 and 12=< former:
	print("YYMM")

else:
	print("NA")