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

Fixed submission:
## ABC 054 b
import sys

n,m = (int(_) for _ in input().split())
a = [input() for i in range(n)]
b = [input() for i in range(m)]

if(a[::1] == b[::1]):
    print('Yes')
    sys.exit(0)

for i in range(n-m):
    for j in range(n-m):
        if (b[::1] == [ai[j:j+m] for ai in a[i:i+m]]):
            print('Yes')
            sys.exit(0)

print('No')

Buggy submission (verdict: Runtime Error):
## ABC 054 b
import sys
import numpy as np

n,m = (int(_) for _ in input().split())
a = [list(input()) for i in range(n)]
b = [list(input()) for i in range(m)]
aa = np.array(a)
bb = np.array(b)

for i in range(n-m+1):
    for j in range(n-m+1):
        if (bb[:, :] == aa[i:i+m, j:j+m]):
            print('Yes')
            sys.exit(0)

print('No')

Buggy submission (verdict: Runtime Error):
## ABC 054 B
import sys
n, m = map(int, input().split())

a = [input() for i in range(n)]
b = [input() for j in range(m)]

if(n == m and a == b):
    print('Yes')
    sys.exit(0)
elif(m == 1):
    for i in range(n):
        if(b[0] in a[i]):
            print('Yes')
            sys.exit(0)
    print('No')
    sys.exit(0)

for k in range(n-m):
    idx = []
    for j in range(n-m):
        if (a[k][j:j + m] == b[k]):
            idx.append(j)
            continue
    for id in idx:
        for i in range(k,m):
            if(a[i][id:id+m] == b[i]):
                continue
            else:
                print('No')
                sys.exit(0)
        print('Yes')
        sys.exit(0)
Problem p02661 (python)

Fixed submission:
N = int(input())
AB = [list(map(int,input().split())) for _ in range(N)]
 
A = []
B = []
for i in range(N):
  A.append(AB[i][0])
  B.append(AB[i][1])
A.sort()
B.sort()
if N % 2 == 0:
    n = N // 2
    med1 = A[n-1] + A[n]
    med2 = B[n-1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
    
print(x)

Buggy submission (verdict: Runtime Error):
N = int(input())
AB = [int(input().split()) for _ in range(n)]
 
A = AB[::2]
B = AB[1::2]
 
A.sort()
B.sort()
 
if N % 2 == 0:
    n = N // 2
    med1 = A[n - 1] + A[n]
    med2 = B[n - 1] + B[n]
    x = med2 - med1 + 1
else:
    n = N // 2
    med1 = A[n]
    med2 = B[n]
    x = med2 - med1 + 1
 
print(x)
Problem p02711 (python)

Fixed submission:
s = str(input())
if s[0]=='7' or s[1]=='7' or s[2]=='7':
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[0]==7 or s[1]==7 or s[2]==7:
  print('Yes')
else:
  print('No'9
Problem p02723 (python)

Fixed submission:
S = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = str(input())
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if S[2]==S[3] and S[4]==S[5]:
    print("Yes")
else:
    print("No")
Problem p02754 (python)

Fixed submission:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = str(input())
b = str(input())

L =[(a+b)*n]

for i in range(n+1):
  if a == 0:
    print(b*n)
  else:
    print(b.count(n))
Problem p02773 (python)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
    s=input()
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1
max_d = max(d.values())
print(*sorted([kv[0] for kv in d.items() if kv[1] == max_d]))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input() for _ in range(n)]
dic = {}
for i in range(n):
  if s[i] not in dic:
    dic[s[i]] = 1
    else:
      dic[s[i]] += 1
max_dic_val = max(dic.values()) 
ans = []
for keys in dic.keys():
  if dic[keys] == max_dic_val: 
    ans.append(keys)
ans = sorted(ans)
for words in ans:
  print(words)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = sorted([a[0] for i in d.items() if a[1] == max_d])
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s  in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = d.sorted([kv[0] for kv in d.items() if kv[1] == max_d])
print(ans)
Problem p02777 (python)

Fixed submission:
S,T = input().split()
A,B = map(int, input().split())
U = input()

if S==U:
    A -= 1
else:
    B -= 1
print(A,B)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k:
  print(x-1,y)
else:
  print(x,y-1)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
x,y = map(int,input().split())
k = int(input())

if a == k:
  print(x-1,y)
else:
  print(x,y-1)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k:
  print(x-1,y)
else:
  print(x,y-1)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
else
  print(x,y-1)

Buggy submission (verdict: Runtime Error):
a,b = input().split()
x,y = int(input().split())
k = input()

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)

Buggy submission (verdict: Runtime Error):
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if "a" == "k" :
  print(x-1,y)
elif "b" == "k" :
  print(x,y-1)
else:
  print(x,y)

Buggy submission (verdict: Runtime Error):
a,b = str(input().split())
x,y = int(input().split())
k = str(input())

if a == k :
  print(x-1,y)
elif b == k :
  print(x,y-1)
else:
  print(x,y)
Problem p02785 (python)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if len(l) > k:
    print(sum(l[:n-k]))
else:
    print(0)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
if n-k+1 <= 0:
  print(0)
  quit()
else:
  L = l[0:n-K+1]
  L_sum = sum(L)
  print(L_sum)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0:n-K+1]
L_sum = sum(L)
print(L_sum)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
L = l[0,n-K+1]
L_sum = sum(L)
print(L_sum)
Problem p02881 (python)

Fixed submission:
n = int(input())
ma = 10**100
for i in range(1, 10**6+2):
  if n % i == 0:
    ma = min(ma,((i-1)+(n//i)-1))
print(ma)

Buggy submission (verdict: Runtime Error):
n = int(input())
ma = 10**100
for i in range(1, 10**6+2):
  if N % i == 0:
    ma = min(ma,((i-1)+(n//i)-1))
print(ma)
Problem p02897 (python)

Fixed submission:
a = int(input())
if a % 2 == 0:
  print(0.5)
else:
  print(((a+1)//2) / a)

Buggy submission (verdict: Runtime Error):
a = int(input)
if a % 2 == 0:
  print(0.5)
else:
  print(((a+1)//2) / a)
Problem p02933 (python)

Fixed submission:
a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print('red')

Buggy submission (verdict: Runtime Error):
a = int(input())
s  = str(input())
if n >= 3200:
  print(s)
else:
  print('red')

Buggy submission (verdict: Runtime Error):
a = int(input())
s  = input()
if n >= 3200:
  print(s)
else:
  print('red')
Problem p02989 (python)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = l[a]-l[a-1]

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
a = n//2

ans = d[a]-d[a-1]

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
b = l[n//2+1]-l[n//2+2]
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort()
b = l[n//2+1]-[n//2+2]
print(b)
Problem p03075 (python)

Fixed submission:
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):
for i in range()
if i[4]-i[0] <= i[5]:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = map(int,input().split())
if abs(e-a) <= k:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e = map(int,input().split())
k = int(input())
if e-a < k:
  print('Yay!')
else:
  print(':(')

Buggy submission (verdict: Runtime Error):
a,b,c,d,e,k = map(int,input().split())
if e-a <= k:
  print('Yay!')
else:
  print(':(')
Problem p03077 (python)

Fixed submission:
N = int(input())
capacity = [int(input()) for _ in range(5)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Buggy submission (verdict: Runtime Error):
N = int(input())
quank = [int(input()) for _ in range(N)]
b = min(quank)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Buggy submission (verdict: Runtime Error):
N = int(input())
capacity = [int(input()) for _ in range(N)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)

Buggy submission (verdict: Runtime Error):
N = int(input())
capacity = [int(input()) for _ in range(N)]
b = min(capacity)
if N % b == 0:
    a = N//b
else:
    a = N//b + 1
print(a+4)
Problem p03207 (python)

Fixed submission:
n = int(input())
p = [int(input()) for i in range(n)]
print(sum(p) - max(p) // 2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
  s.append(int(input())
m = max(s)
print(sum(s)-m)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list()
[a = int(input()) for i in range(n):]
  s.add(a)
m = max(s)
print(sum(s)-m)
Problem p03250 (python)

Fixed submission:
a,b,c = (map(int,input().split()))
L = [a,b,c]
M = L.sort()

print(L[-1]*10 + L[0] + L[1])

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
L = [a,b,c]
M = L.sorted()
print(int(str(M[2])+str(M[1]))+int(M[0]))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
L = [a,b,c]
M = L.sorted()
ptint(int(str(M[2])+str(M[1]))+int(M[0]))
Problem p03252 (python)

Fixed submission:
s=list(input())
t=list(input())
S=sorted(map(s.count,set(s)))
T=sorted(map(t.count,set(t)))
print("Yes" if S==T else "No")

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

from collections import Counter
SC = Counter(s)
TC = Counter(t)

SCV = SC.values()
TCV = TC.values()

SCV.sort()
TCV.sort()
ans = 1
for i in range(len(s)):
  if SCV[i] != TCV[i]:
    ans = 0

if ans == 1:
  print('Yes')
else:
  print('No')

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

from collections import Counter
SC = Counter(s)
TC = Counter(s)

SCV = SC.values()
TCV = TC.values()

SCV.sort()
TCV.sort()

if SCV == TCV:
  print('Yes')
else:
  print('No')
Problem p03265 (python)

Fixed submission:
x_1,y_1,x_2,y_2 = map(int,input().split())
print(y_1+x_2-y_2,-x_1+x_2+y_2,x_1+y_1-y_2,-x_1+y_1+x_2)

Buggy submission (verdict: Runtime Error):
x1,y1,x2,y2 = map(int,input().split())
l = abs(y2 - y1)
x3 = x1 - l
y3 = y2
x4 = x3
y4 = y1
print(x3,y3.x4.y4)
Problem p03272 (python)

Fixed submission:
n,i = map(int,input().split())
print(n-i+1)

Buggy submission (verdict: Runtime Error):
n,i = (int,input().split())
print(n-i+1)
Problem p03286 (python)

Fixed submission:
n=int(input())
x=""
while n != 0:
    x = str(n%2) + x
    n = -(n//2)
print(0 if x == "" else x)

Buggy submission (verdict: Runtime Error):
n=int(input())
x=""
While n != 0:
    x = str(n%2) + x
    n = -(n//2)
print(0 if x == "" else x)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = ''
While n != 0:
  x += str(n%2)
  n = -(n//2)
  
if x == '':
  print(0)
else:
  print(x)
Problem p03327 (python)

Fixed submission:
n = int(input())
if n >= 1000:
  print('ABD')
else:
  print('ABC')

Buggy submission (verdict: Runtime Error):
n = int(input())
if n >= 1000:
  print('ABD'+(n-999))
else:
  print('ABC'+n)

Buggy submission (verdict: Runtime Error):
n = int(input())
if n >= 1000:
  print('ABD'+(1000-n))
else:
  print('ABC'+n)
Problem p03329 (python)

Fixed submission:
import numpy as np
N = int(input())

coin = [6**n for n in range(10) if 6**n <= N]
coin += [9**n for n in range(10) if 9**n <= N]

dp = np.zeros(N+1, dtype=np.int32)
dp += 10**9
dp[0] = 0

for c in coin:
  for _ in range(9):
    dp[c:] = np.minimum(dp[:-c] + 1, dp[c:])

answer = dp[-1]
print(answer)

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

arr6 = []
for i in range(10):
	arr6.append(6**i)

arr9 = []
for i in range(10):
	arr9.append(9**i)


ans = float("inf")
for i in range(n+1):
	count = 0
	tmp = i
	while tmp > 0:
		t = 0
		while arr6[t] <= tmp:
			t+=1

		tmp -= arr6[t-1]
		count += 1

	tmp = n-i
	while tmp > 0:
		t = 0
		while arr9[t] <= tmp:
			t += 1
		tmp -= arr9[t-1]
		count += 1

	ans = min(ans,count)

print ans
Problem p03617 (python)

Fixed submission:
Q, T, S, D = map(int, input().split())
N = int(input())

for_1L = min(4*Q, 2*T, S)
for_2L = min(2*for_1L, D)

print((N//2)*for_2L + (N%2)*for_1L)

Buggy submission (verdict: Runtime Error):
q,h,s,d = map(int,input().split())
n = int(input())
a = min(q*4,h*2,s)
if n % 2 == 0:
  print(min(n/(a*2),n/d))
else:
  print(min(n/(a*2)+d),n/d)
Problem p03834 (python)

Fixed submission:
a,b,c = input().split(",")
print(a,b,c)

Buggy submission (verdict: Runtime Error):
s = input()
s[5]=' '
s[13]=' '
print(s)
Problem p03835 (python)

Fixed submission:
k,n = map(int,input().split())
ans = 0
for i in range(k+1):
  for j in range(k+1):
    if 0 <= n-i-j <= k:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
k,s = int(input())
ans = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
      if x + y + z == s:
        ans += 1
print(ans)
Problem p02831 (python)

Fixed submission:
import fractions


def run(A, B):
    return A * B // fractions.gcd(A, B)


def main():
    A, B = map(int, input().split())
    print(run(A, B))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math


def run(A, B):
    return A * B // math.gcd(A, B)


def main():
    A, B = map(int, input().split())
    print(run(A, B))


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

Fixed submission:
import math


def run(N):
    if N == 0:
        return 0
    ans = 0
    if N % 2 == 0:
        for i in range(int(math.log(N, 5))):
            ans += N // (10 * (5**i))
    return ans


def main():
    N = int(input())
    print(run(N))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math


def run(N):
    ans = 0
    if N % 2 == 0:
        for i in range(int(math.log(N, 5))):
            ans += N // (10 * (5**i))
    return ans


def main():
    N = int(input())
    print(run(N))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import math


def run(N):
    ans = 0
    if N % 2 == 0:
        for i in range(int(math.log(N, 5))):
            ans += N // (10 * (5**i))
    return ans


def main():
    N = int(input())
    print(run(N))


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

Fixed submission:
s=input()
k=int(input())

tail = s[0]
plus = 0
flg = False
if tail == s[-1]:
  tmp_cnt1 = 0
  tmp_cnt2 = 0
  for i in s:
    if tail == i:
      tmp_cnt1 += 1
    else:
      break
  for i in s[::-1]:
    if tail == i:
      tmp_cnt2 += 1
    else:
      break
  if (tmp_cnt1 % 2) == 1 and (tmp_cnt2%2)==1:
    plus = 1
  if tmp_cnt1 == len(s):
    flg = True

cnt=0
if len(s)==1:
  ret = k//2
else:
  tmp=s[0]
  tmp_cnt=0
  for i in s[1:]:
    if tmp==i:
      tmp_cnt+=1
    else:
      cnt+=(tmp_cnt+1)//2
      tmp_cnt=0
    tmp=i
  cnt+=(tmp_cnt+1)//2
  ret=cnt*k
  if plus == 1:
    ret += k-1
  if flg:
    ret = len(s)*k//2
print(ret)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

tail = s[0]
plus = 0
if tail == s[-1]:
  tmp_cnt1 = 0
  tmp_cnt2 = 0
  for i in s:
    if tail == i:
      tmp_cnt1 += 1
    else:
      break
  for i in s[::-1]:
    if tail == i:
      tmp_cnt2 += 1
    else:
      break
  if (tmp_cnt1 % 2) == 1 and (tmp_cnt2%2)==1:
    plus = 1

cnt=0
if len(s)==1:
  ret = k
else:
  tmp=s[0]
  tmp_cnt=0
  for i in s[1:]:
    if tmp==i:
      tmp_cnt+=1
    else:
      cnt+=(tmp_cnt+1)//2
      tmp_cnt=0
    tmp=i
  cnt+=(tmp_cnt+1)//2
  ret=cnt*k
  if plus == 1:
    ret += k-1
  if tmp_cnt1 == len(s):
    ret = len(s)*k//2
print(ret)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

tail = s[0]
if tail == s[-1]:
  tmp_cnt1 = 0
  tmp_cnt2 = 0
  for i in s:
    if tail == i:
      tmp_cnt1 += 1
    else:
      for i in s.reverse():
        if tail == i:
          tmp_cnt2 += 1
        else:
          break
      break
  if (tmp_cnt1 + tmp_cnt2) % 2 == 1:
    tail = ''

cnt=0
if len(s)==1:
  ret = k
else:
  tmp=s[0]
  tmp_cnt=0
  for i in s[1:]+tail:
    if tmp==i:
      tmp_cnt+=1
    else:
      cnt+=(tmp_cnt+1)//2
      tmp_cnt=0
    tmp=i
  cnt+=(tmp_cnt+1)//2
  ret=cnt*k
print(ret)

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())

tail = s[0]
if tail == s[-1]:
  tmp_cnt1 = 0
  tmp_cnt2 = 0
  for i in s:
    if tail == i:
      tmp_cnt1 += 1
    else:
      for i in s.reverse():
        if tail == i:
          tmp_cnt2 += 1
        else:
          break
      break
  if (tmp_cnt1 + tmp_cnt2) % 2 == 1:
    tail = ''

cnt=0
if len(s)==1:
  ret = k
else:
  tmp=s[0]
  tmp_cnt=0
  for i in s[1:]+s[0]:
    if tmp==i:
      tmp_cnt+=1
    else:
      cnt+=(tmp_cnt+1)//2
      tmp_cnt=0
    tmp=i
  cnt+=(tmp_cnt+1)//2
  ret=cnt*k
print(ret)
Problem p03188 (python)

Fixed submission:
def run(K):
    n_max = 500
    '''
    K <= 500の場合は、n = Kとして1行につき1色を塗ればよい
        111
        222
        333
    Kが4の倍数の場合は、n = K/2以下の塗り方ができる
        1234
        5678
        3412
        7856
    上記でn+i+1色をi色に塗り替えても条件を満たす
        1234
        5178
        3412
        7851
    K = 1000の時は、n = 500で満たし、塗り替え操作で501～999まで表現できる
    '''
    n = 0
    trouts = []
    if K <= n_max:
        n = K
        for i in range(K):
            trouts.append([i+1]*K)
    else:
        n = n_max
        change = n_max*2 - K
        c1 = [i for i in range(1, n_max+1)]
        # c - 1 + n_max - c + 1 (c>0)
        # 0 + n_max (c==0)
        c2 = [i for i in range(2, change+1)] + [i for i in range(n_max+1, n_max*2+1-change)]
        if change > 0:
            c2 += [1]
        for i in range(n_max):
            shift = (i//2) * 2
            if i % 2 == 0:
                trouts.append(c1[shift:] + c1[:shift])
            else:
                trouts.append(c2[shift:] + c2[:shift])
    return (n, trouts)


def main():
    K = int(input())
    n, trouts = run(K)
    print(n)
    for i in range(len(trouts)):
        print(' '.join(map(str, trouts[i])))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def run(K):
    n = 0
    trouts = []
    div = 0
    for i in range(2, 500):
        if K % (i**2) == 0:
            div = i
            break
    if K <= 500:
        for i in range(K):
            n = K
            trouts.append([i+1]*K)
    else:
        n = div
        cnt = K // div
        for i in range(cnt):
            trouts.append([j+1 for j in range(i*div, (i+1)*div)]*(K//(div**2)))
    return (n, trouts)


def main():
    K = int(input())
    n, trouts = run(K)
    print(n)
    for i in range(len(trouts)):
        print(' '.join(map(str, trouts[i])))


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

Fixed submission:
def run(a, b, c):
    s = sorted([a, b, c])
    return 10*s[2]+s[1]+s[0]


def main():
    a, b, c = map(int, input().split())
    print(run(a, b, c))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import collections


def run(s, t):
    ss = collections.Counter(s)
    tt = collections.Counter(t)
    if sorted(list(ss.values())) == sorted(list(tt.values())):
        return 'Yes'
    else:
        return 'No'


def main():
    s = input()
    t = input()
    print(run(s, t))


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

Fixed submission:
def run(n, m, ab):
    ab = sorted(ab)
    cnt = 1
    b = ab[0][1]
    c = b
    for i in range(1, m):
        a = ab[i][0]
        b = ab[i][1]
        if a < c and c <= b:
            pass
        elif c <= a:
            cnt += 1
            c = b
        else:
            c = b
    return cnt


def read_line():
    n, m = list(map(int, input().split()))
    ab = []
    for i in range(m):
        a, b = list(map(int, input().split()))
        ab.append([a, b])
    return (n, m, ab)


def main():
    n, m, ab = read_line()
    print(run(n, m, ab))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def run(n, m, ab):
    ab = sorted(ab)
    cnt = 1
    b = ab[0][1]
    for i in range(1, m):
        a = ab[i][0]
        if b < a:
            cnt += 1
        b = ab[i][1]
    return cnt


def read_line():
    n, m = list(map(int, input().split()))
    ab = []
    for i in len(m):
        a, b = list(map(int, input().split()))
        ab.append([a, b])
    return (n, m, ab)


def main():
    n, m, ab = read_line()
    print(run(n, m, ab))


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

Fixed submission:
def run(n):
    if n % 2 == 0:
        return n
    else:
        return n * 2


def read_line():
    n = int(input())
    return n


def main():
    n = read_line()
    print(run(n))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def run(n):
    if n % 2 == 0:
        return n
    else:
        return n * 2


def read_line():
    n = map(int, input().split())
    return n


def main():
    n = read_line()
    print(run(n))


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

Fixed submission:
n = int(input())
l = [i for i in range(1,n+1)]
l = list(filter(lambda x: x%3 != 0,l))
l = list(filter(lambda x: x%5 != 0,l))
print(sum(l))

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [i for i in range(1,n+1)]
l = list(filter(lambda x: x%3 != 0,l))
l = list(filter(lambda x; x%5 != 0,l))
print(sum(l))
Problem p02847 (python)

Fixed submission:
day = input()
if day == "SUN":
  print(7)
elif day=="MON":
  print(6)
elif day=="TUE":
  print(5)
elif day=="WED":
  print(4)
elif day=="THU":
  print(3)
elif day=="FRI":
  print(2)
elif day=="SAT":
  print(1)

Buggy submission (verdict: Runtime Error):
print 2

Buggy submission (verdict: Runtime Error):
import sys
def nextHoliday(day):
    days={'SUN':7,'MON':6,'TUE':5,'WED':4,'THU':3,'FRI':2,'SAT':1}
    return days[day.upper()]
  
day = sys.stdin.readline()
output=nextHoliday(day)
print(output)
Problem p02688 (python)

Fixed submission:
n,k=list(map(int, input().split()))
dic={}
for i in range(k):
  j=int(input())
  l=list(map(int, input().split()))
  for a in l:
    if a not in dic:
      dic[a]=True
x=len(list(dic.keys()))
print(n-x)

Buggy submission (verdict: Runtime Error):
n,k=list(map(int, input().split()))
dic={}
for i in range(2*k):
  j=int(input())
  l=list(map(int, input().split()))
  for a in l:
    if a not in dic:
      dic[a]=True
x=len(list(dic.keys()))
print(n-x)
Problem p02879 (python)

Fixed submission:
A,B = map(int,input().split())

if 1<=A<=9 and 1<=B<=9:
  	print (A*B)
else:
  	print('-1')

Buggy submission (verdict: Runtime Error):
a = 0
N = int(input())
for i in range(1, 10):
  for j in range(1, 10):
    if N == i*j:
      print('Yes')
      a = 1
  if a == 1:
    break
if a == 0:
  print('No')
Problem p02624 (python)

Fixed submission:
n = int(input())
s = 0
for i in range(1, n+1):
	x = n // i
	s += i * (x * (x+1)) / 2 
print(int(s))

Buggy submission (verdict: Runtime Error):
s = 0
q = int(n ** .5)
for i in range(1, int(n ** .5) + 1):
	x = n // i
	s += i * (x * (x+1)) / 2
	if x**2 != n:
		y = max(n // (i+1), q)
		s += (i * (i+1) // 2) * ((x * (x+1) // 2) - (y * (y+1) // 2))

print(int(s))