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

Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

def meguru(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng)//2
        if isOK(mid): ok = mid
        else: ng = mid
    return ok

def isOK(num): return bcum[num] <= tb

n,m,k = imap()
a,b = iarr(),iarr()
acum,bcum = np.array(a).cumsum(),np.array(b).cumsum()

anss = []
for i in range(n+1):
    ans = 0 if i==n else i + 1
    ta = 0 if i==n else acum[i]
    if ta > k: continue
    else: tb = k - ta
    #ok,ng = -1,m
    #ans += meguru(ok,ng) + 1 # OKなければansは-1+1で不変
    ans += bs.bisect_right(bcum, tb)
    anss.append(ans)
ans = max(anss) if anss else 0
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

def meguru(ok, ng):
    while abs(ok - ng) > 1:
        mid = (ok + ng)//2
        if isOK(mid): ok = mid
        else: ng = mid
    return ok

def isOK(num): return bcum[num] <= tb

n,m,k = imap()
a,b = iarr(),iarr()
acum,bcum = np.array(a).cumsum(),np.array(b).cumsum()

anss = []
for i in range(n+1):
    ans = i + 1
    ta = 0 if i==n+1 else acum[i]
    if ta > k: continue
    else: tb = k - ta
    #ok,ng = -1,m
    #ans += meguru(ok,ng) + 1 # OKなければansは-1+1で不変
    ans += bs.bisect_right(bcum, tb)
    anss.append(ans)
ans = max(anss) if anss else 0
print(ans)
Problem p02629 (python)

Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
ch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]

ans = ""
while n>0:
    if n%26: ans = ch[n%26] + ans; n //= 26
    else: ans = ch[n%26] + ans; n //= 26; n -= 1
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

n = iinput()
ch = ["z"]+[chr(i) for i in range(ord("a"), ord("a")+25)]

def cnt26(num):
    cnt = 0
    while 1:
        if 26 ** cnt > num: return cnt - 1
        else: cnt += 1

s = ""
dig = cnt26(n)
while dig >= 1:
    div,mod = divmod(n, 26**dig)
    #print(div,mod)
    n = mod
    s += ch[div]
    dig -= 1
s += ch[mod]
print(s)
Problem p02659 (python)

Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

import decimal as dec

a,b = sarr()
a,b = dec.Decimal(a), dec.Decimal(b)
ans = int(a*b)
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan
import cmath as cma
import copy as cp
import sys
import re
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

a,b = imap()
b *= 100
ans = a*b //100
print(ans)
Problem p02766 (python)

Fixed submission:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

class unionfind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.size = [1 for i in range(n)]
    def find(self,a):
        if a == self.parent[a]: return a
        else: self.parent[a] = find(self,self.parent[a]); return self.parent[a]
    def unite(self,a,b):
        pa,pb = self.find(self,a), self.find(self,b)
        if pa == pb: return
        else: self.parent[pb] = pa; self.size[pa] += self.size[pb]
    def same(self,a,b): return find(self,a) == find(self,b)

n,k = imap()
for i in range(31):
    if k**i > n: ans = i; break
print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
from math import cos,sin,tan,sqrt
import cmath as cma
import copy as cp
import sys
import re
import bisect as bs
sys.setrecursionlimit(10**7)
EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf
MOD = 10**9 + 7

def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def adj(n): return [[] for _ in range(n)]

class unionfind:
    def __init__(self, n):
        self.parent = [i for i in range(n)]
        self.size = [1 for i in range(n)]
    def find(self,a):
        if a == self.parent[a]: return a
        else: self.parent[a] = find(self,self.parent[a]); return self.parent[a]
    def unite(self,a,b):
        pa,pb = self.find(self,a), self.find(self,b)
        if pa == pb: return
        else: self.parent[pb] = pa; self.size[pa] += self.size[pb]
    def same(self,a,b): return find(self,a) == find(self,b)

n,k = imap()
for i in range(31):
    if k**i > n: ans = i; break
ans = 1 if
print(ans)
Problem p02990 (python)

Fixed submission:
import sys
MOD = 10**9 + 7
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

def inv(a): return pow(a, MOD-2, MOD) #逆元
def comb(n,r):
    ans = 1
    for i in range(r): ans *= n-i; ans *= inv(r-i); ans %= MOD
    return ans

    
n,k = imap()
ans = n-k+1
print(ans)
for i in range(2,k+1):
    ans *= (n-k-i+2) * (k-i+1) * inv(i) * inv(i-1)
    print(ans %MOD)

Buggy submission (verdict: Runtime Error):
MOD = 10**9 + 7
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
def adj(n): return [[] for _ in range(n)]

def inv(a): return pow(a, MOD-2, MOD) #逆元
def comb(n,r):
    ans = 1
    for i in range(r): ans *= n-i; ans *= inv(r-i); ans %= MOD
    return ans
    
n,k = imap()
for i in range(1,k+1):
    ans = comb(n-k+1, i) * comb(k-1, i-1)
    print(ans %MOD)
Problem p03253 (python)

Fixed submission:
import collections as col
import numpy as np
import math as ma
import scipy.misc as spm #miscellaneous

MOD = 10**9 + 7
def inv(a): return pow(a, MOD-2, MOD)
def comb(n,r):
    ans = ma.factorial(n)%MOD * inv(ma.factorial(r)) * inv(ma.factorial(n-r))
    return ans%MOD

def prime(n):
    ans = []
    for i in range(2, int(n**0.5)+1):
        while not n%i: n //= i; ans.append(i)
    if n != 1: ans.append(n)
    return ans

n,m = map(int,input().split())
cnt = col.Counter(prime(m))

ans = 1
for key,val in cnt.items():
    #ans *= comb(val + n-1, n-1)
    ans *= spm.comb(val + n-1, n-1, exact=1)
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
import collections as col
import numpy as np
import math as ma
import scipy.misc as spm #miscellaneous

MOD = 10**9 + 7
def inv(a): return pow(a, MOD-2, MOD)
def comb(n,r):
    ans = ma.factorial(n)%MOD * inv(ma.factorial(r)) * inv(ma.factorial(n-r))
    return ans%MOD

def prime(n):
    ans = []
    for i in range(2, int(n**0.5)+1):
        while not n%i: n //= i; ans.append(i)
    if n != 1: ans.append(n)
    return ans

n,m = map(int,input().split())
cnt = col.Counter(prime(m))

ans = 1
for key,val in cnt.items():
    #ans *= comb(val + n-1, n-1)
    ans *= comb(val + n-1, n-1, MOD)
    ans %= MOD
print(ans)

Buggy submission (verdict: Runtime Error):
import collections as col
import itertools as ite
import numpy as np
import math as ma
from scipy.special import comb

MOD = 10**9 + 7
def inv(a): return pow(a, MOD-2, MOD)
def cmb(n,r):
    ans = ma.factorial(n)%MOD * inv(ma.factorial(r)) * inv(ma.factorial(n-r))
    return ans%MOD

def prime(n):
    ans = []
    for i in range(2, int(n**0.5)+1):
        while not n%i: n //= i; ans.append(i)
    if n != 1: ans.append(n)
    return ans

n,m = map(int,input().split())
cnt = col.Counter(prime(m))

ans = 1
for key,val in cnt.items():
    #ans *= cmb(val + n-1, n-1)
    ans *= comb(val + n-1, n-1, exact=1)
    ans %= MOD
print(ans)
Problem p02819 (python)

Fixed submission:
limit = 100003
import math
def resolve():
    N = int(input())
    for k in range(N, limit+1):
        factor = 0
        if k % 2 == 0 and k != 2:
            continue
        for divisor in range(2, math.floor(math.sqrt(k))+1):
            if k % divisor == 0:
                factor += 1
        if factor == 0:
                return k
print(resolve())

Buggy submission (verdict: Runtime Error):
limit = 100000
def resolve()
	N = int(input())
  	for k in range(N, limit+1):
        if k % 2 == 0 and k != 2:
            continue
        for divisor in range(2, math.floor(math.sqrt(k))+1):
            if k % divisor == 0:
              	print(k)
                break
resolve()
Problem p03723 (python)

Fixed submission:
def resolve():
    A,B,C = map(int,input().split())
    count = 0
    if A == C and A == B:
        if A % 2 == 1:
            print(0)
        else:
            print(-1)
    else:
        while (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
            tmpA = (B + C) / 2 
            tmpB = (A + C) / 2 
            tmpC = (A + B) / 2
            A = tmpA
            B = tmpB
            C = tmpC
            count = count + 1
        print(count)
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    A,B,C = map(int,input().split())
    count = 0
    if A == C and A == B:
        if A % 2 == 1:
            print(0)
        else:
            print(-1)
    else:
        while (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
            tmpA = (B + C) / 2 
            tmpB = (A + C) / 2 
            tmpC = (A + B) / 2
            A = tmpA
            B = tmpB
            C = tmpC
            count = count + 1
        print(count)
resolve():
Problem p02659 (python)

Fixed submission:
import decimal

A, B = input().split()
A = int(A)
B = decimal.Decimal(B)
C = A * B
C = int(C)
print(C)

Buggy submission (verdict: Runtime Error):
import Decimal from decimal as de

a, b = input().split()
a = int(a)
b = de(float(b))
print(int(a*b))

Buggy submission (verdict: Runtime Error):
decimal.Decimal

Buggy submission (verdict: Runtime Error):
import decimal
 
A, B = map(input().split())
A = int(A)
B = decimal.Decimal(float(B))
print(int(A*B))

Buggy submission (verdict: Runtime Error):
import decimal

A, B = map(input().split())
A = int(A)
B = decimal.Decimal(B)
print(int(A*B))
Problem p02781 (python)

Fixed submission:
import sys
from functools import lru_cache

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 8)


@lru_cache(maxsize=None)
def solve(n, k):
    if n < 10:
        if k == 1:
            return n
        elif k == 0:
            return 1
        else:
            return 0

    q, r = divmod(n, 10)

    return solve(q, k) + solve(q, k - 1) * r + solve(q - 1, k - 1) * (9 - r)


def main():
    N = int(input())
    K = int(input())

    print(solve(N, K))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    K = int(input())

    nstr = str(N)

    nl = len(str(N))

    dp = [[[0 for _ in range(nl + 1)] for _ in range(2)] for _ in range(nl + 1)]
    dp[0][0][0] = 1

    for i in range(nl):
        max_digit = int(nstr[i])
        for smaller in range(2):
            for j in range(nl):
                range_digit = 9
                # range_digit = 9 if smaller else max_digit
                if not smaller:
                    range_digit = max_digit
                for x in range(range_digit + 1):
                    if x != 0:
                        if smaller == 1:
                            dp[i + 1][smaller][j + 1] += dp[i][smaller][j]
                        else:
                            if x < max_digit:
                                dp[i + 1][1][j + 1] += dp[i][smaller][j]
                            else:
                                dp[i + 1][0][j + 1] += dp[i][smaller][j]
                    else:
                        if smaller == 1:
                            dp[i + 1][smaller][j] += dp[i][smaller][j]
                        else:
                            if x < max_digit:
                                dp[i + 1][1][j] += dp[i][smaller][j]
                            else:
                                dp[i + 1][0][j] += dp[i][smaller][j]

    ans = 0
    print(dp[nl][1][K])


if __name__ == '__main__':
    main()
Problem p02862 (python)

Fixed submission:
import sys
input = sys.stdin.readline

def modPow(a, x, p):
    res = 1
    while x > 0:
        if x % 2 != 0:
            res = res * a % p
        a = a * a % p
        x = x // 2
    return res

def modInverse(a, p):
    return modPow(a, p - 2, p)

def modBinomial(n, k, p):
    numerator = 1
    for i in range(k):
        numerator = (numerator * (n - i)) % p

    denominator = 1
    for i in range(1, k + 1):
        denominator = (denominator * i) % p

    return (numerator * modInverse(denominator, p)) % p


def main():
    X, Y = [int(x) for x in input().split()]

    MOD = 10 ** 9 + 7
    y = (X - 2 * Y) // (-3)
    x = (X - y) // 2

    if y < 0 or x < 0:
        print(0)
        exit()
    if X == x * 2 + y and Y == x + 2 * y:
        print(modBinomial(x + y, x, MOD))
    else:
        print(0)









if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
from math import factorial as fact

MOD = 10 ** 9 + 7


def inv(x):
    return pow(x, MOD - 2, MOD)


def comb(n, r):
    return (fact(n) * inv(fact(n - r)) * inv(fact(r))) % MOD


def main():
    X, Y = [int(x) for x in input().split()]

    y = (X - 2 * Y) // (-3)
    x = (X - y) // 2

    print(x, y)
    if X == x * 2 + y and Y == x + 2 * y:
        a = comb(x + y, x)
        print(a % MOD)
    else:
        print(0)









if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
from math import factorial as fact

MOD = 10 ** 9 + 7


def inv(x):
    return pow(x, MOD - 2, MOD)


def comb(n, r):
    return (fact(n) * inv(fact(n - r)) * inv(fact(r))) % MOD




def main():
    X, Y = [int(x) for x in input().split()]

    y = (X - 2 * Y) // (-3)
    x = (X - y) // 2

    print(x, y)
    if X == x * 2 + y and Y == x + 2 * y:
        a = comb(x + y, x)
        print(a % MOD)
    else:
        print(0)









if __name__ == '__main__':
    main()
Problem p02948 (python)

Fixed submission:
from collections import defaultdict
import heapq

N, M = [int(x) for x in input().split()]

dict = defaultdict(list)
for _ in range(N):
    A, B = [int(x) for x in input().split()]
    dict[A].append(B)

h = []
total = 0
for x in range(1, M + 1):
    for y in dict[x]:
        heapq.heappush(h, -y)
    if h:
        total += heapq.heappop(h)

print(-total)

Buggy submission (verdict: Runtime Error):
import sys
input=sys.stdin.readline
from operator import itemgetter
import numpy as np

N, M = [int(x) for x in input().split()]
A = {}
for _ in range(N):
    x, y = [int(x) for x in input().split()]
    if x  not in A:
       A[x] = []
    A[x].append(y)

for key in A:
    A[key].sort()


total = 0
for x in range(1, M + 1):
    max = 0
    max_index = -1
    for k, v in sorted(A.items()):
        if k > x:
            break
        if v[-1] > max:
            max = v[-1]
            max_index = k
    if max_index != -1:
        total += A[max_index].pop()
        if len(A[max_index]) == 0:
            A[max_index].append(-1)


print(total)

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

input=sys.stdin.readline

N, M = [int(x) for x in input().split()]
A = []
for _ in range(N):
    A.append([int(x) for x in input().split()])

total = 0

for x in range(1, M + 1):
    max = 0
    max_index = -1
    for y, row in enumerate(A):
        if row[0] <= x and row[1] > max:
            max = row[1]
            max_index = y
    if max_index != -1:
        total += max
        A.pop(max_index)

print(total)
Problem p02546 (python)

Fixed submission:
s3="s"
es="es"
S=input()
if S[-1]=="s":
	s1= S + es
	print(s1)
else:
	s2 = S + s3
	print(s2)

Buggy submission (verdict: Runtime Error):
s=input()
if s[-1]==s:
	s1= s +"es"
  	print(s1)
else:
  	s2 = s +"s"
    	print(s2)

Buggy submission (verdict: Runtime Error):
s=input()
if s[-1]==s:
	s1= s +"es"
  print(s1)
else:
  	s2 = s +"s"
    print(s2)
Problem p02693 (python)

Fixed submission:
k= int(input())
a, b= input().split()
a= int(a)
b= int(b)
cont=0
while 1:
    cont+= k
    if a<= cont <= b:
        print("OK")
        break
    if cont > b:
        print("NG")
        break

Buggy submission (verdict: Runtime Error):
k= int(input())
cont=0
a, b= input().split()
a= int(a)
b= int(b)
while 1:
    cont+= k
    if a<= cont <= b:
        print("OK")
        break
    if x > b:
        print("NG")
        break
Problem p02771 (python)

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

if (a==b and c==b) or (a!=b and b!=c and c!=a):
	print('No')
else:
	print('Yes')

Buggy submission (verdict: Runtime Error):
    n= int(input())
    lista=[]
    listanova=[]
    for x in input().split():
    	x= int(x)
    	if x %2 ==0:
    		lista.append(x)
    for x in lista:
    	if x %3==0 or x%5==0:
    		listanova.append(x)
     
    if len(lista)==len(listanova):
    	print('APPROVED')
    else:
    	print('DENIED')
Problem p02676 (python)

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

if len(s) <= k:
    print(s)
else:
    print(s[:k] + '...')

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

if len(s) <= k:
    print(s)
else:
    print(s[:k+1])