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

Fixed submission:
from fractions import gcd
N = int(input())
A = list(map(int, input().split()))


def lcm(a, b):
    y = a * b // gcd(a, b)
    return y


c = 0
for i, a in enumerate(A):
    if i == 0:
        c = a
    else:
        c = lcm(c, a)

result = 0
for a in A:
    result += c // a

print(result % (10 ** 9 + 7))

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


def lcm(a, b):
    y = a * b // math.gcd(a, b)
    return y


c = 0
for i, a in enumerate(A):
    if i == 0:
        c = a
    else:
        c = lcm(c, a)

result = 0
for a in A:
    result += c // a

print(result % (10 ** 9 + 7))

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


def lcm(a, b):
    y = a * b // math.gcd(a, b)
    return y


c = 0
for i, a in enumerate(A):
    if i == 0:
        c = a
    else:
        c = lcm(c, a)

result = 0
for a in A:
    result += c // a

print(result % (10 ** 9 + 7))
Problem p02831 (python)

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

def lcm(a, b):
    return int(a * b / fractions.gcd(a, b))

print(lcm(A, B))

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

def lcm(a, b):
    return int(a * b / math.gcd(a, b))

print(lcm(A, B))
Problem p02847 (python)

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

Buggy submission (verdict: Runtime Error):
import math

A, B, X = map(int, input().split())

# Nがとりうる最大値
L_M = X // A

if L_M < 1:
    print(0)
    exit()

if L_M >= 1 and (X - (int(math.log10(L_M)) + 1) * B) // A > 10 ** 9:
    print(10 ** 9)
    exit()

if L_M >= 1:
    while True:
        if A * L_M + B * (int(math.log10(L_M)) + 1) <= X:
            if L_M > 10 ** 9:
                print(10 ** 9)
            else:
                print(L_M)
            exit()
        elif L_M <= 0:
            print(0)
            exit()
        else:
            L_M -= 1
else:
    print(0)
Problem p02862 (python)

Fixed submission:
import math

N = 10 ** 9 + 7
X, Y = map(int, input().split())
B3 = 2 * X - Y
if B3 % 3:
    print(0)
    exit()
B = B3 // 3
A = X - 2 * B
if A < 0 or B < 0:
    print(0)
    exit()

# count = 1
# for i in range(A + 1, A + B + 1):
#     count *= i
# for i in range(1, A + 1):
#     count //= i
# print(count % N)

# def combinations_count(n, r):
#     return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
#
# print(combinations_count(A + B, A) % N)

def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

print(cmb(A + B,A) % N)

Buggy submission (verdict: Runtime Error):
import math

N = 10 ** 9 + 7

X, Y = map(int, input().split())

B3 = 2 * X - Y

if B3 % 3:
    print(0)
    exit()

B = B3 // 3

A = X - 2 * B

print(A)
print(B)


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

print(combinations_count(A + B, A) % N)
Problem p02881 (python)

Fixed submission:
import math

N = int(input())

A = int(math.sqrt(N))

for i in reversed(range(1, A + 1)):
    if N % i == 0:
        print(i + (N // i) - 2)
        exit()

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

import math

A = int(math.sqrt(N))

for i in reversed(range(A)):
    if N % i == 0:
        print(i + (N // i) - 2)
        exit()
Problem p02711 (python)

Fixed submission:
"""
    Author : thekushalghosh
    Team   : CodeDiggers
"""
import sys,math,cmath,time
start_time = time.time()
################# ---- USER DEFINED INPUT FUNCTIONS ---- #################
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().split()))
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
 
def solve():
  n = inp()
  if "7" in list(str(n)):
    print("Yes")
  else:
    print("No")
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
    sys.stdin = open('input.txt','r')
    sys.stdout = open('output.txt','w')
else:
    input = sys.stdin.readline
t = 1
for tt in range(t):
    solve()
if not ONLINE_JUDGE:
    print("Time Elapsed:",time.time() - start_time,"seconds")
sys.stdout.close()

Buggy submission (verdict: Runtime Error):
"""
    Author : thekushalghosh
    Team   : CodeDiggers
"""
import sys,math,cmath,time
start_time = time.time()
################# ---- USER DEFINED INPUT FUNCTIONS ---- #################
def inp():
    return(int(input()))
def inlt():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().split()))
##########################################################################
################# ---- THE ACTUAL CODE STARTS BELOW ---- #################
 
def solve():
  n = inp()
  if "7" in list(str(n)):
    print("YES")
  else:
    print("NO")
################## ---- THE ACTUAL CODE ENDS ABOVE ---- ##################
##########################################################################
ONLINE_JUDGE = __debug__
if not ONLINE_JUDGE:
    sys.stdin = open('input.txt','r')
    sys.stdout = open('output.txt','w')
else:
    input = sys.stdin.readline
t = 1
t = inp()
for tt in range(t):
    solve()
if not ONLINE_JUDGE:
    print("Time Elapsed:",time.time() - start_time,"seconds")
sys.stdout.close()
Problem p02781 (python)

Fixed submission:
N = list(map(int,list(input())))
K = int(input())
#print(N)

def main(k,p):
    l = len(k)
    x = 9 ** p###先頭桁が0
    for i in range(p):
        x *= max(l - 1 - i,0)
    for i in range(p):
        x //= (i+1)
    y = (k[0] - 1)*(9**(p-1))###先頭桁が1以上k[0]-1以下
    for i in range(p-1):
        y *= max(l - 1 - i,0)
    for i in range(p-1):
        y //= (i+1)
    ##以下, 先頭がk[0]
    i = 1
    while i < l-1 and k[i] == 0 :
        i += 1
    #print("i=",i)
    if p == 1:
        z = 1
    elif i == l-1 and k[i]==0:
        z = 0
    else:
        z = main(k[i:],p-1)
    #print(k,x,y,z)
    return (x+y)+z

if len(N) < K:
    print(0)
else:
    print(main(N,K))

Buggy submission (verdict: Runtime Error):
N = list(map(int,list(input())))
K = int(input())
#print(N)

def main(k,p):
    l = len(k)
    x = 9 ** p###先頭桁が0
    for i in range(p):
        x *= max(l - 1 - i,0)
    for i in range(p):
        x //= (i+1)
    y = (k[0] - 1)*(9**(p-1))###先頭桁が1以上k[0]-1以下
    for i in range(p-1):
        y *= max(l - 1 - i,0)
    for i in range(p-1):
        y //= (i+1)
    ##以下, 先頭がk[0]
    i = 1
    while i < l-1 and k[i] == 0 :
        i += 1
    #print("i=",i)
    if p == 1:
        z = 1
    elif i == l-1 and k[i]==0:
        z = 0
    else:
        z = main(k[i:],p-1)
    #print(k,x,y,z)
    return (x+y)+z

print(main(N,K))
Problem p02990 (python)

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

comb = [[0 for j in range(i+1)] for i in range(n+1)]

for i in range(n+1):
    for j in range(i+1):
        if j == 0 or j == i:
            comb[i][j] = 1
        elif j < 0 or j > i:
            comb[i][j] = 0
        else:
            comb[i][j] = (comb[i-1][j] + comb[i-1][j-1])%(10**9+7)


for i in range(1,k+1):
    if n-k+1 < i:
        print(0)
    else:
        print((comb[n-k+1][i]*comb[k-1][i-1])%(10**9+7))

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

comb = [[0 for j in range(i+1)] for i in range(n+1)]

for i in range(n+1):
    for j in range(i+1):
        if j <= 0 or j >= i:
            comb[i][j] = 1
        else:
            comb[i][j] = (comb[i-1][j] + comb[i-1][j-1])%(10**9+7)


for i in range(1,k+1):
    print((comb[n-k+1][i]*comb[k-1][i-1])%(10**9+7))

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

comb = [[0 for j in range(i+1)] for i in range(n)]

for i in range(n):
    for j in range(i+1):
        if j <= 0 or j >= i:
            comb[i][j] = 1
        else:
            comb[i][j] = (comb[i-1][j] + comb[i-1][j-1])%(10**9+7)


for i in range(1,k+1):
    print((comb[n-k+1][i]*comb[k-1][i-1])%(10**9+7))

Buggy submission (verdict: Runtime Error):
def cmd(p,q):
    if q <= 0 or q >= p:
        return 1
    else:
        return (cmd(p-1,q-1)+cmd(p-1,q))%(10**9+7)


n,k = map(int,input().split())
for i in range(1,k+1):
    print((cmd(n-k+1,i)*cmd(k-1,i-1))%(10**9+7))
Problem p03013 (python)

Fixed submission:
fiblist = [0] * 100001
fiblist[0] = 1
fiblist[1] = 1
for p in range(2,100001):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

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

if m == 0:
    print(fiblist[n])
else:
    a = []
    for i in range(m):
        a.append(int(input()))

    d = [a[0]-1]
    for j in range(1,m):
        d.append(a[j]-a[j-1]-2)

    d.append(n-a[m-1]-1)




#print(d)

    if (-1 in d) or (-2 in d):
        print(0)
    else:
        ans = 1
        for k in range(m+1):
            ans = (ans * fiblist[d[k]]) % 1000000007

        print(ans)

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

a = []
for i in range(m):
    a.append(int(input()))

d = [a[0]-1]
for j in range(1,m):
    d.append(a[j]-a[j-1]-2)

d.append(n-a[m-1]-1)


fiblist = [0] * 100001
fiblist[0] = 1
fiblist[1] = 1

for p in range(2,100001):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

#print(d)

if (-1 in d) or (-2 in d):
    print(0)
else:
    ans = 1
    for k in range(m+1):
        ans = (ans * fiblist[d[k]]) % 1000000007

    print(ans)

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

a = []
for i in range(m):
    a.append(int(input()))

d = [a[0]-1]
for j in range(1,m):
    d.append(a[j]-a[j-1]-2)

d.append(n-a[m-1]-1)


fiblist = [0] * 100000
fiblist[0] = 1
fiblist[1] = 1

for p in range(2,100000):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

#print(d)

if (-1 in d) or (-2 in d):
    print(0)
else:
    ans = 1
    for k in range(m+1):
        ans = (ans * fiblist[d[k]]) % 1000000007

    print(ans)

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

a = []
for i in range(m):
    a.append(int(input()))

d = [a[0]-1]
for j in range(1,m):
    d.append(a[j]-a[j-1]-2)

d.append(n-a[m-1]-1)

mm = max(d)

fiblist = [0] * (mm+100)
fiblist[0] = 1
fiblist[1] = 1

for p in range(2,mm+100):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

#print(d)

if (-1 in d) or (-2 in d):
    print(0)
else:
    ans = 1
    for k in range(m+1):
        ans = (ans * fiblist[d[k]]) % 1000000007

    print(ans)

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

a = []
for i in range(m):
    a.append(int(input()))

d = [a[0]-1]
for j in range(1,m):
    d.append(a[j]-a[j-1]-2)

d.append(n-a[m-1]-1)

mm = max(d)

fiblist = [0] * (mm+5)
fiblist[0] = 1
fiblist[1] = 1

for p in range(2,mm+5):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

#print(d)

if -1 in d:
    print(0)
else:
    ans = 1
    for k in range(m+1):
        ans = (ans * fiblist[d[k]]) % 1000000007

    print(ans)

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

a = []
for i in range(m):
    a.append(int(input()))

d = [a[0]-1]
for j in range(1,m):
    d.append(a[j]-a[j-1]-2)

d.append(n-a[m-1]-1)

mm = max(d)

fiblist = [0] * (mm+1)
fiblist[0] = 1
fiblist[1] = 1

for p in range(2,mm+1):
    fiblist[p] = (fiblist[p-1]+fiblist[p-2]) % 1000000007

#print(d)

if -1 in d:
    print(0)
else:
    ans = 1
    for k in range(m+1):
        ans = (ans * fiblist[d[k]]) % 1000000007

    print(ans)
Problem p03127 (python)

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

n = int(input())
a = list(map(int,input().split()))

x = gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = gcd(x,a[i])
        
print(x)

Buggy submission (verdict: Runtime Error):
INF = 10 ** 10

def num(k):#各数字に使用するマッチ棒の本数を返す関数
    if k == 1:
        return 2
    elif k == 7:
        return 3
    elif k == 4:
        return 4
    elif k == 2 or k == 3 or k == 5:
        return 5
    elif k == 6 or k == 9:
        return 6
    elif k == 8:
        return 7

n, m = map(int,input().split())
l = list(map(int,input().split()))
l.sort(reverse = True)
         
dp = [(-1) * INF] * (n+1)

dp[0] = 0

for i in range(2,n+1):
    can = []
    for x in l:
        if i-num(x)>=0:
            can.append(dp[i-num(x)]+1)
    if can == []:
        dp[i] = (-1) * INF
    else:
        dp[i] = max(can)
        
#print(dp)

anslist = [0] * dp[n]

left = n

for j in range(dp[n],0,-1):#jは桁数
    if j == 1:
        for x in l:
            if num(x) == left:
                anslist[j-1] = x
                break
    else:
        for x in l:
            if dp[left-num(x)] == j - 1:
                anslist[j-1] = x#j桁目は10^(j-1)の位
                left = left-num(x)
                break
            
    #print([j,x,left])
#print(anslist)
            
            
ans = 0

for j in range(0,dp[n]):
    ans = ans + anslist[j] * (10 ** j)

print(ans)

Buggy submission (verdict: Runtime Error):
#ABC118_C

import fraction

n = int(input())
a = list(map(int,input().split()))

x = fraction.gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = fraction.gcd(x,a[i])
        
print(x)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = list(map(int,input().split()))

x = math.gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = math.gcd(x,a[i])
        
print(x)

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
a = list(map(int,input().split()))

x = math.gcd(a[0],a[1])

if n != 2:
    for i in range(2,n):
        x = math.gcd(x,a[i])
        
print(x)
Problem p03222 (python)

Fixed submission:
MOD = 10 ** 9 +7
h, w, k = map(int,input().split())

if w == 1:
    print(1)
else:
    acr = []
    for p in range(2**(w-1)):
        det = 0
        pp = p
        exist = [0] * (w-1)
        for i in range(w-1):
            exist[i] = pp % 2
            pp = pp // 2
        for ii in range(w-2):
            if exist[ii] == 1 and exist[ii+1] == 1:
                det = 1
        if det == 0:
            acr.append(exist[:])
    #print(acr)

    cur = [0] * w
    cur[0] = 1
    

    for t in range(h):
        n = [0] * w
        for x in range(len(acr)):
            n[0] = (n[0] + cur[1] * acr[x][0] + cur[0] * (1-acr[x][0]))%MOD
            for j in range(1,w-1):
                n[j] = (n[j] + cur[j-1] * acr[x][j-1] + cur[j+1] * acr[x][j] + cur[j] * (1-acr[x][j-1])*(1-acr[x][j]))%MOD
            n[w-1] = (n[w-1] + cur[w-2] * acr[x][w-2] + cur[w-1] * (1-acr[x][w-2])) % MOD
        
        cur = n[:]
        
    print(cur[k-1])

Buggy submission (verdict: Runtime Error):
MOD = 10 ** 9 +7
h, w, k = map(int,input().split())

if w == 1:
    print(1)
else:
    acr = []
    for p in range(2**(w-1)):
        det = 0
        pp = p
        exist = [0] * (w-1)
        for i in range(w-1):
            exist[i] = pp % 2
            pp = pp // 2
        for ii in range(w-2):
            if exist[ii] == 1 and exist[ii+1] == 1:
                det = 1
        if det == 0:
            acr.append(exist)

    cur = [0] * w
    cur[0] = 1
    n = [0] * w

    for x in range(len(acr)):
        n[0] = cur[1] * acr[x][0] + cur[0] * (1-acr[x][0])
        for j in range(1,w-1):
            n[j] = cur[j-1] * acr[x][j-1] + cur[j+1] * acr[x][j] + cur[j] * (1-acr[x][j-1])(1-acr[x][j])
        n[w-1] = cur[w-2] * acr[x][w-2] + cur[w-1] * (1-acr[x][w-1])
        cur = n[:]
    print(cur[k-1])
Problem p03426 (python)

Fixed submission:
H,W,D = map(int,input().split())

A = [[0]*W for i in range(H)]
data = [0]*(H*W+1)

for i in range(H):
    A[i] = list(map(int,input().split()))

for i in range(H):
    for j in range(W):
        data[A[i][j]] = [i,j]

Q = int(input())

L = [0] * Q
R = [0] * Q

for i in range(Q):
    L[i],R[i] = map(int,input().split())

X = [0]*(H*W+1)

for i in range(D):
    x = H*W-D-i
    count = 0
    while x > 0:
        count += abs(data[x][0]-data[x+D][0])+abs(data[x][1]-data[x+D][1])
        X[x] += count
        x -= D

for i in range(Q):
    print(X[L[i]]-X[R[i]])

Buggy submission (verdict: Runtime Error):
H,W,D = map(int,input().split())

A = [[0]*W for i in range(H)]
data = [0]*(H*W+1)

for i in range(H):
    A[i] = list(map(int,input().split()))

for i in range(H):
    for j in range(W):
        data[A[i][j]] = [i,j]

Q = int(input())

L = [0] * Q
R = [0] * Q

for i in range(Q):
    L[i],R[i] = map(int,input().split())

X = [0]*300

for i in range(D):
    x = H*W-D-i
    count = 0
    while x > 0:
        count += abs(data[x][0]-data[x+D][0])+abs(data[x][1]-data[x+D][1])
        X[x] += count
        x -= D

for i in range(Q):
    print(X[L[i]]-X[R[i]])
Problem p02873 (python)

Fixed submission:
s=input()
a=[0]*(len(s)+1)
for i in range(len(s)):
    if s[i]=="<":
        a[i+1]=a[i]+1
for i in range(len(s)-1,-1,-1):
    if s[i]==">":
        a[i]=max(a[i],a[i+1]+1)
print(sum(a))

Buggy submission (verdict: Runtime Error):
s=input()
a=[0]*len(s)
for i in range(len(s)+1):
    if s[i]=="<":
        a[i+1]=a[i]+1
for i in range(len(s)-1,-1,-1):
    if s[i]==">":
        a[i]=max(a[i],a[i+1]+1)
print(sum(a))

Buggy submission (verdict: Runtime Error):
s=input()
print(s.count("<"))
print(s.count(">"))
print(len(s))
a=[0]*len(s)
for i in range(len(s)+1):
    if s[i]=="<":
        a[i+1]=a[i]+1
for i in range(len(s)-1,-1,-1):
    if s[i]==">":
        a[i]=max(a[i],a[i+1]+1)
print(sum(a))
Problem p03723 (python)

Fixed submission:
a,b,c=map(int,input().split())
if a%2!=0 or b%2!=0 or c%2!=0:
    print(0)
elif a==b==c:
    print(-1)
else:
    total=0
    while True:
        x=a/2
        y=b/2
        z=c/2
        a=y+z
        b=x+z
        c=x+y
        total+=1
        if a%2!=0 or b%2!=0 or c%2!=0:
            print(total)
            break

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b==c:
    print(-1)
total=0
else:
    while True:
        x=a/2
        y=b/2
        z=c/2
        a=y+z
        b=x+z
        c=x+y
        total+=1
        if a%2!=0 or b%2!=0 or c%2!=0:
            print(total)
            break
Problem p02707 (python)

Fixed submission:
import collections
n=int(input())
a=list(map(int,input().split()))
m=max(a)
c=collections.Counter(a)
c=c.most_common()
l=[0]*n
for i in range(len(c)):
    l[c[i][0]-1]=c[i][1]
print(l[0])
for j in range(1,n):
    print(l[j])

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
l=[0]*n

for i in a:
  l[i]+=1
print(l[1])
for i in a:
  print(l[i+1])
Problem p02773 (python)

Fixed submission:
import collections

N = int(input())
l = []
 
for _ in range(N):
    s = str(input())
    l.append(s)

c = collections.Counter(l)
c = c.most_common()
 
most_count = c[0][1]
c.sort()
 
for i in range(len(c)):
    if c[i][1] == most_count:
        print(c[i][0])

Buggy submission (verdict: Runtime Error):
n=int(input())
dict={}
for i in range(n):
    s=input()
    if s in dict_keys:
        dict[s]=1
    else:
        dict[s]+=1
items_sorted = sorted(dict.items(), key = lambda x : x[1])
value=items_sorted[0][0]
i=0
while(1):
    if items_sorted[i][0]==value:
        print(items_sorted[i][1])
    else:
        break
Problem p02779 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
s="YES"
for i in range(n-1):
    if a[i]==a[i+1]:
        s="NO"
        break
print(s)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
s="NO"
for i in range(n):
    for j in range(i+1,n):
        if a[i]==s[j]:
            s="YES"
            break
print(s)
Problem p02785 (python)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
h.sort()
print(sum(h[:max(0,n-k)]))

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

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

Fixed submission:
a=int(input())
b=int(input())
print(6-a-b)

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

Buggy submission (verdict: Runtime Error):
a,b=int(input())
print(6-a-b)
Problem p02831 (python)

Fixed submission:
from fractions import gcd
a,b=map(int,input().split())
print(a*b//gcd(a,b))

Buggy submission (verdict: Runtime Error):
from numpy import gcd
a,b=map(int,input().split())
print(a*b//gcd(a,b))

Buggy submission (verdict: Runtime Error):
from math import gcd
a,b=map(int,input().split())
print(a*b//gcd(a,b))
Problem p02847 (python)

Fixed submission:

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

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

l=["SUN","MON","TUE","WED","THU","FRI","SAT"]
s=input()
print(7-l.index(s))
Problem p03013 (python)

Fixed submission:
import sys
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(int(input()))
if n==1:
    if 1 in l:
        print(0)
    else:
        print(1)
    sys.exit()
ans1=0
ans2=0
c=0
if 1 in l:
    c+=1
    if 2 in l:
        print(0)
        sys.exit()
    else:
        ans2=1
else:
    ans1=1
    if 2 in l:
        c+=1
    else:
        ans2=2
ans=[0,ans1,ans2]
S=2
while S<n:
    S+=1
    if c>=len(l):
        ans.append((ans[-1]+ans[-2])%1000000007)
    elif S==l[c]:
        c+=1
        ans.append(0)
    else:
        ans.append((ans[-1]+ans[-2])%1000000007)
print(ans[-1])

Buggy submission (verdict: Runtime Error):
import sys
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(int(input()))
if n==1:
    if 1 in l:
        print(0)
    else:
        print(1)
    sys.exit()
ans1=0
ans2=0
if 1 in l:
    if 2 in l:
        print(0)
        sys.exit()
    else:
        ans2=1
else:
    ans1=1
    if 2 in l:
        pass
    else:
        ans2=2
ans=[0,ans1,ans2]
S=2
while S<n:
    S+=1
    if S in l:
        ans.append(0)
    else:
        ans.append((ans[-1]+ans[-2])%1000000007)
print(ans[-1])
//print(ans)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(int(input()))
if not 1 in l:
    two=1
else:
    two=0
if not 2 in l:
    if two==1:
        one=2
    else:
        one=1
lis=[two,one]
for _ in range(3,n+1):
    if not _ in l:
        lis.append((lis[_-3]+lis[_-2])%1000000007)
    else:
        lis.append(0)
print(lis[-1])

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=[]
for i in range(m):
    l.append(int(input()))
if not 1 in l:
    two=1
if not 2 in l:
    if two==1:
        one=2
    else:
        one=1
lis=[two,one]
for _ in range(3,n+1):
    if not _ in l:
        lis.append((lis[_-3]+lis[_-2])%1000000007)
    else:
        lis.append(0)
print(lis[-1])