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

Fixed submission:
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    a= heappop(L)
    b= heappop(L)
    s=(a+b)/2
    heappush(L,s)
print(s)

Buggy submission (verdict: Runtime Error):
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

Buggy submission (verdict: Runtime Error):
from heapq import heapify, heappush
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)
Problem p02891 (python)

Fixed submission:
a = [input() for i in range(2)]

text = a[0]
iter = int(a[1])

text_list = list(text)
ren = []
start = text_list[0]
a = 0
for i in range(1,len(text_list)):
  if text_list[i] == start:
    a += 1
    if i == len(text_list)-1:
      ren.append(a)
  else:
    start = text_list[i]
    ren.append(a)
    a = 0

for i in range(len(ren)):
  ren[i] += 1

if ren == []:
  ren = [1]
  
ans = 0
if len(ren) == 1:
  ans = ren[0] * iter // 2
elif text_list[0] == text_list[-1]:
  if ren[0] % 2 == 1 and ren[-1] % 2 == 1:
    for r in ren:
      ans += (r//2)
    ans *= iter
    ans += iter-1
  else:
    for r in ren:
      ans += (r//2)
    ans *= iter    
else:
  for r in ren:
    ans += (r//2)
  ans *= iter

print(ans)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(2)]

text = a[0]
iter = int(a[1])

text_list = list(text)
ren = []
start = text_list[0]
a = 0
for i in range(1,len(text_list)):
  if text_list[i] == start:
    a += 1
    if i == len(text_list)-1:
      ren.append(a)
  else:
    start = text_list[i]
    ren.append(a)
    a = 0

for i in range(len(ren)):
  ren[i] += 1

ans = 0
if text_list[0] == text_list[-1]:
  if ren[0] % 2 == 1 and ren[-1] % 2 == 1:
    for r in ren:
      ans += (r//2)
    ans *= iter
    ans += iter-1
  else:
    for r in ren:
      ans += (r//2)
    ans *= iter    
else:
  for r in ren:
    ans += (r//2)
  ans *= iter

print(ans)

Buggy submission (verdict: Runtime Error):
a = [input() for i in range(2)]

text = a[0]
iter = int(a[1])

text_list = list(text)
ren = []
start = text_list[0]
a = 0
for i in range(1,len(text_list)):
  if text_list[i] == start:
    a += 1
    if i == len(text_list)-1:
      ren.append(a)
  else:
    start = text_list[i]
    ren.append(a)
    a = 0

for i in range(len(ren)):
  ren[i] += 1

ans = 0
if text_list[0] == text_list[-1]:
  if ren[0] % 2 == 1 and ren[-1] % 2 == 1:
    for r in ren:
      ans += (r//2)
    ans *= iter
    ans += iter-1
  else:
    for r in ren:
      ans += (r//2)
      ans *= iter    
else:
  for r in ren:
    ans += (r//2)
  ans *= iter

print(ans)
Problem p02954 (python)

Fixed submission:
import re
RL_list = input()
RL_list = re.findall(r'R*L*',RL_list)
buf = []

for lis in RL_list:
    if len(lis)==2:
        buf.extend([1,1])
    if len(lis)>2:
        r_cnt = lis.count('R')
        l = len(lis) - r_cnt
        if (len(lis) % 2 == 1) & (r_cnt % 2 == 1):
            r = len(lis) // 2 + 1
        #elif (len(lis) % 2 == 1) & (r_cnt % 2 == 0):
        else:
            r = int(len(lis) / 2)
        
        buf.extend([0]*(r_cnt-1))
        buf.extend([r,len(lis)-r])
        buf.extend([0]*(len(lis)-r_cnt-1))
        
print(" ".join(map(str,buf)))

Buggy submission (verdict: Runtime Error):
N,M = [int(x) for x in input().split()]

dic = {}
for _ in range(N):
    A,B = [int(x) for x in input().split()]
    if A <= M: dic.setdefault(A, []).append(B)

buf = []
for m in sorted(dic.keys(),reverse=True):
     buf.extend(sorted(dic[m],reverse=True)[:M-m+1])
print(sum(sorted(buf,reverse=True)[:M]))

Buggy submission (verdict: Runtime Error):
import re
RL_list = input()
RL_list = re.findall(r'R*L*',RL_list)
buf = []

for lis in RL_list:
    if len(lis)==2:
        buf.extend([1,1])
    if len(lis)>2:
        r_cnt = lis.count('R')
        l = len(lis) - r
        if (len(lis) % 2 == 1) & (r_cnt % 2 == 1):
            r = len(lis) // 2 + 1
        else:
            r = int(len(lis) / 2)
        
        buf.extend([0]*(r_cnt-1))
        buf.extend([r,len(lis)-r])
        buf.extend([0]*(len(lis)-r_cnt-1))
        
print(" ".join(map(str,buf)))

Buggy submission (verdict: Runtime Error):
import numpy as np
#def replace_RL(RL_str,word):
#    buf = []
#    for s in RL_str:
#        if s == word:
#            buf.append(1)
#        else:
#            buf.append(0)
#    return np.array(buf)

RL_str =np.array(list(input()))
#menber = np.ones(RL_str.size)

R_list = np.where(RL_str=='R',1,0)#replace_RL(RL_str,'R')
L_list = np.where(RL_str=='L',1,0)##replace_RL(RL_str,'L')

for n in range(1000):
    men_R = menber*R_list
    men_L = menber*L_list

    #shift
    men_R = np.roll(men_R, 1)
    men_L = np.roll(men_L, -1)

    menber = men_R + men_L

print(" ".join(menber.astype(int).astype(str).tolist()))
Problem p02955 (python)

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

def checker(A,k):
    A.sort(reverse=True)
    if sum(A[sum(A) // d:]) <= k:
        return True
    return False

n,k = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

for d in make_divisors(sum(A)):
    buf = []
    for a in A:
        buf.append(a%d)
    #print(buf)
    if checker(buf,k):
        print(d)
        break

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

def checker(A,k):
    if sum(costs[sum(A) // d:]) <= k:
        return True
    return False

n,k = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

for d in make_divisors(sum(A)):
    buf = []
    if d == 1:
        print(d)
        break
    else:
        for a in A:
            buf.append(a%d)
        print(buf)
        if checker(buf,k):
            print(d)
            break

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

def checker(A,k):
    if sum(sorted(A)[:-1]) <= k:
        return True
    return False

n,k = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

for d in make_divisors(sum(A)):
    buf = []
    buf2 = []
    if d == 1:
        print(d)
        break
    else:
        for a in A:
            buf.append(a%d)
        #print(buf)
        if checker(buf.sort(reverse=True),k):
            print(d)
            break
Problem p02951 (python)

Fixed submission:
a, b, c = map(int, input().split())

res = c -(a - b)
print(res if res > 0 else 0)

Buggy submission (verdict: Runtime Error):
N = input()
nlen = len(N)
cnt = 0
for i in range(1, nlen):
  if i % 2:
    cnt += (10 ** i) - (10 ** (i - 1))
N = int(N)
if nlen % 2:
  cnt += N - 10 ** (nlen - 1) + 1
print(cnt)
Problem p02912 (python)

Fixed submission:
import heapq

N,M=map(int,input().split())
A=list(map(int,input().split()))
q = []
for x in A:
    heapq.heappush(q, -x)
for m in range(M):
    x = heapq.heappop(q)
    x /= 2
    heapq.heappush(q, x)
ans = 0
for x in q:
    ans += int(-x)
print(ans)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))

list.sort(A, reverse=True)
print(A)
for m in range(M):
    tmp = int(A[0] / 2)
    del A[0]
    for i in range(len(A)):
        if A[i] < tmp:
            A.insert(i, tmp)
            break

print(sum(A))
Problem p02959 (python)

Fixed submission:
import copy

n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

ans = 0
for i in range(0,n):
    if A[i] <= B[i]:
        ans += A[i]
        B[i] -= A[i] 
        if A[i+1] <= B[i]:
            ans += A[i+1]
            A[i+1] = 0
        else:
            ans += B[i]
            A[i+1] -= B[i]
    else:
        ans += B[i]

print(ans)

Buggy submission (verdict: Runtime Error):
import copy

n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

ans = 0
for i in range(0,n):
    if A[i] <= B[i]:
        ans += A[i]
        B[i] -= A[i] 
        if A[i+1] <= B[i]:
            ans += A[i+1]
1            A[i+1] -= 0
        else:
            ans += B[i]
            A[i+1] -= B[i]
    else:
        ans += B[i]

print(ans)
Problem p02915 (python)

Fixed submission:
N=int(input())
print(N*N*N)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
M=0
for i in range(N):
    A[i]-=1
for i in range(N-1):
    if A[i]+1==A[i+1]:
        M+=B[A[i]]+C[A[i]]
    else:
        M+=B[A[i]]
print(M+B[A[N-1]])
Problem p03250 (python)

Fixed submission:
A,B,C=sorted(map(int,input().split()))
print(10*C+B+A)

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print("No War" if (max(x)<min(y) and X<Y and X<min(y) and Y>max(x)) else "War")

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print('War' if int(X-max(x))>=int(Y-max(y)) else 'No War')

Buggy submission (verdict: Runtime Error):
N,M,X,Y=map(int, input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print('War' if max(x)>=max(y) else 'No War')
Problem p03631 (python)

Fixed submission:
a,b,c=input()
print('Yes'  if a==c else  'No')

Buggy submission (verdict: Runtime Error):
a,b,c=input()
if a==c, print('Yes')
else print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=input()
print('Yes' if a==c,else 'No')

Buggy submission (verdict: Runtime Error):
a,b,c=input()
print('yes' if a==c,else 'no')
Problem p02891 (python)

Fixed submission:
s = list(input())
k = int(input())
count = 0
s1 = list(set(s))
if len(s1) == 1:
    count = int((k * len(s)) / 2)
elif k >= 3:
    t1 = s * 5
    for i in range(len(t1) - 1):
        if t1[i] == t1[i + 1]:
            t1.pop(i + 1)
            t1.insert(i + 1, "")
            count += 1
    if count % 5 == 0:
        count = (count / 5) * k
    elif (count + 1) % 5 == 0:
        count = ((count + 1) / 5) * k - 1
    else:
        count = ((count + 2) / 5) * k - 2
else:
    t1 = s * k
    for i in range(len(t1) - 1):
        if t1[i] == t1[i + 1]:
            t1.pop(i + 1)
            t1.insert(i + 1, "")
            count += 1
print(int(count))

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())
count = 0
import copy
s1 = list(set(s))
if len(s1) == 1:
    count = int((k * len(s)) / 2)
elif k >= 3:
    t1 = s * 5
    for i in range(len(t1) - 1):
        if t1[i] == t1[i + 1]:
            t1.pop(i + 1)
            t1.insert(i + 1, "")
            count += 1
    if count % 5 == 0:
        count = (count / 5) * k
    else (count + 2) % 5 == 0:
        count = ((count + 2) / 5) * k - 2
else:
    t1 = s * k
    for i in range(len(t1) - 1):
        if t1[i] == t1[i + 1]:
            t1.pop(i + 1)
            t1.insert(i + 1, "")
            count += 1
print(int(count))

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())
count = 0
x = 0
if s[0] != s[-1]:
    for i in range(len(s) - 1):
        if s[i] == s[i + 1]:
            s.pop(i + 1)
            s.insert(i + 1, "")
            count += 1
    count = count * k
else:
    if s[-2] == s[-1]:
        x = 1
    s.append(s[0])
    for i in range(len(s) - 1):
        if s[i] == s[i + 1]:
            s.pop(i + 1)
            s.insert(i + 1, "")
            count += 1
    count = count * k - 1
    if x == 1:
        count += 1
print(int(count))

Buggy submission (verdict: Runtime Error):
s = list(input())
k = int(input())
count = 0
x = 0
if s[0] != s[-1]:
    for i in range(len(s) - 1):
        if s[i] == s[i + 1]:
            s.pop(i + 1)
            s.insert(i + 1, "")
            count += 1
    count = count * k
else:
    if s[-2] == s[-1]:
        x = 1
    s.append(s[0])
    for i in range(len(s) - 1):
        if s[i] == s[i + 1]:
            s.pop(i + 1)
            s.insert(i + 1, "")
            count += 1
    count = count * k - 1
    if x == 1:
        count += 1
print(int(count))
Problem p02990 (python)

Fixed submission:
import numpy as np

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

def comb(n,k,p):
  """power_funcを用いて(nCk) mod p を求める"""
  from math import factorial
  if n<0 or k<0 or n<k: return 0
  if n==0 or k==0: return 1
  a=factorial(n) %p
  b=factorial(k) %p
  c=factorial(n-k) %p
  return (a*power_func(b,p-2,p)*power_func(c,p-2,p))%p
def power_func(a,b,p):
  """a^b mod p を求める"""
  if b==0: return 1
  if b%2==0:
    d=power_func(a,b//2,p)
    return d*d %p
  if b%2==1:
    return (a*power_func(a,b-1,p ))%p

for i in range(k):
    print(int(comb(k-1,i, pow(10, 9) + 7) * comb(n-k+1,i+1, pow(10, 9) + 7)) % (pow(10, 9) + 7))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

#階乗
def factorial(a):
    if a == 0:
        return 1
    else: 
        val = 1
        for i in np.arange(a)+1:
            val = val * i
        return val
    
def factorial2(a,b):
    if a == 0:
        return 1
    else: 
        val = 1
        for i in np.arange(b)+a-b+1:
            val = val * i
        return val

#組み合わせ数
def comb(a,b):
    return int(factorial2(a,b)/factorial(b))

for i in range(k):
    print(int(comb(k-1,i) * comb(n-k+1,i+1)) % (pow(10, 9) + 7))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

#階乗
def factorial(a):
    if a == 0:
        return 1
    else: 
        val = 1
        for i in np.arange(a)+1:
            val = val * i
        return val

#組み合わせ数
def comb(a,b):
    return int(factorial(a)/factorial(b)/factorial(a-b))

for i in range(k):
    print(int(comb(k-1,i) * comb(n-k+1,i+1) %(pow(10, 9) + 7)))

Buggy submission (verdict: Runtime Error):
import numpy as np

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

#階乗
def factorial(n):
    if n == 0:
        return 1
    else: 
        val = 1
        for i in np.arange(n)+1:
            val *= i
        return val

#組み合わせ数
def comb(a,b):
    return int(factorial(a)/factorial(b)/factorial(a-b) % (10^9 + 7))

for i in range(k):
    print(int(comb(k-1,i) * comb(n-k+1,i+1)  % (10^9 + 7)))
Problem p03013 (python)

Fixed submission:

# 壊れている床を無視すればフィボナッチ数になってる
from collections import defaultdict

def Fib(n, broken):
    dd = defaultdict(int)

    dd[0] = 1

    for i in range(n):
        for j in range(i+1, min(n, i+2)+1):
            if broken[j] == 0:
                dd[j] += dd[i]
                dd[j] %= 1000000007

    return dd[n]


n, m = map(int, input().split())
A = [int(input()) for _ in range(m)]
broken = defaultdict(int)
for c in A:
    broken[c] = 1

ans = Fib(n, broken)
print(ans % 1000000007)

Buggy submission (verdict: Runtime Error):

# 壊れている床を無視すればフィボナッチ数になってる

from collections import defaultdict

def Fib(n, dd, broken):
    if n in broken:
        return 0

    if dd[n] != 0:
        return dd[n]

    if n <= 1:
        return 1

    x = Fib(n-1, dd, broken) + Fib(n-2, dd, broken)
    dd[n] = x
    return x

dd = defaultdict(int)

n, m = map(int, input().split())
A = [int(input()) for _ in range(m)]

ans = Fib(n, dd, A)
print(ans % 1000000007)
Problem p03137 (python)

Fixed submission:

N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()

if N >= M:
    print(0)
    exit()

diff = []
for i in range(M-1):
    diff.append(X[i+1] - X[i])

#print(diff)

diff.sort()
for i in range(N-1):
    diff.pop()

print(sum(diff))

Buggy submission (verdict: Runtime Error):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
##############################

N, M = map(int, input().split())
X = list(map(int, input().split()))
X.sort()

diff = []
for i in range(M-1):
    diff.append(X[i+1] - X[i])

#print(diff)

if len(diff) == 0:
    print(0)
    exit()

diff.sort()
for i in range(N-1):
    diff.pop()

print(sum(diff))
Problem p03775 (python)

Fixed submission:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

N = int(input())

a = 1
ans = len(str(N))

while a*a <= N:
    if N%a == 0:
        b = N//a
        tmp = len(str(b))
        ans = min(ans, tmp)
    a += 1

print(ans)

Buggy submission (verdict: Runtime Error):
x
Problem p02951 (python)

Fixed submission:
a,b,c=(int(x) for x in input().split())
if ((c - (a - b)) < 0):
    print(0)
else:
    print(c - (a - b))

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
if ((a > 0) & (a < 100001)):
    data_size = int (math.log10(a) + 1)
    if a == 100000:
        print(90909)
    elif data_size == 5:
        print(a - 10000 + 1 + 909)
    elif data_size == 4:
        print(909)
    elif data_size == 3:
        print(a - 100 + 1 + 9)
    elif data_size == 2:   
        print(9)
    elif data_size == 1:   
        print(a - 1 + 1)

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
data_size = int (math.log10(a) + 1)
if a == 100000:
    print(90909)
elif data_size == 5:
    print(a - 10000 + 1 + 909)
elif data_size == 4:
    print(909)
elif data_size == 3:
    print(a - 100 + 1 + 9)
elif data_size == 2:   
    print(9)
elif data_size == 1:   
    print(a - 1 + 1)
Problem p03208 (python)

Fixed submission:
N,K=map(int,input().split(" "))
H=[int(input()) for _ in range(N)]
H.sort()
tmax=10**9
for a in range(N-K+1):
    h1,h2=H[a],H[a+K-1]
    tmax=min(tmax,abs(h1-h2))
    if(tmax==0):
        break
print(tmax)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split(" "))
H=[int(input()) for _ in range(N)]
H.sort()
tmax=10**9
for a in range(N-K+1):
    h1,h2=H[a],H[a+K]
    tmax=min(tmax,abs(h1-h2))
    if(tmax==0):
        break
print(tmax)
Problem p02915 (python)

Fixed submission:
N = input()
N = int(N)
print(N**3)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)

a_sub = input().split(" ")
a = [int(n0) for n0 in a_sub]
# print(a)

b_sub = input().split(" ")
b = [int(n0) for n0 in b_sub]
# print(b)

c_sub = input().split(" ")
c = [int(n0) for n0 in c_sub]
# print(c)

score = 0
for xi in range(N-1):
    score = score + b[xi]
    if a[xi+1]==a[xi]+1:
        score = score + c[a[xi]-1]
        # print(xi, c[xi])
score = score + b[N-1]
print(score)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)

a_sub = input().split(" ")
a = [int(n0) for n0 in a_sub]
# print(a)

b_sub = input().split(" ")
b = [int(n0) for n0 in b_sub]
# print(b)

c_sub = input().split(" ")
c = [int(n0) for n0 in c_sub]
# print(c)

score = 0
for xi in range(N):
    score = score + b[xi]
    if a[xi+1]==a[xi]+1 and xi<N-1:
        score = score + c[a[xi]-1]
        # print(xi, c[xi])

print(score)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)

a_sub = input().split(" ")
a = [int(n0) for n0 in a_sub]
# print(a)

b_sub = input().split(" ")
b = [int(n0) for n0 in b_sub]
# print(b)

c_sub = input().split(" ")
c = [int(n0) for n0 in c_sub]
# print(c)

score = 0
for xi in range(N):
    score = score + b[xi]
    if a[xi+1]==a[xi]+1 and xi<N:
        score = score + c[a[xi]-1]
        # print(xi, c[xi])

print(score)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)

a_sub = input().split(" ")
a = [int(n0) for n0 in a_sub]
# print(a)

b_sub = input().split(" ")
b = [int(n0) for n0 in b_sub]
# print(b)

c_sub = input().split(" ")
c = [int(n0) for n0 in c_sub]
# print(c)

score = 0
for xi in range(N):
    score = score + b[xi]
    if a[xi+1]==a[xi]+1 and xi<N:
        score = score + c[a[xi]-1]
        print(xi, c[xi])

print(score)

Buggy submission (verdict: Runtime Error):
N = input()
N = int(N)

a_sub = input().split(" ")
a = [int(n0) for n0 in a_sub]
# print(a)

b_sub = input().split(" ")
b = [int(n0) for n0 in b_sub]
# print(b)

c_sub = input().split(" ")
c = [int(n0) for n0 in c_sub]
# print(c)

score = 0
for xi in range(N):
    score = score + b[xi]
    if a[xi+1]==a[xi]+1 and xi<N:
        score = score + c[a[xi]-1]
        print(xi, c[xi])

# print(score)

for xi in range(N-1):
    if a[xi+1]==a[xi]+1:
        score = score + c[a[xi]-1]
        print(xi, c[xi])
print(score)

Buggy submission (verdict: Runtime Error):
N = input()
print(N**3)
Problem p03042 (python)

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

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

Buggy submission (verdict: Runtime Error):
s = raw_input()

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

if 0<a<13:
    if 0<b<13:
        print("AMBIGUOUS")
    else:
        print("MMYY")
else:
    if -1<b<13:
        print("YYMM")
    else:
        print("NA")
Problem p03104 (python)

Fixed submission:
a,b=map(int,input().split())
if a==b:
    print(a)
else:
    s=4-a%4
    t=(1+b%4)
    ans=0
    for j in range(a,a+s):
        ans=ans^j
    for j in range(b+1-t,b+1):
        ans=ans^j
    print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
    print(a)
else:
    s=0
    t=0
    for i in range(41):
        if 2**i>a:
            s=i
            break
    for i in range(41):
        if 2**i>b:
            t=i-1
            break
    ans=0
    for j in range(a,2**s):
        ans=ans^j
    for j in range(2**t,b+1):
        ans=ans^j
	print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
    print(a)
else:
    s=0
    t=0
    for i in range(41):
        if 2**i>a:
            s=i
            break
    for i in range(41):
        if 2**i>b:
            t=i-1
            break
    ans=0
    for j in range(a,2**s):
        ans=ans^j
    for j in range(2**t,b+1):
        ans=ans^j
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a==b:
    print(a)
else:
    s=0
    t=0
    for i in range(41):
        if 2**i>a:
            s=i
            break
    for i in range(41):
        if 2**i>b:
            t=i-1
            break
    print(s,t)
    x=int('0'*t)
    ans=x
    for j in range(a,2**s):
        ans=ans^j
    for j in range(2**t,b+1):
        ans=ans^j
print(ans)
Problem p03252 (python)

Fixed submission:
import collections

s = list(input())
t = list(input())

cs = collections.Counter(s)
ct = collections.Counter(t)

slist = list(cs.values())
tlist = list(ct.values())

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import collections

s = list(input())
t = list(input())

cs = collections.Counter(s)
ct = collections.Counter(t)

slist = cs.values()
tlist = ct.values()

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter

s = list(input())
t = list(input())

cs = Counter(s)
ct = Counter(t)

slist = list(cs.value())
tlist = list(cs.value())

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
from collections import Counter

s = list(input())
t = list(input())

cs = Counter(s)
ct = Counter(t)

slist = cs.value()
tlist = cs.value()

slist.sort()
tlist.sort()

if slist == tlist:
    print("Yes")
else:
    print("No")
Problem p03307 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
if n%2 == 0:
  print(n):
else:
  print(2*n)