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

Fixed submission:
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
            L.append(temp)
        else:
            temp*=10
            L.append(temp)
    else:
        temp = 0
L.append(-1)        
if len(L)==2 and L[0]==0:
    P=0
elif len(L)==1:
    P=0
else:
    P = len(str(max(L)))
print(P)

Buggy submission (verdict: Runtime Error):
import math
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
        else:
            temp*=2
            L.append(temp)
    else:
        temp = 0
print(int(math.log2(max(L))+1))
Problem p03103 (python)

Fixed submission:
from operator import itemgetter

N, M = map(int,input().split())


a = [list(map(int,input().split())) for i in range(N)]

if N ==1:
    Z = M*a[0][0]
    print(Z)
else:
    a.sort(key = itemgetter(0))
    X = 0 
    D = 0
    var=0
    while M>D:
        D+=a[var][1]
        X+=a[var][0]*a[var][1]
        var+=1
        
    X += a[var-1][0]*(M-D)
    print(X)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter

N, M = map(int,input().split())

a = []
R=[]
D = 0
X = 0
for i in range(N):
    a.append(list(map(int,input().split())))
if N ==1:
    Z = M*int(a[0])
    print(Z)
else:
    a.sort(key = itemgetter(0))

    for i in range(N):
        D += a[i][1]
        if D>M:
            R.append(i)
            break
    for i in range(R[0]+1):
        X += a[i][0]*a[i][1]
    Y = X-(D-M)*a[R[0]][0]
    print(Y)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter

N, M = map(int,input().split())

a = []
R=[]
D = 0
X = 0
for i in range(N):
    a.append(list(map(int,input().split())))
if N ==1:
    Z = M*a[0]
    print(Z)
else:
    a.sort(key = itemgetter(0))

    for i in range(N):
        D += a[i][1]
        if D>M:
            R.append(i)
            break
    for i in range(R[0]+1):
        X += a[i][0]*a[i][1]
    Y = X-(D-M)*a[R[0]][0]
    print(Y)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
import numpy

N, M = map(int,input().split())
a = []

D = 0
X = 0
for i in range(N):
    a.append(list(map(int,input().split())))
a.sort(key = itemgetter(0))

for i in range(N):
    D += a[i][1]
    if D>M:
        for k in range(i+1):
            X += a[k][0]*a[k][1]
            Y = X-(D-M)*a[i][0]
        break
print(Y)

Buggy submission (verdict: Runtime Error):
from operator import itemgetter
import numpy

N, M = map(int,input().split())
a = []
R=[]
D = 0
X = 0
for i in range(N):
    a.append(list(map(int,input().split())))
a.sort(key = itemgetter(0))

for i in range(N):
    D += a[i][1]
    if D>M:
        R.append(i)
        break
for i in range(R[0]+1):
    X += a[i][0]*a[i][1]
Y = X-(D-M)*a[R[0]][0]
print(Y)
Problem p03730 (python)

Fixed submission:
a,b,c=map(int,input().split())
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
if c==0:
    print("YES")
elif c%gcd(a,b)==0 and c!=0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
import math
a,b,c=map(int,input().split())

if c==0:
    print("YES")
elif c%math.gcd(a,b)==0 and c!=0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
def gojo(x,y):
    if x%y==0:
        return y
    else:
        return gojo(y,x-y)

if c==0:
    print("YES")
elif c%gojo(a,b)==0 and c!=0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
def gojo(x,y):
    if x%y==0:
        return y
    else:
        return gojo(y,x-y)

if c%gojo(a,b)!=0:
    print("NO")
else:
    print("YES")
Problem p02554 (python)

Fixed submission:
MOD=10**9+7
N=int(input())
 
all=pow(10,N,MOD)
sub9=pow(9,N,MOD)
sub8=pow(8,N,MOD)
print((all-2*sub9+sub8)%MOD)

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

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10**(N-2)
	each=N*(N-1)/2
	final=without*each

	considered=final%(1000000007)

	print(final)

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

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10**(N-2)
	each=N*(N-1)/2
	final=without*each

	considered=final%(1000000007)

	print(final)

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

if N<2:
	print(0)
ellif N==2:
	print(2)
else:
	without=10**(N-2)
	considered=(without+2)*(without+1)
	considered=considered%(1000000007)
	print(considered)

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

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	consider%=10**9+7

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

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	print(considered)

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

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10*(N-2)
	considered=(without+2)*(without+1)/2
	print(considered)

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

if N<2:
	print(0)
elif N==2:
	print(2)
else:
	without=10*(N-2)
	considered=without*(without-1)/2
	print(considered)
Problem p02658 (python)

Fixed submission:
def main():
    n = int(input())
    A = list(map(int, input().split()))

    if 0 in A:
        print(0)
        return

    ans = 1
    for item in A:
        ans = ans * item
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    list = list(map(int, input().split()))
    ans = 1

    for i in range(n):
        ans = ans * list[i]
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)


main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    list = list(map(int, input().split()))
    ans = 1

    for i in range(n):
        ans = ans * list[i]
        if ans > 1000000000000000000:
            print(-1)
            return

    print(ans)


main()
Problem p02789 (python)

Fixed submission:
a,b=input().split(" ")
a=int(a)
b=int(b)
if b<a:
  print ("No")
if b==a :
  print ("Yes")

Buggy submission (verdict: Runtime Error):
a,b=raw.input().split(" ")
if b<a:
  print "Yes"
else :
  print "No"
Problem p02573 (python)

Fixed submission:
def root(x, root_ls):
  if root_ls[x] < 0:
    return x
  else:
    root_ls[x] = root(root_ls[x], root_ls)
    return root_ls[x]

def unite(a, b, root_ls):
  a = root(a, root_ls)
  b = root(b, root_ls)
  if a != b:
    root_ls[a] += root_ls[b]
    root_ls[b] = a
  
n, m = list(map(int, input().rstrip().split(" ")))
members = [-1 for i in range(n)]
max_idx = 0
for mm in range(m):
  a, b = list(map(int, input().rstrip().split(" ")))
  unite(a-1, b-1, members)
print(max([-m for m in members]))

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().rstrip().split(" ")))
members = [1 for i in range(n)]
max_idx = 0
for mm in range(m):
  print(members)
  a0, b0 = list(map(int, input().rstrip().split(" ")))
  a = a0
  b = b0
  while members[a-1] < 0:
    a = -members[a-1]
    members[a0-1] = -a
  while members[b-1] < 0:
    b = -members[b-1]
    members[b0-1] = -b
  if a != b:
    print(a, b, members[a-1], members[b-1])
    members[a-1] += members[b-1]
    members[b-1] = -a
    if members[a-1] > members[max_idx]:
      max_idx = a-1
print(members[max_idx])

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().rstrip().split(" ")))
members = [1 for i in range(n)]
max_idx = 0
for mm in range(m):
  a0, b0 = list(map(int, input().rstrip().split(" ")))
  a = a0
  b = b0
  while members[a-1] < 0:
    a = -members[a-1]
  while members[b-1] < 0:
    b = -members[b-1]
  members[a0-1] = -a
  members[b0-1] = -b
  if a != b:
    members[a-1] += members[b-1]
    members[b-1] = -a
    if members[a-1] > members[max_idx]:
      max_idx = a-1
print(members[max_idx])

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().rstrip().split(" ")))
friendships = []
l = 0
for mm in range(m):
  a, b = list(map(int, input().rstrip().split(" ")))
  i_a = -1
  i_b = -1
  j_a = -1
  j_b = -1
  for ll in range(l):
    if a in friendships[ll]:
      j_a = friendships[ll].index(a)
      i_a = ll
      break
  for ll in range(l):
    if b in friendships[ll]:
      j_b = friendships[ll].index(b)
      i_b = ll
      break
  if i_a != -1 and i_b != -1:
    if i_a != i_b:
      fb_ls = friendships[i_b]
      for fb in fb_ls:
        friendships[i_a].append(fb)
        del friendships[i_b]
        l -= 1
  elif i_a != -1:
    friendships[i_a].append(b)
  elif i_b != -1:
    friendships[i_b].append(a)
  else:
    l += 1
    friendships.append([a, b])
print(max([len(friendship) for friendship in friendships]))
Problem p02583 (python)

Fixed submission:
n = int(input().rstrip())
edgeList = [int(x) for x in input().rstrip().split(" ")]
cnt = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    if edgeList[i] != edgeList[j]:
      for k in range(j+1, n):
        cnt += (edgeList[i] != edgeList[k] and 
                edgeList[j] != edgeList[k] and 
                edgeList[i] + edgeList[j] > edgeList[k] and 
                edgeList[j] + edgeList[k] > edgeList[i] and 
                edgeList[k] + edgeList[i] > edgeList[j])
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(input().rstrip())
edgeList = sorted([int(_) for _ in input().rstrip().split(" ")])n = int(input().rstrip())
edgeList = [int(_) for _ in input().rstrip().split(" ")]
cnt = 0
for i in range(n):
  for j in range(i+1, n):
    if edgeList[i] != edgeList[j]:
      for k in range(j+1, n):
        cnt += (edgeList[i] != edgeList[k] and 
                edgeList[j] != edgeList[k] and 
                edgeList[i] + edgeList[j] > edgeList[k] and 
                edgeList[j] + edgeList[k] > edgeList[i] and 
                edgeList[k] + edgeList[i] > edgeList[j])
print(cnt)
Problem p02612 (python)

Fixed submission:
n = int(input().rstrip())

print((1000-n)%1000)

Buggy submission (verdict: Runtime Error):
n, k = [int(x) for x in input().strip().split(" ")]
p = 10**9 + 7

num_list = [int(x) for x in input().strip().split(" ")]
num_list = sorted(num_list, reverse = True)
ans = 1
l_idx = 0
r_idx = -1

while True:
  if k >= 2:
    l_prod = num_list[l_idx] * num_list[l_idx+1]
    r_prod = num_list[r_idx] * num_list[r_idx-1]
    if l_prod >= r_prod:
      ans *= l_prod % p
      ans %= p
      l_idx +=2
      k -= 2
    else:
      ans *= r_prod % p
      ans %= p
      r_idx +=2
      k -= 2
  elif k == 1:
    ans *= num_list[l_idx] % p
    ans %= p
    break
  else:
    break
        
if num_list[0] < 0 and k % 2 == 1:
  ans = 1
  for i in range(k):
    ans *= num_list[i]
    ans %= p

print(ans)
Problem p02830 (python)

Fixed submission:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(l):
	n = len(l)
	

N = int(stdin.readline())
s,t = list(map(str, stdin.readline().rstrip().split()))
ans = ''
for i in range(N):
	ans += s[i] + t[i]
print(ans)

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D

from math import *

'''

'''

a,b = list(map(int, input().split()))
print(0)

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from sys import stdin
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''

'''

def solve(a,b):
	g = gcd(a,b)
	return a*b//g

a,b = list(map(int, stdin.readline().rstrip().split()))
ans = solve(a,b)
print(ans)

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D

from math import *

'''

'''

a,b = map(int, input().split())
print(0)
Problem p03160 (python)

Fixed submission:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *
from random import *					# alpha = ascii_lowercase
from sys import stdin
from itertools import *
from collections import Counter			# z = dict(Counter(l))

def jump(l,i,end):
	dp = [0]*len(l)
	if(len(l) == 2):
		return abs(l[0] - l[1])
	dp[1] = abs(l[0] - l[1])
	for i in range(2,len(l)):
		dp[i] = min(abs(l[i] - l[i-2]) + dp[i-2], abs(l[i] - l[i-1]) + dp[i-1])
	return dp[-1]


N = int(stdin.readline())
l = list(map(int, stdin.readline().rstrip().split()))
ans = jump(l,N-1,N-1)
print(ans)

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *
from random import *					# alpha = ascii_lowercase
from sys import stdin
from itertools import *
from collections import Counter			# z = dict(Counter(l))

def solve(l,n,k):
	if(n == 2):
		return abs(l[0] - l[1])
	else:
		dp = [999999999999]*n
		dp[1] = abs(l[0] - l[1])
		for i in range(1,n):
			j = K
			while(j > 0):
				if(i-j < n):
					dp[i] = min(dp[i-j] + abs(l[i] - l[i-j]), dp[i])
				j -= 1
		return dp[-1]


N,K = map(int, stdin.readline().rstrip().split())
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l,N,K)
print(ans)
Problem p03355 (python)

Fixed submission:
s = input()
K = int(input())
 
 
L = []
 
for i in range(1, K+1):
    for j in range(len(s)-i+1):
        L.append(s[j:j+i])
 
M = sorted(list(set(L)))
 
print(M[K-1])

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D
 
def get_all_substrings(input_string):
  length = len(input_string)
  return list([input_string[i:j+1] for i in range(length) for j in range(i,length)])


s = input()
K = int(input())  
l = get_all_substrings(s)
l = sorted(l)
L = []
for i in l:
	if(i not in L):
		L.append(i)
print(L[K-1])
Problem p03389 (python)

Fixed submission:
# ANSHUL GAUTAM
# IIIT-D

A,B,C = map(int, input().split())
m = max(A,B,C)
s = sum((m-A,m-B,m-C))
if(s%2 == 0):
	print(s//2)
else:
	print(s//2 + 2)

Buggy submission (verdict: Runtime Error):
# ANSHUL GAUTAM
# IIIT-D

A,B,C = map(int, input().split())
m = max(A,B,C)
s = sum(m-A,m-B,m-C)
if(s%2 == 0):
	print(s//2)
else:
	print(s//2 + 2)
Problem p02811 (python)

Fixed submission:
K,X = map(int, input().split())

if K*500 >= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
K = int(input())
X = int(input())

if K*500 >= X:
  print("Yes")

Buggy submission (verdict: Runtime Error):
K = int(input())
X = int(input())

if K*500 >= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
K = input()
X = input()

if K*500 >= X:
  print("Yes")
else:
  print("No")
Problem p02691 (python)

Fixed submission:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

po = [0 for i in range(5*(10**5)+1)]
if n-1-a[0] >= 0:
    po[n-1-a[0]] = 1
ans = 0
for i in range(1,n):
    ppo = n-1-i + a[i]
    if ppo > 5*(10**5):
        if n-i-1 - a[i] >= 0:
            po[n-i-1 - a[i]] += 1
        continue
    if ppo >= 0:
        ans += po[ppo]
    if n-i-1 - a[i] >= 0:
        po[n-i-1 - a[i]] += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

a = l()

po = [0 for i in range(2*(10**5)+1)]
if n-1-a[0] >= 0:
    po[n-1-a[0]] = 1
ans = 0
for i in range(1,n):
    ppo = n-1-i + a[i]
    
    if ppo >= 0:
        ans += po[ppo]
    if n-i-1 - a[i] >= 0:
        po[n-i-1 - a[i]] += 1
print(ans)
Problem p02882 (python)

Fixed submission:
import sys,collections as cl,bisect as bs,math 
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

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(int(n))
  return table

def make_divisors(n): #約数列挙
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors




a,b,x = m()

if a * a * b == x:
    print(0)

elif x >= a*a*b/2:
    kkk = 2 * x / (a**2) - b

    on = b - kkk

    k = math.degrees(math.atan(a/on))
    print(90-k)
else:
    kkk = 2*x/(a*b)

    k = math.degrees(math.atan(b/kkk))
    print(k)

Buggy submission (verdict: Runtime Error):
import sys,collections as cl,bisect as bs,math 
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

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(int(n))
  return table

def make_divisors(n): #約数列挙
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors




a,b,x = m()

if x >= a*a*b/2:
    kkk = 2 * x / (a**2) - b

    on = b - kkk

    k = math.degrees(math.atan(a/on))
    print(90-k)
else:
    kkk = 2*x/(a*b)

    k = math.degrees(math.atan(b/kkk))
    print(k)
Problem p02913 (python)

Fixed submission:
import sys,collections as cl,bisect as bs,heapq as hq
input = sys.stdin.readline
sys.setrecursionlimit(100000)
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def search(a,n):
    se = dict()
    data = []
    for i in range(0,len(a)-n+1):
        kkk = a[i:i+n]
        kkk = "".join(kkk)
        if In(kkk,data):
            if se[kkk] <= i-n:
                    return True
        else:
            bs.insort(data,kkk)
            se[kkk] = i
    return False
def solver():
    n = onem()

    s = list(input())
    l = 0
    r = n//2
    for i in range(n):
        mid = -(-(l+r)//2)
        ans = search(s,mid)
        if l == mid:
            break
        if ans:
            l = mid
        else:
            r = mid-1
    print(l)



if __name__ == '__main__':
    solver()

Buggy submission (verdict: Runtime Error):
import sys,collections as cl,bisect as bs , heapq as hq
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k][0] ==  x:
        return True
    else:
        return False

def search(a,n):
    se = dict()
    for i in range(0,len(a)-n+1):
        kkk = a[i:i+n]
        kkk = "".join(kkk)
        if kkk in se:
            if se[kkk][j] <= i-n:
                    return True
        else:
            se[kkk] = i
    return False


n = onem()

s = list(input())
l = 0
r = n//2
while True:
    mid = -(-(l+r)//2)
    ans = search(s,mid)
    if l == mid:
        break
    if ans:
        l = mid
    else:
        r = mid-1
print(l)