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

Fixed submission:
from collections import defaultdict
from collections import deque
from collections import Counter
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,k = readInts()
p = [0]+readInts()
c = [0]+readInts()

ans = -1*float("inf")
for i in range(1,n+1):
	j = p[i]
	t = [0]
	al = set()
	while j not in al:
		t.append(t[-1]+c[j])
		al.add(j)
		j = p[j]
	if t[-1]<=0:
		ans = max(ans, max(t[1:k+1]))
	else:
		kuri =(k-1)//(len(t)-1)
		s = kuri*t[-1]
		re = k -kuri*(len(t)-1)
		ans = max(ans, max(s,s+max(t[:re+1])))

print(ans)

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

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n,k = readInts()
p = [0]+readInts()
c = [0]+readInts()

ans = -1*float("inf")
for i in range(1,n+1):
	j = p[i]
	past[j] = True
	t = [0]
	al = set()
	while j not in al:
		t.append(t[-1]+c[j])
		al.add(j)
		j = p[j]
	if t[-1]<0:
		ans = max(ans, max(t[1:k+1]))
	else:
		kuri = k//(len(t)-1)
		s = kuri*t[-1]
		ans = max(ans, max(s,s+max(t[:k-kuri*(len(t)-1)+1])))

print(ans)
Problem p02657 (python)

Fixed submission:
import math
from collections import deque
from collections import defaultdict

import time

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq

a,b = readInts()

print(a*b)

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

for i in range(x,0,-1):
  j = int(i**0.5)
  if i==j**2:
    print(i)
    exit()

Buggy submission (verdict: Runtime Error):
a

Buggy submission (verdict: Runtime Error):
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():

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

print(a*b)
Problem p02678 (python)

Fixed submission:
import queue

n,m = list(map(int, input().split()))
puted = [0]*(n+1)

ab = [[] for i in range(n+1)]
for i in range(m):
	a,b = list(map(int, input().split()))
	ab[a].append(b)
	ab[b].append(a)

q = queue.Queue()
flg = [-1]*n
flg[0] = 0
q.put(1)

while not q.empty():
	item = q.get()
	for i in ab[item]:
		if puted[i]==0:
			flg[i-1]=item
			q.put(i)
			puted[i]=1

if -1 in flg:
	print("No")
	exit()

print("Yes")
for i in range(1,len(flg)):
	print(flg[i])

Buggy submission (verdict: Runtime Error):
import queue

n,m = list(map(int, input().split()))
puted = [0]*(n+1)

ab = [[] for i in range(n+1)]
for i in range(m):
	a,b = readInts()
	ab[a].append(b)
	ab[b].append(a)

q = queue.Queue()
flg = [-1]*n
flg[0] = 0
q.put(1)

while -1 in flg or q.empty():
	item = q.get()
	for i in ab[item]:
		if puted[i]==0:
			flg[i-1]=item
			q.put(i)
			puted[i]=1

if -1 in flg:
	print("No")
	exit()

print("Yes")
for i in range(1,len(flg)):
	print(flg[i])
Problem p02702 (python)

Fixed submission:
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = reversed(input())

ai = 0
si = 0

p = 2019
countarr = [0]*2019

for i, j in enumerate(s):
	ai = (int(j)*pow(10,i,p))%p
	si = (si+ai)%p
	countarr[si]+=1

res = countarr[0]
for i in range(p):
	c = countarr[i]
	res += c*(c-1)//2

print(res)

Buggy submission (verdict: Runtime Error):
p=d=2019
z=[0]*p
for i,j in enumerate(input()[::-1]):
	d=d+int(j)*pow(10,i,p)
	z[d%p]+=1
r=z[0]
for i in a:
	r+=i*(i-1)//2
print(r)

Buggy submission (verdict: Runtime Error):
p=2019
s,a,d,z=reversed(input()),0,0,[0]*p
for i in range(len(s)):
	d=(d+(int(s[i])*pow(10,i,p)))%p
	z[d]+=1
r=z[0]
for i in range(p):
	r+=z[i]*(z[i]-1)//2
print(r)

Buggy submission (verdict: Runtime Error):
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = reversed(input())

ai = 0
si = [0]*len(s)

p = 2019

for i, j in enumerate(s):
	ai = (int(j)*pow(10,i,p))%p
	si[i] = (si[i-1]+ai)%p
countarr = [0]*2019
for i in si:
	countarr[i]+=1

res = countarr[0]
for i in range(p):
	c = countarr[i]
	res += c*(c-1)//2

print(res)

Buggy submission (verdict: Runtime Error):
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = reverse(input())

ai = [0]*len(s)
si = [0]*len(s)

p = 2019

for i in range(len(s)):
	ai[i] = (int(s[i])*pow(10,i))%p
	si[i] = sum(ai[:i+1])%p
countarr = [0]*2019
for i in si:
	countarr[i]+=1

res = countarr[0]
for i in range(p):
	c = countarr[i]
	res += c*(c-1)//2

print(res)

Buggy submission (verdict: Runtime Error):
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = input().reverse()

ai = [0]*len(s)
si = [0]*len(s)

p = 2019
ee = 0
for i in range(len(s)):
	ee = (int(s[i])*pow(10,i))%p

Buggy submission (verdict: Runtime Error):
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = input().reverse()

ai = [0]*len(s)
si = [0]*len(s)

p = 2019

for i in range(len(s)):
	(int(s[i])*pow(10,i))%p

Buggy submission (verdict: Runtime Error):
import math

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()

s = input()

ai = [0]*len(s)
si = [0]*len(s)

p = 2019

for i in range(len(s)):
	ai[i] = (int(s[-1*i-1])
Problem p02708 (python)

Fixed submission:
import math
import queue

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()



x = readInts()
n = x[0]
k = x[1]

def ts(l):
	return int((l*(l-1))/2)

def ts2(l):
	return int(l*(n+n-(l-1))/2)


#for i in range(k,n):
#	for j in range(0,n-i+1):
#iは個数

#a = range(0+1,n+n-1 +1) #2
#b = range(0+1+2,n+n-1+n-2 +1) #3

s = 0

for i in range(k,n+2):
	#x = range(ts(i),ts2(i)+1)
	#print(ts2(i)+1-ts(i))
	#print(x)
	s += ts2(i)+1-ts(i)

print(s%(1000000007))

Buggy submission (verdict: Runtime Error):
n,k,s=list(map(int,input().split())),0
for i in range(k,n+2):
	s+=i*(n+n-(i-1))//2+1-(i*(i-1))//2
print(s%(1000000007))

Buggy submission (verdict: Runtime Error):
n,k,s=input(),input(),0
for i in range(k,n+2):
	s+=i*(n+n-(i-1))//2+1-(i*(i-1))//2
print(s%(1000000007))

Buggy submission (verdict: Runtime Error):
n,k=list(map(int,input().split()))
for i in range(k,n+2):
	s+=i*(n+n-(i-1))//2+1-(i*(i-1))//2
print(s%(1000000007))
Problem p02713 (python)

Fixed submission:
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)

K = readInt()
d = defaultdict(int)
ans=0
for a in range(1,K+1):
	for b in range(1,K+1):
		x = math.gcd(a,b)
		for c in range(1,K+1):
			ans+=math.gcd(x,c)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=q
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)

K = readInt()
d = defaultdict(int)
ans=0
for a in range(1,K+1):
	for b in range(1,K+1):
		x = gcd(a,b)
		for c in range(1,K+1):
			ans+=gcd(x,c)

print(ans)
Problem p02720 (python)

Fixed submission:
def jud(n1,n2):
	if abs(n1-int(str(n2)[0]))<=1:
		return 1
	else:
		return 0

rnrn = [[1,2,3,4,5,6,7,8,9],[10,11,12,21,22,23,32,33,34,43,44,45,54,55,56,65,66,67,76,77,78,87,88,89,98,99]]

for div in range(1,10):
	rnrn.append([])
	for i in range(len(rnrn[div])):
		y = str(rnrn[div][i])
		x = int(y[-1])
		if x-1!=-1:
			rnrn[div+1].append(int(y+str(x-1)))
		rnrn[div+1].append(int(y+str(x)))
		if x+1!=10:
			rnrn[div+1].append(int(y+str(x+1)))
		
rnrn2 = []
for i in range(len(rnrn)):
	rnrn2.extend(rnrn[i])

print(rnrn2[int(input())-1])

Buggy submission (verdict: Runtime Error):
import math
import queue

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()


q = queue.Queue()

for i in range(1,9):
	q.put(i)

n = readInt()

for i in range(1,100000):
	a = str(q.get())
	if a[-1]!=0:
		q.put(int(a + str( int(a[-1])-1)))
	q.put(int(a+str(str(int(a[-1])))))
	if a[-1]!=9:
		q.put(int(a+str(int(a[-1])+1)))	
	if i==n:
		print(q.get())
		break

Buggy submission (verdict: Runtime Error):
import math
import queue

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()


q = queue.Queue()

for i in range(1,9):
	q.put(i)

n = readInt()

for i in range(1,100000):
	a = str(q.get())
	if a[-1]!=0:
		q.put(int(a+str(int(a[-1])-1)))
	q.put(int(a+str(str(int(a[-1])))))
	if a[-1]!=9:
		q.put(int(a+str(int(a[-1])+1)))	
	if i==n:
		print(q.get())
		break
Problem p02888 (python)

Fixed submission:
import bisect

n = int(input())
d = list(map(int, input().split()))
d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		m+=bisect.bisect_left(d,d[a]+d[b])-1-b

print(m)

Buggy submission (verdict: Runtime Error):
import bisect

n = int(input())
d = list(map(int, input().split()))
d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		m+=bisect.bisect_left(d,d[a]+d[b])-1-j

print(m)

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

d = list(map(int, input().split()))

d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		for c in range(b+1,n):
			if d[c]<d[b]+d[a]:
				m += 1
				if d[c]==d[a]:
                  m -= 1
			else:
				break

print(m)

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

d = list(map(int, input().split()))

d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		for c in range(b+1,n):
			if d[c]<d[b]+d[a]:
				m += 1
				if d[c]==d[a]:
				m -= 1
			else:
				break

print(m)

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

d = list(map(int, input().split()))

d.sort()

m = 0

for a in range(n-2):
	for b in range(a+1,n-1):
		for c in range(b+1,n):
			if d[c]<d[b]+d[a]:
				m += 1
				if d[c]==d[a]:
				m -= 1
			else:
				break

print(m)
Problem p02921 (python)

Fixed submission:
x = list(input())
y = list(input())
i = 0
for n in range(3):
	if x[n] == y[n]:
		i += 1

print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(round(format((n)*(n-1)/2,"f")))

Buggy submission (verdict: Runtime Error):
x = input().split("")
y = input().split("")
i = 0
for n in range(3):
	if x[n] == y[n]:
		i += 1

print(i)
Problem p02922 (python)

Fixed submission:
x = input().split(" ")
a = int(x[0])
b = int(x[1])

c = 0
while True:
	if 1-c+a*c >= b:
		print(c)
		break
	c += 1

Buggy submission (verdict: Runtime Error):
a,b = map(int. input().split())
print((b-0.1)//a+1)
Problem p02923 (python)

Fixed submission:
n = int(input())
h = list(map(lambda x: int(x), input().split(" ")))

ans = 0

kari = 0
i = 0
for m in range(0,n-1):
	if h[m] >= h[m+1]:
		kari += 1
	else:
		kari = 0
	if ans < kari:
		ans = kari



print(ans)

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

print((n-1)(n-2)/2)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(lambda x: int(x), input().split(" ")))

ans = []

for i in range(0,n):
	kari = 0
	j = i
	while h[j] >= j[j+1] and j<n-1:
		kari += 1
		j += 1
	ans.append(kari)

print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(lambda x: int(x), input().split(" ")))

ans = []

for i in range(0,n):
	kari = 0
	for j in range(i,n-1):
		if h[j] < h[j+1]:
			break
		kari += 1
	ans.appened(kari)

print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(lambda x: int(x), input().split(" ")))

ans = 0

for i in range(0,n):
	kari = 0
	for j in range(i,n):
		if h[j] < h[j+1]:
			break
		kari += 1
	if ans < kari:
		ans = kari

print(ans)

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

ans = 0

for i in range(0,n):
	kari = 0
	for j in range(i,n):
		if h[j] < h[j+1]:
			break
		kari += 1
	if ans < kari:
		ans = kari

print(ans)
Problem p02924 (python)

Fixed submission:
from collections import defaultdict
import bisect

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()


n = readInt()
print(n*(n-1)//2)

Buggy submission (verdict: Runtime Error):
n = int(input())
print(round(format((n)*(n-1)/2,"f")))

Buggy submission (verdict: Runtime Error):
n = int(input())
print(format((n)*(n-1)/2,f))

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

print((n-1)(n-2)/2)
Problem p02969 (python)

Fixed submission:
x = int(input())
print(3*x*x)

Buggy submission (verdict: Runtime Error):
x = int(input())
print(a*x*x)

Buggy submission (verdict: Runtime Error):
x = input()
print(a*x*x)
Problem p02971 (python)

Fixed submission:
import copy

data = []
i = int(input())

data = [int(input()) for _n in range(i)]
maxInt = max(data)
data2 = copy.copy(data)
data2.remove(maxInt)
max2Int = max(data2)
for n in range(i):
	if maxInt != data[n]:
		print(maxInt)
	else:
		print(max2Int)

Buggy submission (verdict: Runtime Error):
data = []
res = []

data = [int(input()) for _n in range(int(input()))]

for n in range(i):
	res.append(max(data[0:n]+data[n+1:]))

for item in res:
	print(item)
Problem p03001 (python)

Fixed submission:
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

w,h,x,y = readInts()

if x==w/2 and y==h/2:
	d = 1
else:
	d = 0

print(w*h/2,d)

Buggy submission (verdict: Runtime Error):
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()

d = Counter(readInts())

d = [i for i in sorted(d.items(), reverse=True) if i[1]>=2]

if len(d)==0:
	print(0)
	exit()
elif len(d)==1:
	if d[0][1]>=4:
		pass
	else:
		print(0)
		exit()
if d[0][1]>=4:
	print(int(d[0][0])**2)
else:
	print(int(d[0][0])*int(d[1][0]))
Problem p03035 (python)

Fixed submission:
x = list(map(lambda y: int(y),input().split(" ")))

if x[0] >= 13:
	print(x[1])
elif x[0] >= 6:
	print(int(x[1]/2))
else:
	print(0)

Buggy submission (verdict: Runtime Error):
data = list(map(lambda x: int(x),input().split(" ")))

cardNum = []

for n in range(data[1]):
	cardNum.append(list(map(lambda x: int(x),input().split(" "))))


card = [0]*(data[0])

check = [0,1000000]

for n in range(data[1]):
	if check[0] < cardNum[n][0]:
		check[0] = cardNum[n][0]
	if check[1] > cardNum[n][1]:
		check[1] = cardNum[n][1]

print(check[1]-check[0]+1)
Problem p03131 (python)

Fixed submission:
from collections import defaultdict
from collections import deque
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

k,a,b = readInts()

if a+1<=k and a+2<b:
	k-=a+1
	ans=k//2*(b-a)+k%2+b
else:
	ans = k+1

print(ans)

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

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

k,a,b = readInts()

if a+1<=k and a+2<b:
	k-=a+1
	ans+=k//2*(b-a)+k%2+b
else:
	ans = k+1

print(ans)
Problem p03323 (python)

Fixed submission:
x = list(map(lambda y: int(y),input().split(" ")))

if x[0]<9 and x[1]<9:
	print("Yay!")
else:
	print(":(")

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

print(x)

print("Hello World!")

Buggy submission (verdict: Runtime Error):
print('Hello World!'')

Buggy submission (verdict: Runtime Error):
4444
1111
aaaa
a
a
a
a
a
a
print('Hello World!'')

Buggy submission (verdict: Runtime Error):
4444
1111
aaaa
a
a
a
a
a
a

Buggy submission (verdict: Runtime Error):
4545454
5455454
4
4545
44444444444444444444444444440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

0000000000044444

Buggy submission (verdict: Runtime Error):
ｈｈｈ
Problem p03324 (python)

Fixed submission:
from collections import defaultdict
def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

d,n = readInts()

if d==0:
  if n==100:
    print(101)
  else:
    print(n)
elif d==1:
  if n==100:
    print(10100)
  else:
    print(n*100)
else:
  if n==100:
    print(1010000)
  else:
    print(n*10000)

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

print(x)

print("Hello World!")
Problem p03373 (python)

Fixed submission:
import math
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1

a,b,c,x,y = readInts()

ans = 1000000000000000000
for i in range(0,x+1):
	B = max(y-(x-i),0)
	AB = max(2*(x-i),0)
	money = i*a+B*b+AB*c
	ans = min(ans,money)

for i in range(0,y+1):
	A = max(x-(y-i),0)
	AB = max(2*(y-i),0)
	money = A*a+b*i+AB*c
	ans = min(ans,money)

for i in range(0,max(x,y)*2+1,2):
	A = max(x - i//2,0)
	B = max(y - i//2,0)
	money = A*a+B*b+i*c
	ans = min(ans,money)

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=readInts()
for i in range(max(x,y)*2+1,2):
	ans=min(ans,max(x-i//2,0)*a+max(y-i//2,0)*b+i*c)
print(ans)