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

Fixed submission:
#!/usr/bin/env python3

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

d={}
for i in range(m):
    a,b=map(int,input().split())
    if a in d:
        d[a]=d[a]+1
    else:
        d[a]=1

    if b in d:
        d[b]=d[b]+1
    else:
        d[b]=1

for i in range(n):
    if i+1 in d:
        print(d[i+1])
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3

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

d={}
for i in range(m):
    a,b=map(int,input().split())
    if a in d:
        d[a]=d[a]+1
    else:
        d[a]=1

    if b in d:
        d[b]=d[b]+1
    else:
        d[b]=1

for i in range(n):
    print(d[i+1])
Problem p03844 (python)

Fixed submission:
a,op,b = input().split()

if op=="+":
  print(int(a)+int(b))
elif op=="-":
  print(int(a)-int(b))

Buggy submission (verdict: Runtime Error):
a,op,b = input().split()

if op="+":
  print(int(a)+int(b))
elif op="-":
  print(int(a)-int(b))
Problem p03943 (python)

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

if a==b+c:
  print("Yes")
elif b==a+c:
  print("Yes")
elif c==a+b:
  print("Yes")
else:
  print("No")

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

if a==b+c:
  print("Yes")
elif b==a+c:
  print("Yes")
elif c==a+b:
  print("Yes")

print("No")
Problem p02882 (python)

Fixed submission:
import math

a, b, x = map(int, input().split())

v = (a * a * b)/2

if x >= v:
  print(math.degrees(math.atan(2*(2*v-x)/(a**3))))
else:
  print(math.degrees(math.atan((a*b*b)/(2*x))))

Buggy submission (verdict: Runtime Error):
import math

a, b, x = map(int, input().split())

v = (a * a * b)/2

if x >= v:
  print(math.degree(math.atan(2*(2*v-x)/(a**3))))
else:
  print(math.degree(math.atan(v/x)))
Problem p02887 (python)

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

ans = 1

for i in range(1, n):
  if s[i] != s[i-1]:
    ans += 1

print(ans)

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

b = ''
b += b + s[0]

for i in range(1, n):
  if s[i] != s[i-1]:
    b += b + s[i]

print(b)
Problem p02909 (python)

Fixed submission:
s = input()
if s == 'Sunny':
  print('Cloudy')
elif s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'Sunny':
  print('Cloudy')
elid s == 'Cloudy':
  print('Rainy')
else:
  print('Sunny')
Problem p02922 (python)

Fixed submission:
a,b=map(int,input().split())
q,r=divmod(b-a,a-1)
if r==0:
  print(q+1)
else:
  print(q+2)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
q,r=divmod(b-a,a-1)
if r==0:
  print(q+1)
else:
  print((q+2)
Problem p02923 (python)

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

c = 0
a = 0   
for i in range(n-1):
  if h[i] >= h[i+1]:
    c += 1
  else:
    a = max(c, a)
    c = 0
    
a = max(c, a)    
print(a)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
def f(i):
  if i==n-1:
    return 0
  if i<n-1 and h[i]>=h[i+1]:
    return f(i+1)+1
  return 0
m=0
for i in range(n):
  m=max(f(i),m)
print(m)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=list(map(int,input().split()))
def f(i):
  if i==n-1:
    return 0
  if i<n-1 and h[i]>=h[i+1]:
    return f(i+1)+1
  if i<n-1 and h[i]<h[i+1]:
    return 0
m=0
for i in range(n):
  m=max(f(i),m)
print(m)
Problem p02971 (python)

Fixed submission:
N=int(input())
a=[int(input()) for i in range(N)]
b=sorted(a)[::-1]
for i in range(N):
  if a[i]==b[0]:
    print(b[1])
  else:
    print(b[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
b=sorted(a)[::-1]
for i in range(N):
  if a[i]=b[0]:
    print(b[1])
  else:
    print(b[0])

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
b=a
for i in range(N):
  print(max(a.remove(a[i])))
  a=b

Buggy submission (verdict: Runtime Error):
N=int(input())
a=[int(input()) for i in range(N)]
for i in range(N):
  print(max(a.remove(a[i])))
Problem p02981 (python)

Fixed submission:
n,a,b=map(int,input().split())
print(min(a*n,b))

Buggy submission (verdict: Runtime Error):
n,a,b-map(int,input().split())
print(min(a*n,b))
Problem p02982 (python)

Fixed submission:
import numpy as np
n,d=map(int,input().split())
v=[]
for i in range(n):
  v.append(np.array(list(map(int,input().split()))))
  
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dist=np.linalg.norm(v[i]-v[j], ord = 2)
    if int(dist) == dist:
      ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,d=map(int,input().split())
v=[]
for i in range(n):
  v.append(np.array(list(map(int,input().split()))))
  
ans=0
for i in range(n-1):
  for j in range(i+1,n):
    dist=np.linalg.norm(v[i]-v[j], ord = 2)
    if int(dist) == dist:
      ans += 1

print(ans)
Problem p03087 (python)

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
  t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
  l, r = map(int, input().split())
  print(t[r-1] - t[l-1])

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

for i in range(q):
  l, r = map(int, input().split())
  print(s[l, r+1].count('AC')
Problem p03109 (python)

Fixed submission:
S = list(input())
a = int(S[5]+S[6])

if a <= 4:
    ans = "Heisei"
else:
    ans = "TBD"
print(ans)

Buggy submission (verdict: Runtime Error):
s=input()
if s[5] == '1':
  print('TBD')
else:
  if s[6] > 4:
    print('TBD')
  else:
    print('Heisei')
Problem p03352 (python)

Fixed submission:
from math import sqrt
x=int(input())
c=1
for b in range(1,int(sqrt(x))+1):
  for p in range(2,x):
    if b**p<=x:
      c=max(b**p,c)
    else:
      break
print(c)

Buggy submission (verdict: Runtime Error):
from math import sqrt
x=int(input())
c=1
for b in range(1,int(sqrt(x))+1):
  for p in range(2,x):
    if b**p<=x:
      c=mac(b**p,c)
    else:
      break
print(c)
Problem p03378 (python)

Fixed submission:
n,m,x=map(int,input().split())
b=[0]*(n+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=b[i]
print(m-c if c>=m-c else c)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
b=[0]*(N+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=b[i]
print(n-c if c>=n-c else c)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
b=[0]*(N+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=b[i]
print(c if c>=n-c else n-c)

Buggy submission (verdict: Runtime Error):
n,m,x=map(int,input().split())
b=[0]*(N+1)
A=list(map(int,input().split()))
for a in A:
  b[a]=1
c=0
for i in range(x):
  c+=a[i]
print(c if c>=n-c else n-c)
Problem p03408 (python)

Fixed submission:
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]
lis=set(s)
print(max(0,max([s.count(l)-t.count(l) for l in lis])))

Buggy submission (verdict: Runtime Error):
n=int(input())
s=[input() for i in range(n)]
m=int(input())
t=[input() for i in range(m)]
lis=set(s)
print(max(0,max([s.count(l)-t.count(l) for l in lis]))
Problem p03478 (python)

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

def degitalsum(i):
  s = str(i)
  array = list(map(int, s))
  return sum(array)

ans = 0

for i in range(1, n + 1):
  if a <= degitalsum(i) <= b:
    ans += i

print(ans)

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

def degitalsum(i):
  s = str(i)
  array = list(s)
  return sum(array)

ans = 0

for i in range(1, n + 1):
  if a <= degitalsum(i) <= b:
    ans += i

print(ans)
Problem p03860 (python)

Fixed submission:
a=input().split()
print(a[0][0]+a[1][0]+a[2][0])

Buggy submission (verdict: Runtime Error):
a=input().split
print(a[0][0]+a[1][0]+a[2][0])
Problem p04011 (python)

Fixed submission:
n,k,x,y = (int(input()) for i in range(4))
print(n*x+(y-x)*max(n-k,0))

Buggy submission (verdict: Runtime Error):
n,k,x,y = list(map(int,input().split()))
print(n*x+(y-x)*max(n-k,0))
Problem p02741 (python)

Fixed submission:
l= [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())

print(l[k-1])

Buggy submission (verdict: Runtime Error):
l= [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(l[k+1])
Problem p02783 (python)

Fixed submission:
import math
h,a = map(float,input().split())
result = math.ceil(h/a)
print(result)

Buggy submission (verdict: Runtime Error):
import math
h= int(input())
a= int(input())
result = math.ceil(h/a)
print(result)
Problem p02885 (python)

Fixed submission:
w,c = map(int,input().split())
         
res = w - (2*c)

if res < 0:
    res =0
print(res)

Buggy submission (verdict: Runtime Error):
    w,c = map(int,input().split())
     
    res = w - (c+c)
    if res < 0:
      res =0
    print(res)
Problem p03059 (python)

Fixed submission:
l = [int(i) for i in input().split()]
print(int((l[2] + 0.5) // l[0] * l[1]))

Buggy submission (verdict: Runtime Error):
l = [int(i) for i in input().split()]
print((l[3] + 0.5) // l[0] * l[1])
Problem p03085 (python)

Fixed submission:
dic = {"A" : "T", "T" : "A", "C" : "G", "G" : "C"}
print(dic[input()])

Buggy submission (verdict: Runtime Error):
dic = {"A" : "T", "T" : "A", "C" : "G", "G" : "C"}
print(dict[input()])
Problem p03351 (python)

Fixed submission:
l = [int(i) for i in input().split()]
print("Yes" if ((abs(l[0] - l[1]) <= l[3]) & (abs(l[1] - l[2]) <= l[3])) or (abs(l[0] - l[2]) <= l[3]) else "No")

Buggy submission (verdict: Runtime Error):
l = [int(i) for i in input().split()]
if min(abs(l[0]-l[1]), abs(l[1]-l[2]), abs(l[0]-abs[2])) <= l[3]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l = [int(i) for i in input().split()]
if max(abs(l[0-l[1]], abs(l[1]-l[2])) <= l[3]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l = [int(i) for i in input().split()]
if max(abs(l[0-l[1]], abs(l[1]-l[2]))) <= l[3]:
  print('Yes')
else:
  print('No')
Problem p03385 (python)

Fixed submission:
s = input()
c = 0
for i in 'abc':
  if s.count(i) == 1:
    c += 1
print('Yes' if c == 3 else 'No')

Buggy submission (verdict: Runtime Error):
s = input()
c = 0
for i in 'abc': if s.count(i) == 1: c += 1
print('Yes' if c == 3 else 'No')
Problem p03415 (python)

Fixed submission:
s = ''
for i in range(3): s += input()[i]
print(s)

Buggy submission (verdict: Runtime Error):
s = ''
for i in range(3):
  s += [j for j in input().split()][i]
print(s)

Buggy submission (verdict: Runtime Error):
s = ''
for i in range(3):
  l = [int(j) for j in input().split()]
  s += l[i]
print(s)

Buggy submission (verdict: Runtime Error):
for i in range(3): l[i] = [int(j) for j in input().split()]
print(l[0][0] + l[1][1] + l[2][2])

Buggy submission (verdict: Runtime Error):
for i in range(3): l[i] = [int(i) for i in input().split()]
print(l[0][0] + l[1][1] + l[2][2])

Buggy submission (verdict: Runtime Error):
l = [[int(i) for i in input().split()] * 3]
print(l[0][0] + l[1][1] + l[2][2])
Problem p03729 (python)

Fixed submission:
a,b,c=input().split();print('NYOE S'[a[-1]==b[0]and b[-1]==c[0]::2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split()
print('NYOE S'[[a[-1]==b[0] and b[-1]==c[0]]::2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split();print('NYOE S'[[a[-1]==b[0]and b[-1]==c[0]]::2])

Buggy submission (verdict: Runtime Error):
a,b,c=input().split();print('NYOE S'[a[-1]==b[0]and b[-1]==c[0]]::2)
Problem p03795 (python)

Fixed submission:
n=int(input());print(800*n-n//15*200)

Buggy submission (verdict: Runtime Error):
n-int(input());print(800*n-n//15*200)
Problem p02741 (python)

Fixed submission:
a = input()
a = int(a)
 
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(l[a-1])

Buggy submission (verdict: Runtime Error):
a = input()
a = int(a)
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(l[k-1])

Buggy submission (verdict: Runtime Error):
a = input()
a = int(a)
 
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
 
print(l[a+1])

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

l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(l[a+1])
Problem p03455 (python)

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

if a*b % 2 == 0:
  print('Even')
else:
  print('Odd')

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

if a*b % 2 = 0:
  print('Even')
else:
  print('Odd')
Problem p03456 (python)

Fixed submission:
a, b = input().split(" ")
n = a + b
n = int(n)

if (n ** 0.5).is_integer():
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a, b = input()
n = a + b
n = int(n)

if (n ** 0.5).isinteger():
  print(Yes)
else:
  print(No)
Problem p02741 (python)

Fixed submission:
K = int(input())
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51] 
print(nums[K - 1])

Buggy submission (verdict: Runtime Error):
K = int(input())
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[K])
Problem p02741 (python)

Fixed submission:
nums = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
K = int(input())
print(nums[K-1])

Buggy submission (verdict: Runtime Error):
import numpy as np


a,b,c = list(map(float,input().split()))
if (np.sqrt((a)) + np.sqrt(b)) < np.sqrt(c):
    print('Yes')
else:
    print('No')
Problem p02742 (python)

Fixed submission:
import numpy as np


h,w = list(map(int,input().split()))
if h == 1 or w == 1:
    print(1)
else:
    print( int(np.ceil(h*w/2)))

Buggy submission (verdict: Runtime Error):
import numpy as np


h,w = list(map(int,input().split()))
if h == 1 or w == 1:
    print(1)
else
    print( int(np.ceil(h*w/2)))
Problem p03485 (python)

Fixed submission:
a, b = map(int, list(input().split(" ")) )
s = a + b
print(int((s+1)/2))

Buggy submission (verdict: Runtime Error):
a, b = map(int, list(input.split(" ")) )
s = a + b
print((s+1)/2)
Problem p02741 (python)

Fixed submission:
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())

k = k - 1

print(l[k])

Buggy submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())

k = k + 1

print(l[k])

Buggy submission (verdict: Runtime Error):
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input())

print(l[k+1])
Problem p02783 (python)

Fixed submission:
H = input().split()
H = [int(i) for i in H]

count = 0

while True:
    if H[0] > H[1]:
        H[0] = H[0] - H[1]
        count+=1
    else:
        count = count + 1
        break
print(count)

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

if H[0] > H[1]:
    H[0] = H[0] - H[1]
    count+ = 0
else:
    count+ = 1
print(count)
Problem p02843 (python)

Fixed submission:
X = int(input())

if X >= 100:
    if X % 100 == 0:
        print(1)
        exit()
elif 0 <= X <= 99:
    print(0)
    exit()

a = X // 105
b = a * 105 + 1
c = str(a) + '9' * 2
c = int(c)

if b <= X <= c:
    print(0)
else:
    print(1)

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

amari = X % 105

if 0 <= X <= 99 or 106 <= X <= 199 or 211 <= X <= 299 or 421 <= X <= 499 or 526 <= X <= 599 or 631 <= X <= 699 or 736 <= X <= 799 or 841 <= X <= 899 or 1 <= amari <= 44 #946 <= X <= 999 or 1051 <= X <= 1099 or 1156 <= X <= 1199:
    print(0)
else:
    print(1)
Problem p02741 (python)

Fixed submission:
import sys

input = sys.stdin.readline
K = int(input())

array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(array[K-1])

Buggy submission (verdict: Runtime Error):
array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(array[K-1])
Problem p02742 (python)

Fixed submission:
import sys
 
input = sys.stdin.readline
H, W = list(map(int,input().split()))
 
if H==1 or W==1:
    print(1)
    exit(0)

ans =int((H*W+1) // 2)
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
 
input = sys.stdin.readline
H, W = list(map(int,input().split()))
 
if H==1 or W==1:
    print(1)

ans =(A*B+1)//2
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
 
input = sys.stdin.readline
H, W = list(map(int,input().split()))
 
if H==1 of W==1:
    print(1)

ans =(A*B+1)//2
print(ans)
Problem p02837 (python)

Fixed submission:
N = int(input())

proof = [[] for _ in range(N)]
for i in range(N):
    for j in range(int(input())):
        x, y = map(int, input().split())
        proof[i].append([x-1, y])

ans = 0
for i in range(1, 2**N):
    flag = 0
    for j in range(N):
        if (i>>j) & 1 == 1:
            for x, y in proof[j]:
                if (i>>x)&1 != y:
                    flag = 1
                    break
    if flag == 0:
        ans = max(ans, bin(i)[2:].count('1'))
print(ans)

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

proof = [[] for _ in range(N)]
for i in range(N):
    for j in range(int(input())):
        x, y = map(int, input().split())
        proof[i].append([x-1, y])

ans = 0
for i in range(1, 2**N):
    flag = 0
    for j in range(N):
        if (i>>j) & 1 == 1:
            for x, y in proof[j]:
                if (i>>x)&1 != state:
                    flag = 1
                    break
    if flag == 0:
        ans = max(ans, bin(i)[2:].count('1'))
print(ans)
Problem p02841 (python)

Fixed submission:
a, b = map(int, input().split())
c, d = map(int, input().split())
if a != c:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
x = '000'
ans = 0
while int(x) < 1000:
  st = 0
  cnt = 0
  if x[0] in S:
    for i in range(N):
      if x[0] == S[i]:
        st = i+1
        cnt += 1
        break
  if x[1] in S[st:]:
    for j in range(st, N):
      if x[1] == S[j]:
        st = j+1
        cnt += 1
        break
  if x[2] in S[st:]:
    for k in range(st, N):
      if x[2] == S[k]:
        st = k+1
        cnt += 1
        break
                
  if cnt == 3:
    ans += 1
  x = '{:03d}'.format(int(x)+1)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = str(input())
x = '000'
ans = 0
while int(x) < 1000:
  st = 0
  cnt = 0
  if x[0] in S:
    for i in range(N):
      if x[0] == S[i]:
        st = i+1
        cnt += 1
        break
  if x[1] in S[st:]:
    for j in range(st, N):
      if x[1] == S[j]:
        st = j+1
        cnt += 1
        break
  if x[2] in S[st:]:
    for k in range(st, N):
      if x[2] == S[k]:
        st = k+1
        cnt += 1
        break
                
  if cnt == 3:
    ans += 1
  x = '{:03d}'.format(int(x)+1)
print(ans)
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int, input().split())
if a*a*b == x:
    print(0)
    exit()
if x <= (a*a*b)/2:
    n = (2*x)/(a*b)
    s = (n**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
else: 
    n = (2*x) / (a**2) - b
    a = (a*n) / (b-n) + a
    s = (a**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
if a*a*b == x:
    print(0)
    exit()
if x <= (a*a*b)/2:
    n = (2*x)/(a*b)
    s = (n**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
elif 
    n = (2*x) / (a**2) - b
    a = (a*n) / (b-n) + a
    s = (a**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int, input().split())
if x <= (a*a*b)/2:
    n = (2*x)/(a*b)
    s = (n**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
else:
    n = (2*x) / (a**2) - b
    a = (a*n) / (b-n) + a
    s = (a**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
Problem p02917 (python)

Fixed submission:
N = int(input())
S = list(map(int, input().split()))
S = [10**5+1] + S + [10**5+1]
ans = []
for i in range(1, N+1):
    ans.append(min(S[i-1], S[i]))
print(sum(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, input().split()))
S = S[::-1]
S.append(S[-1])

for i in range(1, N):
    if S[i] <= S[i-1]:
        cnt += S[i]
    else:
        cnt += S[i-1]
        S[i] = S[i-1]

print(sum(S))
Problem p02921 (python)

Fixed submission:
S = list(input())
T = list(input())
cnt = 0
for i in range(3):
    if S[i] == T[i]:
        cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
print(int((N+1)*N/2))
Problem p02924 (python)

Fixed submission:
from decimal import *
N = int(input())

print(int(Decimal(Decimal(N-1)/2*Decimal(N))))

Buggy submission (verdict: Runtime Error):
N = int(input())
M = [0]*N
for i in range(N-1):
    M[i+1] = M[i] + i + 1
print(M[-1])
Problem p02958 (python)

Fixed submission:
N = int(input())
lst = list(map(int, input().split()))
cnt = 0
for i in range(N):
    if lst[i]-1 != i:
        cnt += 1
if cnt > 2:
    print('NO')
else:
    print('YES')

Buggy submission (verdict: Runtime Error):
N = int(input())
lst = list(map(int, input().split()))
cnt = 0
for i in lst:
    if lst[i]-1 != i:
        cnt += 1
if cnt > 2:
    print('NO')
else:
    print('YES')
Problem p02981 (python)

Fixed submission:
N, A, B = map(int, input().split())
print(min(N*A, B))

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
small1 = L % 2019
small2 = R % 2019
for i in range(L, R+1):
    ans = i % 2019
    if  ans < small1:
        small2 = small1
        small1 = ans
    elif ans < small2:
        small2 = ans
    if small1 == 0:
        break
print(small1 * small2)
Problem p02993 (python)

Fixed submission:
lst = list(str(input()))
flag = 0
for i in range(3):
    if lst[i] == lst[i+1]:
        flag += 1
if flag == 0:
    print('Good')
else:
    print('Bad')

Buggy submission (verdict: Runtime Error):
lst = list(int(input()))
flag = 0
for i in range(3):
    if lst[i] == lst[i+1]:
        flag += 1
if flag == 0:
    print('Good')
else:
    print('Bad')
Problem p02995 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
i, j = c, d
def gcd(i, j):
    return i if j == 0 else gcd(j, i%j)
lcm = int(c//gcd(c, d)*d)

def cont(x):
    cnt1 = x//c 
    cnt2 = x//d
    ans = x - cnt1 - cnt2 + x//lcm
    return int(ans)

print(cont(b) - cont(a-1))

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
i, j = c, d
def gcd(i, j):
    return i if j == 0 else GCD(j, i%j)
lcm = int(c//gcd(c, d)*d)

def cont(x):
    cnt1 = x//c 
    cnt2 = x//d
    ans = x - cnt1 - cnt2 + x//lcm
    return int(ans)

print(cont(b) - cont(a-1))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c, d = map(int, input().split())
lst = []
cnt = 0
for i in range(a, b+1):
    if i%c != 0:
        lst.append(i)
for j in lst:
    if j%d != 0:
        cnt += 1
print(cnt)
Problem p02996 (python)

Fixed submission:
#131d
N = int(input())
lst = []
for i in range(N):
    a, b = map(int, input().split())
    lst.append([b, a])
lst = sorted(lst)

lim = 0
time = 0
flag = 0
for i in lst:
    lim = i[0]
    if time + i[1] <= lim:
        time += i[1]
    else:
        flag = 1
        break
if flag == 0:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
#131d
N = int(input())
lst = []
for i in range(N):
    a, b = map(int, input())
    lst.append([b, a])
lst = sorted(lst)

lim = 0
time = 0
flag = 0
for i in lst:
    lim = i[0]
    if time + i[1] <= lim:
        time += i[1]
    else:
        flag = 1
        break
if flag == 0:
    print('Yes')
else:
    print('No')