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

Fixed submission:
import sys
sys.setrecursionlimit(200100)

def abc157_d():
    N, M, K = map(int, input().split())
    fr = [set() for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        fr[a].add(b)
        fr[b].add(a)
    bl = []
    for _ in range(K):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        bl.append((c,d))

    def dfs(nd, lb):
        nonlocal label, gr
        label[nd] = lb
        gr[lb] += 1
        for ch in fr[nd]:
            if label[ch] != -1: continue
            dfs(ch, lb)

    ans = [0] * N
    label = [-1] * N
    lb = 0
    gr = []
    for i in range(N):
        if label[i] != -1:
            ans[i] = gr[label[i]]
            continue
        gr.append(0)
        dfs(i, lb)
        ans[i] = gr[label[i]]
        lb += 1

    for c, d in bl:
        if label[c] == label[d]:
            ans[c] -= 1
            ans[d] -= 1

    for i in range(N):
        ans[i] -= len(fr[i]) + 1

    print(*ans, sep=' ')

abc157_d()

Buggy submission (verdict: Runtime Error):
def abc157_d():
    N, M, K = map(int, input().split())
    fr = [set() for _ in range(N)]
    bl = [set() for _ in range(N)]
    for _ in range(M):
        a, b = map(int, input().split())
        a, b = a-1, b-1
        fr[a].add(b)
        fr[b].add(a)
    for _ in range(K):
        c, d = map(int, input().split())
        c, d = c-1, d-1
        bl[c].add(d)
        bl[d].add(c)

    def dfs(nd, lb):
        nonlocal label, gr
        label[nd] = lb
        gr[lb].add(nd)
        for ch in fr[nd]:
            if label[ch] != -1: continue
            dfs(ch, lb)

    label = [-1] * N
    lb = 0
    gr = []
    for i in range(N):
        if label[i] != -1: continue
        gr.append(set())
        dfs(i, lb)
        lb += 1

    ans = [0] * N
    for i in range(N):
        cand = gr[label[i]] - fr[i] - bl[i]
        ans[i] = len(cand) - 1
    print(*ans, sep=' ')

abc157_d()
Problem p02792 (python)

Fixed submission:
from collections import defaultdict

def abc152_d():
    N = int(input())
    freq = defaultdict(int)
    for i in range(1, N+1):
        s = str(i)
        freq[(s[0], s[-1])] += 1  # (先頭,末尾) となる個数を数える

    ans = 0
    for i in range(1, N+1):
        s = str(i)
        ans += freq[(s[-1], s[0])]  # ペアになる (末尾, 先頭) の個数を足していく
    print(ans)

abc152_d()

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

def diverta192_b():
    N = int(input())
    P = [tuple(map(int, input().split())) for _ in range(N)]
    if len(P) == 1:
        print(1)  # 座標が1つだけ与えられる場合は即終了
        return

    dcnt = defaultdict(int)  # import忘れずに
    for i in range(N):
        xi, yi = P[i]
        for j in range(i):
            xj, yj = P[j]
            dcnt[(xi-xj, yi-yj)] += 1
            dcnt[(xj-xi, yj-yi)] += 1  # 逆向きもカウントする(都合よいほうを使う)
    most = sorted(dcnt.values(), reverse=True)[0]  # 最も多いカウントを取り出す
    ans = N - most
    print(ans)

diverta192_b()
Problem p02862 (python)

Fixed submission:
# D - Knight

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

a = (2*Y - X) / 3
b = (2*X - Y) / 3

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] % mod * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

if a%1 != 0 or b%1 != 0:
    print(0)
else:
    ans = cmb(int(a+b), int(min(a,b)), mod)
    print(ans)

Buggy submission (verdict: Runtime Error):
# D - Knight

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

a = (2*Y - X) / 3
b = (2*X - Y) / 3

import math

if a%1 != 0 or b%1 != 0:
    print(0)
else:
    a = int(a)
    b = int(b)
    # 最短経路の数 nCr
    ans = (math.factorial(a + b) // (math.factorial(a) * math.factorial(b))) % (10**9 + 7)

    print(ans)
Problem p02897 (python)

Fixed submission:
def q_A(N):
	kisuu = 0
	for i in range(N):
		n = i + 1
		if n % 2 == 1:
			kisuu += 1
	density = kisuu / N
	print(density)

#q_A(1)
q_A(int(input()))

Buggy submission (verdict: Runtime Error):
# D - Disjoint Set of Common Divisors
A, B = map(int, input().split())

from fractions import gcd

# nの素数判定
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

# nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass #sortされていない

ans = 0
gcd1 = gcd(A, B)
for i in divisor(gcd1):
    if is_prime(i):
        ans += 1

print(ans+1)
Problem p03017 (python)

Fixed submission:
N, A, B, C, D = map(int, input().split())
S = str(input())

Sarr = [True if s == '.' else False for s in S]
#print(Sarr)

def canmove(st):
  global N, Sarr
  can = [False] * N
  can[st-1] = True
  for i in range(st, N):
    if Sarr[i]:
      if can[i-1] or can[i-2]:
        can[i] = True
  return can

Acan = canmove(A)
Bcan = canmove(B)
#print(Acan)
#print(Bcan)

ans = Acan[C-1] and Bcan[D-1]
#print(ans)

def canpass(st, ed):
  global Sarr
  for i in range(st, ed-1):
    if Sarr[i] and Sarr[i+1] and Sarr[i+2]:
      return True
  return False

if C > D:
  ans = ans and canpass(B-2, D)
#print(ans)

if ans:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N, A, B, C, D = map(int, input().split())
S = str(input())

Sarr = [True if s == '.' else False for s in S]
#print(Sarr)

def canmove(st):
  global N, Sarr
  can = [False] * N
  can[st-1] = True
  for i in range(st, N):
    if Sarr[i]:
      if can[i-1] or can[i-2]:
        can[i] = True
  return can

Acan = canmove(A)
Bcan = canmove(B)
#print(Acan)
#print(Bcan)

ans = Acan[C-1] and Bcan[D-1]
#print(ans)

def canpass(st, ed):
  global Sarr
  for i in range(st, ed-1):
    if Sarr[i] and Sarr[i+1] and Sarr[i+2]:
      return True
  return False

if C > D:
  ans = ans and canpass(B-1, D+1)
#print(ans)

if ans:
  print('Yes')
else:
  print('No')
Problem p03053 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import deque

def agc033_a():
    H, W = map(int, readline().split())
    dist = [[-1] * W for _ in range(H)]
    que = deque()
    for i, ln in enumerate(read().split()):
        for j, c in enumerate(ln.strip().decode('UTF-8')):
            if c == '#':
                que.append((i, j))
                dist[i][j] = 0

    while que:
        x, y = que.popleft()
        for i, j in ((x-1, y), (x, y-1), (x, y+1), (x+1, y)):
            if i < 0 or H-1 < i or j < 0 or W-1 < j: continue
            if dist[i][j] != -1: continue
            dist[i][j] = dist[x][y] + 1
            que.append((i, j))

    ans = 0
    for row in dist:
        ans = max(max(row), ans)
    print(ans)

agc033_a()

Buggy submission (verdict: Runtime Error):
import math
def agc033_a():
  h, w = map(int, input().split())
  grid = [[s for s in str(input())] for _ in range(h)]

  # 黒マスからの距離(#は0)
  dist = [[math.inf] * w for _ in range(h)]
  for i in range(h):
    for j in range(w):
      if grid[i][j] == '#':
        dist[i][j] = 0

  def ask_dist(i, j):
    adj = math.inf
    if 0 < i: adj = min(adj, dist[i-1][j])
    if i < h-1: adj = min(adj, dist[i+1][j])
    if 0 < j: adj = min(adj, dist[i][j-1])
    if j < w-1: adj = min(adj, dist[i][j+1])
    if adj != math.inf:
      return adj + 1
    else:
      return math.inf

  # 1往復したら距離確定する？？ TLEするかも？？
  d_max = 0
  for i in range(h):
    for j in range(w):
      if dist[i][j] != math.inf: continue
      d_tmp = ask_dist(i, j)
      if d_tmp != math.inf:
        dist[i][j] = d_tmp
        d_max = max(d_max, d_tmp)
  for i in range(h-1, -1, -1):
    for j in range(w-1, -1, -1):
      if dist[i][j] != math.inf: continue
      d_tmp = ask_dist(i, j)
      if d_tmp != math.inf:
        dist[i][j] = d_tmp
        d_max = max(d_max, d_tmp)
  print(d_max)

agc033_a()
Problem p03634 (python)

Fixed submission:
def abc070_d():
    import sys
    sys.setrecursionlimit(10010010)
    read = sys.stdin.buffer.read
    inp = iter(map(int, read().split()))

    n = next(inp)
    adjlist = [[] for _ in range(n)]
    for _ in range(n-1):
        a = next(inp) - 1
        b = next(inp) - 1
        c = next(inp)
        adjlist[a].append((b, c))
        adjlist[b].append((a, c))

    q = next(inp)
    k = next(inp) - 1

    dist = [-1] * n

    def dfs(x:int, d:int):
        dist[x] = d
        for nx, nd in adjlist[x]:
            if dist[nx] != -1: continue
            dfs(nx, d + nd)

    dfs(k, 0)

    for _ in range(q):
        x = next(inp) - 1
        y = next(inp) - 1
        ans = dist[x] + dist[y]
        print(ans)

if __name__ == '__main__':
    abc070_d()

Buggy submission (verdict: Runtime Error):
def abc070_d():
    import sys
    read = sys.stdin.buffer.read
    inp = iter(map(int, read().split()))

    import numpy as np
    from scipy.sparse import csr_matrix
    from scipy.sparse.csgraph import dijkstra

    n = next(inp)
    adjmtx = np.zeros((n, n), dtype=np.int32)
    for _ in range(n-1):
        a = next(inp) - 1
        b = next(inp) - 1
        c = next(inp)
        adjmtx[a, b] = c
        adjmtx[b, a] = c

    q = next(inp)
    k = next(inp) - 1

    graph = csr_matrix(adjmtx)
    dist = dijkstra(csgraph=graph, indices=k)
    eps = 1e-6

    for _ in range(q):
        x = next(inp) - 1
        y = next(inp) - 1
        ans = int(dist[x] + dist[y] + eps)
        print(ans)

if __name__ == '__main__':
    abc070_d()

Buggy submission (verdict: Runtime Error):
def abc070_d():
    import sys
    read = sys.stdin.buffer.read
    inp = iter(map(int, read().split()))

    import numpy as np
    from scipy.sparse import csr_matrix
    from scipy.sparse.csgraph import dijkstra

    n = next(inp)
    adjmtx = np.zeros((n, n), dtype=np.int64)
    for _ in range(n-1):
        a = next(inp) - 1
        b = next(inp) - 1
        c = next(inp)
        adjmtx[a, b] = c
        adjmtx[b, a] = c

    q = next(inp)
    k = next(inp) - 1

    graph = csr_matrix(adjmtx)
    dist = dijkstra(csgraph=graph, indices=k)
    eps = 1e-6

    for _ in range(q):
        x = next(inp) - 1
        y = next(inp) - 1
        ans = int(dist[x] + dist[y] + eps)
        print(ans)

if __name__ == '__main__':
    abc070_d()

Buggy submission (verdict: Runtime Error):
def abc070_d():
    import sys
    read = sys.stdin.buffer.read
    inp = iter(map(int, read().split()))

    import numpy as np
    from scipy.sparse import csr_matrix
    from scipy.sparse.csgraph import dijkstra

    n = next(inp)
    adjmtx = np.zeros((n, n), dtype=np.int64)
    for _ in range(n-1):
        a = next(inp) - 1
        b = next(inp) - 1
        c = next(inp)
        adjmtx[a, b] = c
        adjmtx[b, a] = c

    q = next(inp)
    k = next(inp) - 1

    graph = csr_matrix(adjmtx)
    dist = dijkstra(csgraph=graph, indices=k)

    for _ in range(q):
        x = next(inp) - 1
        y = next(inp) - 1
        ans = int(dist[x] + dist[y])
        print(ans)

if __name__ == '__main__':
    abc070_d()
Problem p02933 (python)

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

if a>=3200: print(s)
else: print("red")

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

if a>=3200: print(s)
else: print("red")
Problem p02935 (python)

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

v.sort()
ans=(v[0]+v[1])/2

for i in range(2,n):
  ans=(ans+v[i])/2

print(ans)

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

v.sort()
dif=[v[i+1]-v[i] for i in range(n-1)]

while len(v)>2:
  i=dif.index(min(dif))
  v[i]=(v[i]+v.pop(i+1))/2
  dif.pop(i)
  dif[i]=v[i+1]-v[i]
  if i!=0: dif[i-1]=v[i]-v[i-1]

print((v[0]+v[1])/2)
Problem p02572 (python)

Fixed submission:
def solve():
  N = int(input())
  AA = list(map(int,input().split()))
 
  ans = 0
  for a in AA:
    ans += a
  ans = ans**2
  for a in AA:
    ans -= a**2
  ans = ans//2
  print(ans%(10**9+7))
solve()

Buggy submission (verdict: Runtime Error):
def solve():
  N = int(input())
  AA = list(map(int,input().split()))
 
  ans = 0
  for a in AA:
    ans += a
  ans = ans**2
  for a in AA:
    ans -= a**2
  ans = ans//2
  print(ans%(10**9+7)
solve()
Problem p02771 (python)

Fixed submission:
nums = input().rstrip().split(" ")
n1 = int(nums[0])
n2 = int(nums[1])
n3 = int(nums[2])
if n1 == n2 and n2 == n3 and n1 == n3:
  print("No")
elif n1 != n2 and n2 != n3 and n1 != n3:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
if A==B:
  if A!=C:
    print('Yes')
  else:
    print('No')
else:
  if A==C:
    print('Yes')
  elif B==C:
    print('Yes')
  else:
    print('No')
Problem p02577 (python)

Fixed submission:
n=input()
s=0
for i in n:
  s+=int(i)
  s=s%9
if s%9==0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
s=0
for i in n:
  s+=int(i)
  s=s%9
if s%9==0:
  print(Yes)
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n=input()
s=0
for i in n:
  s+=int(i)
if s%9==0:
  print(Yes)
else:
  print("No")
Problem p02699 (python)

Fixed submission:
s, w = map(int, input().split())

print("unsafe") if (s <= w) else print("safe")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
attack = True
win = True

while a < 0 | c < 0:
	if attack:
		c -= b
		attack = False
	else:
		a -= d
		attack = True
		if a < 0:
			win = False
            
print("Yes") if win else print('No')

Buggy submission (verdict: Runtime Error):
a, b, c ,d = map(int, input().split())
attack = True
win = True

while True:
	if attack:
		c -= b
		attack = False
		if c < 0:
			break
	else:
		a -= d
		attack = True
		if a < 0:
			win = False 
			break


print("Yes") if win else print('No')

Buggy submission (verdict: Runtime Error):
a, b, c ,d = map(int, input().split())
attack = True
win = True

while True:
	if attack:
		c -= b
		attack = False
		if c < 0:
			break
	else:
		a -= d
		attack = True
		if a < 0:
			win = False 
			break


print("Yes") if win else print('No')
Problem p02659 (python)

Fixed submission:
import math
A,B = input().split()
A = int(A)
B = B.replace(".","")
 
B = int(B)
print(math.floor(A*B//100))

Buggy submission (verdict: Runtime Error):
A,B = input().split()
A = int(A)
B = replace(".","")

B = int(B) * 100

print(A*B/100)
Problem p02779 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
    if (A[i] in dic) == True:
        print("NO")
        exit()
    dic[A[i]] = "exist"
print("YES")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
cnt = [0]* (max(A)+1)
for i in range(N):
    if cnt[A[i]] == 0:
        cnt[A[i]] = 1
    else:
        print("NO")
        exit()
print("YES")
Problem p02831 (python)

Fixed submission:
import math
import fractions
a,b = map(int,input().split())

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

print(lcm(a, b))

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))
Problem p02881 (python)

Fixed submission:
import math
N = int(input())
N_sqrt = int(math.sqrt(N))

for i in range(1,N_sqrt+1):
    if N % i == 0:
        x = i
        y = int(N/i)

print(x+y-2)

Buggy submission (verdict: Runtime Error):
import math
N = int(input())
N_sqrt = int(math.sqrt(N))

for i in range(1,N_sqrt):
    if N % i == 0:
        x = i
        y = int(N/i)

print(x+y-2)
Problem p03127 (python)

Fixed submission:
import fractions

N = int(input())
A = list(map(int,input().split()))

# ユークリッドの互除法
# 全体の最小公約数 = 最小値
min_life = fractions.gcd(A[0],A[1])

for i in range(1,N):
    min_life = fractions.gcd(min_life,A[i])

print(min_life)

Buggy submission (verdict: Runtime Error):
import math

N = int(input())
A = list(map(int,input().split()))

# ユークリッドの互除法
# 全体の最小公約数 = 最小値
min_life = math.gcd(A[0],A[1])

for i in range(1,N):
    min_life = math.gcd(min_life,A[i])

print(min_life)
Problem p03242 (python)

Fixed submission:
n=input()
l=[]

for i in n:
	if i=='9':
		l.append('1')
	elif i=='1':
		l.append('9')
	else:
		l.append(i)

print(''.join(l))

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

l=list(map(int,input().split()))
l1=[]
l2=[]

for i in range(n):
	if i%2==0:
		l1.append(l[i])
	else:
		l2.append(l[i])

count1=[]
count2=[]

for i in range(100000):
	count1.append(0)
	count2.append(0)

for i in range(n//2):
	count1[l1[i]-1]+=1
	count2[l2[i]-1]+=1

max1=0
max2=0

maxc1=[]
maxc2=[]

for i in range(100000):
	if count1[i]>=max1:
		max1=count1[i]
		maxc1.append(i)

	if count2[i]>=max2:
		max2=count2[i]
		maxc2.append(i)

# print('maxc1',maxc1)
# print('maxc2',maxc2)
# print('max1',max1)
# print('max2',max2)

# if len(maxc2)+len(maxc1)>2 or (len(maxc2)+len(maxc1)==2 and maxc1[0]!=maxc2[0]):
# 	final=max1+max2

# else :
max3=0
max4=0
for i in range(100000):
	if i!=maxc1[0]:
		if count1[i]>=max3:
			max3=count1[i]
			maxc1.append(i)

	if i!=maxc2[0]:
		if count2[i]>=max4:
			max4=count2[i]
			maxc2.append(i)

final=max(max1+max4,max2+max3)

print(n-final)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

ans = [1, 2, 3]
ans.remove(a)
ans.remove(b)

print(ans[0])

Buggy submission (verdict: Runtime Error):
python src/train.py --dataset cifar10 --comet --ct 0.5 --at 0.5
Problem p02831 (python)

Fixed submission:
a, b = [int(i) for i in input().split()]

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

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
a, b = [int(i) for i in input().split()]

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

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

print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
import math

a, b = [int(i) for i in input().split()]

print(a * b // math.gcd(a, b))

Buggy submission (verdict: Runtime Error):
import math

a, b = [int(i) for i in input().split()]

print(math.gcd(a, b))
Problem p02916 (python)

Fixed submission:
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

counter = 0
for i in range(N):
    # print(i)
    num = A[i] - 1
    counter += B[num]
    # print('Add:', B[num])
    if i != 0 and num - 1 == A[i-1] - 1:
        counter += C[num-1]
        # print('Add:', C[num-1])
    # print('')
print(counter)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

counter = 0
for i in range(N):
    counter += B[i]
    if i != 0 and A[i] - 1 == A[i-1]:
        counter += C[i]
print(counter)
Problem p02984 (python)

Fixed submission:
n = int(input())
A = [int(a) for a in input().split()]

x = 0
rains = [x]
for a in A:
    x = a - x
    rains.append(x)

diff = (rains[-1] - rains[0]) // 2
result = []
for i, x in enumerate(rains[:-1]):
    if i % 2 == 0:
        result.append(str((x + diff) * 2))
    else:
        result.append(str((x - diff) * 2))

print(' '.join(result))

Buggy submission (verdict: Runtime Error):
l, r = [int(i) for i in input().split()]

base = 2019
l_mod = l % base
r_mod = r % base

print(l_mod * (l_mod + 1))
Problem p02571 (python)

Fixed submission:
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    S = input()
    T = input()

    numdic = [0]*(100000)
    for i in range(len(S)+1-len(T)):
        small = S[i:i+len(T)]
        same = 0
        for s in range(len(T)):
            if small[s] == T[s]:
                same += 1
        numdic[i] = same

    ans = len(T) - max(numdic)
    print(ans)




if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    S = input()
    T = input()

    numdic = [0]*(len(T)+1)
    for i in range(len(S)+1-len(T)):
        small = S[i:i+len(T)]
        same = 0
        for s in range(len(T)):
            if small[s] == T[s]:
                same += 1
        numdic[i] = same

    ans = len(T) - max(numdic)
    print(ans)




if __name__ == '__main__':
    solve()
Problem p02623 (python)

Fixed submission:
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N, M, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    B = list(map(int, readline().split()))


    nowtime = 0

    Asum = [0]
    Bsum = [0]
    tmp = 0
    for a in A:
        tmp += a
        Asum.append(tmp)
    tmp = 0
    for b in B:
        tmp += b
        Bsum.append(tmp)

    maxbooks = 0
    before = M
    bcount = M
    for acount in range(N+1):
        if Asum[acount] > K:
            continue
        while K < Asum[acount] + Bsum[bcount]:
            bcount -= 1
        maxbooks = max(maxbooks, acount+bcount)

    print(maxbooks)



if __name__ == '__main__':
    solve()

Buggy submission (verdict: Runtime Error):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    N, M, K = map(int, readline().split())
    A = list(map(int, readline().split()))
    B = list(map(int, readline().split()))


    nowtime = 0

    Asum = []
    Bsum = []
    tmp = 0
    for a in A:
        tmp += a
        Asum.append(tmp)
    tmp = 0
    for b in B:
        tmp += b
        Bsum.append(tmp)

    maxbooks = 0
    for acount in range(N):
        for bcount in range(before, M):
            if K < Asum[acount] + Bsum[bcount]:
                acount -= 1
                break
        maxbooks = max(maxbooks, acount+bcount)

    print(maxbooks)

    print(acount+bcount-1)



if __name__ == '__main__':
    solve()
Problem p02659 (python)

Fixed submission:
a,b=map(str,input().split())
a=int(a)
b = b[0]+b[2:]
b = int(b)
ans = a*b
ans = str(ans)
if len(ans)>=3:
    ans = ans[:-2]
    ans = int(ans)
else:
    ans = 0
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(str,input().split())
a=int(a)
b = b[0]+b[2:]
b = int(b)
ans = a*b
ans = str(ans)
ans = ans[:-2]
ans = int(ans)
print(ans)