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

Fixed submission:
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
  j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans+=1/2**j
print("{:.12}".format(ans/n))

Buggy submission (verdict: Runtime Error):
#salmonize の文
n,k = map(int,input().split()) 
 #複数文字の入力
ans = 0

for i in range(1,n+1):
j=0 
  #カウンター設置
  while i<k:
    i*=2
    j+=1
  ans=1/2**j
print("{:.12}".format(ans/n))
Problem p03103 (python)

Fixed submission:
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    cost=cost-((honsu-M)*data[i][0])
    print(cost)
    exit()
print(cost)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    ans=cost-((honsu-M)*data[i][0])
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]
data.sort()

honsu=0
cost=0
for i in range(N):
  honsu+=data[i][1]
  cost+=data[i][0]*data[i][1]
 
  if honsu>M:
    ans=cost-((honsu-M)*data[i][0])
print(ans)

Buggy submission (verdict: Runtime Error):
satoooh
, M = map(int, input().split())
A, B = [0] * N, [0] * N
for i in range(N):
	A[i], B[i] = map(int, input().split())

#  値段Aの昇順でソート
C = sorted(zip(A, B))
A, B = zip(*C)

ans, cnt, i = 0, 0, 0
while cnt < M:
	tmp = min(B[i], M - cnt)
	cnt += tmp
	ans += A[i] * tmp
	i += 1
print(ans)

Buggy submission (verdict: Runtime Error):
yandy
N, M = list(map(int, input().split()))
data = [list(map(int, input().split())) for _ in range(N)]

data.sort()

price = 0
for d in data:
    price += d[0] * min(M, d[1])
    M -= d[1]
    if M <= 0:
        break
print(price)
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
c = [0] * M
for i in range(N):
    a = [int(i) for i in input().split()]

    for j in a[1:]:
        c[j-1] += 1
 
print(c.count(N))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in a:
    i.pop(0)
for i in range(n-1):
    a[i+1] = set(a[i]) & set(a[i+1])
print(len(a[n-1]))
salmo

Buggy submission (verdict: Runtime Error):
yandy
N, M = map(int, input().split())
c = [0] * M
for i in range(N):
    a = [int(i) for i in input().split()]
    for j in a[1:]:
        c[j-1] += 1

print(c.count(N))

n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
for i in a:
    i.pop(0)
for i in range(n-1):
    a[i+1] = set(a[i]) & set(a[i+1])
print(len(a[n-1]))
Problem p03149 (python)

Fixed submission:
a=list(map(int,input().split()))
a.sort()
if a==[1,4,7,9] :
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split()))
a,sort()
if a==[1,4,7,9] :
  print("YES")
else:
  print("NO")
Problem p03273 (python)

Fixed submission:
h,w=map(int,input().split())
a=[]
for i in range(h):
    j=list(input())
    if '#' in j:
        a.append(j)
aa=zip(*[i for i in zip(*a) if '#' in i])
for i in aa:
    print(''.join(i))

Buggy submission (verdict: Runtime Error):
satooh
H, W = map(int, input().split())
a = [list(input()) for _ in range(H)]
a = [i for i in a if "#" in "".join(i)]
# print("step1", a)
a = list(zip(*a))
# print("step2", a)
a = [j for j in a if "#" in "".join(j)]
# print("step3", a)
a = list(zip(*a))
# print("step4", a)
for n in range(len(a)):
	print("".join(a[n]))

Buggy submission (verdict: Runtime Error):
salmo
h, w = map(int, input().split())
a = [list(input()) for i in range(h)]
for i in range(h):
    if set(a[h-i-1]) == {'.'}:
        del(a[h-i-1])
for i in range(w):
    if set([j[w-i-1] for j in a]) == {"."}:
        for j in a:
            del(j[w-i-1])
for i in a:
    print(''.join(i))
Problem p03281 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if count==8 and i%2==1:
    ans+=1
print(ans)

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

ans = 0
for i in range(n+1):
    count = 0
    for j in range(1,i+1):
        if i%j == 0:
            count+=1
    if count==8 and i%2 == 1:
        ans += 1
print(ans)

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

count = [0] * 201
count[105] = 1
for i in range(105, 201):
    if i % 2 == 1:
        num = 0
        for n in range(1, i+1):
            if i % n == 0:
                num += 1
        if num == 8:
            count[i] = count[i-1]+1
        else:
            count[i] = count[i-1]
    else:
        count[i] = count[i-1]

print(count[N])
Problem p03289 (python)

Fixed submission:
s = input()

if s[0]=="A" and s[2:-1].count("C")==1 and s[1:].replace("C","a",1).islower()==True:
  print('AC')
else:
  print('WA')

Buggy submission (verdict: Runtime Error):
yandy
S = input()

if S[0] == 'A' and S[2:-1].count('C') == 1:
    c = S.index('C')
    if S[1:c].islower() and S[c+1:].islower():
        print('AC')
        exit()


print('WA')
Problem p03294 (python)

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

ans=0
for i in range(n):
  ans+=a[i]-1
print(ans)

Buggy submission (verdict: Runtime Error):
sal
n = int(input())
a = list(map(int, input().split()))
print(sum(a)-len(a))
Problem p03407 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if abs(a-b)<=d and abs(b-c)<=d:
  if abs(a-c)<=d:
    print("Yes")
  else:
    print("No")
else:
  print("No")
Problem p03434 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
#print(a)
b=[]
c=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    c.append(a[i])
print(sum(b)-sum(c))

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

a.sort(reverse=True)

Alice = a[0::2]
Bob = a[1::2]

print(sum(Alice) - sum(Bob))
Problem p03449 (python)

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

maxans=0
for i in range(n):
  ans=sum(a[0:i+1]+b[i:n])
  maxans=max(ans,maxans)
print(maxans)

Buggy submission (verdict: Runtime Error):

a=list(map(int,input().split()))
a.sort()
count=a[2]-a[1]
print(count)
if a[0]-count%2==0:
  print((a[2]-(a[0]+count))//2)
else:
  print(2+(a[2]-(a[0]+count))//2)
Problem p03574 (python)

Fixed submission:
H, W = map(int, input().split())
S = [input() for _ in range(H)]

A = [''] * H

di = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1)]

for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            A[h] += '#'
        else:
            c = 0
            for d in di:
                h1 = h + d[0]
                w1 = w + d[1]
                if 0 <= h1 < H and 0 <= w1 < W:
                    if S[h1][w1] == '#':
                        c += 1
            A[h] += str(c)

for i in range(H):
    print(A[i])

Buggy submission (verdict: Runtime Error):
yandy
H, W = map(int, input().split())
S = [input() for _ in range(H)]

A = [''] * H

di = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1)]

for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            A[h] += '#'
        else:
            c = 0
            for d in di:
                h1 = h + d[0]
                w1 = w + d[1]
                if 0 <= h1 < H and 0 <= w1 < W:
                    if S[h1][w1] == '#':
                        c += 1
            A[h] += str(c)

for i in range(H):
    print(A[i])
Problem p03610 (python)

Fixed submission:
s=input()
for i in range(0,len(s),2):
  print(s[i],end="")

Buggy submission (verdict: Runtime Error):
s=input()
for i in range(len(s)):
  print(s[2*i],end="")
Problem p03624 (python)

Fixed submission:
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
if len(ks)==0:
  print("None")
else:
  ks.sort()
  print(ks[0])

Buggy submission (verdict: Runtime Error):
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
if len(ks)==0:
  print("None")
else:
  ks.sort()
print(ks[0])

Buggy submission (verdict: Runtime Error):
k=set("aqwertyuioplkjhgfdsazxcvbnm")
s=set(input())
ks=list(k-s)
ks.sort()
print(ks[0])
Problem p03680 (python)

Fixed submission:
n = int(input())
a = [0] + [int(input()) for i in range(n)]
c = a[1]
p = 1
while c > 2:
    d = a[c]
    a[c] = 0
    c = d
    p += 1

if c == 2:
    print(p)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
yandy
N = int(input())
a = [int(input()) for i in range(N)]

num = 0
now = 0
been = set()
been.add(0)

while now != 1:
    now = a[now] - 1
    if now in been:
        num = -1
        break
    else:
        been.add(now)
        num += 1

print(num)
Problem p03695 (python)

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

l=[0]*9

for i in range(n):
  if a[i]<400:
    l[0]="t"
  elif a[i]<800:
    l[1]="t"
  elif a[i]<1200:
    l[2]="t"
  elif a[i]<1600:
    l[3]="t"
  elif a[i]<2000:
    l[4]="t"
  elif a[i]<2400:
    l[5]="t"
  elif a[i]<2800:
    l[6]="t"
  elif a[i]<3200:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if l[8]==0:
  print(countt,countt)
else:
  print(max(countt,1),countt+l[8])

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

l=[0]*8

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if countr==0:
  print(countt,countt)
else:
  print(max(0,countt-l[8]),min(countt+1,8))

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

l=[0]*8

for i in range(n):
  if a[i]<399:
    l[0]="t"
  elif a[i]<799:
    l[1]="t"
  elif a[i]<1199:
    l[2]="t"
  elif a[i]<1599:
    l[3]="t"
  elif a[i]<1999:
    l[4]="t"
  elif a[i]<2399:
    l[5]="t"
  elif a[i]<2799:
    l[6]="t"
  elif a[i]<3199:
    l[7]="t"
  else:
    l[8]+=1
countt=l.count("t")

if countr=0:
  print(countt,countt)
else:
  print(max(0,countt-l[8]),min(countt+1,8))
Problem p03699 (python)

Fixed submission:
n=int(input())
a = []

for i in range(n):
  a.append(int(input()))
a.sort()
suma=sum(a)
if suma%10!=0:
  print(suma)
  exit()
else:
  for i in range(n):
    suma=suma-a[i]
    if suma%10!=0:
      print(suma)
      exit()
    else:
      suma=suma+a[i]
print(0)

Buggy submission (verdict: Runtime Error):
全部１０の倍数ならNG
一番小さい10お倍数以外を引く
Problem p03720 (python)

Fixed submission:
n,m=map(int,input().split())
l=[0]*n
for i in range(m):
  a,b=map(int,input().split())
  l[a-1]+=1
  l[b-1]+=1
for i in range(n):
  print(l[i])

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

num = [0] * N

for i in range(M):
    a, b = map(int, input().split())
    num[a-1] += 1
    num[b-1] += 1

for i in num:
    print(i)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
d=dict()
for i in range(b):
  s,l=input().split()
  if s in d.keys():
    d[s]+=1
    if l in d.keys():
      d[l]+=1
    else:
      d[l]=1
  else:
    d[s]=1
    if l in d.keys():
      d[l]+=1
    else:
      d[l]=1
score_sorted = sorted(d.items(), key=lambda x:x[0])

for i in range(a):
  print(score_sorted[i][1])
Problem p03760 (python)

Fixed submission:
a=input()
b=input()

if len(a)==len(b):
  for i in range(len(a)):
    print(a[i]+b[i],end="")
else:
  k=""
  for i in range(len(a)-1):
    k+=a[i]+b[i]
  print(k+a[-1])

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


for i in range(len(a)):
  print(a[i]+b[i],end="")
Problem p03845 (python)

Fixed submission:
n=int(input())
t=[0]+[int(i) for i in input().split()]
m=int(input())
p=[[int(j) for j in input().split()] for i in range(m)]

total=sum(t)
for i in range(m):
  print(total-t[p[i][0]]+p[i][1])

Buggy submission (verdict: Runtime Error):
yandy
n = int(input())
t = [int(i) for i in input().split()]
m = int(input())

ans = sum(t)
for i in range(m):
    p, x = map(int, input().split())
    print(ans - t[p-1] + x)
Problem p03861 (python)

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

print(b//x-(a-1)//x)

Buggy submission (verdict: Runtime Error):
satoooh
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)
Problem p03957 (python)

Fixed submission:
s=input()
try: 
  if "F" in s[s.index("C"):]:
    print("Yes")
  else:
    print("No")
 
except:
  print("No")

Buggy submission (verdict: Runtime Error):
s=input()
if "F" in s[s.index("C"):]:
  print("Yes")
else:
  print("No")
Problem p04012 (python)

Fixed submission:
s=list(input())
s.sort()
if len(s)%2==1 and s[0]==s[-1]:
  print("No")
  
else:
  ans=0
  for i in range(len(s)-1):
    if s[i]==s[i+1]:
      ans+=1
    else:
      if ans%2==0:
        print("No")
        break
      else:
        ans=0
        pass
  else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
w = input()
print(set(w))
"""for i in set(w):
  print(w)
  if w.count(i)%2 != 0:
    print("No")
    exit()
print("Yes")"""
セットで出てくる文字列を絞って数える
Problem p02718 (python)

Fixed submission:
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
abc = sum(alist)
if alist[M-1] >= abc/(4*M):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
su = 0
correct = True
for i in alist:
    su += i
for i in range[M-1]:
    if alist[i] < 1/(4*M) :
        print("No")
        correct = False
if correct:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N, M=map(int,input().split())
alist = list(map(int,input().split()))
alist.sort(reverse = True)
sum = 0
correct = True
for i in alist:
    sum += i
for i in range[M-1]:
    if alist[i] < 1/(4*M) :
        print("No")
        correct = False
if correct:
    print("Yes")
Problem p03852 (python)

Fixed submission:
c=input()
print("vowel"if c in "aiueo" else "consonant")

Buggy submission (verdict: Runtime Error):
c=input()
print("vowel"if c=='a','i','u','e','o' else "constant")

Buggy submission (verdict: Runtime Error):
N=input()
print("vowel"if N=='a','i','u','e','o' else "constant")
Problem p02700 (python)

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

result = ''
while True:
  C -= B

  if (C <= 0):
    result = 'Yes'
    break
  
  A -= D
  if (A <= 0):
    result = 'No'
    break

print(result)

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

while True:
  C -= B

  if (C <= 0):
    print('Yes')
    return
  
  A -= D
  if (A <= 0):
    print('No')
    return
Problem p02761 (python)

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

guess = []
for _ in range(M):
  s, c = map(int, input().split())
  guess.append([s, c])

result = -1
for n in range(pow(10, N)):
  if (len(str(n)) != N):
    continue
  
  valid = True
  for s_c in guess:
    keta = s_c[0]
    index = keta - 1
    if (str(n)[index] != str(s_c[1])):
      valid = False
      break
  
  if (valid == False):
    continue
  else:
    result = n
    break

print(result)

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

guess = []
for _ in range(M):
  s, c = map(int, input().split())
  guess.append([s, c])

for n in range(pow(10, N)):
  if (len(str(n)) != N):
    continue
  
  valid = True
  for s_c in guess:
    keta = s_c[0]
    index = keta - 1
    if (str(n)[index] != str(s_c[1])):
      valid = False
      break
  
  if (valid == False):
    continue
  else:
    print(n)
    return

print(-1)
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
result = "Even" if (a*b % 2 == 0) else "Odd"
print(result)

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

M = []
for _ in range(N):
  t, x, y = map(int, input().split())
  M.append([t, x, y])

current = [0, 0, 0]
can = True
for m in M:
  dt = m[0] - current[0]
  dist = abs(m[1] - current[1]) + abs(m[2] - current[2])
  if (dist > dt):
    can = False
    break
  else:
    if (dist % 2 != dt % 2):
      can = False
      break
  current = m

result = "Yes" if (can == True) else "No"
print(result)
Problem p03457 (python)

Fixed submission:
N = int(input())

M = []
for _ in range(N):
  t, x, y = map(int, input().split())
  M.append([t, x, y])

current = [0, 0, 0]
can = True
for m in M:
  dt = m[0] - current[0]
  dist = abs(m[1] - current[1]) + abs(m[2] - current[2])
  if (dist > dt):
    can = False
    break
  else:
    if (dist % 2 != dt % 2):
      can = False
      break
  current = m

result = "Yes" if (can == True) else "No"
print(result)

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

M = []
for _ in range(N):
  t, x, y = map(int, input().split())
  M.append([t, x, y])

current = [0, 0, 0]
can = True
for m in M:
  dt = m[0] - current[0]
  dist = abs(m[1] - current[1]) + abs(m[2] - current[2])
  if (dist > dt):
    can = False
    break
  else:
    if (dist % 2 != dt % 2):
      can = False
      break
  current = m

result = "Yes" if (can == True) else "No"
print(result)
Problem p03493 (python)

Fixed submission:
s = input()
print(s.count("1"))

Buggy submission (verdict: Runtime Error):
  s = input()
  print(s.count("1"))
Problem p03826 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
areaA = A*B
areaB = C*D
result = areaA if (areaA > areaB) else areaB
print(result)

Buggy submission (verdict: Runtime Error):
  A, B, C, D = map(int, input().split())
  areaA = A*B
  areaB = C*D
  result = areaA if (areaA > areaB) else areaB
  print(result)
Problem p03998 (python)

Fixed submission:
Sa = input()
Sb = input()
Sc = input()

dic = {'a':Sa, 'b':Sb, 'c':Sc}

doCont = True
person = 'a'
result = ''
while doCont:
  if (len(dic[person]) == 0):
    doCont = False
    result = person.upper()
    break

  drop_card = dic[person][0]
  dic[person] = dic[person][1:]
  person = drop_card

print(result)

Buggy submission (verdict: Runtime Error):
Sa = input()
Sb = input()
Sc = input()

dic = {'a':Sa, 'b':Sb, 'c':Sc}

doCont = True
person = 'a'
result = ''
while doCont:
  if (len(dic[person]) == 0):
    doCont = False
    result = person.upper()

  drop_card = dic[person][0]
  dic[person] = dic[person][1:]
  person = drop_card

print(result)
Problem p04043 (python)

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

result = "YES" if ((arr.count('5')) == 2 and (arr.count('7')) == 1) else "NO"

print(result)

Buggy submission (verdict: Runtime Error):
ins = list(map(int, input().split()))
N = ins[0]
L = ins[1]
Ss = []

for i in range(N):
  Ss.append(input())

for i, a in enumerate(Ss):
  key = a
  j = i - 1

  while j >= 0 and Ss[j] > a:
    Ss[j + 1] = Ss[j]
    j = j - 1

  Ss[j + 1] = key

print(' '.join(Ss))
Problem p04044 (python)

Fixed submission:
N, L = map(int, input().split())
S = []
for i in range(N):
    line = input()
    S.append(line)
S.sort()
print("".join(S))

Buggy submission (verdict: Runtime Error):
N = int(input().splice()[0])
L = int(input().splice()[1])
Ss = []

for i in range(N):
  Ss[i] = input()

for i, a in enumerate(Ss):
  key = a
  j = i - 1

  while j >= 0 and Ss[j] > a:
    Ss[j + 1] = Ss[j]
    j = j - 1

  Ss[j + 1] = key

print(' '.join(Ss))
Problem p03006 (python)

Fixed submission:
def most_frequent(List):
    counter = 0
    num = List[0]

    for i in List:
        curr_frequency = List.count(i)
        if(curr_frequency> counter):
            counter = curr_frequency
            num = i

    return num

n = int(input())
c = []
for i in range(n):
    x,y = map(int,input().split())
    c.append([x,y])
c = sorted(c)
l = []
for i in range(len(c)-1):
    for j in range(i+1,len(c)):
        l.append([c[j][0]-c[i][0],c[j][1]-c[i][1]])
if(n==1):
    z = most_frequent(c)
else:
    z = most_frequent(l)
l = 1
for i in range(1,len(c)):
    if([c[i][0]-z[0],c[i][1]-z[1]] not in c):
        l+=1
print(l)

Buggy submission (verdict: Runtime Error):
def most_frequent(List):
    counter = 0
    num = List[0]

    for i in List:
        curr_frequency = List.count(i)
        if(curr_frequency> counter):
            counter = curr_frequency
            num = i

    return num

n = int(input())
c = []
for i in range(n):
    x,y = map(int,input().split())
    c.append([x,y])
c = sorted(c)
l = []
for i in range(len(c)-1):
    for j in range(i+1,len(c)):
        l.append([c[j][0]-c[i][0],c[j][1]-c[i][1]])

z = most_frequent(l)
l = 1
for i in range(1,len(c)):
    if([c[i][0]-z[0],c[i][1]-z[1]] not in c):
        l+=1
print(l)

Buggy submission (verdict: Runtime Error):
def most_frequent(List):
    counter = 0
    num = List[0]

    for i in List:
        curr_frequency = List.count(i)
        if(curr_frequency> counter):
            counter = curr_frequency
            num = i

    return num

n = int(input())
c = []
for i in range(n):
    x,y = map(int,input().split())
    c.append([x,y])
c = sorted(c)
l = []
for i in range(len(c)-1):
    l.append([c[i+1][0]-c[i][0],c[i+1][1]-c[i][1]])
z = most_frequent(l)
l = 1
for i in range(1,len(c)):
    if(c[i][0]-c[i-1][0]!=z[0] or c[i][1]-c[i-1][1]!=z[1]):
        l+=1
print(l)
Problem p02882 (python)

Fixed submission:
from math import degrees, atan

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

vol = a * a * b

def A(a, b, x):
    return degrees(atan((a * b * b) / (2 * x)))

if vol == x:
    result = 0
elif 2 * x > vol:
    x -= vol / 2
    tmp = A(a, a, vol / 2 - x)
    result = 90 - tmp
else:
    result = A(a, b, x)

print(result)

Buggy submission (verdict: Runtime Error):
from math import degrees, atan

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

vol = a * a * b

def A(a, b, x):
    return degrees(atan((a * b * b) / (2 * x)))

if 2 * x > vol:
    x -= vol / 2
    tmp = A(a, a, vol / 2 - x)
    result = 90 - tmp
else:
    result = A(a, b, x)

print(result)

Buggy submission (verdict: Runtime Error):
from math import degrees, atan

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

half_vol = a * a * b / 2

def A(a, b, x):
    return degrees(atan((a * b * b) / (2 * x)))

if x > half_vol:
    x -= half_vol
    tmp = A(a, a, half_vol - x)
    result = 90 - tmp
else:
    result = A(a, b, x)

print(result)
Problem p02700 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
while(True):
    c-=b
    if(c<=0):
        print("Yes")
        exit()
    a-=d
    if(a<=0):
        print("No")
        exit()

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
while(True):
    c-=b
    if(c<=0):
        print("Yes")
        exit()
    a-=d:
    if(a<=0):
        print("No")
        exit()
Problem p02802 (python)

Fixed submission:
n, m = map(int,input().split())
cor, war = 0,0
c = [[0,0] for k in range(n)] #[ACしたか,WA数]
for i in range(m):
  p,s = list(input().split())
  p = int(p)-1
  if s == "AC" and c[p][0] == 0: #初めてのACなら正答数を増やしてフラグを立て、ペナルティを誤答数分増やす
    cor += 1
    c[p][0] = 1
    war += c[p][1]
  if s == "WA" and c[p][0] == 0: #ACしていない状態でのWA数を記録
    c[p][1] += 1
print(cor,war)

Buggy submission (verdict: Runtime Error):
n, m = map(int,input().split())
cor, war = 0,0
c = [[0,0] for k in range(n)] #[ACしたか,WA数]
for i in range(m):
  p,s = list(input().split())
  p = int(p)
  if s == "AC" and c[p][0] == 0: #初めてのACなら正答数を増やしてフラグを立て、ペナルティを誤答数分増やす
    cor += 1
    c[p][0] = 1
    war += c[p][1]
  if s == "WA" and c[p][0] == 0: #ACしていない状態でのWA数を記録
    c[p][1] += 1
print(cor,war)
Problem p02818 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
if a>=k:
  print(str(a-k) + str(b))
elif a+b>=k:
  print(str(0) + str(a+b-k)
elsem
        print(0 0)