Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
M_chr = []
for i in range(1,M+1):
    M_chr.append(str(i))
As = list(itertools.combinations_with_replacement(M_chr, N))
pointA_max = 0
for i, A in enumerate(As):
    pointA = 0
    for i in range(Q):
        a = abcd[i][0]
        b = abcd[i][1]
        c = abcd[i][2]
        d = abcd[i][3]
        if int(A[b-1])-int(A[a-1]) == c:
            pointA = pointA + d
    if pointA_max < pointA:
        pointA_max = pointA
print(pointA_max)


Fixed submission:
import itertools
N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
M_chr = []
for i in range(1,M+1):
    M_chr.append(str(i))
As = list(itertools.combinations_with_replacement(M_chr, N))
pointA_max = 0
for i, A in enumerate(As):
    pointA = 0
    for i in range(Q):
        a = abcd[i][0]
        b = abcd[i][1]
        c = abcd[i][2]
        d = abcd[i][3]
        if int(A[b-1])-int(A[a-1]) == c:
            pointA = pointA + d
    if pointA_max < pointA:
        pointA_max = pointA
print(pointA_max)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
M_chr = []
for i in range(1,M+1):
    M_chr.append(str(i))
As = list(itertools.combinations_with_replacement(M_chr, N))
pointA_max = 0
for i, A in enumerate(As):
    pointA = 0
    for i in range(Q):
        a = abcd[i][0]
        b = abcd[i][1]
        c = abcd[i][2]
        d = abcd[i][3]
        if int(A[b-1])-int(A[a-1]) == c:
            pointA = pointA + d
    if pointA_max < pointA:
        pointA_max = pointA
print(pointA_max)

Fixed submission:
import itertools
N, M, Q = map(int, input().split())
abcd = [list(map(int, input().split())) for _ in range(Q)]
M_chr = []
for i in range(1,M+1):
    M_chr.append(str(i))
As = list(itertools.combinations_with_replacement(M_chr, N))
pointA_max = 0
for i, A in enumerate(As):
    pointA = 0
    for i in range(Q):
        a = abcd[i][0]
        b = abcd[i][1]
        c = abcd[i][2]
        d = abcd[i][3]
        if int(A[b-1])-int(A[a-1]) == c:
            pointA = pointA + d
    if pointA_max < pointA:
        pointA_max = pointA
print(pointA_max)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,-1,-1):
    cnt[total] += 1
    total += int(s[i])*x
    total %= mod
    ans += cnt[total]
    x *= 10%2019
print(ans)

Fixed submission:
s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,-1,-1):
    cnt[total] += 1
    total = total + int(s[i])*x
    total %= mod
    ans += cnt[total]
    x = x*10%2019
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,-1,-1):
    cnt[total] += 1
    total = int(s[i::])%mod
    ans += cnt[total]
print(ans)

Fixed submission:
s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,-1,-1):
    cnt[total] += 1
    total = total + int(s[i])*x
    total %= mod
    ans += cnt[total]
    x = x*10%2019
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt = 0
num_list = []
list4 = []
for i in range(1,10001):
    num_list.append(i*2019)
    list4.append(int(str(i*2019)[-4::]))
for j in range(0,len(s)-4+1):
    if int(s[0+j:4+j]) in list4:
        
        if s[4+j-len(str(num_list[list4.index(int(s[0+j:4+j]))])):4+j] == str(num_list[list4.index(int(s[0+j:4+j]))]):
            cnt += 1
            
print(cnt)

Fixed submission:
s = input()
from collections import Counter
x = 1
mod = 2019
total = 0
ans = 0
cnt = Counter()
for i in range(len(s)-1,-1,-1):
    cnt[total] += 1
    total = total + int(s[i])*x
    total %= mod
    ans += cnt[total]
    x = x*10%2019
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
s = input()
r_cnt = 0
g_cnt = 0
b_cnt = 0
for i in s:
    if i == 'R':
        r_cnt += 1
    elif i == 'G':
        g_cnt += 1
    elif i == 'B':
        b_cnt += 1
        
total = r_cnt*g_cnt*b_cnt

if n < 4:
    print(0)

else:
    for i in range(1,math.floor(len(s)-3/2)):
        for j in range(n-2*i):
            tmp = s[j]+s[j+i]+s[j+2*i]
            if (tmp == 'RGB') or (tmp == 'RBG') or (tmp == 'GBR') or (tmp == 'GRB') or (tmp == 'BRG') or (tmp == 'BGR'):
                total -= 1

    print(total)


Fixed submission:
import math
n = int(input())
s = input()
r_cnt = 0
g_cnt = 0
b_cnt = 0
for i in s:
    if i == 'R':
        r_cnt += 1
    elif i == 'G':
        g_cnt += 1
    elif i == 'B':
        b_cnt += 1
        
total = r_cnt*g_cnt*b_cnt

if n < 4:
    print(0)

else:
    for i in range(1,math.floor((len(s)-2)/2)+10):
        for j in range(n-2*i):
            tmp = s[j]+s[j+i]+s[j+2*i]
            if (tmp == 'RGB') or (tmp == 'RBG') or (tmp == 'GBR') or (tmp == 'GRB') or (tmp == 'BRG') or (tmp == 'BGR'):
                total -= 1

    print(total)

Buggy python submission (verdict: Time Limit Exceeded):
import math
n = int(input())
s = input()
r_cnt = 0
g_cnt = 0
b_cnt = 0
for i in s:
    if i == 'R':
        r_cnt += 1
    elif i == 'G':
        g_cnt += 1
    elif i == 'B':
        b_cnt += 1
        
total = r_cnt*g_cnt*b_cnt

if n < 4:
    print(0)

else:
    for i in range(1,math.floor(len(s)-3/2)):
        for j in range(n-2*i):
            tmp = s[j]+s[j+i]+s[j+2*i]
            if (tmp == 'RGB') or (tmp == 'RBG') or (tmp == 'GBR') or (tmp == 'GRB') or (tmp == 'BRG') or (tmp == 'BGR'):
                total -= 1

    print(total)


Fixed submission:
import math
n = int(input())
s = input()
r_cnt = 0
g_cnt = 0
b_cnt = 0
for i in s:
    if i == 'R':
        r_cnt += 1
    elif i == 'G':
        g_cnt += 1
    elif i == 'B':
        b_cnt += 1
        
total = r_cnt*g_cnt*b_cnt

if n < 4:
    print(0)

else:
    for i in range(1,math.floor((len(s)-2)/2)+10):
        for j in range(n-2*i):
            tmp = s[j]+s[j+i]+s[j+2*i]
            if (tmp == 'RGB') or (tmp == 'RBG') or (tmp == 'GBR') or (tmp == 'GRB') or (tmp == 'BRG') or (tmp == 'BGR'):
                total -= 1

    print(total)
Buggy python submission (verdict: Time Limit Exceeded):
def rev_f(string , i):
    if i[2] == '2':
        string = string + i[4]

    if i[2] == '1':
        string = i[4] + string
    return string



def rev_s(string , i):
    if i[2] == '1':
        string = string + i[4]

    if i[2] == '2':
        string = i[4] + string
    return string




string = input()
num = int(input())
q_list = []
reverse_num = 0
reverse = True
reverese_s = False
for a in range(num):
    i = input()
    if i == '1':
        reverse_num  +=1 
        if reverese_s:
            reverese_s = False
        else:
            reverese_s = True
    else:
        if reverese_s == False:
            string = rev_f(string,i)

        if reverese_s ==True:
            string = rev_s(string,i)
        
if reverse_num %2 == 0:
    reverse = False
    
if reverse == True:
    string = string[::-1]
print(string)


Fixed submission:
def rev_f(string , i):
    if i[2] == '2':
        string = string + i[4]

    if i[2] == '1':
        string = i[4] + string
    return string



def rev_s(string , i):
    if i[2] == '1':
        string = string + i[4]

    if i[2] == '2':
        string = i[4] + string
    return string



front = ''
back = ''
string = input()
num = int(input())
q_list = []
reverse_num = 0
reverse = True
reverese_s = False
for a in range(num):
    i = input()
    if i == '1':
        reverse_num  +=1 
        if reverese_s:
            reverese_s = False
        else:
            reverese_s = True
    else:
        if reverese_s == False:
            if i[2] == '2':
                back += i[4]
            else:
                front = i[4] + front
            
        else :
            if i[2] == '2':
                front = i[4] + front
            else:
                back += i[4]
        
if reverse_num %2 == 0:
    reverse = False
    
string = front + string + back
if reverse == True:
    string = string[::-1]
    
print(string)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M,K = map(int,input().split())
answer_list = [0]*N
frend_list = [[0] * N for i in range(N)]
flag_list = [0]*N
for i in range(M):
    num_list= list(map(int,input().split()))
    frend_list[num_list[0]-1][num_list[1]-1] = 1
    frend_list[num_list[1]-1][num_list[0]-1] = 1

for i in range(K):
    num_list= list(map(int,input().split()))
    frend_list[num_list[0]-1][num_list[1]-1] = 3
    frend_list[num_list[1]-1][num_list[0]-1] = 3
    
    
for i in range(len(answer_list)):
    for n in range(len(frend_list[i])):
        if (frend_list[i][n] == 0) & (i != n):
            flag_list = (np.array(frend_list[n])+np.array(frend_list[i]))
            flag_list = flag_list.tolist()
            for g in flag_list:
                if g == 2:
                    answer_list[i] += 1
print(answer_list)

Fixed submission:
N,M = map(int,input().split())
flag = True
answer = [0]*N
if len(answer) != 1:
    answer[0] = 1
change_list = [0]*N
answer_num = 0
for i in range(M):
    num_list = list(map(int,input().split()))
    if change_list[num_list[0]-1] == 0:
        answer[num_list[0]-1] = num_list[1]
        change_list[num_list[0]-1] = 1
    else:
        if answer[num_list[0]-1] == num_list[1]:
            continue
        else:
            flag = False

if flag == False:
    print(-1)

elif (answer[0] == 0)&(len(answer) != 1):
    print(-1)
else:
    for i in range(len(answer)):
        answer_num += 10**(len(answer) - (i+1))*answer[i]
    print(answer_num)
Buggy python submission (verdict: Runtime Error):
N = int(input())
R = int(input())
if N < 10:
    print(R + 100*(10 - N))
else:
    print(R)

Fixed submission:
N,R = map(int,input().split())
if N < 10:
    print(R + 100*(10 - N))
else:
    print(R)
Buggy python submission (verdict: Runtime Error):
loss = 0
ans = 0
minimum = min(zahyou)
maximum = max(zahyou)
for i in range(minimum, maximum+1):
    loss = 0
    for j in zahyou:
        loss += (j-i)**2
        
    if i == minimum:
        ans = loss
    if loss < ans:
        ans = loss
print(ans)

Fixed submission:
n = int(input())
zahyou = list(map(int,input().split()))
loss = 0
ans = 0
minimum = min(zahyou)
maximum = max(zahyou)
for i in range(minimum, maximum+1):
    loss = 0
    for j in zahyou:
        loss += (j-i)**2
        
    if i == minimum:
        ans = loss
    if loss < ans:
        ans = loss
print(ans)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = 0
for i in range(n-k):
    if i == 0:
        for j in range(k):
            candidate += (num_list[j]+1)/2
        tmp = candidate
    else:
        tmp += -(num_list[i-1]+1)/2 + (num_list[i+k]+1)/2
        if tmp > candidate:
            candidate = tmp
        
print(candidate)

Fixed submission:
s,t = input().split()
num_s,num_t =map(int,input().split())
u = input()
if u == s:
    num_s -= 1
else:
    num_t -= 1
print('{0} {1}'.format(num_s , num_t))
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = []
tmp = [0]
num = 0
for i in range(n):
    i += num
    
    if sum(tmp) < sum(num_list[i:i+k]):
        tmp = num_list[i:i+k]
    else:
        candidate.append(tmp)
        num += 2
        
    if i == n-k:
        candidate.append(tmp)
        break
        
ans = 0
for i in candidate:
    tmp = 0
    for j in i:
        tmp += (j+1)/2
    if tmp > ans:
        ans = tmp
print(ans)

Fixed submission:
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = 0
for i in range(n-k+1):
    if i == 0:
        for j in range(k):
            candidate += (num_list[j]+1)/2
        tmp = candidate
    else:
        tmp += -(num_list[i-1]+1)/2 + (num_list[i+k-1]+1)/2
        if tmp > candidate:
            candidate = tmp
        
print(candidate)

Buggy python submission (verdict: Runtime Error):
def kaidan(n):
    if n >= 1:
        return n+kaidan(n- 1)
    else:
        return 0
    
    
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = []
tmp = [0]
num = 0
for i in range(n):
    i += num
    
    if sum(tmp) < sum(num_list[i:i+k]):
        tmp = num_list[i:i+k]
    else:
        candidate.append(tmp)
        num += 2
        
    if i == n-k:
        candidate.append(tmp)
        break
        
ans = 0
for i in candidate:
    tmp = 0
    for j in i:
        tmp += kaidan(j)/j
    if tmp > ans:
        ans = tmp
        
print(ans)

Fixed submission:
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = 0
for i in range(n-k+1):
    if i == 0:
        for j in range(k):
            candidate += (num_list[j]+1)/2
        tmp = candidate
    else:
        tmp += -(num_list[i-1]+1)/2 + (num_list[i+k-1]+1)/2
        if tmp > candidate:
            candidate = tmp
        
print(candidate)

Buggy python submission (verdict: Runtime Error):
def kaidan(n):
    if n >= 1:
        return n+kaidan(n- 1)
    else:
        return 0
    
    
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = []
tmp = [0]
num = 0
for i in range(n):
    i += num
    
    if sum(tmp) < sum(num_list[i:i+k]):
        tmp = num_list[i:i+k]
    else:
        candidate.append(tmp)
        num += 2
        
    if i == n-k:
        candidate.append(tmp)
        break
        
ans = 0
for i in candidate:
    tmp = 0
    for j in i:
        tmp += kaidan(j)/j
    if tmp > ans:
        ans = tmp

Fixed submission:
n,k = map(int,input().split())
num_list = list(map(int , input().split()))
candidate = 0
for i in range(n-k+1):
    if i == 0:
        for j in range(k):
            candidate += (num_list[j]+1)/2
        tmp = candidate
    else:
        tmp += -(num_list[i-1]+1)/2 + (num_list[i+k-1]+1)/2
        if tmp > candidate:
            candidate = tmp
        
print(candidate)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n,k = map(int,input().split())
num_list = list(map(int,input().split()))
ans = 0
num_list = np.sort(num_list)[::-1]
num_list = np.array(num_list)

if k > len(num_list):
    ans = 0
    
else:
    for i in range(k):
        num_list = np.delete(num_list,0)
    ans = sum(num_list)
print(ans)

Fixed submission:
import numpy as np
n,k = map(int,input().split())
num_list = list(map(int,input().split()))
ans = 0
num_list = np.sort(num_list)[::-1]
num_list = np.array(num_list)

if k > len(num_list):
    ans = 0
    
else:
    for i in range(n-k):
        ans += num_list[i+k]
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n,k = map(int,input().split())
num_list = list(map(int,input().split()))

num_list = np.sort(num_list)[::-1]
num_list = np.array(num_list)
for i in range(k):
    num_list = np.delete(num_list,0)
    
print(sum(num_list))

Fixed submission:
import numpy as np
n,k = map(int,input().split())
num_list = list(map(int,input().split()))
ans = 0
num_list = np.sort(num_list)[::-1]
num_list = np.array(num_list)

if k > len(num_list):
    ans = 0
    
else:
    for i in range(n-k):
        ans += num_list[i+k]
print(ans)
Buggy python submission (verdict: Runtime Error):
n =int(input())
ans = 1
for i in range(int(np.log2(n))):
    ans += 2**(i+1)
    
print(ans)

Fixed submission:
import numpy as np
n =int(input())
ans = 1
for i in range(int(np.log2(n))):
    ans += 2**(i+1)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ac_list = [0]*n
wa_list = [0]*n
pena = 0
for i in range(m):
    p,s = input().split()
    if s == 'AC':
        if ac_list[int(p)-1] == 0:
            ac_list[int(p)-1] =1
            pena += wa_list[int(p)-1]
        
    if s == 'WA':
        if ac_list[int(p)-1] == 0:
            wa_list[int(p)-1] += 1
            
print('{0} {1}'.format(sum(ac_list) , pena)

Fixed submission:
n,m = map(int,input().split())
ac_list = [0]*n
wa_list = [0]*n
pena = 0
for i in range(m):
    p,s = input().split()
    if s == 'AC':
        if ac_list[int(p)-1] == 0:
            ac_list[int(p)-1] =1
            pena += wa_list[int(p)-1]
        
    if s == 'WA':
        if ac_list[int(p)-1] == 0:
            wa_list[int(p)-1] += 1
            
print('{0} {1}'.format(sum(ac_list) , pena))
Buggy python 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))

Fixed submission:
a = int(input())
b = int(input())
num = [1,2,3]
num.remove(a)
num.remove(b)
print(num[0])
Buggy python 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(123,456))

Fixed submission:
a,b = map(int,input().split())
def fcd(a , b):
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
def fcd(a , b):
    if a>= b:
        while b != 0:
            a,b = b,a%b
        return a
    
    else:
        while a != 0:
            b,a = a,b%a
        return b
    
    
def lcm(a,b):
    return a*b//fcd(a , b)


print(lcm(a,b))


Fixed submission:
n = int(input())
num_list = list(map(int,input().split()))
cnt = 0
num = 1
for i in num_list:
    if i != num:
        cnt += 1
    else:
        num += 1

if num == 1:
    print(-1)
    
else:print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n%2 == 1:
    print(0)
    
else:
    list5 = []
    flag = True
    num = 5
    while flag:
        tmp = n//(num*2)
        if tmp > 0:
            list5.append(tmp)
            num *= 5
        else:
            flag = False
    ans_list = []
    for i in range(len(list5)-1):
        ans_list.append(list5[i] - list5[i+1])
    ans_list.append(list5[-1])
    ans = 0
    for i in range(len(ans_list)):
        ans += ans_list[i]*(i+1)
    print(ans)

Fixed submission:
n = int(input())
if n%2 == 1:
    print(0)
    
else:
    if n < 10:
        print(0)
    else:
        list5 = []
        flag = True
        num = 5
        while flag:
            tmp = n//(num*2)
            if tmp > 0:
                list5.append(tmp)
                num *= 5
            else:
                flag = False
        ans_list = []
        for i in range(len(list5)-1):
            ans_list.append(list5[i] - list5[i+1])
        ans_list.append(list5[-1])
        ans = 0
        for i in range(len(ans_list)):
            ans += ans_list[i]*(i+1)
        print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
mod = 10**9+7
a = np.array(list(map(int,input().split())))
ans = 0
for i in range(60):
    #aをiビット右にずらす、iは60桁目まで、&1で対象のビットが1のもの以外を0にその数をカウントする。
    b = np.count_nonzero(a >>i&1)
    ans += ((2**i)*(n-b)*b)%mod
print(ans)

Fixed submission:
import numpy as np
n = int(input())
mod = 10**9+7
a = np.array(list(map(int,input().split())))
ans = 0
for i in range(60):
    #aをiビット右にずらす、iは60桁目まで、&1で対象のビットが1のもの以外を0にその数をカウントする。
    b = np.count_nonzero(a >>i&1)
    ans += ((2**i)*(n-b)*b)%mod
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import numpy as np
n = int(input())
l_list = list(map(int,input().split()))
l_list = np.sort(l_list)
ans = 0
for i in range(n-2):
    for j in range(i+1 , n-1):
        ans += bisect.bisect_left(l_list,l_list[i] + l_list[j]) -j -1
        
print(ans)

Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1 , n-1):
        ans += bisect.bisect_left(l_list,l_list[i] + l_list[j]) -j -1
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import numpy as np
n = int(input())
l_list = list(map(int,input().split()))
l_list = np.sort(l_list)
ans = 0
for i in range(n):
    for j in range(i+1 , n):
        ans += bisect.bisect_left(l_list,l_list[i] + l_list[j]) -j -1
        
print(ans)

Fixed submission:
import bisect
n = int(input())
l_list = list(map(int,input().split()))
l_list.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1 , n-1):
        ans += bisect.bisect_left(l_list,l_list[i] + l_list[j]) -j -1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


a,b = map(int,input().split())
gcd = gcd(a ,b)
print(len(np.unique(prime_decomposition(gcd)))+1)

Fixed submission:
import numpy as np
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


a,b = map(int,input().split())
gcd = gcd(a ,b)
print(len(np.unique(prime_decomposition(gcd)))+1)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
price_list = sorted(list(map(int,input().split())),reverse = True)
for num in range(m):
    price_list[0] = price_list[0]//2
    price_list = sorted(price_list,reverse = True)
sum(price_list)

Fixed submission:
i  = input()
if i == 'Sunny':
    print('Cloudy')
elif i == 'Cloudy':
    print('Rainy')
elif i == 'Rainy':
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
i  = input()
if i == 'Sunny':
    print('Cloudy')
elif i == 'Cloudy':
    print('Rainy')
elif i = 'Rainy':
    print('Sunny')

Fixed submission:
i  = input()
if i == 'Sunny':
    print('Cloudy')
elif i == 'Cloudy':
    print('Rainy')
elif i == 'Rainy':
    print('Sunny')

Buggy python submission (verdict: Runtime Error):
i  = input()
if i == 'Sunny':
    print('Cloudy'):
elif i == 'Cloudy':
    print('Rainy')
elif i = 'Rainy':
    print('Sunny')

Fixed submission:
i  = input()
if i == 'Sunny':
    print('Cloudy')
elif i == 'Cloudy':
    print('Rainy')
elif i == 'Rainy':
    print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
price_list = sorted(list(map(int,input().split())),reverse = True)
for i in range(m):
    n = max(price_list)
    price_list.remove(n)
    price_list.append(n//2)
print(sum(price_list))

Fixed submission:
import heapq
n,m = map(int,input().split())
price_list =list(map(lambda x : -int(x),input().split()))
heapq.heapify(price_list)

for i in range(m):
    dis = heapq.heappop(price_list)
    heapq.heappush(price_list, -(-dis//2)) 
print(-1*sum(price_list))

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
price_list = sorted(list(map(int,input().split())),reverse = True)
for num in range(m):
    price_list[0] = price_list[0]//2
    price_list = sorted(price_list,reverse = True)
print(sum(price_list))

Fixed submission:
import heapq
n,m = map(int,input().split())
price_list =list(map(lambda x : -int(x),input().split()))
heapq.heapify(price_list)

for i in range(m):
    dis = heapq.heappop(price_list)
    heapq.heappush(price_list, -(-dis//2)) 
print(-1*sum(price_list))

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
price_list = sorted(list(map(int,input().split())),reverse = True)for num in range(m):
    price_list[0] = price_list[0]//2
    price_list = sorted(price_list,reverse = True)
sum(price_list)

Fixed submission:
import heapq
n,m = map(int,input().split())
price_list =list(map(lambda x : -int(x),input().split()))
heapq.heapify(price_list)

for i in range(m):
    dis = heapq.heappop(price_list)
    heapq.heappush(price_list, -(-dis//2)) 
print(-1*sum(price_list))