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

Fixed submission:
n,r=map(int,input().split())
rate=0
if n<10:
    print(r+100*(10-n))
else:
    print(r)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
x=np.fromstring(input(),int,sep=' ')
p=0
hoge=np.inf
for i in range(1,np.max(x)+1):
    sux=sum((x-i)**2)
    if sux<hoge:
        p=i
        hoge=sux
print(hoge)

Buggy submission (verdict: Runtime Error):
import numpy as np
n=int(input())
x=np.fromstring(input(),int,sep=' ')
print(x)
p=0
hoge=np.inf
for i in range(1,np.max(x)+1):
    sux=sum((x-i)**2)
    if sux<hoge:
        p=i
        hoge=sux
print(hoge)
Problem p03087 (python)

Fixed submission:
n,q=map(int,input().split())
text=input()
sum_=[]
count=0
for i in range(n):
    if text[i-1]=='A' and text[i]=='C':
        count+=1
    sum_.append(count)
for i in range(q):
    l,r=map(int,input().split())
    print(sum_[r-1]-sum_[l-1])

Buggy submission (verdict: Runtime Error):
tg="AC"
n,q=map(int,input().split())
text=input()
ans=[]

def check():
    l,r=map(int,input().split())
    text_=text[l-1:][:r-1]
    count=re.findall(tg,text_)
    ans.append(len(count))
    
for i in range(q):
    check()

for i in ans:
    print(i)
Problem p02615 (python)

Fixed submission:
import heapq
n = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
q = []
heapq.heappush(q, A[0]*-1)
for i in range(1, n):
    tmp = heapq.heappop(q)
    ans += tmp
    heapq.heappush(q, A[i] * -1)
    heapq.heappush(q, A[i] * -1)

print(ans*-1)

Buggy submission (verdict: Runtime Error):
import heapq
n = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
q = []
heapq.heappush(q, A[0]*-1)
for i in range(1, n):
    print(q)
    tmp = heapq.heappop(q)
    ans += tmp
    heapq.heappush(q, A[i] * -1)
    heapq.heappush(q, A[i] * -1)

print(ans*-1)
Problem p02910 (python)

Fixed submission:
s = input()
odd = ["R", "U", "D"]
even = ["L", "U", "D"]

for i in range(len(s)):
    if i%2 == 0:
        if not s[i] in odd:
            print("No")
            exit(0)
    else:
        if not s[i] in even:
            print("No")
            exit(0)

print("Yes")

Buggy submission (verdict: Runtime Error):
s = input()
odd = ["R", "U", "D"]
even = ["L", "U", "D"]

for i in range(0, len(s), 2):
    if not (s[i] in odd) and (s[i+1]):
        print("No")
        exit(0)

print("Yes")
Problem p03000 (python)

Fixed submission:
n, x = map(int, input().split())
l = list(map(int, input().split()))
ans = 0
d = []
d.append(0)
for i in range(n):
    d.append(d[i] + l[i])

for i in range(len(d)):
    if d[i] <= x:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
c = 0
total = 0
for i in range(n+2):
    if total <= x:
        c += 1
        total += l[i]
    else:
        break

print(c)
Problem p03076 (python)

Fixed submission:
time = []
for _ in range(5):
    time.append(int(input()))

mod = []
for i in time:
    mod.append(i % 10)

mod = [i for i in mod if i != 0]

for i in range(len(mod)):
    mod[i] = 10 - mod[i]

if len(mod) == 0:
    add = 0
else:
    add = sum(mod) - max(mod)

print(sum(time) + add)

Buggy submission (verdict: Runtime Error):
time = []
for _ in range(5):
    time.append(int(input()))

mod = []
for i in time:
    mod.append(i % 10)

mod = [i for i in mod if i != 0]

for i in range(len(mod)):
    mod[i] = 10 - mod[i]

add = sum(mod) - max(mod)

print(sum(time) + add)
Problem p03386 (python)

Fixed submission:
A, B, K = map(int, input().split())
l = []
for i in range(K):
    if A+i <= B:
        l.append(A+i)
    if B-i >= A:
        l.append(B-i)

for i in sorted(set(l)):
    print(i)

Buggy submission (verdict: Runtime Error):
A, B, K = map(int, input().split())
l = list(range(A, B+1))
l_s = l[:K]
l_m = l[K*-1:]
ans = l_s + l_m
ans = list(set(ans))
ans.sort()
for i in ans:
    print(i)
Problem p02841 (python)

Fixed submission:
m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if m1 != m2 and d2 == 1:
    print(1)
else:
    print(0)

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

ans = -1
for x in range(n):
    if int(x*1.08)==n:
        ans = x

if ans != -1:
    print(ans)
else:
    print(':(')
Problem p03399 (python)

Fixed submission:
a = int(input()) 
b = int(input()) 
c = int(input()) 
d = int(input()) 
print((min(a,b)+min(c,d)))

Buggy submission (verdict: Runtime Error):
a = int(input()) 
b = int(input()) 
c = int(input()) 
d = int(input()) 
print(sum(min(a,b)+min(c,d)))

Buggy submission (verdict: Runtime Error):
a = int(input()) 
b = int(input()) 
c = int(input()) 
d = int(input()) 
print(sun(min(a,b)+min(c,d)))
Problem p02646 (python)

Fixed submission:
import sys

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print('NO')
    sys.exit()

d = abs(A-B)
v = V - W
if d/v <= T:
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

d = abs(A-B)
v = V - W
if d/v <= T:
    print('YES')
else:
    print('NO')
Problem p03106 (python)

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

for i in range(min(a, b), 0, -1):
    if a % i == 0 and b % i == 0:
        k -= 1
        if k == 0:
            print(i)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, min(a, b)):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, max(min(a, b), 2)):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, int(max(a, b))):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, max(int(max(a, b)), 2)):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, max(int(max(a, b) / 2), 2)):
    if a % i == 0:
        if b % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
divs = []

for i in range(1, max(int(max(a, b) / 2), 2)):
    if a % i == 0:
        if a % i == 0:
            divs.append(i)
print(divs[-k])

Buggy submission (verdict: Runtime Error):

a, b, k = map(int, input().split())
divs = []

for i in range(1, int(max(a, b) / 2)):
    if a % i == 0:
        if a % i == 0:
            divs.append(i)
print(divs[-k])
Problem p03323 (python)

Fixed submission:
a=input().split(" ")
b=int(a[0])
c=int(a[1])
if c>8 or b>8:
  print(":(")
else:
  print("Yay!")

Buggy submission (verdict: Runtime Error):
a=input().split(" ")
b=int(a[0])
c=int(a[1])
if a>8 or b>8:
  print(":(")
else:
  print("Yay!")
Problem p02612 (python)

Fixed submission:
N = int(input())
a = N//1000
b = ((a+1)*1000)-N
if b%1000 == 0:
	b = 0
    
print(b)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE") :
     MB_TLE += 1
    if (ch =="WA") :
     MB_WA += 1
    if (ch =="RE") : 
     MB_RE += 1
    if (ch =="AC") :
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if: (ch =="TLE")
     MB_TLE += 1
    if: (ch =="WA")
     MB_WA += 1
    if: (ch =="RE")
     MB_RE += 1
    if: (ch =="AC")
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE")
     MB_TLE += 1
    if (ch =="WA")
     MB_WA += 1
    if (ch =="RE")
     MB_RE += 1
    if (ch =="AC")
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)
Problem p02613 (python)

Fixed submission:
MB_AC = 0
MB_WA = 0
MB_TLE = 0
MB_RE = 0
n = int(input())
for i in range (n):
    ch = input ()
    if (ch =="AC") :
     MB_TLE += 1
    if (ch =="WA") :
     MB_WA += 1
    if (ch =="TLE") : 
     MB_RE += 1
    if (ch =="RE") :
     MB_AC += 1
print('AC x ',MB_TLE)
print('WA x ',MB_WA)
print('TLE x ',MB_RE)
print('RE x ',MB_AC)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE") :
     MB_TLE += 1
    if (ch =="WA") :
     MB_WA += 1
    if (ch =="RE") : 
     MB_RE += 1
    if (ch =="AC") :
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if: (ch =="TLE")
     MB_TLE += 1
    if: (ch =="WA")
     MB_WA += 1
    if: (ch =="RE")
     MB_RE += 1
    if: (ch =="AC")
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)

Buggy submission (verdict: Runtime Error):
MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE")
     MB_TLE += 1
    if (ch =="WA")
     MB_WA += 1
    if (ch =="RE")
     MB_RE += 1
    if (ch =="AC")
     MB_AC += 1
print('TLE x ',MB_TLE)
print('WA x ',MB_WA)
print('RE x ',MB_RE)
print('AC x ',MB_AC)

Buggy submission (verdict: Runtime Error):

MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE")
     MB_TLE += 1
      if (ch =="WA")
     MB_WA += 1
    if (ch =="RE")
     MB_RE += 1
      if (ch =="AC")
     MB_AC += 1
print('TLE x',MB_TLE)
print('WA x',MB_WA)
print('RE x',MB_RE)
print('AC x',MB_AC)

Buggy submission (verdict: Runtime Error):

MB_TLE = 0
MB_WA = 0
MB_RE = o
MB_AC = 0
n=int(input())
for i in range (n):
    ch = input ()
    if (ch =="TLE")
     MB_TLE += 1
      if (ch =="WA")
     MB_WA += 1
    if (ch =="RE")
     MB_RE += 1
      if (ch =="AC")
     MB_AC += 1
print('TLE x',MB_TLE)
print('WA x',MB_WA)
print('RE x',MB_RE)
print('AC x',MB_AC)
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a**2+a**3)

Buggy submission (verdict: Runtime Error):
s = str(input())
t = str(input())
count = 0

for i in range(len(s)):
    if s[i] != t[i]:
        count +=1

print(count)
Problem p02628 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
print(sum(a[:k]))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split())
a.sort()
print(sum(a[:k]))
Problem p02681 (python)

Fixed submission:
a  =input()
b =input()
c = 0
for i in range(len(a)):
	if a[i] != b[i]:
		c = 1
      
if c ==0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
S,T = map(str,input().split())
if T[:-1]  == S :
    print ('Yes')
else :
    print ('No')
#st = st[:-1]
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
a,b = map(int,raw_input().split())
print(a+b,a-b,a*b)
Problem p02957 (python)

Fixed submission:
a,b=map(int, input().split())
c = (a+b)/2
if c.is_integer():
  print(int(c))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split()
c = (a+b)/2
if c.is_integer():
  print(int(c))
else:
  print("impossible")
Problem p03085 (python)

Fixed submission:
b = input()

if b == 'A':
    b = 'T'
elif b == 'T':
    b = 'A'
elif b == 'C':
    b = 'G'
else:
    b = 'C'

print(b)

Buggy submission (verdict: Runtime Error):
b = input()
 
if b == 'A':
    b = 'T'
elif b == 'T':
    b = 'A'
elif b == 'C':
    b = 'G'
else:
    b = 'C'
 
print(b)
b = input ')
if b = a

Buggy submission (verdict: Runtime Error):
b = input()
 
if b = 'A':
    b = 'T'
elif b = 'T':
    b = 'A'
elif b = 'C':
    b = 'G'
else:
    b = 'C'
 
print(b)
b = input ')
if b = a
Problem p03219 (python)

Fixed submission:
x,y=map(int,input().split())
print(int(x+y/2))

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split()
print(int(X+y/2))
Problem p03260 (python)

Fixed submission:
A, B = map(int, input().split())
if A % 2 == 0 or B % 2 == 0:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
if A % 2 == 0 
  print("No")
else:
  print("Yes")
Problem p03719 (python)

Fixed submission:
a,b,c = map(int, input().split())
print('Yes') if a<=c<=b else print('No')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split()
print('Yes') if a<=c<=b else print('No')
Problem p03759 (python)

Fixed submission:
a,b,c = map(int, input().split())
print('YES' if b-a==c-b else 'NO')

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
print('YES') if b-a==c-b 
else print ('NO')
Problem p02640 (python)

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

if (y % 2 == 0) and (x * 2 <= y <= x * 4):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())

#a+b=x
#2a+4b=y
#2a=4x-y

if ((y-(2*x))%2==0)&(x-((y-(2*x))/2))>0 :
  print("Yes")
else:
  print("No")
Problem p02658 (python)

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

x=1

for i in a:
  x*=i
  if x>10**18:
    print("-1")
    exit()
print(x)

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

x=1

for i in a:
  x*=i
  if x>10**18:
    print("-1")
    exit()
  if x=0:
    print(0)
    exit()
print(x)
Problem p02756 (python)

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

rev=1

sf=""
sb=s

for _ in range(0,q):
  n=input().split()
  if n[0]=="1":
    rev*=-1
  else:
    if (n[1]=="1" and rev==1) or (n[1]=="2" and rev==-1):
      sf+=n[2]
    else:
      sb+=n[2]

s=sf[::-1]+sb

if rev==1:
  print(s)
else:
  print(s[::-1])

Buggy submission (verdict: Runtime Error):
s=input()
q=int(input())

rev=1

for _ in range(0,q):
  n=input()
#  print(n[0:1])
  if n[0:1]=="1":
#    print("!")
    rev*=-1
  else:
    m=n.split()
    x=[]
    if (m[1]=="1" and rev==1) or (m[1]=="2" and rev==-1):
    x.append(m[2])
    x.append(s)
      s=''.join(x)
#      s=m[2]+s
    else:
    x.append(s)
    x.append(m[2])
      s=''.join(x)
#      s=s+m[2]
if rev==1:
  print(s)
else:
  print(s[::-1])
Problem p02937 (python)

Fixed submission:
s = input()
t = input()

x = len(s)
y = len(t)

a = 0
b = x
c = 0
a0 = 0


for i in range(0,y):
  while True:
    #先頭からの位置
    a=s.find(t[i:i+1],a0)+1
    if a <= 0:
      a=s.find(t[i:i+1])+1
    if a <= 0:
      print("-1")
      exit()
    
    if a<=a0:
      c=c+a+b
    else:
      c=c+a-a0
    b=x-a
    a0=a
    break
    
print(c)

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

c=1
j=0
k=0

#t
for i in range(0,len(t)):
  while True:
    if t[i:i+1]==s[j:j+1]:
      J=J+1
      k=0
      break
    else:
      if j==len(s):
        j=0
      else:
        j=j+1
        k=k+1
        c=c+1
        if k+1==len(s):
          print("-1")
          exit()
        else:
          j=j+1
          k=k+1
          c=c+1
print(c)

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

c=1
j=0
k=0

#t
for i in range(0,len(t)):
  flag = 0
  while True:
    if t[i:i+1]==s[j:j+1]:
      J=J+1
      k=0
      break
    else:
      if j==len(s):
        j=0
      else:
        j=j+1
        k=k+1
        c=c+1
        if k+1==len(s):
          print("-1")
          exit()
        else:
          j=j+1
          k=k+1
          c=c+1
print(c)

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

c=1
j=0
k=0

flag = 0

#t
for i in range(0,len(t)):
  print("i",i)
  flag = 0
  while True:
    print("j",j) 
    if t[i:i+1]==s[j:j+1]:
      J=J+1
      flag = 1
      k=0
      break
    else:
      if j==len(s):
        j=0
      else:
        j=j+1
        k=k+1
        c=c+1
        if k+1==len(s):
          print("-1")
          exit()
        else:
          j=j+1
          k=k+1
          c=c+1
print(c)
Problem p02583 (python)

Fixed submission:
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    count = 0

    for i in range(N-2):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] + L[j] > L[k] and L[i] != L[j] != L[k]:
                    count += 1

    print(count)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L = sorted(L)
    print(L)
    count = 0

    for i in range(N-2):
        for j in range(i+1, N):
            for k in range(j+1, N):
                if L[i] + L[j] > L[k] and L[i] != L[j] != L[k]:
                    print(i,j,k)
                    count += 1
                    print(count)

    print(count)

if __name__ == '__main__':
Problem p02755 (python)

Fixed submission:
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

Buggy submission (verdict: Runtime Error):
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1
Problem p02756 (python)

Fixed submission:
s = input()
q = int(input())
qs = [input().split() for i in range(q)]
n = False
left= right = ""
for operation in qs:
    if operation[0] == '1':
        n = not n
    if operation[0] == '2':
        t , f, c = operation
        f = int(f)
        if n:
            f = 1 if f != 1 else 2
        if f == 1:
            left=c+left
        elif f == 2:
            right+=c
s = left+s+right
print(s[::-1] if n else s)

Buggy submission (verdict: Runtime Error):
a = input()
if 'A' in a and 'B' in a:
    print("Yes")
else:
    print("No")
--------------------------------
n, a, b = map(int, input().split())
period = a+b
times = n//period
k = n%period
n =  a if k >a else k
print(times*a + n)
---------------------------
a, b = [int(x) for x in input().split()]
 
if (b < a):
    temp = b
    b = a
    a = temp
 
 
x = 1
while True:
    if (int(x*0.08) == a and int(x*0.1) == b):
        print(x)
        break
    else:
        if (x > 1500):
            print(-1)
            break
        else:
            x += 1

1, 2 and 3
------------------------
s = input()
q = int(input())
qs = [input().split() for i in range(q)]
n = False
left= right = ""
for operation in qs:
    if operation[0] == '1':
        n = not n
    if operation[0] == '2':
        t , f, c = operation
        f = int(f)
        if n:
            f = 1 if f != 1 else 2
        if f == 1:
            left=c+left
        elif f == 2:
            right+=c
s = left+s+right
print(s[::-1] if n else s)
Problem p02783 (python)

Fixed submission:
h, a = map(int, input().split())

i = 0

while h > 0:
    h = h - a
    i += 1

print(i)

Buggy submission (verdict: Runtime Error):
H,A = map(int, input())
for i in range(H):
   H = H-4
   i += 1
   if H<= 0:
      break
print(i)
Problem p02576 (python)

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

a = N // X
if N%X == 0:
	min_T=T*a
else:
	min_T = T*(a+1)

print(min_T)

Buggy submission (verdict: Runtime Error):
N, X, T = map(int, input().split())

a = N // X
if N%X == 0
	min_T=T*a
else
	min_T = T*(a+1)

print(min_T)

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

a = N // X
min_T = T*a

print(min_T)

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

a = N//X
min_T = T*a

print(min_T)
Problem p03493 (python)

Fixed submission:
S = int(input())
c = 0

if S%10 == 1:
  c += 1
if S//100 == 1:
  c += 1
if (S//10)%10 == 1:
  c += 1
print(c)

Buggy submission (verdict: Runtime Error):
s = string(input())
counter = 0

for i in range(3):
  print(s[i])
  if s[i]==1:
    counter+=1
print(counter)

Buggy submission (verdict: Runtime Error):
s = string(input())
counter = 0

for i in range(3):
  if s[i]==1:
    counter+=1
print(counter)

Buggy submission (verdict: Runtime Error):
S = map(int, input().split())
c = 0

if S%10 == 1:
  c += 1
if S//100 == 1:
  c += 1
if (S//10)%10 == 1:
  c += 1
print(c)
Problem p02603 (python)

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

money = 1000

for i in range(n-1):
    s = 0
    if a[i] < a[i + 1]:
        s = money // a[i]
    money += (a[i + 1] - a[i]) * s
print(money)

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

money = 1000

for i in range(n-1):
    s = 0
    if a[i] < a[i + 1]:
        s = money / a[i]:
    money += (a[i + 1] - a[i]) * s
print(money)
Problem p02606 (python)

Fixed submission:
l, r, d = map(int, input().split())
ans = 0
for i in range(l, r + 1):
    if i % d == 0:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(n):
    count = 0
    for x in range(1, 101):
        for y in range(1, 101):
            for x in range(1, 101):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == (i + 1):
                    count += 1
    print(count)
Problem p02608 (python)

Fixed submission:
n = int(input())
ans=[0]*(n+1)
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if n >= a >= 1:
                ans[a] += 1
print(*ans[1:],sep="\n")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans=[0]*n
for x in range(1, int(math.sqrt(n))):
    for y in range(1, int(math.sqrt(n))):
        for z in range(1, int(math.sqrt(n))):
            a = x * x + y * y + z * z + x * y + y * z + z * x
            if n >= a >= 1:
                ans[a] += 1
print(*ans,sep="\n")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans=[0]*n
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            a = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if n >= a >= 1:
                ans[a] += 1
print(*ans,sep="\n")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
ans=[0]*n
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            ans[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1
print(ans,sep="\n")

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(n):
    count = 0
    for x in range(1, 101):
        for y in range(1, 101):
            for x in range(1, 101):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == (i + 1):
                    count += 1
    print(count)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
for i in range(n):
    count = 0
    for x in range(int(math.sqrt(n))):
        for y in range(int(math.sqrt(n))):
                if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x == (i+1):
                    count += 1
    print(count)
Problem p02615 (python)

Fixed submission:
#D
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = [a[0]]
for i in range(1, n - n // 2 + 1):
    ans.append(a[i])
    ans.append(a[i])
print(sum(ans[:n - 1]))

Buggy submission (verdict: Runtime Error):
#D
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
for i in range(1, n - n // 2 + 1):
    ans += a[i] * 2
ans-=a[n - n // 2 + 1]
print(ans)