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

Fixed submission:
x, y = list(map(int, input().split()))
 
a = int(x)
b = int(y)
 
product = a*b
 
if product % 2 == 0:
	print("Even")
else:
	print("Odd")

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

a = int(x)
b = int(y)

product = a*b

if product % 2 = 0:
	print("Even")
else:
	print("Odd")
Problem p03109 (python)

Fixed submission:
S = input()

year, month, day = [int(item) for item in S.split('/')]

if (int(year) >= 2019) & (int(month) >= 5):
	print('TBD')
else:
	print('Heisei')

Buggy submission (verdict: Runtime Error):
year, month, day = [int(item) for item in S.split('/')]

if (int(year) >= 2019) & (int(month) >= 5):
	print('TBD')
else:
	print('Heisei')
Problem p03110 (python)

Fixed submission:
N = int(input())

yen = 0.
for i in range(N):
	x, u = input().split(' ')
	if u == 'JPY':
		yen += float(x)
	elif u == 'BTC':
		yen += 380000.0*float(x)

print(yen)

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

yen = 0.
for i in range(N):
	x, u = input().split(' ')
	if u == 'JPY':
		yen += float(x)
	elif u == 'BTC':
		yen += 380000.0*float(x)

print(yen)
Problem p03633 (python)

Fixed submission:
import math
import functools
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
def gcd(A, B):
  while(True):
    if A and B:
      if A > B:
        A = A % B
      else:
        B = B % A
    else:
      return max(A, B)

def lcm(A, B):
  return (A // gcd(A, B)) * B

print(functools.reduce(lcm, sorted(T, reverse=True)))

Buggy submission (verdict: Runtime Error):
import math
import functools
N = int(input())
T = []
for i in range(N):
  T.append(int(input()))
def gcd(A, B):
  while(True):
    if A and B:
      if A > B:
        A = A % B
      else:
        B = B % A
    else:
      return max(A, B)
 
def lcm(A, B):
  return (A * // gcd(A, B)) * b

print(functools.reduce(lcm, sorted(T, reverse=True)))
Problem p03729 (python)

Fixed submission:
str = raw_input().split()
if (str[0][-1:] == str[1][0] and str[1][-1:] == str[2][0]):
	print ("YES")
else :
	print("NO")

Buggy submission (verdict: Runtime Error):
N, t = map(int, raw_input().split())
n = map(int, raw_input().split())
total = 0
next = t
for i in range(N-1):
	if(next < n[i+1]):
		total += t
		next = n[i+1]
	else:
		total += n[i+1]-n[i]
		next = n[i+1] +t
total += t
print(total)
Problem p03125 (python)

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

Q = B/A

if Q.is_integer():
    print(A+B)
else:
    print(B-A)

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

while len(HPs) > 1:
    HPs.sort()
    for i in range(len(HPs)-1):
        HPs[i+1] = HPs[i+1] % HPs[0]
    while 0 in HPs:
        HPs.remove(0)

print(HPs[0])
Problem p03147 (python)

Fixed submission:
N = int(input())
h = list(map(int, input().split()))

count = 0

for i in range(N-1):
    if h[i] > h[i+1]:
        count = count + h[i] - h[i+1]

count = count + h[N-1]

print(count)

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

loc_max = h[0]
count = 0

for i in range(1, N):
    if h[i] >= loc_max:
        loc_max = h[i]
    if h[i] < h[i-1]:
        count = count + loc_max - h[i]
        loc_max = 0
    if i == N-1:
        count = count + h[i]

print(count)
Problem p03138 (python)

Fixed submission:
# input
n, k = map(int, input().split())
A = list(map(int, input().split()))

ones = [0] * 40 # 各桁で1が立っている数
for a in A:
    for i in range(40):
        if a & (1 << i):
            ones[i] += 1

x = 0
for i in range(39, -1, -1):
    if x + (1 << i) > k:
        continue
    if ones[i] < n - ones[i]: # 1が立っている数 < 0が立っている数 -> 1を立てる
        x += (1 << i)

ans = 0
for a in A:
    ans += x ^ a

print(ans)

Buggy submission (verdict: Runtime Error):
# input
n, k = map(int, input().split())
A = list(map(int, input().split()))

ones = [0] * 40 # 各桁で1が立っている数
for a in A:
    for i in range(40):
        if a & (1 << k):
            ones[i] += 1

x = 0
for i in range(39, -1, -1):
    if x + (1 << k) > K:
        continue
    if ones[k] < n - ones[k]: # 1が立っている数 < 0が立っている数 -> 1を立てる
        x += (1 << k)

ans = 0
for a in A:
    ans += x ^ a

print(ans)

Buggy submission (verdict: Runtime Error):
# input
n, k = map(int, input().split())
A = sorted(list(map(int, input().split())))

x = A[0]
for i in range(1, n):
    x = x ^ A[i]

ans1 = 0
for i in range(n):
    ans += x ^ A[i]

ans2 = 0
for i in range(n):
    ans += k ^ A[i]

ans = max(ans1, ans2)
print(ans)
Problem p03141 (python)

Fixed submission:
#input
n = int(input())
H = []
for _ in range(n):
    a, b = map(int, input().split())
    H.append([a + b, a, b])

H = sorted(H, reverse = True)
sum_c = 0
sum_a = 0

for i in range(n):
    if i % 2 == 0:
        sum_c += H[i][1]
    else:
        sum_a += H[i][2]

ans = sum_c - sum_a
print(ans)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter, attrgetter
#input
n = int(input())
H = []
for i in range(n):
    a, b = map(int, input().split())
    H.append([i, a, b])

C = sorted(H, key = itemgetter(1, 2), reverse = True)
A = sorted(H, key = itemgetter(2, 1), reverse = True)
 
ans_c = 0
ans_a = 0
turn = 0
 
while H != []:
    C = sorted(H, key = itemgetter(1, 2), reverse = True)
    A = sorted(H, key = itemgetter(2, 1), reverse = True)
    if turn % 2 == 0: #chokudai 
        if C[0][1] - A[0][1] >= A[0][2] - C[0][2]:
            chokudai = C.pop(0)
        else:
            chokudai = A.pop(0)
        ans_c += chokudai[1]
        H.pop(chokudai[0])
    else: #aoki
        if A[0][2] - C[0][2] >= C[0][1] - A[0][1]:
            aoki = A.pop(0)
        else:
            aoki = C.pop(0)
        ans_a += aoki[2]
        H.pop(aoki[0])
    turn += 1
 
print(ans_c - ans_a)
Problem p03280 (python)

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

ans = (A - 1) * (B - 1)
print(ans)

Buggy submission (verdict: Runtime Error):
# input
A = int(input())
B = int(input())

ans = (A - 1) * (B - 1)
print(ans)
Problem p03283 (python)

Fixed submission:
# input
N, M, Q = map(int, input().split())
train_query = {} # 対象区間とクエリを一緒にソート
for i in range(M + Q):
    train_query[i] = list(map(int, input().split()))

train_query = sorted(train_query.items(), key=lambda x: x[1][1])
# 辞書をソートするとリストが返ってくることに注意

StartPoints = [0 for _ in range(N)] # 対象区間の開始位置
ans = [0 for _ in range(Q)] # 各クエリに対する答え

for j in range(M + Q):
    if train_query[j][0] < M: # 対象区間
        StartPoints[train_query[j][1][0] - 1] += 1
    else: # クエリ
        ans[train_query[j][0] - M] = sum(StartPoints[(train_query[j][1][0] - 1):(train_query[j][1][1])])

for i in range(Q):
    print(ans[i])

Buggy submission (verdict: Runtime Error):
# input
N, M, Q = map(int, input().split())
train_query = {} # 対象区間とクエリを一緒にソート
for i in range(M + Q):
    train_query[i] = list(map(int, input().split()))

train_query = sorted(train_query.items(), key=lambda x: x[1], reverse = True)
# 辞書をソートするとリストが返ってくることに注意

a = [0 for _ in range(N)]

for j in range(M + Q):
    if train_query[j][0] < M: # 対象区間
        a[train_query[j][1][0]] = 1
    else: # クエリ
        ans = sum(a[train_query[j][1][0]:train_query[j][1][1]])
        print(ans)
Problem p03296 (python)

Fixed submission:
# input
N = int(input())
A = list(map(int, input().split()))

i = 0
ans = 0

while i < N - 1:
    if A[i + 1] == A[i]:
        if i < N - 2:
            A[i + 1] == A[i] + A[i + 2]
        if i == N - 1:
            A[i + 1] += 1
        i += 1
        ans += 1
    i += 1

print(ans)

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

i = 0
ans = 0

while i < N - 1:
    if A[i + 1] == A[i]:
        A[i + 1] == A[i] + A[i + 2]
        i += 1
        ans += 1
    i += 1

print(ans)
Problem p03305 (python)

Fixed submission:
import heapq
# dijkstra
# edges = |V|のリスト
# 頂点iから頂点jにコストwで移動可能な場合：edges[i] = [(j, w)]

def dijkstra(n, edges, start):
    INF = float('inf')
    vertices = [INF] * n # 初期化
    vertices[start] = 0 # スタートの距離はゼロ
    hq = [(0, start)]
    heapq.heapify(hq)

    while hq:
        cost, v = heapq.heappop(hq)
        
        for to, w in edges[v]:
            if cost + w >= vertices[to]:
                continue
            vertices[to] = cost + w
            heapq.heappush(hq, (vertices[to], to))
    
    return vertices

# input
n, m, s, t = map(int, input().split())
G = [list(map(int, input().split())) for _ in range(m)]
INF = float('inf')


G_yen = [[] for _ in range(n)]
G_snu = [[] for _ in range(n)]

s, t = s - 1, t - 1

for u, v, a, b in G:
    G_yen[u - 1].append((v - 1, a))
    G_yen[v - 1].append((u - 1, a))
    G_snu[u - 1].append((v - 1, b))
    G_snu[v - 1].append((u - 1, b))

yen = dijkstra(n, G_yen, s)
snu = dijkstra(n, G_snu, t)

ans = [INF]

for i in reversed(range(n)):
    tmp = snu[i] + yen[i]
    ans.append(min(ans[-1], tmp))

for i in reversed(ans[1:]):
    print(10 ** 15 - i)

Buggy submission (verdict: Runtime Error):
import heapq
# dijkstra
# edges = |V|のリスト
# 頂点iから頂点jにコストwで移動可能な場合：edges[i] = [(j, w)]

def dijkstra(n, edges, start):
    INF = float('inf')
    vertices = [INF] * n # 初期化
    vertices[start] = 0 # スタートの距離はゼロ
    hq = [(0, start)]
    heapq.heapify(hq)

    while q:
        cost, v = heapq.heappop(hq)
        
        for to, w in edges[v]:
            if cost + w >= vertices[to]:
                continue
            vertices[to] = cost + w
            heapq.heappush(hq, (vertices[to], to))
    
    return vertices

# input
n, m, s, t = map(int, input().split())
G = [list(map(int, input().split())) for _ in range(m)]

G_yen = [[] for _ in range(n)]
G_snu = [[] for _ in range(n)]

s, t = s - 1, t - 1

for u, v, a, b in G:
    G_yen[u - 1].append((v - 1, a))
    G_yen[v - 1].append((u - 1, a))
    G_snu[u - 1].append((v - 1, b))
    G_snu[v - 1].append((u - 1, b))

yen = dijkstra(n, G_yen, s)
snu = dijkstra(n, G_snu, t)

ans = [INF]

for i in reversed(range(n)):
    tmp = snu[i] + yen[i]
    ans.append(min(ans[-1], tmp))

for i in reversed(ans[1:]):
    print(10 ** 15 - a)
Problem p03309 (python)

Fixed submission:
from statistics import median_low

# input
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    A[i] = A[i] - (i + 1)

b = median_low(A)
ans = 0

for i in range(N):
    ans += abs(A[i] - b)

print(ans)

Buggy submission (verdict: Runtime Error):
import statistics

# input
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    A[i] = A[i] - (i + 1)

b = median_low(A)
ans = 0

for i in range(N):
    ans += abs(A[i] - b)

print(ans)
Problem p03323 (python)

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

if A >= 9 or B >= 9:
    print(':(')
else:
    print('Yay!')

Buggy submission (verdict: Runtime Error):
# input
A, B = map(int, input().input())

if A >= 9 or B >= 9:
    print(':(')
else:
    print('Yay')
Problem p03339 (python)

Fixed submission:
import math
import numpy as np

N = int(input())
S = list(input())

nW = [0 for i in range(N)] #iまでのWの数
nE = [0 for i in range(N)] #iまでのEの数

if S[0] == 'W':
    nW[0] = 1
else:
    nE[0] = 1

for i in range(1, N):
    if S[i] == 'W':
        nW[i] = nW[i-1] + 1
        nE[i] = nE[i-1]
    else:
        nW[i] = nW[i-1]
        nE[i] = nE[i-1] + 1

if nE[N-1] - nE[0] < nW[N-1]:
    count = nE[N-1] - nE[0]
else:
    count = nW[N-1]

for i in range(1,N-1):
    if nW[i-1] + nE[N-1] - nE[i] < count:
        count = nW[i-1] + nE[N-1] - nE[i]

print(count)

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

N = int(input())
S = list(input())

nW = [0 for i in range(N)]
nE = [0 for i in range(N)]

if S[0] == 'W':
    nW[0] = 1

if S[N-1] == 'E':
    nE[N-1] = 1

for i in range(1, N):
    if S[i] == 'W':
        nW[i] = nW[i-1] + 1
    else:
        nW[i] = nW[i-1]

for i in range(N-2,-1,-1):
    if S[i] == 'E':
        nE[i] = nE[i+1] + 1
    else:
        nE[i] = nE[i+1]

if nE[0] > nW[N-1]:
    count = nW[n-1]
else:
    count = nE[0]

for i in range(1,N-1):
    if nW[i-1] + nE[i+1] < count:
        count = nW[i-1] + nE[i+1]


print(count)
Problem p03340 (python)

Fixed submission:
# input
N = int(input())
A = list(map(int, input().split()))

l, r, sum, ans = 0, 0, 0, 0
 
while r < N:
    if sum + A[r] == sum ^ A[r]:
        sum += A[r]
        ans += r - l + 1
        r += 1
    else:
        sum -= A[l]
        l += 1
 
print(ans)

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

l, r, sum, ans = 0, 0, 0, 0
 
while r < N:
    if sum + A[r] == num ^ A[r]:
        sum += A[r]
        ans += r - l + 1
        r += 1
    else:
        sum -= A[l]
        l += 1
 
print(ans)

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

l, r, sum, ans = 0, 0, 0, 0
 
while r < N:
    if num + A[r] == num ^ A[r]:
        num += A[r]
        ans += r - l + 1
        r += 1
    else:
        num -= A[l]
        l += 1
 
print(ans)
Problem p03352 (python)

Fixed submission:
import math

# input
X = int(input())

ans = 1

for b in range(2, 32):
    p = 2
    while b ** p <= X:
        if b ** p > ans:
            ans = b ** p
        p += 1

print (ans)

Buggy submission (verdict: Runtime Error):
import math

# input
X = int(input())

ans = 1

for b in range(2, math.sqrt(X)):
    p = 1
    while b ** p <= X:
        if b ** p > ans:
            ans = b ** p
        p += 1
Problem p03353 (python)

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

sub = set()

for i in range(len(s)):
	for j in range(i + 1,i + K + 1):
		sub.add(s[i:j])

ans = list(sorted(sub))

print(ans[K - 1])

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

sub = set()

for i in range(len(s)):
	for j in range(i + 1,i + K + 1):
		sub.add(s[i:j])

ans = list(sorted(sub))

print(sub[K - 1])
Problem p03369 (python)

Fixed submission:
# input
S = input()

ans = 0

for i in range(3):
    if S[i] == 'o':
        ans += 1

ans = ans * 100 + 700

print(ans)

Buggy submission (verdict: Runtime Error):
# input
S = input()

ans = 0

for i in range(3):
    if S[i] == o:
        ans += 1

print(ans)
Problem p03385 (python)

Fixed submission:
# input
S = set(input())

if S == set(['a', 'b', 'c']):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# input
S = set(input())

if S = set(a, b, c):
    print('Yes')
else:
    print('No')
Problem p03448 (python)

Fixed submission:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for i in range(0, A+1):
    for j in range(0, B+1):
        for k in range(0, C+1):
            tmp = i * 500 + j * 100 + k * 50
            if (tmp == X):
                ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0

for i in [0, A+1]:
    for j in [0, B+1]:
        for k in [0, C+1]:
            int tmp = i * 500 + j * 100 + k * 50
            if (tmp == X):
                ans += 1

print(ans)
Problem p03472 (python)

Fixed submission:
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

D = [list(map(int, input().split())) for i in range(N)]
B = [D[i][1] for i in range(N)] # bのリスト

a_max = 0 # 最大のa

for i in range(N):
    if D[i][0] >= a_max:
        a_max = D[i][0]

B_larger = [] # a_maxより大きいbのリスト

for i in range(N):
    if B[i] > a_max:
        B_larger.append(B[i])

B_larger.sort(reverse=True)

n = 0

for i in range(len(B_larger)):
    H = H - B_larger[i]
    n += 1    
    if H <= 0:
        print(n)
        break
    

if H > 0:
    n += math.ceil(H/a_max)
    print(n)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

D = [list(map(int, input().split())) for i in range(N)]
B = [D[i][1] for i in range(N)] # bのリスト

a_max = 0 # 最大のa

for i in range(N):
    if D[i][0] >= a_max:
        a_max = D[i][0]

B_larger = [] # a_maxより大きいbのリスト

for i in range(N):
    if B[i] > a_max:
        B_larger.append(B[i])

B_larger.sort(reverse=True)

n = 0

while H > 0:
    H = H - B_larger[i]
    n += 1    

if H <= 0:
    print(n)
else:
    n = math.ceil(H/a_max)
    print(n)

Buggy submission (verdict: Runtime Error):
import math
import numpy as np
from operator import mul

# 整数Nを桁ごとのリストにする
# l = [int(x) for x in list(str(N))]

# リストliから重複を削除したリストli_uniqを作成
#li_uniq = []
#for i in li:
#    if x not in li_uniq:
#        li_uniq.append(x)

# 複数行のinput - list版
#list = [list(map(int, input().split())) for i in range(N)]
# 複数行のinput - dictionary版
# key = a, value = b
#for i in range(N):
#    a, b = map(int, input().split())
#    dict[a] = b


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

D = [list(map(int, input().split())) for i in range(N)]
B = [D[i][1] for i in range(N)] # bのリスト

a_max = 0 # 最大のa

for i in range(N):
    if D[i][0] >= a_max:
        a_max = D[i][0]

B_larger = [] # a_maxより大きいbのリスト

for i in range(N):
    if B[i] > a_max:
        B_larger.append(B[i])

B_larger.sort(reverse=True)

n = 0

while H > 0:
    H = H - B_larger[i]
    n += 1    

if H <= 0:
    print(n)
else
    n = math.ceil(H/a_max)
    print(n)
Problem p03473 (python)

Fixed submission:
a = int(input())
print(48-a)

Buggy submission (verdict: Runtime Error):
import math

def is_prime_sqrt(q): #合成数xはp<=sqrt(x)を満たす素因子pを持つ
    if q == 1: #1は素数ではない
        return False
    if q == 2: #2は素数
        return True
    elif q % 2 == 0: #2以外の偶数は合成数
        return False
    for divisor in range(3, math.floor(math.sqrt(q))+1, 2): #繰り返しの上限は平方根
        if q % divisor == 0: #平方根までに約数があれば合成数
            return False
    return True

Q = int(input())

for i in range(Q):
    l, r = map(int, input().split())
    n = 0
    for q in range(l,r+1,2):
        if is_prime_sqrt(q) and is_prime_sqrt((q+1)/2):
            n += 1
    print(n)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
try:
    first, second = s.split("-")
    if len(first) == a and len(second) == b:
        print("Yes")
    else:  
        print("No")
except:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
    print("Yes")
else:
    print("No")
Problem p03474 (python)

Fixed submission:
a, b = map(int, input().split())
s = input()
try:
    first, second = s.split("-")
    if len(first) == a and len(second) == b:
        print("Yes")
    else:  
        print("No")
except:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
first, second = s.split("-")
if len(first) == a and len(second) == b:
    print("Yes")
else:
    print("No")
Problem p03477 (python)

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

if A + B > C + D:
    print("Left")
elif A + B < C + D:
    print("Right")
else:
    print("Balanced")

Buggy submission (verdict: Runtime Error):
import math

X, Y = map(int, input().split())
k = math.floor(math.log(Y/X, 2) + 1)
print(k)
Problem p03486 (python)

Fixed submission:
import math

s = list(input())
t = list(input())
s.sort()
t.sort()
t.reverse()
if s < t:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math

s = list(input())
t = list(input())
s.sorted()
t.sorted()
if s < t:
    print('Yes')
else:
    print('No')
Problem p03493 (python)

Fixed submission:
s = input()
num = list(map(int, str(s)))
print(num.count(1))

Buggy submission (verdict: Runtime Error):
import math

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

#keyはA[i]、valueは登場回数
A_unique = {}
 
for i in range(0,len(A)):
    if A[i] in A_unique:
        A_unique[A[i]] += 1
    else:
        A_unique[A[i]] = 1
v = list(A_unique.values())
v.sort() #登場回数が少ない順に書き換えていく
A_length = len(A_unique.keys()) #元々のAの長さ
d = 0

for k in v:
    if  A_length - d < K:
        print(d)
        break
    else:
        d += A_unique[k]
Problem p03495 (python)

Fixed submission:
import math

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

#keyはA[i]、valueは登場回数
A_unique = {}
 
for i in range(0,len(A)):
    if A[i] in A_unique:
        A_unique[A[i]] += 1
    else:
        A_unique[A[i]] = 1
v = list(A_unique.values())
v.sort() #登場回数が少ない順に書き換えていく
A_length = len(A_unique.keys()) #元々のAに含まれる数字の種類
d = 0
n = 0

for k in v:
    if  A_length - n <= K:
        print(d)
        break
    else:
        d += k #d個を書き換え
        n += 1 #数字が1種類減る

Buggy submission (verdict: Runtime Error):
import math

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

#keyはA[i]、valueは登場回数
A_unique = {}
 
for i in range(0,len(A)):
    if A[i] in A_unique:
        A_unique[A[i]] += 1
    else:
        A_unique[A[i]] = 1
v = list(A_unique.values())
v.sort() #登場回数が少ない順に書き換えていく
A_length = len(A_unique.keys()) #元々のAの長さ
d = 0

for k in v:
    if  A_length - d < K:
        print(d)
        break
    else:
        d += A_unique[k]
Problem p03502 (python)

Fixed submission:
import math

N = int(input())
l = [int(x) for x in list(str(N))]

if N%sum(l) == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
l = [int(x) for x in list(str(N))]

if X%sum(l) == 0:
    print('Yes')
else:
    print('No')
Problem p03543 (python)

Fixed submission:
# input
N = [int(x) for x in list(input())]

if N[1] == N[2]:
    if N[0] == N[1] or N[2] == N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
# input
N = [int(x) for x in list(input()]

if N[1] == N[2]:
    if N[0] == N[1] or N[2] == N[3]:
        print('Yes')
    else:
        print('No')
else:
    print('No')