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

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

from fractions import gcd
l = [0]
r = [0]
for i in range(n-1):
  l += [gcd(l[i],num[i])]
  r += [gcd(r[i],num[-i-1])]
  
print(max(gcd(r[i],l[-i-1]) for i in range(n)))

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

left = [0]*(n-1)
right = [0]*(n-1)
from fractions import gcd
for i in range(1,n-1):
  left[i] = gcd(left[i-1],a[i-1])
  right[n-i-1] = gcd(right[n-i],a[n-i])

ans = 1
for i in range(n-1):
  g = gcd(left[i],right[i])
  ans = max(ans,g)
print(ans)
Problem p03076 (python)

Fixed submission:
time = [[int(input())] for _ in range(5)]

for i in range(5):
  if time[i][0]%10!=0:
    time[i].append(time[i][0]%10)
  else:
    time[i].append(10)

time = sorted(time, key = lambda time:time[1])
ans = 0
import math
for i in range(1,5):
  ans = ans + math.ceil(time[i][0]/10)*10
  
ans = ans + time[0][0]
print(ans)

Buggy submission (verdict: Runtime Error):
time = [int(input()) for _ in range(5)]

import math
ans = 0
minmod = 10
for i in range(n):
  if time[i]%10!=0:
    minmod = min(minmod,time[i]%10)
  else:
    minmod = min(minmod,10)
  ans += math.ceil(time[i]/10)*10

ans -= (10-minmod)
print(ans)
Problem p03086 (python)

Fixed submission:
s = list(input())
key = ['A','T','G','C']
count = 0
flag = False
ans = 0
for i in range(len(s)):
  if s[i] in key:
    count += 1
    flag = True
  if flag==True and (s[i] not in key):
    ans = max(ans,count)
    count = 0
    flag = False
ans = max(ans,count)
print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
key = ['A','T','G','C']

count = 0
ans = 0
for i in range(n):
  if s[i] in key: count += 1
  else: count = 0
  ans = max(ans,count)
print(ans)
Problem p03103 (python)

Fixed submission:
n,m = map(int,input().split())
drink = [list(map(int,input().split())) for _ in range(n)]
drink = sorted(drink, key=lambda drink:drink[0])
money = 0
total = 0
for i in range(n):
  if total+drink[i][1]<m:
    total += drink[i][1]
    money += drink[i][1]*drink[i][0]
  else:
    money += drink[i][0]*(m-total)
    print(money)
    exit()

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab, key=lambda ab:ab[0])

ans = 0
total = 0
for i in range(n):
  num = m-toal
  if ab[i][1]<=num:
    total += ab[i][1]
    ans += ab[i][0]*ab[i][1]
  else:
    total += num
    ans += num*ab[i][1]
    break
print(ans)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split()）
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab, key=lambda ab:ab[0])

ans = 0
total = 0
for i in range(n):
  num = m-toal
  if ab[i][1]<=num:
    total += ab[i][1]
    ans += ab[i][0]*ab[i][1]
  else:
    total += num
    ans += num*ab[i][1]
    break
print(ans)
Problem p03105 (python)

Fixed submission:
a,b,c = map(int,input().split())
if b//a>=c: print(c)
else: print(b//a)

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split)
print(min(b//a,c))
Problem p02573 (python)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]


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

uf = UnionFind(n+1)

for i in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

ans = 1
for i in range(1, n+1):
    ans = max(ans, uf.size(i))

print(ans)

Buggy submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]


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

uf = UnionFind(n+1)

for i in range(m):
    a, b = map(int, input().split())
    uf.union(a, b)

ans = 1
for i in range(1, n+1):
    ans = max(ans, uf.size(i))

print(ans)
Problem p02576 (python)

Fixed submission:
import math
n,x,t = map(int,input().split())

num = math.ceil(n/x)

print(num*t)

Buggy submission (verdict: Runtime Error):
########### E
H, W, M = map(int, input().split())
bombs = []
for _ in range(M):
    bomb = list(map(int, input().split()))
    bombs.append(bomb)

H_list = [0]*H
W_list = [0]*W
sign = True
for i in range(M):
    H_list[bombs[i][0]-1] += 1
    W_list[bombs[i][1]-1] += 1

max_H = [i for i,k in enumerate(H_list) if k == max(H_list)]
max_W = [i for i,k in enumerate(W_list) if k == max(W_list)]

cross = []

for i in max_H:
    for k in max_W:
        if [i+1,k+1] not in bombs:
            sign = False
            print(max(H_list) + max(W_list))
            break
    break

if sign:
    print(max(H_list) + max(W_list) -1)

Buggy submission (verdict: Runtime Error):
from collections import deque
H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())

meiro = []
for i in range(H):
    meiro.append(list(map(str, input())))

check_list = deque()   
num = 0

def check0(i,k):   
    global H, W
    global check_list
    global num
    
    if k > 0:
        if meiro[i][k-1] == '.' or meiro[i][k-1] == num+1:
            meiro[i][k-1] = num  
            check_list.appendleft([i,k-1])
    if k < W-1:
        if meiro[i][k+1] == '.' or meiro[i][k+1] == num+1:
            meiro[i][k+1] = num  
            check_list.appendleft([i,k+1])
    if i < H-1:
        if meiro[i+1][k] == '.' or meiro[i+1][k] == num+1:
            meiro[i+1][k] = num 
            check_list.appendleft([i+1,k])
    if i > 0:
        if meiro[i-1][k] == '.' or meiro[i-1][k] == num+1:
            meiro[i-1][k] = num  
            check_list.appendleft([i-1,k])
    
    return check_list

def check1(i,k):
    global H,W
    global check_list
    global num
    for w in range(-2,3):
        for h in range(-2,3):
            ind = max(0,k-h)
            col = max(0,i-w)
            ind = min(H-1,ind)
            col = min(W-1,col)
            if meiro[ind][col] == '.':
                meiro[ind][col] = num+1
                check_list.append([ind, col])
                

meiro[Ch-1][Cw-1] = num
check_list.append([Ch-1,Cw-1])
while check_list != deque([]):

    position = check_list.popleft()
    if meiro[position[0]][position[1]] != num:
        num +=1
    check0(position[0],position[1])
    check1(position[0],position[1])
    
    
if meiro[Dh-1][Dw-1] == '.':
    print(-1)
else:
    print(meiro[Dh-1][Dw-1])
Problem p02696 (python)

Fixed submission:
import math
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
print(calc(min(n,b-1)))

Buggy submission (verdict: Runtime Error):
import math 
a,b,n=map(int,input().split())
def calc(x):
    global a,b
    return math.floor(a*x/b)-a*math.floor(x/b)
bef=-100
count=0
for i in range(1,n+1):
    num=calc(i)
    if num==0:
        if bef!=0:
            if count==0:
                count+=1
            else:
                break
    kind.add(num)
    bef=num
print(bef)
Problem p02702 (python)

Fixed submission:
s=list(input())
s=s[::-1]
l=len(s)
mod=2019
count=[0]*2019
count[0]=1
num=0
seki=1
for i in range(l):
    num+=int(s[i])*seki
    num=num%mod
    count[num]+=1
    seki=(seki*10)%mod
ans=0
for i in range(2019):
    N=count[i]
    ans+=N*(N-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
s=s[::-1]
l=len(s)
mod=2019
count=[0]*2019
count[0]=1
num=0
seki=1
for i in range(l):
    num+=(int(s[i])*(seki))%mod
    count[num]+=1
    seki=(seki*10)%mod
ans=0
for i in range(2019):
    N=count[i]
    ans+=N*(N-1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
l=len(s)
ans=0
for i in range(l-3):
    sum_keta=int(s[i])
    num=s[i]
    index=i+1
    while sum_keta<=100:
        num+=s[i+j]
        if int(num)%2019==0:
            ans+=1
        index+=1
        sum_keta+=int(s[i+j])
        if l-1<index:
            break
print(ans)
Problem p02861 (python)

Fixed submission:
import math

n=int(input())
info=[]
for i in range(n):
    x,y=map(int,input().split())
    info.append([x,y])
total=0
for i in range(n-1):
    for j in range(i+1,n):
        total+=math.sqrt((info[i][0]-info[j][0])**2+(info[i][1]-info[j][1])**2)
print(total*2/n)

Buggy submission (verdict: Runtime Error):
import math

n=int(input())
info=[]
for i in range(n):
    x,y=map(int,input().split())
    info.append([x,y])
total=0
for i in range(n-1):
    for j in range(i+1,n):
        total+=math.sqrt((info[i][0]**2-info[j][0]**2)+(info[i][1]**2-info[j][1]**2))
print(total*2/n)
Problem p02995 (python)

Fixed submission:
import fractions
a,b,c,d=map(int,input().split())
cd=int(c*d/(fractions.gcd(c,d)))
#print(cd)
c1=b//c
c2=(a-1)//c
c3=c1-c2
d1=b//d
d2=(a-1)//d
d3=d1-d2
cd1=b//(cd)
cd2=(a-1)//(cd)
cd3=cd1-cd2
print((b-a+1)-(c3+d3-cd3))
#print(str(c3)+" "+str(d3)+" "+str(cd3))

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
cd=int(c*d/(math.gcd(c,d)))
#print(cd)
c1=b//c
c2=(a-1)//c
c3=c1-c2
d1=b//d
d2=(a-1)//d
d3=d1-d2
cd1=b//(cd)
cd2=(a-1)//(cd)
cd3=cd1-cd2
print((b-a+1)-(c3+d3-cd3))
#print(str(c3)+" "+str(d3)+" "+str(cd3))

Buggy submission (verdict: Runtime Error):
import math
a,b,c,d=map(int,input().split())
cd=int(c*d/(math.gcd(c,d)))
#print(cd)
c1=b//c
c2=(a-1)//c
c3=c1-c2
d1=b//d
d2=(a-1)//d
d3=d1-d2
cd1=b//(cd)
cd2=(a-1)//(cd)
cd3=cd1-cd2
print((b-a+1)-(c3+d3-cd3))
#print(str(c3)+" "+str(d3)+" "+str(cd3))
Problem p02996 (python)

Fixed submission:
n=int(input())
info=[]
time=0
ok=0
for i in range(n):
    a,b=map(int,input().split())
    info.append([a,b])
info2=sorted(info,key=lambda x:x[1])
for i in range(n):
    time+=info2[i][0]
    if time>info2[i][1]:
        ok=1
        break
print("Yes" if ok==0 else "No")

Buggy submission (verdict: Runtime Error):
30
384 8895
1725 9791
170 1024
4 11105
2 6
578 1815
702 3352
143 5141
1420 6980
24 1602
849 999
76 7586
85 5570
444 4991
719 11090
470 10708
1137 4547
455 9003
110 9901
15 8578
368 3692
104 1286
3 4
366 12143
7 6649
610 2374
152 7324
4 7042
292 11386
334 5720
Problem p03061 (python)

Fixed submission:
import fractions

ans=1
n=int(input())
a=list(map(int,input().split()))
l=[0]
r=[0]
for i in range(n-1):
    l.append(fractions.gcd(l[i],a[i]))
    r.append(fractions.gcd(r[i],a[-(i+1)]))
for i in range(n):
    c=fractions.gcd(l[i],r[-(i+1)])
    if ans<c:
        ans=c
print(ans)

Buggy submission (verdict: Runtime Error):
import math

ans=1
n=int(input())
a=list(map(int,input().split()))
l=[0]
r=[0]
for i in range(n-1):
    l.append(fractions.gcd(l[i],a[i]))
    r.append(fractions.gcd(r[i],a[-(i+1)]))
for i in range(n):
    c=fractions.gcd(l[i],r[-(i+1)])
    if ans<c:
        ans=c
print(ans)
Problem p03244 (python)

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
v.insert(0,0) #数合わせ
check=0 #全部同じ数字か？0なら全部同じ数字
now=v[1]
for i in range(2,n):
    if now!=v[i]:
        check=1
        break
        
odd=[]
even=[]
for i in range(1,n+1):
    if i%2==1:
        odd.append(v[i])
    else:
        even.append(v[i])
        
odd2=sorted(odd)
even2=sorted(even)
now_odd,now_even=odd2[0],even2[0]
rensa_odd,rensa_even=1,1
half=n//2
count_odd=[]
count_even=[]

for i in range(1,half):
    if odd2[i]==now_odd:
        rensa_odd+=1
    else:
        count_odd.append([rensa_odd,now_odd])
        now_odd=odd2[i]
        rensa_odd=1
count_odd.append([rensa_odd,now_odd])

for i in range(1,half):
    if even2[i]==now_even:
        rensa_even+=1
    else:
        count_even.append([rensa_even,now_even])
        now_even=even2[i]
        rensa_even=1
count_even.append([rensa_even,now_even])
count_odd2=sorted(count_odd,reverse=True)
count_even2=sorted(count_even,reverse=True)
#print(count_even2)

if check==0:
    print(half)
else:
    if count_odd2[0][1]!=count_even2[0][1]: #最頻値が違う
        print((half-count_odd2[0][0])+(half-count_even2[0][0]))
    else:
        if len(count_odd2)==1:
            print((half-count_odd2[0][0])+(half-count_even2[1][0]))
        elif len(count_even2)==1:
            print((half-count_odd2[1][0])+(half-count_even2[0][0]))
        else:
            print(min((half-count_odd2[0][0])+(half-count_even2[1][0]),(half-count_odd2[1][0])+(half-count_even2[0][0])))

Buggy submission (verdict: Runtime Error):
n=int(input())
v=list(map(int,input().split()))
v.insert(0,0) #数合わせ
check=0 #全部同じ数字か？0なら全部同じ数字
now=v[1]
for i in range(2,n):
    if now!=v[i]:
        check=1
        break
        
odd=[]
even=[]
for i in range(1,n+1):
    if i%2==1:
        odd.append(v[i])
    else:
        even.append(v[i])
        
odd2=sorted(odd)
even2=sorted(even)
now_odd,now_even=odd2[0],even2[0]
rensa_odd,rensa_even=1,1
half=n//2
count_odd=[]
count_even=[]

for i in range(1,half):
    if odd2[i]==now_odd:
        rensa_odd+=1
    else:
        count_odd.append([rensa_odd,now_odd])
        now_odd=odd2[i]
        rensa_odd=1
count_odd.append([rensa_odd,now_odd])

for i in range(1,half):
    if even2[i]==now_even:
        rensa_even+=1
    else:
        count_even.append([rensa_even,now_even])
        now_even=even2[i]
        rensa_even=1
count_even.append([rensa_even,now_even])
count_odd2=sorted(count_odd,reverse=True)
count_even2=sorted(count_odd,reverse=True)

if check==0:
    print(half)
else:
    if count_odd2[0][1]!=count_even2[0][1]: #最頻値が違う
        print((half-count_odd2[0][0])+(half-count_even2[0][0]))
    else:
        if len(count_odd2)==1:
            print((half-count_odd2[0][0])+(half-count_even2[1][0]))
        elif len(count_even2)==1:
            print((half-count_odd2[1][0])+(half-count_even2[0][0]))
        else:
            print(min((half-count_odd2[0][0])+(half-count_even2[1][0]),(half-count_odd2[1][0])+(half-count_even2[0][0])))
Problem p03261 (python)

Fixed submission:
n=int(input())
a=input()
b=a[len(a)-1]
word1=[a]
word2=[b]
c=0

for i in range(n-1):
    aa=input()
    bb=aa[0]
    if aa not in word1 and word2[i]==bb:
        word1.append(aa)
        top=aa[len(aa)-1]
        word2.append(top)
    else:
        c=1
        break
        
print("Yes" if c==0 else "No")

Buggy submission (verdict: Runtime Error):
n=int(input())
a=input()
b=a[len(a)-1]
word1=[a]
word2=[b]
c=0

for i in range(n-1):
    aa=input()
    bb=aa[0]
    if aa not in word1 and word2[i]==bb:
        word1.append(aa)
        top=aa[len(aa)-1]
        word2.append(top)
    else:
        c=1
        
print("Yes" if c==0 else "No")
Problem p03262 (python)

Fixed submission:
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
ans=abs(x[0]-X)
for i in range(1,n):
    b=abs(x[i]-X)
    ans=fractions.gcd(ans,b)
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
a=abs(x[0]-X)
for i in range(1,n):
    b=abs(x[i]-X)
    ans=fractions.gcd(a,b)
    a=ans
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x2=sorted(x)
a=x2[1]-x2[0]
if len(x2)<=2:
    print(a)
else:
    for i in range(1,n-1):
        b=x2[i+1]-x2[i]
        ans=fractions.gcd(a,b)
        a=ans
    print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x2=sorted(x)
a=x2[1]-x2[0]
if len(x2)==2:
    print(a)
else:
    for i in range(1,n-1):
        b=x2[i+1]-x2[i]
        ans=fractions.gcd(a,b)
        a=ans
    print(ans)

Buggy submission (verdict: Runtime Error):
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x2=sorted(x)
a=x2[1]-x2[0]
if len(x2)==2:
    print(a)
else:
    for i in range(1,n-1):
        b=x2[i+1]-x2[i]
        ans=fractions.gcd(a,b)
        a=b
    print(ans)
Problem p03290 (python)

Fixed submission:
D,G=map(int,input().split()) 
box=[] 
for i in range(D): 
    box.append(list(map(int,input().split()))) 
box.insert(0,[0,0]) #数を１番目に合わせるため 
info=[[0,0] for i in range(2**D)] #各全完の組での点数、解いた問題数の記憶
info2=[[0]*(D+1) for i in range(2**D)] #i番目を何問解いているか？

for i in range(2**D): #全完したものをinfoに追加
    for j in range(1,D+1): #100j点の問題は全完するか 
        if (i>>(j-1))&1: 
            info[i][0]+=box[j][1]+j*100*box[j][0] 
            info[i][1]+=box[j][0] 
            info2[i][j]=box[j][0] #ｊ番目を全問解いている。

for i in range(2**D):
    score=G-info[i][0]
    if score<=0:
        continue
    else:
        n=D
        while score>0:
            num=box[n][0]-info2[i][n] #残りの問題数
            #print(num)
            #print(str(i)+":"+str(score))
            if num!=0:
                for j in range(1,num+1):
                    score -= 100*n
                    info[i][1]+=1 #解いた数を増やす
                    if j==num: #ボーナス点追加
                        score-=box[n][1]
                    if  score<=0:
                        break
            n-=1
            
l=len(info)
for i in range(l-1):
    min=info[i][1]
    m=info[i]
    t=i
    for j in range(i+1,l):
        if min>info[j][1]:
            min=info[j][1]
            t=j
    info[i]=info[t]
    info[t]=m
print(info[0][1])

Buggy submission (verdict: Runtime Error):
# ABC104-C

D,G=map(int,input().split()) 
box=[] 
for i in range(D): 
    box.append(list(map(int,input().split()))) 
box.insert(0,[0,0]) #数を１番目に合わせるため 
info=[[0,0] for i in range(2**D)] #各全完の組での点数、解いた問題数の記憶

for i in range(2*D): #全完したものをinfoに追加
    for j in range(1,D+1): #100j点の問題は全完するか 
        if (i>>(j-1))&1: 
            info[i][0]+=box[j][1]+j*100*box[j][0] 
            info[i][1]+=box[j][0] 
            info2[i][j]=box[j][0] #ｊ番目を全問解いている。

for i in range(2**D):
    score=G-info[i][0]
    if score<=0:
        continue
    else:
        n=D
        while score>0:
            #print(str(i)+":"+str(score))
            if (i>>(n-1))&1:
                continue
            else:
                for j in range(1,box[n][0]+1):
                    score -= 100*n
                    info[i][1]+=1 #解いた数を増やす
                    if j==box[n][0]: #ボーナス点追加
                        score-=box[n][1]
                    if  score<=0:
                        break
            n-=1
            
l=len(info)
for i in range(l-1):
    min=info[i][1]
    m=info[i]
    t=i
    for j in range(i+1,l):
        if min>info[j][1]:
            min=info[j][1]
            t=j
    info[i]=info[t]
    info[t]=m
print(info[0][1])
Problem p03325 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
for i in range(n):
    if a[i]%2==0:
        num=a[i]
        while num%2==0:
            num /=2
            count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
num=1
count=0
for i in range(n):
    if a[i]%2==0:
        num=num*a[i]
while num%2==0:
    num=num/2
    count+=1
print(count)
Problem p03385 (python)

Fixed submission:
s=list(input())
if s[0]==s[1] or s[0]==s[2] or s[1]==s[2]:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
s=list(input())
if s[0]==s[1] or s[0]==s[2] or s[1]==s[2]:
    print(″No″)
else:
    print(″Yes″)

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1] or s[0]==s[2] or s[1]==s[2]:
    print(″No″)
else:
    print(″Yes″)
Problem p03651 (python)

Fixed submission:
import fractions
N,K=map(int,input().split())
a=list(map(int,input().split()))
bef=a[0]
gcd=a[0]
max_=a[0]
for i in range(1,N):
    if max_<a[i]:
        max_=a[i]
    gcd=fractions.gcd(gcd,a[i])
if max_<K:
    print("IMPOSSIBLE")
else:
    if K%gcd==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
import math
N,K=map(int,input().split())
a=list(map(int,input().split()))
bef=a[0]
gcd=a[0]
max_=a[0]
for i in range(1,N):
    if max_<a[i]:
        max_=a[i]
    gcd=math.gcd(gcd,a[i])
if max_<K:
    print("IMPOSSIBLE")
else:
    if K%gcd==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
Problem p02628 (python)

Fixed submission:
N,K=map(int,input().split())
n=list(map(int, input().split()))
m=sorted(n)
print(sum(m[0:K]))

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
n=list(map(int, input().split()))
m=n.sort()
print(sum(m[0:K]))
Problem p02639 (python)

Fixed submission:
A = list(map(int, input().split()))
count = 0
for a in A:
  count += 1
  if a == 0:
    print(count)
    exit()

Buggy submission (verdict: Runtime Error):
A = list[map(int, input().split())]
count = 0
for a in A:
  count += 1
  if a == 0:
    print(count)
    exit()
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
for a in range(X+1):
  if 2*a + 4*(X-a) == Y:
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
for a in range(1, X):
  if 2*a + 4*(x-a) == Y:
    print("Yes")
    exit()
print("No")

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split)
for a in range(1, X+1):
  if 2*a + 4*(x-a) == Y:
    print("Yes")
    exit()
print("No")
Problem p02641 (python)

Fixed submission:
X, N = map(int, input().split())
A = list(map(int, input().split()))
a = 0
while True:
  if X-a not in A:
      print(X-a)
      break
  if X+a not in A:
      print(X+a)
      break
  a += 1

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
A = [map(int, input().split())]
a = 0
while True:
  if X-a in A:
    if X+a in A:
    a += 1
    else:
      print(X+a)
      break
  else:
    print(X-a)
    break

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
A = [map(int, input().split())]
a = 0
while True:
  if X-a in A:
    if X+a in A:
    a +=1
    else:
      print(X+a)
      exit()
  else:
    print(X-a)
    exit()

Buggy submission (verdict: Runtime Error):
X, N = map(int, input().split())
A = [int(input()) for i in range(N)]
a = 0
while True:
  if X-a in A:
    if X+a in A:
    a +=1
    else:
      print(X+a)
      exit()
  else:
    print(X-a)
    exit()
Problem p02677 (python)

Fixed submission:
import math
A,B,H,M=map(int, input().split())
a=math.pi
b=math.cos(a*((60*H-11*M)/360))
Z=A**2+B**2-2*A*B*b
print(Z**(1/2))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M=map(int, input().split())
a=math.pi
b=math.cos(a*((60*H-11M)/360))
Z=A**2+B**2-2*A*B*b
print(Z**(1/2))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M=map(int, input().split())
a=math.pi
b=math.cos(a*((48H+M)/360))
Z=A**2+B**2-2ABb
print(Z**(1/2))

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M=map(int, input.split())
a=math.pi
b=math.cos(a*((48H+M)/360))
Z=A**2+B**2-2ABb
print(Z**(1/2))
Problem p02730 (python)

Fixed submission:
S=input()
T=S[:(len(S)-1)//2]
U=S[(len(S)+3)//2-1:]
if S==S[::-1]:
    if T==T[::-1]:
        if U==U[::-1]:
            print('Yes')
        else:print('No')
    else:print('No')
else:print('No')

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
print(N*(N-1)//2+M*(M-1)//2)

S=input()
T=S[:(len(S)-1)//2-1]
U=S[(len(S)+3)//2-1:]
if S==S[::-1]:
    if T==T[::-1]:
        if U==U[::-1]:
            print('Yes')
        else:print('No')
    else:print('No')
else:print('No')
Problem p02778 (python)

Fixed submission:
S=len(input())
print('x'*S)

Buggy submission (verdict: Runtime Error):
S=len(input())
print(x*S)
Problem p02812 (python)

Fixed submission:
N=int(input())
S=input()
print(sum(S[i]=='A' and S[i+1]=='B' and S[i+2]=='C' for i in range(N-2)))

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
print(sum(S[i]==A and S[i+1]==B and S[i+2]==C for i in range(N-2)))
Problem p02817 (python)

Fixed submission:
a,b=input().split()
print(b,a, sep='')

Buggy submission (verdict: Runtime Error):
a,b=input().split()
print(b,a sep='')