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

Fixed submission:
n=int(input())
if n<105:
	print(0)
elif 105<=n<135:
	print(1)
elif 135<=n<165:
	print(2)
elif 165<=n<189:
	print(3)
elif 189<=n<195:
	print(4)
elif 195<=n:
	print(5)

Buggy submission (verdict: Runtime Error):
n=int(input())
if n<105:
	print(0)
elif 105<=n<135:
	print(1)
elif 135<=n<189:
	print(2)
"""
elif 189<=n:
"""
	print(3)
Problem p03289 (python)

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

flag = 0
if s[0] == "A":
	flag += 1 
cnt1 = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		cnt1 += 1
if cnt1 == 1:
	flag += 1
cnt2 = 0
for i in range(1,len(s)):
	if s[i].islower():
		cnt2 += 1
if cnt2 >= len(s) -2:
	flag += 1

if flag == 3:
	print("AC")
else:
	print("WA")

Buggy submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = s()

if s[0] != "A":
	f1 = True  
cnt = 0
for i in range(2,len(s)-1):
	if s[i] == "C":
		cnt += 1
if cnt1 == 1:
	f2 =True
cnt2 = 0
for i in range(1,len(s)):
	if s[i].islower():
		cnt2 += 1
if cnt2 >= len(s) -2:
	f3 = True

if f1 and f2 and f3:
	print("AC")
else:
	prinet("WA")
Problem p03316 (python)

Fixed submission:
n = str(input())
cnt = 0
for i in range(len(n)):
	cnt += int(n[i])
if int(n)%cnt == 0:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
n = str(input())
cnt = 0
for i in range(len(n)):
	cnt += n[i]
if int(n)%cnt == 0:
	print("Yes")
else:
	print("No")
Problem p03369 (python)

Fixed submission:
s = str(input())
cnt = 0
for i in range(3):
	if s[i] == "o":
		cnt += 1
print(700+100*cnt)

Buggy submission (verdict: Runtime Error):
s = str(input())
for i in range(3):
	if s[i] == "o":
		cnt += 1
print(700+100*cnt)
Problem p03469 (python)

Fixed submission:
s = list(input())
s[3] = '8'
s = "".join(s)
print(s)

Buggy submission (verdict: Runtime Error):
s = str(input())
s[3]="8"
print(s)
Problem p03493 (python)

Fixed submission:
s = list( input() )
print(int(s[0]) + int(s[1]) + int(s[2]))

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

Fixed submission:
n = str(input())
if n[0] == n[1] == n[2] or n[1] == n[2] == n[3]:
	print("Yes")
else:
	print("No")

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

int main(){
	int n;
	cin >> n;
	if (n%1000 == 111 || n%1000 == 222 || n%1000 == 333 || n%1000 == 444 || n%1000 == 555 || n%1000 == 666 || n%1000 == 777 || n%1000 == 888 || n%1000 == 999){
		cout << "Yes" << endl;
    }
	else if (n/10 == 111 || n/10 == 222 || n/10 == 333 || n/10 == 444 || n/10 == 555 || n/10 == 666 ||n/10 == 777 || n/10 == 888 || n/10 == 999){
		cout << "Yes" << endl;
    }
	else{
		cout << "No" << endl;
    }
}
Problem p03547 (python)

Fixed submission:
A,B,C,D,E,F = 10,11,12,13,14,15
x,y = map(str,input().split())
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = 10,11,12,13,14,15
x,y = map(int,input().split())
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")
Problem p03624 (python)

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

s = l()
alf = "abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):
	alf = alf.replace(s[i],'')
if alf == "":
	print("None")
else:
	print(alf[0])

Buggy submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())


s = list(s())
s = list(set(s))
s.sort()
ans = [str (i) for i in "abcdefghijklmnopqrstuvwxyz"]
#print("s",s)
#print("ans",ans)
#print(len(s))
for i in range(len(s)):
	#print("s",i)
	#print("ans",s)
	#print(ans)
	print(s[i])
	if s[i] in ans: #s[i] in ans なら
		ans.pop(i-1)
		print(i,"ans",ans)
print(ans[0])
Problem p03737 (python)

Fixed submission:
a,b,c = map(str,input().split())
ans = a[0] + b[0] + c[0]
print(ans.upper())

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
ans = a[0] + b[0] + c[0]
print(ans.upper())
Problem p03738 (python)

Fixed submission:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = i()
b = i()

if a > b:
	print("GREATER")
elif a == b:
	print("EQUAL")
else:
	print("LESS")

Buggy submission (verdict: Runtime Error):
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = i()
b = i()

if len(a) > len(b):
	print("GREATER")
elif a == b:
	print("EQUAL")
else:
	print("LESS")
Problem p03826 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b,c,b = map(int,input().split())
print( max(a*b, c*d)
Problem p03844 (python)

Fixed submission:
a,op,b = map(str,input().split())
if op == "+":
	print(int(a) + int(b))
else:
	print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a,op,b = map(str,input(),split())
if op == "+":
	print(int(a) + int(b))
else:
	print(int(a) - int(b))

Buggy submission (verdict: Runtime Error):
a,op,c = map(str,input(),split())
if op == "+":
	print(int(a) + int(b))
else:
	print(int(a) - int(b))
Problem p03971 (python)

Fixed submission:
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=0
for i in range(n):
	if s[i]=='a' and cnt<A+B:
		print('Yes')
		cnt+=1
	elif s[i]=='b' and cnt<A+B and cnt_b<B:
		print('Yes')
		cnt_b+=1
		cnt+=1
	else:
		print('No')

Buggy submission (verdict: Runtime Error):
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=0
for i in range(n):
	if s[i]=='a' and cnt<a+b:
		print('Yes')
		cnt+=1
	elif s[i]=='b' and cnt<A+B and cnt_b<=B:
			print('Yes')
	else:
		print('No')

Buggy submission (verdict: Runtime Error):
n,A,B=map(int,input().split())
s=list(input())
cnt=0
cnt_b=0
for i in range(n):
	if s[i]=='a' and cnt<a+b:
		print('Yes')
		cnt+=1
	else:
		print('No')
	elif s[i]=='b' and cnt<A+B and cnt_b<=B:
			print('Yes')
		else:
			print('No')
	elif s[i]=='c':
		print('No')
		cnt_c+=1
Problem p03997 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input()
b = int(input())
h = int(input())
print( (a+b)*h//2 )
Problem p04043 (python)

Fixed submission:
a = list(str(i) for i in input().split())
if a.count("5") == 2 and a.count("7") == 1:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a == 5 and b == 7 and c == 7) or (a == 7 and b == 5 and c == 7) or (a == 7 and b == 7 c == 5):
	print("YES")
else:
	print("NO")
Problem p02612 (python)

Fixed submission:
N=int(input())
b=N%1000
if b==0:
  print(0)
else:
  print(1000-b)

Buggy submission (verdict: Runtime Error):
N=int(input())
b=N%1000
if b=0:
  print(0)
else:
  print(1000-b)
Problem p02696 (python)

Fixed submission:
c=list(map(int,input().split()))
bunsi=c[0]
bunbo=c[1]
n=c[2]
k=n//bunbo
d=[n]
if k>=1:
    d.append(bunbo-1)
    d.append(bunbo*k-1)
#dの中には候補となるxが入った
def floor(x):
    return ((bunsi*x)//bunbo)-(bunsi*(x//bunbo))
if len(d)>=2:
    print(max(floor(d[0]),floor(d[-1]),floor(d[-2])))
if len(d)==1:
    print(floor(d[0]))

Buggy submission (verdict: Runtime Error):
c=list(map(int,input().split()))
bunsi=c[0]
bunbo=c[1]
n=c[2]
k=n//bunbo
d=[n]
if k!=0:
    for i in range(0,k):
        d.append(bunbo*(i+1)-1)
#dの中には候補となるxが入った
def floor(x):
    return ((bunsi*x)//bunbo)-(bunsi*(x//bunbo))
print(max(floor(d[0]),floor(d[-1]),floor(d[-2])))
Problem p02885 (python)

Fixed submission:
a,b=map(int,input().split())
if a-2*b<0:
  print(0)
else:
  print(a-2*b)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a-2b>=0:
   print(a-2b)
else:
  print(0)
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:
  print("Sunny")
Problem p02613 (python)

Fixed submission:
arr = []
n = int(input())
while n > 0:
  arr.append(input())
  n -= 1
print('AC x', arr.count('AC'))
print('WA x', arr.count('WA'))
print('TLE x', arr.count('TLE'))
print('RE x', arr.count('RE'))

Buggy submission (verdict: Runtime Error):
arr = []
n = int(input())
while n > 0:
  arr.append(input())
  n -= 1
print('AC x '+arr.count('AC'))
print('WA x '+arr.count('WA'))
print('TLE x '+arr.count('TLE'))
print('RE x '+arr.count('RE'))
Problem p02614 (python)

Fixed submission:
def main():
  h, w, k = map(int, input().split())
  C = [list(input()) for _ in range(h)]

  result = 0
  for i in range(1 << h):
    for j in range(1 << w):
      cnt = 0
      for n in range(h):
        if i >> n & 1:
          continue

        for m in range(w):
          if j >> m & 1:
            continue

          if C[n][m] == '#':
            cnt += 1

      if cnt == k:
        result += 1

  print(result)


if __name__ == "__main__":
  main()

Buggy submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
grid = [input() for _ in range(h)]
ans = 0
for i in range(1<<h):
  for j in range(1<<w):
    count = 0
    for x in range(h):
      if i >> n & i:
        continue
      for y in range(w):
        if j >> m & 1:
          continue
        if grid[x][y] == '#':
          count += 1 
    if count == k:
      ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
h, w, k = map(int, input().split())
grid = [input() for _ in range(h)]
ans = 0
for i in range(1<<h):
  for j in range(1<<w):
    count = 0
    for x in range(h):
      if 1 << i & m:
        continue
      for y in range(w):
        if 1 << j & n:
          continue
        if grid[x][y] == '#':
          count += 1 
    if count == k:
      ans += 1
print(ans)
Problem p02630 (python)

Fixed submission:
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
d = {}
for i in arr:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
for _ in range(k):
    v = 0
    a,b = map(int, input().split())
    if a not in d:
        print(s)
        continue
    s += (b-a) * d[a]
    if b in d:
        d[b] += d[a]
    else:
        d[b] = d[a]
    print(s)
    del d[a]

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
d = {}
for i in arr:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
for _ in range(k):
    v = 0
    a,b = map(int, input().split())
    s += (b-a) * d[a]
    if b in d:
        d[b] += d[a]
    else:
        d[b] = d[a]
    print(s)
    del d[a]

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
d = {}
for i in arr:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
for _ in range(k):
    v = 0
    a,b = map(int, input().split())
    s += (b-a) * d[a]
    if b in d:
        d[b] += d[a]
    else:
        d[b] = d[a]
    print(s)
    del d[a]

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
d = {}
for i in arr:
    d[i] = arr.count(i)
for _ in range(k):
    v = 0
    a,b = map(int, input().split())
    if a in d:
        d[b] = d[a]
        del d[a]
    v = d[b]
    s = s - (a*v) + (b*v)
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
s = sum(arr)
for _ in range(k):
	v = 0
    a,b = map(int, input().split())
    for i in range(len(arr)):
      if arr[i] == a:
      	arr[i] = b
       	v += 1
    s = s - (a*v) + (b*v)
    print(s)

Buggy submission (verdict: Runtime Error):
n = int(input())
output = []
arr = list(map(int, input().split()))
k = int(input())
for _ in range(k):
  a,b = map(int, input().split())
  arr[arr.index(a)] = b
  output.append(sum(arr))
for i in output:
  print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
k = int(input())
for _ in range(k):
  a,b = map(int, input().split())
  arr[arr.index(a)] = b
  print(sum(arr))
Problem p02631 (python)

Fixed submission:
n = int(input())
arr = list(map(int, input().split()))
total = 0
for i in arr:
  total ^= i
for i in arr:
  print(total ^ i, end=' ')

Buggy submission (verdict: Runtime Error):
n = int(input())
arr = list(map(int, input().split()))
for i in arr:
  total ^= i
for i in arr:
  print(total ^ i, end=' ')
Problem p02801 (python)

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

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(str(no_ac) + ' ' + str(no_wa))

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

Buggy submission (verdict: Runtime Error):
print(chr(ord(input() + 1)))
Problem p02802 (python)

Fixed submission:
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = 0
no_wa = 0

for i in range(n):
    if ac[i] == 1:
        no_ac += 1
        no_wa += wa[i]

print(str(no_ac) + ' ' + str(no_wa))

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(str(no_acc) + ' ' + str(no_wa))

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(str(no_acc) + ' ' + str(no_wa))

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print('{} {}'.format(no_acc, no_wa))

Buggy submission (verdict: Runtime Error):
n, m = [int(i) for i in input().split(' ')]
wa = [0] * n
ac = [0] * n
for _ in range(m):
    problem, status = input().split(' ')
    problem = int(problem) - 1
    if status == 'WA':
        if ac[problem] == 0:
            wa[problem] += 1
        continue
    ac[problem] = 1

no_ac = sum(ac)
no_wa = sum(wa)

print(f'{no_ac} {no_wa}')
Problem p02705 (python)

Fixed submission:
R =int(input())
import math
RU=2*math.pi*R
print(RU)

Buggy submission (verdict: Runtime Error):
R = int(input())
print(R*pi*2)
Problem p02628 (python)

Fixed submission:
N, K = map(int,input().split())
p = map(int,input().split())
newlist = sorted(p, reverse=False)
ans_list=[]
for i in range(1,K+1):
    ans_list.append(newlist[i-1])
print(sum(ans_list))

Buggy submission (verdict: Runtime Error):
N, K = map(int,input().split())
p = map(int,input().split())
newlist = sorted(p, reverse=False)
ans_list=[]
for i in range(1,K+1):
    ans.append(newlist[i-1])
print(sum(ans_list))
Problem p02657 (python)

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

print(A*B)

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

print(A*B)
Problem p02675 (python)

Fixed submission:
N = int(input())
if (N % 10 == 3):
	print("bon")
elif (N % 10 ==0 or N % 10 ==1 or N % 10 ==6 or N % 10 ==8):
	print("pon")
else:
	print("hon")

Buggy submission (verdict: Runtime Error):
import math
A,B,H,M = map(float, input().split())
rate = M / 60.0
HM = H*5.0 + 10.0*rate
theta = abs(HM-M) * 6.0
if theta > 180:
    theta = 360-theta
#rad = math.radians(theta)
#cos = abs(math.cos(rad))
L = math.sqrt(A**2 + B**2 - 2*A*B*abs(math.cos(math.radians(theta))))
if H==0 and M ==0:
    L = 0
print("{:.19f}".format(L))

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())
if (N % 10 == 3):
	print("bon")
elif (N % 10 ==0 or N % 10 ==1 or N % 10 ==6 or N % 10 ==8):
	print("pon")
else:
	print("hon)
Problem p02681 (python)

Fixed submission:
id1 = input()
id2 = input()

if (id1 == id2[:-1]):
  print("Yes")
else:
  print("No")

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

if (A >= K):
  print(K*1)

else:
  if (A + B >= K):
    print(A*1 + 0)
  else:
    print(A*1 + 0 + (K-A-B)*(-1))
Problem p02683 (python)

Fixed submission:
N,M,X = map(int,input().split())
B = [list(map(int,input().split())) for i in range(N)]
ANS = 10**5 * 12 + 1
for i in range(1<<N):
    SCORE=[0]*M
    MONEY=0
    for j in range(N):
        if (1<<j) & i != 0:
            MONEY+=B[j][0]
            for k in range(M):
                SCORE[k]+=B[j][k+1]
    if min(SCORE)>=X:
        ANS=min(ANS,MONEY)
if ANS == 10**5 * 12 + 1:
    print(-1)
else:
    print(ANS)

Buggy submission (verdict: Runtime Error):
import numpy as np
import itertools
 
N, M, X = list(map(int, input().split()))
Arr = np.zeros((N,M+1))
List = np.zeros(M)
 
for i in range(N):
    Arr[i] = list(map(int, input().split()))
    
for j in range(M):
    List[j] = np.sum(Arr[:,j])

if np.any(List<10):
    print(-1)

else:
    List = sorted(List)
    for i in range(N+1):
        for team in itertools.combinations(List,i):
            Sum = np.sum(Arr[team,:])
            if np.all(Sum>=10):
                break

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

N, M, X = list(map(int, input().split()))
Arr = np.zeros((N,M+1))
List = np.zeros(M)

for i in range(N):
  Arr[i] = list(map(int, input().split()))
  
for j in range(M):
  List[j] = np.sum(Arr[:,j])

if np.any(List<10):
  print(-1)
  
else:
  List = sorted(List)
  for i in range(N+1):
    for team in itertools.combinations(List,i):
      Sum = np.sum(Arr[team,:])
      if np.all(Sum>=10):
        break
Problem p02714 (python)

Fixed submission:
N = int(input())
S = input()
 
r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt * g_cnt * b_cnt
 
for i in range(N):
    for j in range(i,N):
        k = 2*j - i
        if k >= N:
            break
        if S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans -= 1
#         print(i,j,k)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')

ans = r_cnt * g_cnt * b_cnt
 
for i in range(N):
    for j in range(i,N):
        k = 2*j - i
        if k > N:
            break
        elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans -= 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
s = input()
 
r_cnt = s.count('R')
g_cnt = s.count('G')
b_cnt = s.count('B')

ans = r_cnt * g_cnt * b_cnt
 
for i in range(N):
    for j in range(i,N):
        k = 2*j - i
        if k >= N:
            break
        elif S[i]!=S[j] and S[j]!=S[k] and S[k]!=S[i]:
            ans -= 1

print(ans)
Problem p02677 (python)

Fixed submission:
import math
 
A, B, H, M = map(int, input().split())
 
deg_long = M * 6
deg_short = 30 * H + M / 2
    
rad = math.radians( min(deg_long - deg_short, 360-(deg_long-deg_short)))
print( math.sqrt(A **2 + B ** 2 - 2* A * B* math.cos(rad)) )

Buggy submission (verdict: Runtime Error):
import math
 
A, B, H, M = map(int, input().split())
 
deg_long = M * 6
deg_short = 30 * H + M / 2
    
rad = math.radians( min(deg_long - deg_short, 360-(deg_long-deg_short)))
print( math.sqrt(A **2 + B ** 2 - 2*A*B*cos(rad)) )
Problem p02886 (python)

Fixed submission:
a = int(input())
b = list(input().split())
sum = 0
for i in range(len(b)):
  for j in range(i,len(b)):
    if i != j:
        sum += int(b[i]) * int(b[j])
print(sum)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = list(input().split())
sum = 0
for i in range(len(b)):
  for j in range(i,len(b)):
    sum += b[i] * b[j]
print(sum)
Problem p02681 (python)

Fixed submission:
S = input()
T = input()

if S == T[:-1] and len(S) == len(T)-1:
	print('Yes')
else:
	print('No')

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

now = 1
toLoop = 0 #1の町からループに入るまでのワープ数
towns = list()
townList = list()
for i in range(1,K+1):
	now = A[now-1]
	loop_num = i
	if not now in towns:
		towns.append(now)
	else:
		start = now
		count = 1
		now = A[now-1]
		while start != now:
			count += 1
			now = A[now-1]
		toLoop = loop_num - count
		loop_num = count
		break

if K <= loop_num:
	print(now)
else:
	warp_num = (K-toLoop)%loop_num
	for _ in range(warp_num): now = A[now-1]
	print(now)
Problem p02713 (python)

Fixed submission:
import math
 
K = int(input())
 
ans = 0
 
for a in range(1, K+1):
	for b in range(1, K+1):
		tmp = math.gcd(a,b)
		for c in range(1, K+1):
			ans += math.gcd(tmp,c)
 
print(ans)

Buggy submission (verdict: Runtime Error):
 import math

K = int(input())
gcd_map = [[[0] * K for i in range(K)] for j in range(K)]

ans = 0

for a in range(1, K+1):
	for b in range(1, K+1):
		for c in range(1, K+1):
				if gcd_map[a-1][b-1][c-1] == 0:
					gcd = math.gcd(math.gcd(a,b), c)
					gcd_map[a-1][b-1][c-1] = gcd
					gcd_map[a-1][c-1][b-1] = gcd
					gcd_map[b-1][a-1][c-1] = gcd
					gcd_map[b-1][c-1][a-1] = gcd
					gcd_map[c-1][a-1][b-1] = gcd
					gcd_map[c-1][b-1][a-1] = gcd
					ans += gcd
				else:
					ans += gcd_map[a-1][b-1][c-1]

print(ans)
Problem p02607 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
count = 0

if N % 2 ==0:
    for i in range((N+2)//2 - 1):
        if A[2*i ] % 2 == 1:
            count += 1
else:
    for i in range((N+2)//2):
        if A[2*i ] % 2 == 1:
            count += 1

print(count)

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

for i in range((N+2)//2):
    if A[2*i ] % 2 == 1:
        count += 1

print(count)

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

for i in range((N+2)//2):
    if A[2*i ] % 2 == 1:
        count += 1

print(count)
Problem p02713 (python)

Fixed submission:
K = int(input())
ans = 0
from math import gcd
for i in range(1,K+1):
    for k in range(1,K+1):
        for j in range(1,K+1):
            ans += gcd(gcd(i, k),j)
            
print(ans)

Buggy submission (verdict: Runtime Error):
K = int(input())
ans = 0

for i in range(K):
    i = i + 1
    for k in range(K):
        k = k + 1
        for j in range(K):
            j = j + 1
            
            ans += gcd(gcd(i, k),j)
            j = j + 1
        k = k + 1
    i = i + 1
            
print(ans)