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

Fixed submission:
# C
x, n = map(int, input().split())
p = list(map(int, input().split()))
# print(p)
ans = 0
if n == 0:
    print(x)
elif x not in p:
    print(x)
else:
    for i in range(102):
        if i not in p:
            if abs(x - i) < abs(x - ans):
                ans = i
    print(ans)

Buggy submission (verdict: Runtime Error):
# C
x, n = map(int, input().split())
p = list(map(int, input().strip().split()))
print(p)
ans = 0
if n == 0:
    print(x)
elif x not in p:
    print(x)
else:
    for i in range(102):
        if i not in p:
        if abs(x - i) < abs(x - ans):
                ans = i
    print(ans)

Buggy submission (verdict: Runtime Error):
# C
x, n = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
if n == 0:
    print(x)
elif x not in p:
    print(x)
else:
    for i in range(102):
        if i not in p
            if abs(x - i) < abs(x - ans):
                ans = i
    print(ans)

Buggy submission (verdict: Runtime Error):
# C
x, n = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
if n = 0:
    print(x)
elif x not in p:
    print(x)
else:
    for i in range(102):
        if i not in p
            if abs(x - i) < abs(x - ans):
                ans = i
    print(ans)

Buggy submission (verdict: Runtime Error):
# C
x, n = map(int, input().split())
p = list(map(int, input().split()))
ans = 0
if n = 0:
    print(x)
elif x not in p:
    print(x)
else:
    for i in range(102):
        if i not in p and abs(x - i) < abs(x - ans):
            ans = i
    print(ans)
Problem p02690 (python)

Fixed submission:
#D
import sys
x = int(input())

#-118<a<119 -119<b<118で全捜索
for a in range(-118, 120):
    for b in range(-119, 119):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            sys.exit()

Buggy submission (verdict: Runtime Error):
#D
import math ,sys
x = int(input())
for a in range(math.ceil(math.log10(x))):
    for b in range(-10 ** 9//2, 10 ** 9//2):
        if s ** 5 - b ** 5 == x:
            print(a, b)
            sys.exit()
Problem p02702 (python)

Fixed submission:
s = input()
ans = 0
a = [0] * 2019
a[0] = 1
k = 0
mod = 1
for i in range(len(s) - 1, -1, -1):
    k = (k + int(s[i]) * mod) % 2019
    mod = (mod * 10) % 2019
    a[k] += 1
for i in a:
    ans += i * (i - 1) * 0.5
print(int(ans))

Buggy submission (verdict: Runtime Error):
#D
s = input()
count = 0
# print(len(s))
for left in range(len(s) - 3):
    for right in range(left + 3, len(s)):
        print(left + 1, right + 1)
        if int(float(s[left:right + 1])) % 2019 == 0:
            print(s[left:right])
            count += 1
print(count)

Buggy submission (verdict: Runtime Error):
#D
s = input()
count = 0
# print(len(s))
for left in range(len(s) - 1):
    for right in range(left + 1, len(s)):
        # print(left + 1, right + 1)
        if int(float(s[left:right+1])) % 2019 == 0:
            # print(s[left:right])
            count += 1
print(count)
Problem p02732 (python)

Fixed submission:
#D AC
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)#出現回数を辞書で取り出す
val=0
for i in c.values():#辞書に含まれる値をすべて取り出す
    # print(i)  #1,2,3･･･の回数
    val += i * (i - 1) // 2  #整数が同じボールを選ぶ組み合わせ
    # val+=sum(range(i-1))
for i in range(n):
    b = c[a[i]]  #i番目の出現回数
    print(val - b + 1)  #bを除いたボールから整数が同じボールを選ぶ組み合わせ

Buggy submission (verdict: Runtime Error):
#D
from collections import Counter
from copy import deepcopy
n = int(input())
a = list(map(int, input().split()))
def x(i):
    if i < 0:
        return 0
    if i == 1:
        return 1
    else:
        return x(i - 1) + i

for j in range(n):
    b=deepcopy(a)
    b.pop(j)
    # print(a,b)
    ans = 0
    # print(b)
    for i in range(1, max(b) + 1):
        # print(b[i])
        ans += x(b.count(i)-1)
    print(ans)

Buggy submission (verdict: Runtime Error):
#D
from collections import Counter
from copy import deepcopy
n = int(input())
a = list(map(int, input().split()))
def x(i):
    if i < 0:
        return 0
    if i == 1:
        return 1
    else:
        return x(i - 1) + i

for j in range(n):
    b=deepcopy(a)
    b.pop(j)
    # print(a,b)
    b = Counter(b)
    ans = 0
    # print(b)
    for i in range(1, max(b) + 1):
        # print(b[i])
        ans += x(b[i]-1)
    print(ans)
Problem p02755 (python)

Fixed submission:
import sys
a,b=map(int,input().split())
f=True
for i in range(1,1010):#max_a=1
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        f=False
        break
if f:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
import sys
a,b=map(int,input().split())
for i in range(1,1100):#max_a=1
    if int(i*0.08)==a and int(i*0.1)==b:
        ans=i
        bresak
    if i==1099:
        ans=-1

print(ans)

Buggy submission (verdict: Runtime Error):
#C
import sys

a,b=map(int,input().split())
for i in range(1,1000):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i,i*0.08,i*0.1)
        break
    if i==999:
        print(-1)
        sys.exit()

print(ans)
Problem p02765 (python)

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

Buggy submission (verdict: Runtime Error):
#A
n, r = map(int, input().split())
if n >= 10:
    print(r)
else:
    print(r-100*(10-k))
Problem p02780 (python)

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[]
smax=0
for i in range(k-1,n):
    if i==k-1:
        sumnow=sum(a[:i+1])
    else:
        sumnow+=a[i]-a[i-k]
    smax=max(smax,sumnow)
print((smax+k)/2)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
b=[]
for i in range(len(a)):
    b.append((a[i]+1)/2)
for i in range(len(a)-k+1):
    sum=0
    for j in range(i,i+k):
        sum+=b[j]
    if max<=sum:
        max=sum
print(max)

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

def wa (n):
    if n<=1:
        return 1
    else:
        return wa(n-1)+n

if __name__ == "__main__":
    n,k=map(int,input().split())
    a=list(map(int,input().split()))
    b=[]
    for i in a:
        b.append(wa(i)/i)
    b.sort(reverse=True)
    print(a,b)
    ans=0
    for i in range(3):

        ans+=b[i]
    print(ans)
Problem p02789 (python)

Fixed submission:
n,m=map(int,input().split())
if(n==m):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
m=a[0]
ans=1
for i,z in enumerate(a):
  if i==0:continue
  if z<=m:
    ans+=1
  m=min(m,z)
print(ans)
Problem p02791 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
m=a[0]
ans=1
for i,z in enumerate(a):
  if i==0:continue
  if z<=m:
    ans+=1
  m=min(m,z)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
min_a=0
ans=0
for i,z in enumerate:
  if i==0:continue
  if min_a>=z:
    ans+=1
  min_a=min(min_a,z)
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
min=0
ans=0
for i z in enumerate:
  if i==0:continue
  if min>=z:
    ans+=1
  min=min(min,z)
print(ans)
Problem p02803 (python)

Fixed submission:
#D
from collections import deque
h,w=map(int,input().split())
s=[]

for i in range(h):
    s.append(list(input()))
dx=[1,0,-1,0]#東南西北
dy=[0,-1,0,1]
ans=0
def search(i,j):
    if s[i][j]=="#":
        return 0
    max_step=0
    que=deque()
    que.append([i,j])#1現在地
    dist=[[-1 for _ in range(w)] for _ in range (h)]
    #(h,w)
    dist[i][j]=0#現在地は0
    while que:#行き先が無くなるまで
        y,x=que.popleft()#現在地を取り出す(y,x)
        for dir in range(4):
            nx=x+dx[dir]#行き先(nx,xy)
            ny=y+dy[dir]
            if ny<0 or ny>=h or nx<0 or nx>=w or s[ny][nx]=="#":#壁の中
                pass#何もしない
            elif dist[ny][nx]!=-1:#捜索済み
                pass
            elif s[ny][nx]==".":
            #未捜索地点"."
                dist[ny][nx]=dist[y][x]+1#1進む
                que.append([ny,nx])
    out=0
    for i in range(h):
        for j in range(w):
            if dist[i][j]==-1:
                pass
            out=max(out,dist[i][j])
    return out

for i in range(h):
    for j in range(w):
        step=search(i,j)#(j,i)の時の最大移動数を求める
        if ans<step:
            ans=step
print(ans)

Buggy submission (verdict: Runtime Error):
#D
from collections import deque
h,w=map(int,input().split())
s=[]

for i in range(h):
    s.append(list(input()))
dx=[1,0,-1,0]#東南西北
dy=[0,-1,0,1]
ans=0
def search(i,j):
    if s[i][j]=="#":
        return 0
    max_step=0
    que=deque()
    que.append([i,j])#1現在地
    dist=[[-1 for _ in range(w)] for _ in range (h)]
    #(h,w)
    dist[i][j]=0#現在地は0
    while que:#行き先が無くなるまで
        y,x=que.popleft()#現在地を取り出す(y,x)
        for dir in range(4):
            nx=x+dx[dir]#行き先(nx,xy)
            ny=y+dy[dir]
            if ny<0 or ny>=h or nx<0 or nx>=w or s[ny][nx]=="#":#壁の中
            elif dist[ny][nx]!=-1:#捜索済み
            #未捜索地点"."
            else:
                dist[ny][nx]=dist[y][x]+1#1進む
                que.append([ny,nx])
    out=0
    for i in range(h):
        for j in range(w):
            if dist[i][j]==-1:
                break
            out=max(out,dist[i][j])
    return out

for i in range(h):
    for j in range(w):
        step=search(i,j)#(j,i)の時の最大移動数を求める
        if ans<step:
            ans=step
print(ans)
Problem p02817 (python)

Fixed submission:
s,t=input().split()
print(t+s)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
  else:
    b1=0
  print(a1,b1)
Problem p02818 (python)

Fixed submission:
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
  else:
    b1=0
  print(a1,b1)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
    else:
      b1=0
    print(a1,b1)

Buggy submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
if a>=k:
  a1=a-k
  print(a1,b)
  exit
else:
  a1=0
  if b>=k-a:
    b1=b-(k-a)
    else:
      b1=0
    print(a1,b1)
Problem p02842 (python)

Fixed submission:
#B(別解)
import math
n=int(input())
x=math.ceil(n/1.08)
if math.floor(x*1.08)==n:
    print(x)
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
#B(別解)
n=int(input())
x=math.ceil(n/1.08)
if math.floor(x*1.08)==n:
    print(x)
else:
    print(":(")
Problem p02848 (python)

Fixed submission:
a=int(input())
s=list(input())
t=[]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>=26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

Buggy submission (verdict: Runtime Error):
a=int(input())
s=list(input())
t=[len(s)]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>=26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

Buggy submission (verdict: Runtime Error):
a=int(input())
s=list(input())
t=[len(s)]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)
Problem p02865 (python)

Fixed submission:
n=int(input())
if n%2==0:
  print(int(n/2-1))
else:
  print(int((n-1)/2))

Buggy submission (verdict: Runtime Error):
n=int(input())
listx=list(map(int,input().split()))
listx.sort()
x=1
if listx[0]!=0:
  x=0
else:
  for i in range(listx[-1]):
    x*=listx.count(int(i+1))+1
print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
listx=list(map(int,input().split()))
listx.sort()
x=1
if listx[0]!=0:
  x=0
else:
  for i in range(listx[-1]):
    print(i+1)
    x*=listx.count(int(i+1))+1
print(x)

Buggy submission (verdict: Runtime Error):
n=int(input())
listx=list(map(int,input().split()))
listx.sort()
x=1
for i in range(listx[-1]):
  x*=listx.count(int(i+1))+1
if listx[0]!=0:
  x=0
print(x)
Problem p02882 (python)

Fixed submission:
#D
import math
a,b,x=map(int,input().split())
cap=a**2*b
ans=0
if x<=cap/2:
    n=2*x/(a*b)
    ans=math.atan(b/n)*180/math.pi
else:
    n=2*(cap-x)/(a**2)
    ans=math.atan(n/a)*180/math.pi
print(ans)

Buggy submission (verdict: Runtime Error):
#D
import math
a,b,x=map(int,input().split())
cap=a**2*b
ans=0
if x>cap/2:
    n=2*x/(a*b)
    ans=math.atam(b/n)*180/math.pi
else:
    n=2*x/(a**2)
    ans=math.atan(n/a)*180/math.pi
print(ans)
Problem p02885 (python)

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

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if (A<2*B):
    print(0)
    break
print(A-2*B)

Buggy submission (verdict: Runtime Error):
A,B=map(int,input().split())
if (A<2*B):
    print(0)
    break
print(A-2*B)
Problem p02887 (python)

Fixed submission:
n=int(input())
d=list(input())
ans=1
for i in range(1,n):
    if d[i-1]!=d[i]:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
20
xxzaffeeeeddfkkkkllq
Problem p02888 (python)

Fixed submission:
from bisect import bisect_left
n=int(input())
l=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
    for j in range(i+1,n):
        r =bisect_left(l,l[i]+l[j])
        ans+=max((r-j-1),0)
print(ans)

Buggy submission (verdict: Runtime Error):
from bisect import bisect_left
n=int(input())
l=sorted(list(map(int,input().split())))
ans=0
for i in range(n):
    for j in range(i+1,n):
        r =bisect_left(L,L[i]+L[j])
        ans+=max(r-j-1),0
print(ans)
Problem p02909 (python)

Fixed submission:
S=input()
Wether=["Sunny","Cloudy","Rainy"]
if S==Wether[0]:
    print(Wether[1])
elif S==Wether[1]:
    print(Wether[2])
elif S==Wether[2]:
    print(Wether[0])

Buggy submission (verdict: Runtime Error):
S=input()
Wether=[Sunny,Cloudy,Rainy]
if S==Wether[0]:
    print(Wether[1])
elif S==Wether[1]:
    print(Wether[2])
elif S==Wether[2]:
    print(Wether[0])
Problem p02911 (python)

Fixed submission:
n,k,q=map(int,input().split())
a=[]
while True:
  try:
    a.append(int(input()))
  except:
    break;
t=[0]*n
for i in a:
  t[i-1]+=1
for i in t:
  if i >= q - k + 1:
    print("Yes")
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[]
while True:
  try:
    a.append(int(input()))
  except:
    break;
print(a)
t=[]*n
for i in a:
  t[i-1]+=1
for i in t:
  if i>=q-k+1:
    print("Yes")
  else:
    print("No")
Problem p02971 (python)

Fixed submission:
#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
b = a.copy()
b.sort()
b.reverse()
fi = b[0]
se = b[1]
for i in a:
    if i == fi:
        print(se)
    else:
        print(fi)

Buggy submission (verdict: Runtime Error):
#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
first = sorted(set(a))[-1]
if len(a) == 1 or sorted(set(a))[0] == sorted(set(a))[-1]:
    pass
else:
    second = sorted(set(a))[-2]
for i in a:
    if i != first:
        print(first)
    else:
        print(second)

Buggy submission (verdict: Runtime Error):
#C
from collections import Counter
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
first = sorted(set(a))[-1]
if sorted(set(a))[0] == sorted(set(a))[-1]:
    pass
else:
    second = sorted(set(a))[-2]
for i in a:
    if i != first:
        print(first)
    else:
        print(second)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
#A
n, a, b = map(int, input().split())
print(min(n*a,b))A
Problem p02995 (python)

Fixed submission:
#C
import math
a, b, c, d = map(int, input().split())

def gcd(x, y):
    if x < y:
        x, y = y, x
    while y != 0:
        x, y = y, x % y
    return x

s = b - a + 1
cc = b // c - (a - 1) // c
dd = b // d - (a - 1) // d
cd = c * d // gcd(c, d)
cd = b // cd - (a - 1) // cd
s -= cc + dd - cd
print(s)

Buggy submission (verdict: Runtime Error):
#C
import math
a, b, c, d = map(int, input().split())
bb = b - (b // c) - (b // d) + (b // (c * d / math.gcd(c, d)))
aa = a - (a // c) - (a // d) + (a // (c * d / math.gcd(c, d)))

print((bb-aa))

Buggy submission (verdict: Runtime Error):
#C
import math
a, b, c, d = map(int, input().split())

def gcd(x, y):
    if x < y:
        x, y = y, x
    while a % b != 0:
        a, b = b, a % b

a-=1
cd=c*d//math.gcd(c,d)
ans = b - (b // c) - (b // d) + (b // cd)
ans -= a - (a // c) - (a // d) + (a // cd)

print(ans)

Buggy submission (verdict: Runtime Error):
#C
import math
a, b, c, d = map(int, input().split())
a-=1
cd=c*d//math.gcd(c,d)
ans = b - (b // c) - (b // d) + (b // cd)
ans -= a - (a // c) - (a // d) + (a // cd)

print(ans)

Buggy submission (verdict: Runtime Error):
C
import math
a, b, c, d = map(int, input().split())
a-=1
cd=c*d//math.gcd(c,d)
ans = b - (b // c) - (b // d) + (b // cd)
ans -= a - (a // c) - (a // d) + (a // cd)

print(ans)
Problem p03000 (python)

Fixed submission:
#B
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = [0] * (n + 1)
d[0]=0
count = 0
for i in range(n):
    d[i + 1] = d[i] + l[i]
for i in d:
    if i <= x:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
#B
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
count=1
for i in range(n+1):
    d = d + l[i]
    if d > x:
        break
    count+=1
print(count)
Problem p03031 (python)

Fixed submission:
# C
n, m = map(int, input().split())
k =[0]*m
s = [0]*m
for i in range(m):
    lst=input().split()
    k[i] = int(lst[0])
    s[i] = [int(x) - 1 for x in lst[1:]]
p = [int(x) for x in input().split()]
# print(s, p)
ans=0
for i in range(2 ** n):
    all_on = True
    for j in range(m):
        light = 0
        for k in s[j]:
            tmp = i >> k & 1
            #iをkだけ左にシフトし1とのANDをとる
            #>>iのk番目が1の時１を返す
            light = (light + tmp) % 2
            # print(tmp,light)
        if light != p[j]:
            all_on = False
            # print(light,p[j])
            break
    ans += int(all_on)
print(ans)

Buggy submission (verdict: Runtime Error):
#C
n, m = map(int, input().split())
k = [] * m
s = [] * m
p = [] * m
for i in range(m):
    ks = list(map(int, input().split()))
    k.append(ks[0])
    s.append(ks[1:])
p = list(map(int, input().split()))

# print(k, s, p)
for i in range(2 ** n):
    on = True
    for j in range(m):
        light = 0
        for k in s[j]:
            tmp = i >> k & 2
            light = (light + tmp) % 2
        if light != p[j]:
            on = False
            break
    ans += int(on)
print(ans)

Buggy submission (verdict: Runtime Error):
#C
n, m = map(int, input().split())
k = [] * m
s = [] * m
p = [] * m
for i in range(m):
    ks = list(map(int, input().split()))
    k.append(ks[0])
    s.append(ks[1:])
p = list(map(int, input().split()))

print(k, s, p)
for i in range(2 ** n):
    on = Ture
    for j in range(m):
        light = 0
        for k in s[j]:
            tmp = i >> k & 2
            light = (light + tmp) % 2
        if light != p[j]:
            on = False
            break
    ans += int(on)
print(ans)
Problem p03037 (python)

Fixed submission:
#C
n, m = map(int, input().split())
l = []
r = []
for i in range(m):
    lin = list(map(int, input().split()))
    l.append(lin[0])
    r.append(lin[1])
lma = max(l)
rmi = min(r)
if lma > rmi:
    print(0)
else:
    print(rmi - lma + 1)

Buggy submission (verdict: Runtime Error):
10 3
3 6
5 7
6 9
Problem p03111 (python)

Fixed submission:
# C MP消費を抑えるにはABCとの差が小さけれは良い
n, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(n)]
INF = 10**9


def dfs(now, a, b, c):
    if now == n:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    # 方法１　１つ飛ばす
    way1 = dfs(now + 1, a, b, c)
    # 方法２　合成魔法(MP10)
    way2 = dfs(now + 1, a + l[now], b, c)+10
    way3 = dfs(now + 1, a, b + l[now], c)+10
    way4 = dfs(now + 1, a, b, c + l[now])+10
    return min(way1, way2, way3, way4)


print(dfs(0, 0, 0, 0))

Buggy submission (verdict: Runtime Error):
# C MP消費を抑えるにはABCとの差が小さけれは良い
n, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(n)]
INF = 10**9


def dfs(now, a, b, c):
    if now == n:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    # 方法１　１つ飛ばす
    way1 = dfs(now + 1, a, b, c)
    # 方法２　合成魔法(MP10)
    way2 = dfs(now + 1, a + l[now], b, c)+10
    way3 = dfs(now + 1, a, b + l[now], c)+10
    way4 = dfs(now + 1, a, b, c + l[now])+10
    return min(way1, way2, way3, way4)


print(dfs(0, 0, 0, 0))
# C MP消費を抑えるにはABCとの差が小さけれは良い
n, A, B, C = map(int, input().split())
l = [int(input()) for _ in range(n)]
INF = 10**9


def dfs(now, a, b, c):
    if now == n:
        return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else INF
    # 方法１　１つ飛ばす
    way1 = dfs(now + 1, a, b, c)
    # 方法２　合成魔法(MP10)
    way2 = dfs(now + 1, a + l[now], b, c)+10
    way3 = dfs(now + 1, a, b + l[now], c)+10
    way4 = dfs(now + 1, a, b, c + l[now])+10
    return min(way1, way2, way3, way4)


print(dfs(0, 0, 0, 0))
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if a%2==0 or b%2==0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a%2==1 and b%2==1 and c%2==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a%2==1 and b%2==1 and c%2==1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if (a%2==1 and b%2==1 and c%2==1):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if(a%2==0 and b%2==0 and c%2==0):
  print('Yes')
else:
  print('No')
Problem p02642 (python)

Fixed submission:
# MAX = int(1e6)+2


n = int(input())
lis = list(map(int,input().split()))
lis.sort()
MAX = lis[-1]
lis2 = [0]*(MAX+1)
# lis.sort()
# m = max(lis)
ans = 0

for num in lis:
    for i in range(num, MAX+1, num):
            lis2[i] += 1

for j in set(lis):
    if lis2[j] == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
# MAX = int(1e6)+2


n = int(input())
lis = list(map(int,input().split()))
lis.sort()
MAX = lis[-1]
lis2 = [0]*MAX
# lis.sort()
# m = max(lis)
ans = 0

for num in lis:
    for i in range(num, MAX, num):
            lis2[i] += 1

for j in set(lis):
    if lis2[j] == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
MAX = int(2e5)+2


n = int(input())
lis = list(map(int,input().split()))
lis2 = [0]*MAX
# lis.sort()
# m = max(lis)
ans = 0
for num in lis:
    lis2[num] += 1

for num in lis:
    for i in range(num*2, MAX, num):
        if lis2[i] > 0:
            lis2[i] += 1

print(len([i for i in lis if lis2[i] == 1]))

Buggy submission (verdict: Runtime Error):
MAX = int(2e5)+1


n = int(input())
lis = list(map(int,input().split()))
lis2 = [0]*MAX
# lis.sort()
# m = max(lis)
ans = 0
for num in lis:
    lis2[num] += 1

for num in lis:
    for i in range(num*2, MAX, num):
        if lis2[i] > 0:
            lis2[i] += 1

print(len([i for i in lis if lis2[i] == 1]))

Buggy submission (verdict: Runtime Error):
MAX = int(2e5)+1


n = int(input())
lis = list(map(int,input().split()))
lis2 = [0]*MAX
# lis.sort()
# m = max(lis)
ans = 0
for num in lis:
    lis2[num] += 1

for num in lis:
    for i in range(num*2, MAX+1, num):
        if lis2[i] > 0:
            lis2[i] += 1

print(len([i for i in lis if lis2[i] == 1]))

Buggy submission (verdict: Runtime Error):
MAX = int(2e5)


n = int(input())
lis = list(map(int,input().split()))
lis2 = [0]*MAX
# lis.sort()
# m = max(lis)
ans = 0
for num in lis:
    lis2[num] += 1

for num in lis:
    for i in range(num*2, MAX, num):
        if lis2[i] > 0:
            lis2[i] += 1

print(len([i for i in lis if lis2[i] == 1]))