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

Fixed submission:
import sys
 
for line in sys.stdin:
    h, a = list(map(lambda x: int(x), line.split()))
    hits = h // a
    if h % a == 0 and a > 0:
        print(hits)
    else:
    	print(hits + 1)

Buggy submission (verdict: Runtime Error):
import sys
 
for line in sys.stdin:
    h, a = list(map(lambda x: int(x), line.split()))
    hits = h // a
    if a % h and a > 0:
      return hits
    return hits + 1

Buggy submission (verdict: Runtime Error):
import sys

for line in sys.stdin:
    a, b = list(map(lambda x: int(x), line.split()))
    print h // a
Problem p02882 (python)

Fixed submission:
import math
a, b, x = map(int,input().split())
sita = 0
c = 0
if x == a*b*b:
  sita = math.pi/2
elif a*a*b/2 <= x:
  c = a*a*a/2/(a*a*b-x)
  sita = math.atan(c)
else:
  c = 2*x/a/b/b
  sita = math.atan(c)
print('{:.10g}'.format(90-math.degrees(sita)))

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int,input().split())
sita = 0
c = 0
if a*a*b/2 <= x:
  c = a*a*a/2/(a*a*b-x)
  sita = math.atan(c)
else:
  c = 2*x/a/b/b
  sita = math.atan(c)
print('{:.10g}'.format(90-math.degrees(sita)))

Buggy submission (verdict: Runtime Error):
import math
a, b, x = map(int,input().split())
sita = 0
c = 0
if a*a*b/2 <= x:
  c = a*a*a/2/(a*a*b-x)
  sita = math.atan(c)
else:
  c = 2*x/a/b/b
  sita = math.atan(c)
print(90.0000-math.degrees(sita))
Problem p02921 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in range(3):
  if S[i]=T[i]:
    count += 1
print(count)
Problem p02923 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 0
count = 0
for i in range(N-1):
    if A[i]>=A[i+1]:
        count += 1
    else:
        ans = max(ans,count)
        count = 0
ans = max(ans,count)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
ans = 0
count = 0
for i in range(N-1):
  if A[i]>=A[i+1]:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
Problem p02945 (python)

Fixed submission:
A,B=map(int,input().split())
c = A + B
d = A- B
e = A*B
print(max([c,d,e]))

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
c = A + B
d = A - B
e = A*B
print(max([c,d,e])

Buggy submission (verdict: Runtime Error):
A,B=map.(int,input().split())
c = A + B
d = A- B
e = A*B
print(max([c,d,e]))

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
print(MAX(A+B,A-B,A*B))
Problem p02957 (python)

Fixed submission:
A,B=map(int,input().split())
if A%2==B%2:
  print(int((A+B)/2))
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if A%2==B%2:
  print(int.(A+B)/2)
else:
  print("IMPOSSIBLE")
Problem p02958 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(N):
  if i+1 == A[i]:
    count+=0
  else:
    count+=1
if count == 2:
  print("YES")
elif count ==0:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(N):
  if not i == A[i]:
    count+=1
    if A[i]+A[N-i]==N+1:
      continue
    if count >=3:
      break
      print("NO")
    print("YES")
Problem p02988 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(1,n-1):
  if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):
    count += 1
  else:
    count += 0
print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().strip().split()))
count = 0
for i in range(1,N):
  if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):
    count += 1
  else:
    count += 0
print(count)

Buggy submission (verdict: Runtime Error):
n = int(inout())
A = list(map(int, input().strip().split()))
count = 0
for i in range(1,n-1):
  if A[i]!=max(A[i-1],A[i],A[i+1]) and A[i]!=min(A[i-1],A[i],A[i+1]):
    count += 1
  else:
    count += 0
print(count)
Problem p02993 (python)

Fixed submission:
s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
s = list(int,input())
if s.count(s[0])>=2:
  print("Bad")
elif s.count(s[1])>=2:
  print("Bad")
elif s.count(s[2])>=2:
  print("Bad")
else:
  print("Yes")
Problem p03139 (python)

Fixed submission:
N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))

Buggy submission (verdict: Runtime Error):
 N, A, B = map(int, input().split())
print(min(A, B), max(0, A + B - N))
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
c = a % 2
d = b % 2
if c + d == 2:
  print('Odd')
else:
  print('Even')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = a % 2
d = b % 2
if c + d = 2:
  print(Odd)
else:
  print(Even)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = a % 2
d = b % 2
if c + d = 2:
  print(Odd)
  else:
    print(Even)
Problem p02802 (python)

Fixed submission:
from itertools import groupby
N, M  =map(int, input().split())
ps = [[] for i in range(M)]
for i in range(M):
    ps[i] = list(input().split())
if M == 0:
    print(0,0)
    exit()
newps = sorted(ps,key=lambda i:i[0]) 
newpslist = list([list(g) for k, g in groupby(newps, key = lambda i:i[0])])
countAC = 0
counterror = 0
for group in newpslist:
    subcounterror = 0
    for subgroup in group:
        if subgroup[1] == 'WA':
            subcounterror += 1
        else:
            countAC += 1
            counterror += subcounterror
            break    
print(countAC, counterror)

Buggy submission (verdict: Runtime Error):
from itertools import groupby
N, M  =map(int, input().split())
ps = [[] for i in range(M)]
for i in range(M):
    ps[i] = list(input().split())
listnum = []
listAC = []
for i in range(M):
    listnum.append(int(ps[i][0]))
for i in range(M):
    listAC.append(ps[i][1])
newnumlist = list([list(g) for k, g in groupby(listnum)])
newlistAC = [[] for i in range(len(newnumlist))]
for i in range(len(newnumlist[0])):
    newlistAC[0].append(ps[i][1])
lenth = 0

for i in range(1,len(newnumlist)):
    lenth += len(newnumlist[i-1])
    for j in range(len(newnumlist[i])):
        newlistAC[i].append(ps[j+lenth][1])
countAC=0
counterror = 0
for i in range(len(newlistAC)):
    for j in range(len(newlistAC[i])):
        if newlistAC[i][j] == 'WA':
            counterror += 1
        else:
            countAC += 1
            break
    
print(countAC, counterror)
Problem p02846 (python)

Fixed submission:
import math
T1, T2 = map(int,input().split())
A1, A2 = map(int,input().split())
B1, B2 = map(int,input().split())

if A1*T1+A2*T2 == B1*T1+B2*T2:
    print('infinity')
elif (A1-B1)*T1/((A1-B1)*T1+(A2-B2)*T2) > 0:
    print(0)    
else:
    n = abs((A1-B1)*T1/((A1-B1)*T1+(A2-B2)*T2))
    meet = math.ceil(n) + int(n)
    print(meet)

Buggy submission (verdict: Runtime Error):
import math
T1, T2 = map(int,input().split())
A1, A2 = map(int,input().split())
B1, B2 = map(int,input().split())

if A1*T1+A2*T2 == B1*T1+B2*T2:
    print('infinity')
elif (A1-B1)*T1/((A1-B1)*T1+(A2-B2)*T2) > 0:
    print(0)    
else:
    n = abs((A1-B1)*T1/((A1-B1)*T1+(A2-B2)*T2))
    meet = math.ceil(n) + int(n)
print(meet)
Problem p02783 (python)

Fixed submission:
H,A = map(int,input().split())

if H % A >= 1:
    ans = (H//A) +1
    print(ans)
else:
    ans = (H//A)
    print(ans)

Buggy submission (verdict: Runtime Error):
import itertools

H,N = map(int,input().split())
A = list(map(int,input().split()))
l = list(itertools.permutations(A,N))

ans = []
for i in l:
    if sum(i) >= H:
        ans.append("Yes")
    else:
        ans.append("No")

if "Yes" in ans:
    print("Yes")
else:
    print("No")
Problem p02783 (python)

Fixed submission:
h,a=(int(x) for x in input().split())
i = 0
while h > 0:
    h = h - a
    i = i + 1
print(i)

Buggy submission (verdict: Runtime Error):
h = int(input())
a = int(input())
i = 0
while h > 0:
    h = h - a
    i = i + 1
print(i)
Problem p02811 (python)

Fixed submission:
K, X = input().split()
G = 500 * int(K)
if G >= int(X):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
K, X = input().split()
G = 500 * int (K)
if G > X:
    print("Yes")
else:
    print("No")
Problem p02784 (python)

Fixed submission:
h,n = list(map(int,input().split()))
l = list(map(int,input().split()))
 
if sum(l)<h:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
h,n = list(map(int,input().splii()))
l = list(map(int,input().splii()))

if sum(l)<h:
  print("No")
else:
  print("Yes")
Problem p02811 (python)

Fixed submission:
K,X = map(int,input().split())
P = K*500
if (P>=X):
    print("Yes")
elif (P<=X):
    print("No")

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
P = K*500
if (p>=X):
    print("Yes")
elif (p<=X):
    print("No")
Problem p03826 (python)

Fixed submission:
A,B,C,D = input().split()
A = int(A)
B = int(B)
C = int(C)
D = int(D)

if A*B>C*D:
    print(A*B)
elif C*D>A*B:
    print(C*D)
elif A*B==C*D:
    print(A*B)

Buggy submission (verdict: Runtime Error):
A B C D = input()

if A*B>C*D:
    print(A*B)
elif C*D>A*B:
    print(C*D)
elif A*B==C*D:
    print(A*B)
Problem p03160 (python)

Fixed submission:
N = int(input())
h = list(input().split())
for i in range(len(h)):
  h[i] = int(h[i])
dp = [0 for i in range(N)]
dp[1] = abs(h[0] - h[1])
for i in range(2,N):
  dp[i] = min(dp[i-1] + abs(h[i-1] - h[i]), dp[i-2] + abs(h[i-2] - h[i]))
print(dp[N-1])

Buggy submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int>h(N);
  vector<int>dp(N);
  for (int i = 0; i < N; i++) {
    cin >> h.at(i);
    dp.at(i) = 0;
  }
  dp.at(1) = abs(h.at(1) - h.at(0));
  for (int i = 2; i < N; i++) {
    dp.at(i) = min(dp.at(i-1) + abs(h.at(i-1) - h.at(i)), dp.at(i-2) + abs(h.at(i-2) - h.at(i)));
  }
  cout << dp.at(N-1);
}
Problem p03288 (python)

Fixed submission:
R =int(input())
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')

Buggy submission (verdict: Runtime Error):
R =input()
if R<1200:
  print('ABC')
elif R<2800:
  print('ARC')
else:
  print('AGC')
Problem p03109 (python)

Fixed submission:
S = list(map(int, input().split('/')))
X = [2019, 4, 30]

print('Heisei') if all([S[i] <= X[i] for i in range(3)]) else print('TBD')

Buggy submission (verdict: Runtime Error):
a
Problem p03136 (python)

Fixed submission:
N = int(input())
L = list(map(int, input().split()))

x = max(L)
L.remove(x)
if x < sum(L):
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
./ABC/117/abc117B.py
Problem p03138 (python)

Fixed submission:
import operator

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

k = [((K+1)&(1<<i))>>i for i in range(40)]

m = [0]*40
for i in range(40):
	c = 0
	for a in A:
		c += (a&(1<<i))>>i
	
	if N < 2*c:
		m[i] = 0
	else:
		m[i] = 1

f = 0
b = [1<<i for i in range(40)]
for i in range(40):
	if k[i]==1:
		x = sum(map(operator.mul, m[:i]+[0]+k[i+1:], b))
		f = max(f, sum([x^a for a in A]))

print(f)

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

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

if K == 0:
	print(sum(A))

else:
	d = math.floor(math.log2(K)) + 1
	t = [0]*d

	for a in A:
		for i in range(d):
			if a == 0:
				break
			else:
				t[i] += a & 1
				a = a >> 1

	t = list(map(lambda x:N-2*x, t))


	w = []
	v = []

	for i in range(len(t)):
		if t[i] > 0:
			w.append(int(math.pow(2, i)))
			v.append(t[i])

	if w == []:
		print(sum(A))
		sys.exit()

	n = len(w)
	m = [[0]*(K+1) for i in range(n+1)]

	for i in range(1, n+1):
		for j in range(K+1):
			if w[i-1] <= j:
				remaining = j - w[i-1]
				m[i][j] = max(m[i-1][j] ,m[i-1][remaining] + w[i-1]*v[i-1])
			else:
				m[i][j] = m[i-1][j]

	print(sum(A)+m[n][K])

Buggy submission (verdict: Runtime Error):
import math

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

if K == 0:
	print(sum(A))

else:
	d = math.floor(math.log2(K)) + 1
	t = [0]*d

	for a in A:
		for i in range(d):
			if a == 0:
				break
			else:
				t[i] += a & 1
				a = a >> 1

	t = list(map(lambda x:N-2*x, t))


	w = []
	v = []

	for i in range(len(t)):
		if t[i] > 0:
			w.append(int(math.pow(2, i)))
			v.append(t[i])

	n = len(w)
	m = [[0]*(K+1) for i in range(n+1)]

	for i in range(1, n+1):
		for j in range(K+1):
			if w[i-1] <= j:
				remaining = j - w[i-1]
				m[i][j] = max(m[i-1][j] ,m[i-1][remaining] + w[i-1]*v[i-1])
			else:
				m[i][j] = m[i-1][j]

	print(sum(A)+m[n][K])

Buggy submission (verdict: Runtime Error):
import math

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

if K == 0:
	print(sum(A))

else:
	d = math.floor(math.log2(K)) + 1
	t = [0]*d

	for a in A:
		for i in range(d):
			if a == 0:
				break
			else:
				t[i] += a & 1
				a = a >> 1

	t = list(map(lambda x:N-2*x, t))


	w = []
	v = []

	for i in range(len(t)):
		if t[i] > 0:
			w.append(int(math.pow(2, i)))
			v.append(t[i])

	n = len(w)
	m = [[0]*(K+1) for i in range(n+1)]

	for i in range(1, n+1):
		for j in range(K+1):
			if w[i-1] <= j:
				remaining = j - w[i-1]
				m[i][j] = max(m[i-1][j] ,m[i-1][remaining] + w[i-1]*v[i-1])
			else:
				m[i][j] = m[i-1][j]

print(sum(A)+m[n][K])

Buggy submission (verdict: Runtime Error):
import math

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

d = math.floor(math.log2(K)) + 1
m = [0]*d

for a in A:
	for i in range(d):
		if a == 0:
			break
		else:
			m[i] += a & 1
			a = a >> 1

m = list(map(lambda x:N-2*x, m))

a = sum(A)
for i in range(len(m)):
	if m[i] > 0:
		a += int(math.pow(2, i)*m[i])


print(a)
Problem p03069 (python)

Fixed submission:
N = int(input())
S = input()
ac = [0]

# 黒の累積和テーブルを作る
for i in range(N):
    if S[i] == "#":
        ac.append(ac[i] + 1)
    else:
        ac.append(ac[i])

#print(ac)

work_min = N
for j in range(0, N + 1):
    work_sum = ac[j] + (N - j - (ac[N] - ac[j]))
    if work_min > work_sum:
        work_min = work_sum

print(work_min)

Buggy submission (verdict: Runtime Error):
# C - Stones

N = int(input())
S = input()

#print(list(S))
cnt = 0


# stones[i] == "#" のときに stones[i+1] == "." なら stones[i+1] = "#"にしてcnt ++する
def BlackToWhite(stones, len, i):
    global cnt
    if stones[0:i + 1]:
        if stones[i] == "#" and stones[i + 1] == ".":
            cnt += 1
            stones[i + 1] = "#"

        i += 1
        if i >= len - 1:
            print(cnt)
            exit()
        else:
            BlackToWhite(stones, len, i)
    else:
        print(cnt)
        exit()


BlackToWhite(list(S), N, 0)
Problem p03264 (python)

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

Buggy submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int,input().split())
print(x2-y2+y1,y2+x2-x1,y2-y1+x1,x2-x1+y1)
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[3,5,7,11,13,17,19]
c=d=0
if a<105:a=104
for i in range(103,a):
    for j in b:
        if a%j==0:c+=1
    if c==3:d+=1
    c=0
print(d)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=[3,5,7,9,11,13,15,17,19]
c=d=0
if a<105:a=105
for i in range(104,a):
    for j in b:
        if a%j==0:c+=1
    if c==3:d+=1
    c=0
print(d)
Problem p03284 (python)

Fixed submission:
a,b=map(int,input().split())
print("0"if a%b == 0 else "1")

Buggy submission (verdict: Runtime Error):
n=-int(input())
a=""
while n:
    a+=str(n%2)
    n//=-2
print(a[::-1] if a else 0)
Problem p03288 (python)

Fixed submission:
a=int(input())
print(["AGC","ARC","ABC"][(a < 2800) + (a < 1200)])

Buggy submission (verdict: Runtime Error):
a=int(input())
print(["ABC","ARC","AGC"][int(a/2800)+int(a/1200)])
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
w=ans=9**9

for i in range(N):
    e=S[:i].count("W")
    w=S[i:].count("E")
    ans=min(ans,e+w)
    if w=0:break
print(ans)
Problem p03339 (python)

Fixed submission:
N=int(input())
S=input()
e=0
ans=w=S.count("E")
for i in S:
    if i=="E":w-=1
    else: e+=1
    ans=min(ans,e+w)
print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
w=ans=9**9
for i in range(N):
    e=S[:i].count("W")
    w=S[i:].count("E")
    ans=min(ans,e+w)
    if w=0:break
print(ans)
Problem p03425 (python)

Fixed submission:
N=int(input())
C=[0,0,0,0,0,0]
J="MARCH"
for i in range(N):
    C[J.find(input()[0])]+=1
ans=0
ans+=C[0]*C[1]*C[2]
ans+=C[0]*C[1]*C[3]
ans+=C[0]*C[1]*C[4]
ans+=C[0]*C[2]*C[3]
ans+=C[0]*C[2]*C[4]
ans+=C[0]*C[3]*C[4]
ans+=C[1]*C[2]*C[3]
ans+=C[1]*C[2]*C[4]
ans+=C[1]*C[3]*C[4]
ans+=C[2]*C[3]*C[4]
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools as ite
N=int(input())
C=[0]*(N+1)
J="MARCH"
for i in range(N):
    C[J.find(input()[0])]+=1
ans=0
for i,j,k in list(ite.combinations(range(5),3)):
    ans+=C[i]*C[j]*C[k]
print(ans)

Buggy submission (verdict: Runtime Error):
import itertools as ite
N=int(input())
C=[0]*N
J="MARCH"
for i in range(N):
    C[J.find(input()[0])]+=1
ans=0
for i,j,k in list(ite.combinations(range(5),3)):
    ans+=C[i]*C[j]*C[k]
print(ans)
Problem p02786 (python)

Fixed submission:
H = int(input())

def f(x):
    if x == 1:
        return 1
    else:
        return 2 * f(int(x/2)) + 1

ans = f(H)

print(ans)

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

def Test(m):
    if m == 1:
        return 1
    else:
        return 2 * Test(m/2) + 1

ans = Test(H)

print(ans)
Problem p02789 (python)

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

if (M != 0 and N % M == 0):
    print("Yes")
else:
    print("No")

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

if (N % M == 0):
    print("Yes")
else:
    print("No")

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

if (N % M == 0):
    print("Yes")
else:
    print("No")
Problem p02801 (python)

Fixed submission:
C = input()

a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

for i in range(len(a)):
  if a[i] == C:
    print(a[i+1])

Buggy submission (verdict: Runtime Error):
C = input()
print(chr(ord(c)+1))
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")
elif S == "Cloudy":
	  print("Rainy")
else S == "Rainy":
	  print("Sunny")
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, input().strip())

print(max(A+B,A-B,A*B))
Problem p03029 (python)

Fixed submission:
A, P = map(int, input().split())

a = A*3 + P

if a > 0:
  print(int(a/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, P = map(int, input().split())

a = A*3 + P

if a > 0:
  print(math.floor(a/2))
else:
  print(0)

Buggy submission (verdict: Runtime Error):
A, P = map(int, input().split())

a = A*3 + P

print(math.floor(a/2))
Problem p03085 (python)

Fixed submission:
b = input()

a = {'A':'T', 'C':'G', 'G':'C', 'T':'A'}

print(a[b])

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

a = ['A', 'C', 'G', 'T']
for i in range(len()):
  if a[i] == b:
    print(a[i])
    break
Problem p03105 (python)

Fixed submission:
A, B, C = map(int, input().split())

a = int(B/A)

if a >= C:
  print(C)
else:
  print(a)

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

a = int(B/A)

if a >= C:
  print(C)
elif:
  print(a)
Problem p03455 (python)

Fixed submission:
input = input().split()

a = int(input[0]) * int(input[1])

if (a%2 == 0):
	print("Even")
else:
	print("Odd")

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

a = input[0] * input[1]

if (a%2 == 0):
	print("Even")
else:
	print("Odd")

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

a = input[0] * input[1]

if (a%2 == 0):
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
input = input().split()

a = input[0] * input[1]

if (a%2 == 0):
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
input = input().split()

a = input[0] * input[1]

if (a/2 == 0):
	print("Even")
else:
	print("Odd")

Buggy submission (verdict: Runtime Error):
input = input().split()

a = input[0] * input[1]

if (a/2 == 0):
	print("Even")
else
	print("Odd")
Problem p02783 (python)

Fixed submission:
import math
a, b = map(float, input().split())
x = a / b
if (x.is_integer() == False):
    print(math.ceil(x))
else:
    print(int(x))

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

if(a <= sum(attack_list)):
    print("Yes")
else:
    print("No")
Problem p02801 (python)

Fixed submission:
p = input()
print(chr(ord(p)+1))

Buggy submission (verdict: Runtime Error):
N, M = input().split(" ")
N = int(N)
M = int(M)

list = [[] for i in range(N)]
# print(list)

for i in range(M):
    p, S = input().split(" ")
    p = int(p)
    if "AC" not in list[p-1]:
        list[p-1].append(S)
    else:
        pass
pe = 0
cl = 0
for l in list:
    if "AC" in l:
        for i in l:
            if i == "AC":
                cl += 1
            else:
                pe += 1
    else:
        pass
print(cl, pe)
Problem p02947 (python)

Fixed submission:
n = int(input())
D = {}
count = 0
for i in range(n):
    line = "".join(sorted(list(input())))
    if line not in D:
        D[line] = 0
    else:
        D[line] += 1
        count += D[line]

print(count)

Buggy submission (verdict: Runtime Error):
import math

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n = int(input())
L = []
S = set()
count = 0
for i in range(n):
    line = "".join(sorted(list(input())))
    L.append(line)
    S.add(line)


for s in S:
    count += comb(L.count(s), 2)

print(count)
Problem p02953 (python)

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

for i in reversed(range(1, n)):
    d = stair[i] - stair[i - 1]
    if d < -1:
        print("No")
        exit()
    elif d == -1:
        stair[i - 1] -= 1
print("Yes")

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

for i in reversed(range(1, n)):
    d = stair[i] - stair[i - 1]
    if d > 1:
        print("No")
        exit()
    elif d == 1:
        stair -= 1
print("Yes")
Problem p02917 (python)

Fixed submission:
N = int(input())
B = list(map(int,input().split()))

A = [0]*N
A[0] = B[0]
A[N-1] = B[N-1-1]
for i in range(1,N-1):
    A[N-1-i] = min(B[N-1-i],B[N-1-i-1])
print(sum(A))

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

A = [0,0,0,0,0,0]
A[N-1] = B[N-1-1]
for i in range(1,N):
    A[N-1-i] = min(B[N-1-i],B[N-1-i-1])
print(sum(A))
Problem p02983 (python)

Fixed submission:
L,R = map(int, input().split())
if R-L >= 2019:
    print(0)
else:
    ans = 2019
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans = min(ans,(i*j)%2019)
    print(ans)

Buggy submission (verdict: Runtime Error):
L,R = int(input().split())
if R-L > 2019:
    print(0)
else:
    ans = (L*(L+1))%2019
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans = min(ans,(i%2019)*(j%2019))
    print(ans)
Problem p02783 (python)

Fixed submission:
H,A=list(map(int,input().split()))
count=0
while H>0:
    H=H-A
    count +=1
print(count)

Buggy submission (verdict: Runtime Error):
H,N=map(int,input().split())
A=list(map(int,input().split())
if H<=sum(A):
       print('Yes')
else:
       print('No')

Buggy submission (verdict: Runtime Error):
H,A=list(map(int,input().split()))
count=0
while H>0:
    H=H-A
    count +=1
return count