Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log,floor
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a,b,c,d = MAP()

print(max(a*c,a*d,b*c,b*d))

Fixed submission:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log,floor
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a,b,c,d = MAP()

print(max(a*c,a*d,b*c,b*d))
Buggy python submission (verdict: Time Limit Exceeded):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

a = LIST()

ans = 1
for el in a:
    ans*=el
    
if(ans>10**18):
    print(-1)
else:
    print(ans)

Fixed submission:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()

a = LIST()
a.sort()
if(0 in a):
    print(0)
else:
    ans = 1
    for el in a:
        ans*=el
        if(ans>10**18):
            break
    if(ans>10**18):
        print(-1)
    else:
        print(ans)
Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

dd=defaultdict(int)
#take care of 0
for i in range(0, 81):
    for j in range(i):
        temp = i**5 - j**5
        dd[temp] = (i, j)
        temp1 = i**5 + j**5
        dd[temp1] = (i, -j)

x = INT()

print(*dd[x])

Fixed submission:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

dd=defaultdict(int)
#take care of 0
for i in range(0, 121):
    for j in range(i+1):
        temp = i**5 - j**5
        dd[temp] = (i, j)
        temp1 = i**5 + j**5
        dd[temp1] = (i, -j)
# print(dd[2066178367])
x = INT()
if(dd[x]!=0):
    print(dd[x][0], dd[x][1])
Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

k,n = MAP()
a = LIST()
a.sort()

mx = k-a[-1] + a[0]

for i in range(1, n):
    mx = max(mx, a[i]-a[i-1])

print(k-mx)

Fixed submission:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

k,n = MAP()
a = LIST()
a.sort()

mx = k-a[-1] + a[0]

for i in range(1, n):
    mx = max(mx, a[i]-a[i-1])

print(k-mx)
Buggy python submission (verdict: Runtime Error):
s = input()

if(s=="BBB" or s="AAA"):
    print("No")
else:
    print("Yes")



Fixed submission:
s = input()

if(s=="BBB" or s=="AAA"):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()

if("A" not in s):
    print("No")
else:
    print("Yes")



Fixed submission:
s = input()

if(s=="BBB" or s=="AAA"):
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()

if(s=='AAA' or s=='BBB'):
    print("No")
else:
    print("Yes")



Fixed submission:
s = input()

if(s=="BBB" or s=="AAA"):
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n,a,b = MAP()

q = n//(a+b)
rem = n%(a+b)

ans = q*a
if(rem>a):
    print(ans + a)
else:
    print(ans + rem)

Fixed submission:
# Template 1.0
import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n,a,b = MAP()

q = n//(a+b)
rem = n%(a+b)

ans = q*a
if(rem>a):
    print(ans + a)
else:
    print(ans + rem)
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict, Counter

def solve(num):
    #base case:
    if(dic[num]==0):
        return 0

    mx = 0
    for el in dic[num]:
        if(dp[el]==-1):
            temp1 = solve(el)
            mx = max(mx, 1 + temp1)
            dp[el] = temp1
        else:
            mx = max(mx, 1 + dp[el])

    return mx

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

for _ in range(m):
    xtemp, ytemp = map(int, input().split())
    if(xtemp not in dic):
        dic[xtemp] = []
        dic[xtemp].append(ytemp)
    else:
        dic[xtemp].append(ytemp)
#init dp:
dp = [-1]*(n+1)

mxGl = 0
keys = list(dic.keys())
for node in keys:
    if(dp[node]==-1):
        temp = solve(node)
        dp[node] = temp
        mxGl = max(mxGl, temp)
    else:
        mxGl = max(mxGl, dp[node])
print(mxGl)

Fixed submission:
from collections import defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 9)
def solve(num):
    #base case:
    if(dic[num]==0):
        return 0

    mx = 0
    for el in dic[num]:
        if(dp[el]==-1):
            temp1 = solve(el)
            mx = max(mx, 1 + temp1)
            dp[el] = temp1
        else:
            mx = max(mx, 1 + dp[el])

    return mx

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

for _ in range(m):
    xtemp, ytemp = map(int, input().split())
    if(xtemp not in dic):
        dic[xtemp] = []
        dic[xtemp].append(ytemp)
    else:
        dic[xtemp].append(ytemp)
#init dp:
dp = [-1]*(n+1)

mxGl = 0
keys = list(dic.keys())
for node in keys:
    if(dp[node]==-1):
        temp = solve(node)
        dp[node] = temp
        mxGl = max(mxGl, temp)
    else:
        mxGl = max(mxGl, dp[node])
print(mxGl)
Buggy python submission (verdict: Runtime Error):
20 20
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................
....................

Fixed submission:
def list2d(a, b, c): return [[c] * b for i in range(a)]
mod =10**9+7
H, W = map(int, input().split())

grid = []

for _ in range(H):
    grid.append(list(input()))

dp = list2d(H, W, 0)
for i in range(H-1, -1, -1):
    if(grid[i][W-1] == '#'):
        break
    dp[i][W-1] = 1

for j in range(W-1, -1, -1):
    if(grid[H-1][j]=='#'):
        break
    dp[H-1][j] = 1

for row in range(H-2, -1, -1):
    for col in range(W-2, -1, -1):
        if(grid[row][col] == '.'):
            dp[row][col] = (dp[row][col+1] + dp[row+1][col])%mod
        else:
            dp[row][col] = 0
print(dp[0][0]%mod)
Buggy python submission (verdict: Runtime Error):

from collections import defaultdict


def scc(g):
    rg = defaultdict(list)
    V = set()
    for u, e in g.items():
        V.add(u)
        for v in e:
            V.add(v)
            rg[v].append(u)


    o = []
    done = set()
    def dfs(u):
        done.add(u)
        for v in g[u]:
            if v in done:
                continue
            dfs(v)
            done.add(v)
        # o[u] = len(o)
        o.append(u)

    for v in V:
        if v in done:
            continue
        dfs(v)

    done = set()
    ans = []
    while o:
        u = o.pop()
        if u in done:
            continue
        done.add(u)
        s = [u]
        vv = []

        while s:
            u = s.pop()
            vv.append(u)
            for v in rg[u]:
                if v in done:
                    continue
                s.append(v)
                done.add(v)
        ans.append(vv)

    return ans


def atcoder_practice2_g():
    N, M = map(int, input().split())

    g = defaultdict(list)
    for _ in range(M):
        a, b = map(int, input().split())
        g[a].append(b)
    vv = scc(g)
    print(len(vv))
    for r in vv:
        print(len(r), *r)


def test():
    g = {
        1: [2],
        5: [2],
        2: [4, 3],
        3: [4, 7, 6],
        4: [5, 8],
        6: [9],
        7: [8],
        8: [9],
        9: [7, 10],
        10: []
    }

    vv = scc(g)
    for r in vv:
        print(r)


if __name__ == "__main__":
    # test()
    atcoder_practice2_g()


Fixed submission:

from collections import defaultdict
import sys
sys.setrecursionlimit(10**6)

def scc(N, g, rg):
    V = list(range(N))


    def dfs(u, done, o):
        done.add(u)
        for v in g[u]:
            if v in done:
                continue
            done.add(v)
            dfs(v, done, o)
        o.append(u)

    def dfs_rev(u, done, c):
        done.add(u)
        c.append(u)
        for v in rg[u]:
            if v in done:
                continue
            dfs_rev(v, done, c)

    done = set()
    o = []
    for v in V:
        if v in done:
            continue
        dfs(v, done, o)


    done = set()
    ans = []
    while o:
        u = o.pop()
        if u in done:
            continue
        vv = []
        dfs_rev(u, done, vv)
        ans.append(vv)


    return ans


def atcoder_practice2_g():
    N, M = map(int, input().split())

    g = defaultdict(list)
    rg = defaultdict(list)
    for _ in range(M):
        a, b = map(int, input().split())
        g[a].append(b)
        rg[b].append(a)
    vv = scc(N, g, rg)
    print(len(vv))
    for r in vv:
        print(len(r), *r)


def test():
    g = {
        1: [2],
        5: [2],
        2: [4, 3],
        3: [4, 7, 6],
        4: [5, 8],
        6: [9],
        7: [8],
        8: [9],
        9: [7, 10],
        10: []
    }

    vv = scc(g)
    for r in vv:
        print(r)


if __name__ == "__main__":
    # test()
    atcoder_practice2_g()
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, A):
    p = reduce(mul, A[:K], 1)
    for i, a in enumerate(A[K:]):
        np = p//A[i] * a
        if p < np:
            print('Yes')
        else:
            print('No')
        p = np


def main():
    N, K = read_int_n()
    A = read_int_n()
    (slv(N, K, A))


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub


import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, K, A):
    for i, a in enumerate(A[K:]):
        if A[i] < a:
            print('Yes')
        else:
            print('No')


def main():
    N, K = read_int_n()
    A = read_int_n()
    (slv(N, K, A))


if __name__ == '__main__':
    main()