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

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().split()

S = sorted(S)
ls = [[] for i in range(N + 1)]
max_num = 0
left = 0
right = 0
while right < N:
    while right < N and S[left] == S[right]:
        right += 1
    if (right  - left) >= max_num:
        ls[right - left].append(S[left].decode())
        max_num = right - left
    left = right
    
print('\n'.join(ls[max_num]))

Buggy submission (verdict: Runtime Error):
n = input()
s = [input() for i in range(n)]
u = set(s)
dic = dict(zip(u, [0]*len(u)))
for i in range(n):
    dic[s[i]] += 1
m = max(dic.values())
res = []
for k, v in dic.items():
    if v == m:
        res.appned(k)
res.sort()
print(*res, sep="\n")

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().split()

S = sorted(S)
ls = [[] for i in range(N + 1)]
max_num = 0
left = 0
right = 0
while right < N:
    while right < N and S[left] == S[right]:
        right += 1
    if (right  - left) >= max_num:
        ls[right - left].append(S[left])
        max_num = right - left
    left = right
    
print('\n'.join(ls[max_num]))
Problem p02863 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, T = map(int, readline().split())

AB= list(map(int, read().split()))
A = AB[0::2]
B = AB[1::2]
ls = list(zip(A, B))
# 食べるのにかかる時間で昇順にソート
ls.sort()
# 上の並び順において、ls[i:]の美味しさの最大値をdeli[i]とする
deli = [0]*N
deli[- 1] = ls[-1][- 1]
for i in range(N - 2, - 1, - 1):
    deli[i] = max(deli[i - 1], ls[i][- 1])

res = 0
dp = [0]*T
for i in range(N - 1):
    for j in range(T - 1, - 1, - 1):
        if ls[i][0] <= j:
            dp[j] = max(dp[j], dp[j - ls[i][0]] + ls[i][1])
    res = max(res, dp[- 1] + deli[i + 1])
print(res)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, T = map(int, readline().split())

AB= list(map(int, read().split()))
A = AB[0::2]
B = AB[1::2]
ls = list(zip(A, B))
# 食べるのにかかる時間で昇順にソート
ls.sort()
# 上の並び順において、ls[i:]の美味しさの最大値をdeli[i]とする
# deli = [0]*N
# deli[- 1] = ls[-1][- 1]
deli = [ls[- 1][- 1]]
for i in range(N - 2, - 1, - 1):
    #deli[i] = max(deli[i - 1], ls[i][- 1])
    deli.append(max(deli[i - 1], ls[i][- 1]))
    
deli = deli[::- 1]

res = 0
dp = [0]*T
for i in range(N - 1):
    for j in range(T - 1, - 1, - 1):
        if ls[i][0] <= j:
            dp[j] = max(dp[j], dp[j - ls[i][0]] + ls[i][1])
    res = max(res, dp[- 1] + deli[i + 1])
print(res)
Problem p02884 (python)

Fixed submission:
N, M = map(int, input().split())
edge_out = [[] for i in range(N)] #edge_out[i]はiから出ている道
edge_in = [[] for i in range(N + 1)] # edge_in[i]はiに行く道
for i in range(M):
    s, t = map(int, input().split())
    edge_out[s].append(t)
    edge_in[t].append(s)

edge_sum = [len(edge_out[i]) for i in range(N)] # edge_sum[i] = iから出ている道の本数

dp = [0.0]*(N + 1) # dp[i]はiからNへの距離の期待値
dp[N - 1] = 1.0
# 道を塞がない場合
for i in range(N - 2, 0, - 1):
    dp[i] = 1 + sum(dp[j] for j in edge_out[i])/edge_sum[i]
    
p_to_i = [0]*(N + 1) # p_to_i[i]は1から各iへ到達する確率
p_to_i[1] = 1
for i in range(2, N + 1):
    p_to_i[i] = sum(p_to_i[j]/edge_sum[j] for j in edge_in[i])


t = 0

for i in range(1, N - 1):
    if edge_sum[i] == 1:
        continue
        # iから出ている道の先にある部屋のうち、その部屋からNまでの距離の期待値が最も大きいものへ通ずる道を塞ぐ
    t = max(t, p_to_i[i]*(dp[i] - 1- ((dp[i] - 1)*edge_sum[i] - max(dp[j] for j in edge_out[i]))/(edge_sum[i] - 1)))
    
print(dp[1] - t)

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N, M = map(int, input().split())

m = map(int,read().split())
ST = zip(m,m)
 
edge_out = [[] for i in range(N)] #edge_out[i]はiから出ている道
edge_in = [[] for i in range(N + 1)] # edge_in[i]はiに行く道
 
for s,t in ST:
    edge_out[s].append(t)
    edge_in[t].append(s)
    

edge_sum = [len(edge_out[i]) for i in range(N)] # edge_sum[i] = iから出ている道の本数

dp = [0.0]*(N + 1) # dp[i]はiからNへの距離の期待値
dp[N - 1] = 1.0
# 道を塞がない場合
for i in range(N - 2, 0, - 1):
    dp[i] = 1 + sum(dp[j] for j in edge_out[i])/edge_sum[i]
    
p_to_i = [0]*(N + 1) # p_to_i[i]は1から各iへ到達する確率
p_to_i[1] = 1
for i in range(2, N + 1):
    p_to_i[i] = sum(p_to_i[j]/edge_sum[j] for j in edge_in[i])


t = 0

for i in range(1, N - 1):
    if edge_sum[i] == 1:
        continue
        # iから出ている道の先にある部屋のうち、その部屋からNまでの距離の期待値が最も大きいものへ通ずる道を塞ぐ
    t = max(t, p_to_i[i]*(dp[i] - 1- ((dp[i] - 1)*edge_sum[i] - max(dp[j] for j in edge_out[i]))/(edge_sum[i] - 1)))
    
print(dp[1] - t)

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

m = map(int,read().split())
ST = zip(m,m)
 
edge_out = [[] for i in range(N)] #edge_out[i]はiから出ている道
edge_in = [[] for i in range(N + 1)] # edge_in[i]はiに行く道
 
for s,t in ST:
    edge_out[s].append(t)
    edge_in[t].append(s)
    

edge_sum = [len(edge_out[i]) for i in range(N)] # edge_sum[i] = iから出ている道の本数

dp = [0.0]*(N + 1) # dp[i]はiからNへの距離の期待値
dp[N - 1] = 1.0
# 道を塞がない場合
for i in range(N - 2, 0, - 1):
    dp[i] = 1 + sum(dp[j] for j in edge_out[i])/edge_sum[i]
    
p_to_i = [0]*(N + 1) # p_to_i[i]は1から各iへ到達する確率
p_to_i[1] = 1
for i in range(2, N + 1):
    p_to_i[i] = sum(p_to_i[j]/edge_sum[j] for j in edge_in[i])


t = 0

for i in range(1, N - 1):
    if edge_sum[i] == 1:
        continue
        # iから出ている道の先にある部屋のうち、その部屋からNまでの距離の期待値が最も大きいものへ通ずる道を塞ぐ
    t = max(t, p_to_i[i]*(dp[i] - 1- ((dp[i] - 1)*edge_sum[i] - max(dp[j] for j in edge_out[i]))/(edge_sum[i] - 1)))
    
print(dp[1] - t)
Problem p02570 (python)

Fixed submission:
def resolve():
    D, T, S = map(int, input().split())
    if D <= T * S:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    x = []
    for i in range(1, N):
        x.append(sum(A[i:]))

    ans = 0
    for i in range(N-1):
        ans += A[i] * x[i]
    ans = ans % (10**9 + 7)
    print(ans)

if __name__ == "__main__":
    resolve()
Problem p02629 (python)

Fixed submission:
def resolve():
    N = int(input())

    ans = ''
    while N > 0:
        N -= 1
        ans += chr(ord("a") + N % 26)
        N = N // 26
    print(ans[::-1])

if __name__ == "__main__":
    resolve()

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

    alp = [0] * 6
    for i in range(6):
        x = 26 ** (5-i)
        alp[i] = N // x
        N = N % x
    ans = ''
    for a in alp:
        if a > 0:
            ans += chr(64+a)
    print(ans.lower())

if __name__ == "__main__":
    resolve()
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())
if d<=t*s:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-1):
  ans+=(l[i]*(sum(l[i+1:len(l)+1]))%(10**9+7))
print(ans%(10**9+7))
Problem p02577 (python)

Fixed submission:
x=list(input())
a=0
for i in x:
  a+=int(i)
if a%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=int(input())
if n//9==0:
  print(Yes)
else:
  print(No)
Problem p02627 (python)

Fixed submission:
x=input()
if str.isupper(x)==True:
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
x=input()
if str.isupper(x)==True:
  print(A)
else:
  print(B)
Problem p03242 (python)

Fixed submission:
n=input()
print(1110-int(n))

Buggy submission (verdict: Runtime Error):
l=list(input())
print(l.translate(str.maketrans({"1":"9", "9":"1"})))
Problem p03327 (python)

Fixed submission:
a=int(input())
if a<=999:
  print("ABC")
else:
  print("ABD")

Buggy submission (verdict: Runtime Error):
a=int(input())
if a<=999:
  print("ABC")
else:
  print("ABD)
Problem p02570 (python)

Fixed submission:
d,t,s=map(int,input().split())
time=d/s
if(time<=t):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
l=[]
for i in range(3):
  l.append(int(input()))
d=l[0]
t=l[1]
s=l[2]

time=d/s
if(time<=t):
  print("Yes")
else:
  print("No")
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):
import numpy as np
N, K = map(int, input().split())
h = []

for _ in range(N):
    h.append(int(input()))

h_sorted = sorted(h, reverse=False)
diff_h_sorted = np.diff(h_sorted, n=1, axis=-1)

def min_sum(N, a):
    dp = [0]*(N+1)
    for i in range(N):
        dp[i+i] = min(dp[i], dp[i]+a[i])
    return dp[N]

print(min_sum(K-1,diff_h_sorted))
Problem p02570 (python)

Fixed submission:
D,T,S=(int(x) for x in input().split())
if D >S*T:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a = [input().split() for l in range(2)]
count = 0
N = int(a[0][0])
 
for i in range(N):
    for j in range(i):
        if i != j:
            count = (int(a[1][i])*int(a[1][j])) % 1000000007 + count
count = count % 1000000007
print(count)

Buggy submission (verdict: Runtime Error):
D,T,S=(int(x) for x in input().split())
if D >S*T:
  print('no')
elif:
  print('yes')
Problem p02570 (python)

Fixed submission:
def NextInts(): return map(int,input().split())

D,T,S = NextInts()

if (D/S>T)==True:
	print("No")
else :
	print("Yes")

Buggy submission (verdict: Runtime Error):
import itertools

def NextInts(): return map(int,input().split())

saisyo = input()
X = NextInts()
p = itertools.combinations(X, 2)
ANSWER = 0
for i in p:
	answer = int(i[0])*int(i[1])
	ANSWER+=answer
print(ANSWER%(10**9+7))
Problem p02711 (python)

Fixed submission:
a = input()

if a.count("7")>0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
s = str(N)
if s.count("7")>0:
	print(True)
else:
	print(False)
Problem p02847 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if s == "SUN":
    print 7
if s == "MON":
    print 6
if s == "TUE":
    print 5       
if s == "WED":
    print 4
if s == "THU":
    print 3        
if s == "FRI":
    print 2    
if s == "SAT":
    print 1
Problem p02831 (python)

Fixed submission:
def gcd (a,b): 
  return b if a == 0 else gcd (b%a , a) 
num = [int (x) for x in input().split(" ")]
print (int(num[0]*num[1]/gcd(num[0],num[1])))

Buggy submission (verdict: Runtime Error):
def gcd (a,b): 
  return b 
if a == 0 else gcd (b%a , a) 
  num = [int (x) for x in input().split(" ")] print (int(num[0]*num[1]/gcd(num[0],num[1])))
Problem p02693 (python)

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

for i in range(A,B+1):
    if i%K == 0:
        C += 1
        break


if C == 1:
    print("OK")
else:
    print("NG")

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

for i range (A, B+1):
  if i % K == 0:
    print("OK")
    break

print("NG")
Problem p02759 (python)

Fixed submission:
import math
N = int(input())

if N == 1:
    print(N)
elif N%2 == 0:
    print(math.floor(N/2))
else:
    print(math.floor(N/2)+ 1)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split())
a += list(map(int, input().split())
a += list(map(int, input().split())
A = []
N = int(input())
b = list(int(input()) for i in range(N))

for i in range(9):
    if a[i] in b[i]:
        A[i] = "maru"

if A[0] == A[1] == A[2] or A[3] == A[4] == A[5] or A[6] == A[7] == A[8] or A[2] == A[4] == A[6]:
    print("yes")
elif A[0] == A[3] == A[6] or A[1] == A[4] == A[7] or A[2] == A[5] == A[8]:
    print("yes")
else:
    print("no")
Problem p02771 (python)

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

if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and b!=a:
    print("Yes")
else:
    print("No")

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

for i in range(n):
    if A[i]%2 == 0 and A[i]%3 != 0:
        print('DENIED')
    elif A[i]%2 == 0 and A[i]%5 != 0:
        print('DENIED')
    else:
        print('APPROVED')

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

A = list(map(int, input().split()))
for i in range(n):
    if A[i]%2 == 0 and A[i]%3 == 0:
        print("APPROVED")
    elif A[i]%2 == 0 and A[i]%5 == 0:
        print("APPROVED")
    else:
        print("DENIED")

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

for A in range(n):
    A = list(map(int, input().split()))
        if A % 3 == 0 or A % 5 == 0:
            print("APPROVED")
        else:
            print("DENIED")

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

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

for A in range(n):
    if A%3==0 or A%5==0:
        print("APPROVED")
    else:
        print("DENIED")

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

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

for A in range(n):
    if A == A//3 or A == A//5:
        print("APPROVED")
    else:
        print("DENIED")

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

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

for A in range(n):
    if A == A/3 or A == A/5:
        print("APPROVED")
    else:
        print("DENIED")

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

if(a==b and a!=c) or (a==c and a!=b) or (c==b and a!=c)
    print("yes")
else:
    print("no")

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

if(a==b and a!=c) or (a==c and a!=b) or (c==b and a!=c)
    print("yes")
else:
    print("no")

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

if L[0] == L[1] == L[2]:
    print("no")
else:
    print("yes")

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

if L[0]==L[1]==L[2]:
    print("no")
else:
    print("yes")

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

if A==B==C:
    print("no")
else:
    print("yes")
Problem p02570 (python)

Fixed submission:
d, t, s = map(int, input().split())

if t * s >= d:
  print("Yes")
else:
  print("No")

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

ans = 0

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)
Problem p02571 (python)

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

count = len(t)

for i in range(len(s) - len(t) + 1):
    str_ = s[i:i + len(t)]
    temp = 0
    for i in range(len(str_)):
        #print(str_[i])
        if str_[i] != t[i]:
            temp += 1
    count = min(count, temp)    
        
print(count)

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

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

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

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

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

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    print(part)
    if part in s:
        ans = len(part)
        
print(len(t) - ans)

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

A = itertools.combinations(list(range(len(t)+1)),2)
for i in A:
    part = t[i[0]:i[1]]
    print(part)
    if part in s:
        ans = len(part)
        
print(len(t) - ans)
Problem p02595 (python)

Fixed submission:
n, d = map(int, input().split())

A = []

for i in range(n):
  A_i = list(map(int, input().split()))
  A.append(A_i)
  
ans = 0

for j in A:
  if (j[0] ** 2 + j[1] ** 2) <= d **2 :
    ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n, d = map(int, input().split())

A = []

for i in range(n):
  A_i = list(map(int, input().split()))
  A.append(A_i)
  
ans = 0

for j in A:
  if A[0] ** 2 + A[1] ** 2 <= d **2 :
    ans += 1

print(ans)
Problem p02659 (python)

Fixed submission:
from decimal import Decimal
import math
a, b = map(Decimal, input().split())

print(math.floor(a * b))

Buggy submission (verdict: Runtime Error):
from decimal import Decimal
a, b = map(Decimal, input().split())

print(math.floor(a * b))

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

print(int(a * b))
Problem p02682 (python)

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

if a > k:
  print(k)
else:
  num = a; 
  
  if k >= a + b:
      num -= k - (a + b);
  print(num)

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

if a > k:
  print(k)
  break;
else:
  num = a; 
  
  if k >= a + b:
  num -= k - (a + b);
  print(num)

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

if a > k:
  print(k)
  break;
else:
  num = a; 
  
  if k >= a + b:
  num -= k - (a + b);

print(num)
Problem p02707 (python)

Fixed submission:
import collections

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

ans = [0] * n;

c = collections.Counter(A)
key = list(c.keys());
value = list(c.values());

for i in range(len(key)):
    ans[key[i]-1] = value[i];
  
for a in ans:
  print(a);

Buggy submission (verdict: Runtime Error):
import collections

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

ans = [0] * n;

c = collections.Counter(A)
key = list(c.keys());
value = list(c.values());

for i in key:
  ans[i-1] = value[i-1];
  
for a in ans:
  print(a);
Problem p02712 (python)

Fixed submission:
N = int(input());
sum = 0;

for i in range(N):
  num = i + 1;
  if num % 3 != 0 and num % 5 !=0:
    sum += num;
  else:
    pass;

print(sum)

Buggy submission (verdict: Runtime Error):
N = input();
sum = 0;

for i in range(N):
  num = i + 1;
  if num % 3 != 0 and num % 5 !=0:
    sum += num;
  else:
    pass;

print(num)
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 = input();
 
if S[2]==S[3] & S[4]==S[5]:
  print("Yes");
else:
  print("No");

Buggy submission (verdict: Runtime Error):
S = input();
 
if S[3]==S[4] & S[5]==S[6]:
  print("Yes");
else:
  print("No");

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

if S[3]==S[4] & S[5]==S[6]:
  print("Yes");
else
  print("No");
Problem p02773 (python)

Fixed submission:
import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)

num = c.most_common()[0][1];
ans = [];

for a,b in c.most_common():
    if b == num:
      ans.append(a);
      continue;
    
    else:
      break;

ans = sorted(ans);

for i in ans:
  print(i);

Buggy submission (verdict: Runtime Error):
import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)
dic2 = sorted(dic.items())

num = c.most_common()[0][1];
ans = [];

for a,b in c.most_common():
    if b == num:
      ans.append(a);
      continue;
    
    else:
      break;

dic2 = sorted(ans);

for i in ans:
  print(i);

Buggy submission (verdict: Runtime Error):
import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)

num = c.most_common()[0][1];
ans = [];

for i in range(len(c)):
  if c.most_common()[i][1] == num:
    ans.append(c.most_common()[i][0]);
    continue;
    
  else:
    break;
    
for a in len(ans):
  print(ans[a]);

Buggy submission (verdict: Runtime Error):
import collections

n = int(input());
S = [];

for i in range(n):
  S.append(input());

c = collections.Counter(S)

num = c.most_common()[0][1];
ans = [];

for i in range(len(c)):
  if c.most_common()[i][1] == num:
    ans.append(c.most_common()[i][0]);
    continue;
    
  else:
    break;
    
for a in len(ans):
  print(ans[a]);
Problem p02785 (python)

Fixed submission:
n ,k = input().split();
n = int(n);
k = int(k);

H = list(map(int, input().split()));

#HPが多い敵を上からk体だけ減らす。
H.sort(reverse=True);
yowa = H[k:];

ans = sum(yowa);

print(ans);

Buggy submission (verdict: Runtime Error):
n ,k = input().split();
n = int(n);
k = int(k);

H = list(map(int, input().split()));

#HPが多い敵を上からk体だけ減らす。
yowa = H.sort(reverse=True)[k+1:];

ans = sum(yowa);

print(ans);
Problem p02819 (python)

Fixed submission:
x = int(input());

for i in range(x, 10**6):
  for k in range(2, i):
    if i % k != 0: #割り切れない
      continue;
    else: #割り切れた
      break;
  else:
    break;
  
print(i)

Buggy submission (verdict: Runtime Error):
x = int(input());

for i in range(x + 1, 10**5 + 1):
  for k in range(2, i):
    if i % k != 0: #割り切れない
      continue;
    else: #割り切れた
      break;
  else:
    break;
  
print(i)

Buggy submission (verdict: Runtime Error):
x = int(input());

for i in range(x + 1, 10**5 + 1):
  for k in range(1, i):
    if i % k != 0: #割り切れない
      continue;
    else: #割り切れた
      break;
  else:
    continue;
  break;
  
print(i)
Problem p02831 (python)

Fixed submission:
import fractions;
a, b = map(int, input().split());
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y);

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math;
a, b = map(int, input().split());
def lcm(x, y):
    return (x * y) // math.gcd(x, y);

print(lcm(a, b))
Problem p02847 (python)

Fixed submission:
S = input();
day = ["SUN","MON","TUE","WED","THU","FRI","SAT"];

print(7 - day.index(S))

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

for n in range(int(x / a), 10**9 + 1):
  if x >= a * n + b * len(str(n)):
    continue;
  else:
    break;
  
print(n - 1)

Buggy submission (verdict: Runtime Error):
S = input();
day = [SUN,MON,TUE,WED,THU,FRI,SAT];

print(day.index(S)]
Problem p02860 (python)

Fixed submission:
n = int(input());
s = input();

if n % 2 != 0:
  print("No")
else:
  t = s[:int(n/2)]
  if t * 2 == s:
    print("Yes")
  else:
    print("No");

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

if n % 2 !== 0:
  print("No")
else:
  t = s[int(n/2) - 1]
  if t * 2 == s:
    print("Yes")
  else:
    print("No");

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

if n % 2 !== 0:
  print("No")
else:
  t = s[n/2 - 1]
  if t * 2 == s:
    print("Yes")
  else:
    print("No");
Problem p02627 (python)

Fixed submission:
i= input()
print('A' if (ord(i)>64 and ord(i)<91) else 'a')

Buggy submission (verdict: Runtime Error):
def freq(my_list):
    count = {} 
    for i in my_list: 
        count[i] = count.get(i, 0) + 1
    return count

n = int(input())
l = list(map(int, input().split()))
s,f = sum(l), freq(l)
for _ in range(int(input())):
    x, y = map(int, input().split())
    if x in f:
        v = f[x]
        if y in f:
            f[y]+=v
            f.pop(x)
        else:
            f[y]=f.pop(x)
        s += (y-x)*v
    print(s)
Problem p02688 (python)

Fixed submission:
n, k = map(int, input().split())
s = set(range(1, n+1))
for _ in range(k):
    d = int(input())
    for i in input().split():
        s.discard(int(i))
print(len(s))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l, count = [], 0
for _ in range(k):
    input()
    l.append(list(map(int,input().split())))
for i in range(1,n):
    if i not in l[i-1]:
        count += 1
print(count)
Problem p02699 (python)

Fixed submission:
s, w = list(map(int, input().split()))
print('safe' if s > w else 'unsafe')

Buggy submission (verdict: Runtime Error):
print('unsafe') if input() <= input() else print('safe')

Buggy submission (verdict: Runtime Error):
print('unsafe') if input('w') >= input('s') else print('safe')