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

Fixed submission:
a=int(input())
b=int(input())
print(2*b-a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(2b-a)
Problem p03795 (python)

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

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

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

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

Fixed submission:
print(len(set(map(int,input().split()))))

Buggy submission (verdict: Runtime Error):
print(len(list(set(int,input().split()))))
Problem p04012 (python)

Fixed submission:
a=list(input())
sum=0
b=list(set(a))
for i in range(len(b)):
  if a.count(b[i])%2==0:
    sum+=1
print("Yes" if sum==len(b) else "No")

Buggy submission (verdict: Runtime Error):
a=list(input())
sum=0
b=set(a)
for i in range(len(b)):
  if a.count(b[i])%2==0:
    sum+=1
print("Yes" if sum==len(b) else "No")
Problem p04030 (python)

Fixed submission:
a=list(input())
b=[]
for i in range(len(a)):
  if a[i]=="0":
    b.append("0")
  elif a[i]=="1":
    b.append("1")
  else:
    if b!=[]:
      b.pop()
print(*b,sep="")

Buggy submission (verdict: Runtime Error):
a=list(input())
b=[]
for i in range(len(a)):
  if a[i]=="0":
    b.append("0")
  elif a[i]=="1":
    b.append("1")
  else:
    b.pop()
print(*b,sep="")
Problem p02981 (python)

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

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

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

	print(min(a))

Buggy submission (verdict: Runtime Error):
L,R=map(int,input().split())
a=[]
if R-L>=2019:
	print(0)
else:
	for i in range(L,R+1):
		for j in range(i+1,R+1):
			a.append((i%2019)*(j%2019)%2019)

print(min(a))

Buggy submission (verdict: Runtime Error):
L,R=map(input().split())
if int(R/2019)-int(L/2019)>=1 or (R/2019.is_integer)==True or (L/2019.is_integer)==True:
	print(0)
elif R-L>=3:
	if int((R+1346)/2019)-int(L/2019)>=1 or int(R/2019)-int((L-674)/2019)>=1:
		print(0)
	elif int((R+673)/2019)-int(L/2019)>=1 or int(R/2019)-int((L-1347)/2019)>=1:
		print(0)
	else:
		print(min((i*j)/2019 for i<j in range(L,R+1)))
else:
	print(min((i*j)/2019 for i<j in range(L,R+1)))
Problem p02993 (python)

Fixed submission:
S=input()
x=str(S)
if x[0]==x[1]:
	print('Bad')
elif x[1]==x[2]:
	print('Bad')
elif x[2]==x[3]:
	print('Bad')
else:
	print('Good')

Buggy submission (verdict: Runtime Error):
S=int(input())
x=str(S)
if x[0]==x[1]:
	print('Bad')
elif x[1]==x[2]:
	print('Bad')
elif x[2]==x[3]:
	print('Bad')
else:
	print('Good')
Problem p03000 (python)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
count=0
length=0
while length<=X:
	count=count+1
	if count==N+1:
		break
	length=length+L[count-1]
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
count=0
length=0
while length<=X:
	length=length+L[count]
	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
a=[]
for i in range(N):
	a.append(list(map(int,input().split())))
n=0
d=0
while n<=N:
	if d>X:
		break
	else:
		d=d+a[n]
		n=n+1

print(n+1)

Buggy submission (verdict: Runtime Error):
N,X=map(int,input().split())
a=[]
for i in range(N):
	a.append(map(int,input().split()))
n=0
d=0
while n<=N:
	if d>X:
		break
	else:
		d=d+a[n]
		n=n+1

print(n+1)
Problem p03219 (python)

Fixed submission:
X,Y=map(int,input().split())
print(int(X+Y/2))

Buggy submission (verdict: Runtime Error):
X,Y=int(input())
print(int(X+Y/2))
Problem p02534 (python)

Fixed submission:
k = int(input())

ans = "ACL" * k

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if b < c or d < a:
    print("No")
else:
    print("Yes")

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

if b < c or d < a:
    print("No")
else:
    print("Yes")

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

if b <= c or d <= a:
    print("No")
else:
    print("Yes")
Problem p02582 (python)

Fixed submission:
s = input()
if s[0] == s[1] == s[2] == "R":
    print(3)
elif s[0] == s[1] == "R" or s[1] == s[2] == "R":
    print(2)
elif "R" in s:
    print(1)
else:
    print(0)

Buggy submission (verdict: Runtime Error):
print(sum(input() in "R"*i for i in range(3)))
Problem p02588 (python)

Fixed submission:
class BIT:
    def __init__(self, n):
        #A1 ... AnのBIT(1-indexed)
        self.BIT = [0] * (n + 1)
        self.n = n

    #A1 ~ Aiまでの和 O(logN)
    def query(self, idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx & (-idx)
        return res_sum

    #Ai += x O(logN)
    def add(self, idx, x):
        while idx <= self.n:
            self.BIT[idx] += x
            idx += idx&(-idx)
        return
def get_int(f):
    if "." not in f:
        return int(f),0
    return int(f.replace(".","")),len(f)-f.index(".")-1
n = int(input())
p = []
for i in range(n):
    a, b = get_int(input())
    c, d = 0, 0
    while a % 2 == 0:
        c += 1
        a //= 2
    while a % 5 == 0:
        d += 1
        a //= 5
    c -= b
    d -= b
    p.append((c, d))
p.sort()
now = n - 1
t = BIT(200)
ans = 0
for i in range(n):
    for j in range(now, i, -1):
        if p[i][0] + p[j][0] >= 0:
            t.add(-p[j][1] + 100, 1)
            now -= 1
        else:
            break
    if now < i:
        t.add(-p[i][1] + 100, -1)
    ans += max(0, t.query(100 + p[i][1]))

print(ans)

Buggy submission (verdict: Runtime Error):
class BIT:
    def __init__(self, n):
        #A1 ... AnのBIT(1-indexed)
        self.BIT = [0] * (n + 1)
        self.n = n

    #A1 ~ Aiまでの和 O(logN)
    def query(self, idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx & (-idx)
        return res_sum

    #Ai += x O(logN)
    def add(self, idx, x):
        while idx <= self.n:
            self.BIT[idx] += x
            idx += idx&(-idx)
        return
def get_int(f):
    if "." not in f:
        return int(f),0
    return int(f.replace(".","")),len(f)-f.index(".")-1
n = int(input())
p = []
for i in range(n):
    a, b = get_int(input())
    c, d = 0, 0
    while a % 2 == 0:
        c += 1
        a //= 2
    while a % 5 == 0:
        d += 1
        a //= 5
    c -= b
    d -= b
    p.append(c * 300000 + d)
p.sort()
for i in range(n):
    p[i] = (p[i] // 300000, p[i] % 300000)
now = n - 1
t = BIT(50)
ans = 0
for i in range(n):
    for j in range(now, i, -1):
        if p[i][0] + p[j][0] >= 0:
            t.add(-p[j][1] + 25, 1)
            now -= 1
        else:
            break
    if now < i:
        t.add(-p[i][1] + 25, -1)
    ans += max(0, t.query(25 + p[i][1]))

print(ans)
Problem p02612 (python)

Fixed submission:
n = int(input())
n %= 1000
print(1000 - n if 1000 - n < 1000 else 0)

Buggy submission (verdict: Runtime Error):
print(1000-int(input())%1000)%1000
Problem p02618 (python)

Fixed submission:
import sys
from random import randint
from time import time
start = time()
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline


def get_sat():
    sat = 0
    when = [-1] * 26
    for i in range(d):
        sat += s[i][t[i]]
        when[t[i]] = i
        for j in range(26):
            sat -= c[j] * (i - when[j])
    return sat


d = int(input())
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
t = [randint(0, 25) for i in range(d)]
ans = get_sat()
told = t[:]
while time() - start < 1.7:
    p, q = randint(0, d - 1), randint(0, 25)
    t[p] = q
    if ans <= get_sat():
        told = t[:]
    else:
        t = told[:]
for i in t:
    print(i+1)

Buggy submission (verdict: Runtime Error):
import sys
from random import randint
from time import time
start = time()
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline

for i in range(d):
    print(randint(1,26))
Problem p02632 (python)

Fixed submission:
mod = 10**9 + 7  # 998244353 # 変える


def table():
    k = 2 * 10**6 + 5  # 変える
    fac = [1] * k
    finv = [1] * k
    inv = [0] * k
    inv[1] = 1
    for i in range(2, k):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = table()


def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


k = int(input())
s = input()
n = len(s) - 1
ans = 1
for i in range(k + 1):
    x = pow(26, k - i, mod) * pow(25, i, mod) % mod
    ans += (comb(n + i, i) * x)
    ans %= mod
print((ans - 1) % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7  # 998244353 # 変える


def table():
    k = 2 * 10**5 + 5  # 変える
    fac = [1] * k
    finv = [1] * k
    inv = [0] * k
    inv[1] = 1
    for i in range(2, k):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = table()


def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


k = int(input())
s = input()
n = len(s) - 1
ans = 1
for i in range(k + 1):
    x = pow(26, k - i, mod) * pow(25, i, mod) % mod
    ans += (comb(n + i, i) * x)
    ans %= mod
print((ans - 1) % mod)

Buggy submission (verdict: Runtime Error):
mod = 10**9 + 7  # 998244353 # 変える


def table():
    k = 2 * 10**5 + 5  # 変える
    fac = [1] * k
    finv = [1] * k
    inv = [0] * k
    inv[1] = 1
    for i in range(2, k):
        fac[i] = fac[i - 1] * i % mod
        inv[i] = mod - inv[mod % i] * (mod // i) % mod
        finv[i] = finv[i - 1] * inv[i] % mod
    return fac, finv


fac, finv = table()


def comb(n, k):
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod


k = int(input())
s = input()
n = len(s) - 1
ans = 1
for i in range(k + 1):
    x = pow(26, k - i, mod) * pow(25, i, mod) % mod
    ans += (comb(n + i, i) * x)
print((ans - 1) % mod)
Problem p02642 (python)

Fixed submission:
M=10**6+10
c=[0]*M
n=int(input())
a=sorted(list(map(int,input().split())))
for k in a:
    if c[k]:
        c[k]=2
        continue
    for i in range(k,M,k):
        c[i]+=1
ans=0
for i in a:
    if c[i]==1:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()　#小さい順位欲しいとき
    return divisors

n=int(input())
a=sorted(list(map(int,input().split())))
dic={}
for k in a:
    if k in dic:
        dic[k]=0
        continue
    print(x)
    f=1
    for i in x:
        if i in dic:
            f=0
            break
    if f:
        dic[k]=1
print(sum(dic.values()))
Problem p02651 (python)

Fixed submission:
# 解説AC
def solve():
    n=int(input())
    a=list(map(int,input().split()))
    s=input()
    basis=[]
    for i in range(n-1,-1,-1):
      	# 基底を求める
        for e in basis:
            a[i]=min(a[i],a[i]^e)
        if a[i]:
            if s[i]=="0":
                basis.append(a[i])
            else:
                print(1)
                return
    print(0)

t=int(input())
for _ in range(t):
    solve()

Buggy submission (verdict: Runtime Error):
wa
Problem p02664 (python)

Fixed submission:
t=list(input())
if len(t)==1:
    if t[0]=="?":
        print("D")
    else:
        print(*t)
    exit()
if t[0]=="?":
    if t[1]=="?":
        t[0]="P"
        t[1]="D"
    elif t[1]=="D":
        t[0]="P"
    else:
        t[0]="D"
for i in range(1,len(t)-1):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        elif t[i-1]=="D":
            if t[i+1]=="P":
                t[i]="D"
            else:
                t[i]="P"
if t[-1]=="?":
    t[-1]="D"
print(*t,sep="")

Buggy submission (verdict: Runtime Error):
t=list(input())
if len(t)==1:
    if t[0]=="?":
        print("D")
    else:
        print(*t)
if t[0]=="?":
    if t[1]=="?":
        t[0]="P"
        t[1]="D"
    elif t[1]=="D":
        t[0]="P"
    else:
        t[0]="D"
for i in range(1,len(t)-1):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        elif t[i-1]=="D":
            if t[i+1]=="P":
                t[i]="D"
            else:
                t[i]="P"
if t[-1]=="?":
    t[-1]="D"
print(*t,sep="")

Buggy submission (verdict: Runtime Error):
t=list(input())
i=0
if t[i]=="?":
    if t[i+1]=="P":
        t[i]="D"
    else:
        t[i]="P"
for i in range(len(t)-1):
    if t[i]=="?":
        if t[i+1]=="P":
            t[i]="D"
        elif t[i+1]=="D":
            t[i]="P"
        else:
            t[i]="P"
            t[i+1]="D"
if t[-1]=="?":
    t[-1]="D"
print(*t,sep="")
Problem p02669 (python)

Fixed submission:
import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
t=int(input())
INF=10**19
def dfs(k):
    if k==1:return d
    if k==0:return 0
    if k in dic:return dic[k]
    ans=k*d
    ans=min(ans,dfs(k//2)+a+k%2*d,dfs((k+1)//2)+a+-k%2*d,dfs(k//3)+b+k%3*d,dfs((k+2)//3)+b+-k%3*d,dfs(k//5)+c+k%5*d,dfs((k+4)//5)+c+-k%5*d)
    dic[k]=ans
    return ans
for _ in range(t):
    dic={}
    n,a,b,c,d=map(int,input().split())
    print(dfs(n))

Buggy submission (verdict: Runtime Error):
def f(k):
    if k==1:return d
    if k==0:return 0
    if k in dic:return m[k]
    s=k*d
    s=min(s,f(k//2)+a+k%2*d,f((k+1)//2)+a+-k%2*d,f(k//3)+b+k%3*d,f((k+2)//3)+b+-k%3*d,f(k//5)+c+k%5*d,f((k+4)//5)+c+-k%5*d)
    m[k]=s
    return s
for _ in range(int(input())):
    m={}
    n,a,b,c,d=map(int,input().split())
    print(s(n))
Problem p02675 (python)

Fixed submission:
n=int(input())%10
if n==2 or n==4 or n==7 or n==9 or n==5:
    print("hon")
elif n==3:
    print("bon")
else:
    print("pon")

Buggy submission (verdict: Runtime Error):
k=int(input())
s=input()
print(s if len(s)<=k else s[:k]+"...")
Problem p02677 (python)

Fixed submission:
from math import comb, factorial, gcd, isqrt, perm, exp, log, log2, log10, sqrt, pi, acos, asin, atan ,atan2, cos, sin, tan

a,b,h,m=map(int,input().split())
h%12
t=min(abs(30*h+0.5*m-6*m),360-abs(30*h+0.5*m-6*m))
c=(a**2+b**2-2*a*b*cos(pi*t/180))**0.5
print(c)

Buggy submission (verdict: Runtime Error):
from math import comb, factorial, gcd, isqrt, perm, exp, log, log2, log10, sqrt, pi, acos, asin, atan ,atan2, cos, sin, tan

a,b,h,m=map(int,input().split())
h%12
t=min(abs(30*h+0.5*m-6*m),360-abs(30*h+0.5*m-6*m))
c=(a**2+b**2-2*a*b*cos(pi*t/180))**0.5
print(c)
Problem p02743 (python)

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

Buggy submission (verdict: Runtime Error):
from decimal import Decimal,getcontext
getcontext().prec = 100 # 標準は28 その桁まで精度を保つ
a,b,c=map(Decimal,input().split())
print("Yes" if sqrt(a)+sqrt(b)<sqrt(c) else "No")
Problem p02756 (python)

Fixed submission:
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
s=input()
a=[]
b=[]
now=1
q=int(input())
for i in range(q):
    x=list(input().split())
    if x[0]=="1":
        now*=-1
    else:
        if now==1 and x[1]=="2" or now==-1 and x[1]=="1":
            b.append(x[2])
        else:
            a.append(x[2])
if now==-1:
    ans=b[::-1]+list(s[::-1])+a
    print(*ans,sep="")
else:
    ans=a[::-1]+list(s)+b
    print(*ans,sep="")

Buggy submission (verdict: Runtime Error):
s=input()
a=[]
b=[]
now=True
q=int(input())
for i in range(q):
    x=list(input().split())
    if x[0]=="1":
        now=not now
    else:
        if now and x[1]=="2" or not now and x[1]=="1":
            b.append(x[2])
        else:
            a.append(x[2])
if now:
    print(*a[::-1],s,*b,sep="")
else:
    print(*b[::-1],s[::-1],*a,sep="")
Problem p02786 (python)

Fixed submission:
h=int(input())
i=0
ans=0
while h>0:
    ans+=(1<<i)
    h//=2
    i+=1
print(ans)

Buggy submission (verdict: Runtime Error):
print(2**bit_length(int(input())-1)

Buggy submission (verdict: Runtime Error):
h,n=map(int,input().split())
a=[list(map(int,input().split())) for i in range(n)]
# ans=1
# for i in range(n):
#     ans+=a[i][0]
M=10**12
dp=[[M for i in range(max(h+10010,2*h+2))] for j in range(n+1)]
for i in range(n+1):
    dp[i][0]=0
for i in range(n):
    for j in range(max(h+10010,2*h+2)):
        if j<a[i][0]:
            dp[i+1][j]=dp[i][j]
        elif dp[i+1][j-a[i][0]]<M and dp[i][j]<M:
            dp[i+1][j]=min(dp[i][j],dp[i+1][j-a[i][0]]+a[i][1])
        elif dp[i+1][j-a[i][0]]<M:
            dp[i+1][j]=dp[i+1][j-a[i][0]]+a[i][1]
        elif dp[i][j]<M:
            dp[i+1][j]=dp[i][j]
# for i in range(n+1):
#     print(dp[i])
for i in range(h,max(h+10010,2*h+2)):
    if dp[n][i]<M:
        print(dp[n][i])
        exit()
Problem p02803 (python)

Fixed submission:
import queue
import itertools
r,c=map(int,input().split())
s=[list(input()) for i in range(r)]
ans=0
for i1 in range(r):
    for i2 in range(c):
        p=0
        a=[[s[j][i] for i in range(c)] for j in range(r)]
        sy,sx=i1,i2
        if a[sy][sx]=="#":
            continue
                #print(sy,sx,gy,gx)
        q = queue.Queue()
        d=[(-1,0),(1,0),(0,-1),(0,1)]
        a[sy][sx]=0
        for i in d:
            if 0<=sy+i[0]<r and 0<=sx+i[1]<c and a[sy+i[0]][sx+i[1]]==".":
                a[sy+i[0]][sx+i[1]]=1
                q.put((sy+i[0],sx+i[1]))
        while not q.empty():
            y,x=q.get()
            for i in d:
                if 0<=y+i[0]<r and 0<=x+i[1]<c and a[y+i[0]][x+i[1]]==".":
                    a[y+i[0]][x+i[1]]=a[y][x]+1
                    q.put((y+i[0],x+i[1]))
        for i in range(r):
            for j in range(c):
                if type(a[i][j])==int:
                    p=max(p,a[i][j])
        ans=max(p,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import queue
import itertools
r,c=map(int,input().split())
s=[list(input()) for i in range(r)]
ans=0
for i1 in range(r):
    for i2 in range(c):
        p=0
        a=[[s[j][i] for i in range(c)] for j in range(r)]
        sy,sx=i1,i2
        if a[sy][sx]=="#":
            break
                #print(sy,sx,gy,gx)
        q = queue.Queue()
        d=[(-1,0),(1,0),(0,-1),(0,1)]
        a[sy][sx]=0
        for i in d:
            if 0<=sy+i[0]<r and 0<=sx+i[1]<c and a[sy+i[0]][sx+i[1]]==".":
                a[sy+i[0]][sx+i[1]]=1
                q.put((sy+i[0],sx+i[1]))
        while not q.empty():
            y,x=q.get()
            for i in d:
                if 0<=y+i[0]<r and 0<=x+i[1]<c and a[y+i[0]][x+i[1]]==".":
                    p=a[y][x]+1
                    q.put((y+i[0],x+i[1]))
                ans=max(p,ans)
print(ans)
Problem p02843 (python)

Fixed submission:
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
x=int(input())
dp=[0]*(max(x+1,200))
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1
if x<=199:
    print(dp[x])
    exit()
for i in range(200,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[x])

Buggy submission (verdict: Runtime Error):
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
x=int(input())
dp=[0]*(x+1)
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1
if x<=199:
    print(dp[x])
    exit()
for i in range(200,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[x])

Buggy submission (verdict: Runtime Error):
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
import sys
input = sys.stdin.readline
x=int(input())
dp=[0]*(x+1)
dp[100]=1
dp[101]=1
dp[102]=1
dp[103]=1
dp[104]=1
dp[105]=1
for i in range(200,x+1):
    if dp[i-100]==1 or dp[i-101]==1 or dp[i-102]==1 or dp[i-103]==1 or dp[i-104]==1 or dp[i-105]==1:
        dp[i]=1
print(dp[x])
Problem p02844 (python)

Fixed submission:
def search(a):
    x=0
    a="".join(["0"*(3-len(a)),a])
    for i in range(n):
        if a[x]==s[i]:
            x+=1
            if x==3:
                return True
    return False
n=int(input())
s=input()
ans=0
k=[False]*1000
for i in range(1000):
    k[i]=search(str(i))
for i in k:
    if i:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
def list_count(my_list):
    dic={} #辞書型の宣言
    for num in my_list:
        if num in dic: #もしnumがkeyとして辞書にあれば
            dic[num]+=1 #valueに+1
        else: #なければ
            dic[num]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic
import sys
input = sys.stdin.readline
n=int(input())
s=list(input())
for i in range(n):
    s[i]=int(s[i])
l=[0]*1000
a=list(list_count(s).values())
#print(a)
n=len(a)
m=3
dp=[[0 for i in range(n+1)] for j in range(m+1)]

#メイン
#dp[i+1][j]:=i番目までの品物からj個選ぶ組み合わせの総数

for i in range(n+1):
    dp[i][0]=1
for i in range(n):
    for j in range(1,m+1):
        if j-1-a[i]>=0:
            dp[i+1][j]=(dp[i+1][j-1]+dp[i][j]-dp[i][j-1-a[i]])
        else:
            dp[i+1][j]=(dp[i+1][j-1]+dp[i][j])

#出力
print(dp[n][m])

Buggy submission (verdict: Runtime Error):
'''
　 ∧_,,∧    究極奥義「WAがACになーれ！！」
　（`・ω・)つ━☆・*。
　⊂　　 ノ 　　　・゜+.
　 し’´Ｊ　　*・ 
'''
def list_count(my_list):
    dic={} #辞書型の宣言
    for num in my_list:
        if num in dic: #もしnumがkeyとして辞書にあれば
            dic[num]+=1 #valueに+1
        else: #なければ
            dic[num]=1 #dicにnumというkeyを追加し、対応するvalueを1とする
    return dic
import sys
input = sys.stdin.readline
n=int(input())
s=list(input())
for i in range(n):
    s[i]=int(s[i])
l=[0]*1000
a=list(list_count(s).values())
print(a)
n=len(a)
m=3
dp=[[0 for i in range(n+1)] for j in range(m+1)]

#メイン
#dp[i+1][j]:=i番目までの品物からj個選ぶ組み合わせの総数

for i in range(n+1):
    dp[i][0]=1
for i in range(n):
    for j in range(1,m+1):
        if j-1-a[i]>=0:
            dp[i+1][j]=(dp[i+1][j-1]+dp[i][j]-dp[i][j-1-a[i]])
        else:
            dp[i+1][j]=(dp[i+1][j-1]+dp[i][j])

#出力
print(dp[n][m])
Problem p02882 (python)

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

if a*b>=2*x:
    print (math.degrees(math.pi/2-math.atan(2*x/(b**2))))
else:
    y=2*x/a-b
    try:
        print(math.degrees(math.pi/2-math.atan(a/(b-y))))
    except ZeroDivisionError:
        print(0)

Buggy submission (verdict: Runtime Error):
import math
a,b,x= map(int, input().split())
x/=a

if a*b>=2*x:
    print (math.degrees(math.pi/2-math.atan(2*x/(b**2))))
else:
    y=2*x/a-b
    print(math.degrees(math.pi/2-math.atan(a/(b-y))))
Problem p02888 (python)

Fixed submission:
import bisect
n=int(input())
cnt=0
l= list(map(int, input().split()))
l.sort(reverse=True)
k=[[0 for i in range(n-2)] for j in range(n-2)]
for i in range(n-2):
    for j in range(i,n-2):
        k[i][j-i]=-l[i+1]-l[j+2]
#print(k)
for i in range(n-1):
    x=i
    while x<n-2:
        cnt+=bisect.bisect_left(k[x],-l[i])
        #print(l[i],bisect.bisect_left(k[x],-l[i]))
        x+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
n=int(input())
cnt=0
l= list(map(int, input().split()))
l.sort(reverse=True)
k=[[0 for i in range(n-2)] for j in range(n-2)]
for i in range(n-2):
    for j in range(i,n-2):
        k[i][j-i]=-l[i+1]-l[j+2]
#print(k)
for i in range(n-1):
    x=i
    while x<n-2:
        cnt+=bisect.bisect_left(k[x],-l[i])
        #print(l[i],bisect.bisect_left(k[x],-l[i]))
        x+=1
print(cnt)