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

Fixed submission:
MOD = 10**9+7
def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res

def cmb(n,k,p):
    if n < k:
        return 0
    if n-k<k:
        k=n-k

    # 分母
    comb = 1
    for x in range(n-k+1, n+1):
        comb = (comb * x) % MOD

    # 逆行列
    d = 1
    for x in range(1, k+1):
        d = (d * x) % MOD
    comb *= pow(d, MOD-2, MOD)
    return comb % MOD

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

# 2**n-1
total = power_func(2,n,MOD)-1
print((total-cmb(n,a,MOD)-cmb(n,b,MOD))%MOD)

Buggy submission (verdict: Runtime Error):
import numpy as np
MOD = 10**9+7
def power_func(a,n,p):
  bi=str(format(n,"b"))#2進表現に
  res=1
  for i in range(len(bi)):
    res=(res*res) %p
    if bi[i]=="1":
      res=(res*a) %p
  return res
 
def prepare(n, MOD):
    nrt = int(n ** 0.5) + 1
    nsq = nrt * nrt
    facts = np.arange(nsq, dtype=np.int64).reshape(nrt, nrt)
    facts[0, 0] = 1
    for i in range(1, nrt):
        facts[:, i] = facts[:, i] * facts[:, i - 1] % MOD
    for i in range(1, nrt):
        facts[i] = facts[i] * facts[i - 1, -1] % MOD
    facts = facts.ravel().tolist()
 
    invs = np.arange(1, nsq + 1, dtype=np.int64).reshape(nrt, nrt)
    invs[-1, -1] = pow(facts[-1], MOD - 2, MOD)
    for i in range(nrt - 2, -1, -1):
        invs[:, i] = invs[:, i] * invs[:, i + 1] % MOD
    for i in range(nrt - 2, -1, -1):
        invs[i] = invs[i] * invs[i + 1, 0] % MOD
    invs = invs.ravel().tolist()
 
    return facts, invs

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

n,a,b=list(map(int,input().split()))
fact,factinv=prepare(n,MOD)

# 2**n-1
total = power_func(2,n,MOD)-1
print(total-cmb(n,a,MOD)-cmb(n,b,MOD))
Problem p02772 (python)

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            print('DENIED')
            exit()
print('APPROVED')

Buggy submission (verdict: Runtime Error):
n=int(input)
A=list(map(int,input().split()))
for a in A:
    if a%2==0:
        if a%3!=0 and a%5!=0:
            print('DENIED')
            exit()
print('APPROVED')
Problem p02946 (python)

Fixed submission:
k,x=[int(i) for i in input().split()]

left=max(-1000000,x-k+1)
right=min(x+k-1,1000000)
for i in range(left,right+1):
    print(i,end=' ')
print()

Buggy submission (verdict: Runtime Error):
k,x=[int(i) for i in input().split()]

left=max(−1000000,x-k+1)
right=min(x+k-1,1000000)
for i in range(left,right+1):
    print(i,end=' ')
print()
Problem p02993 (python)

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

Buggy submission (verdict: Runtime Error):
s=input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3] or s[3]==s[4]:
    print('Bad')
else:
    print('Good')
Problem p03044 (python)

Fixed submission:

import sys
sys.setrecursionlimit(1000000)
def dfs(now,color):
    col[now]=color
    for n,w in nodes[now]:
        if col[n]!=-1:
            continue
        if w%2==0:
            dfs(n,color)
        else:
            dfs(n,1-color)

n=int(input())

nodes=[]
for i in range(n+1):
    nodes.append([])
for i in range(n-1):
    s,e,w = map(int,input().split())
    nodes[s].append((e,w))
    nodes[e].append((s,w))

col=[-1]*(n+1)

dfs(1,1)

for i in range(1,n+1):
    print(col[i])

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

nodes=[]
for i in range(n+1):
    nodes.append([])
for i in range(n-1):
    s,e,w = map(int,input().split())
    nodes[s].append((e,w))
    nodes[e].append((s,w))

col=[-1]*(n+1)

def dfs(now,color):
    col[now]=color
    for n,w in nodes[now]:
        if col[n]!=-1:
            continue
        if w%2==0:
            dfs(n,color)
        else:
            dfs(n,1-color)

dfs(1,1)

for i in range(1,n+1):
    print(col[i])

Buggy submission (verdict: Runtime Error):
def dfs(now,color):
    col[now]=color
    for n,w in nodes[now]:
        if col[n]!=-1:
            continue
        if w%2==0:
            dfs(n,color)
        else:
            dfs(n,1-color)

n=int(input())

nodes=[]
for i in range(n+1):
    nodes.append([])
for i in range(n-1):
    s,e,w = map(int,input().split())
    nodes[s].append((e,w))
    nodes[e].append((s,w))

col=[-1]*(n+1)

dfs(1,1)

for i in range(1,n+1):
    print(col[i])

Buggy submission (verdict: Runtime Error):
def dfs(now,parent,color):
    col[now]=color
    for node in nodes[now]:
        if node[0]==parent:
            continue
        if node[1]%2==0:
            dfs(node[0],now,color)
        else:
            dfs(node[0],now,1-color)

n=int(input())
e_list = [[int(i) for i in input().split()] for i in range(n-1)]
col=[-1]*n

nodes={}
for e in e_list:
    nodes.setdefault(e[0]-1, []).append((e[1]-1,e[2]))
    nodes.setdefault(e[1]-1, []).append((e[0]-1,e[2]))

dfs(0,-1,1)

for c in col:
    print(c)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

n = int(input())
a_l =[int(i) for i in input().split()]

left=[0]
right=[0]

for i in range(1,n+1):
    left.append(gcd(left[i-1],a_l[i-1]))
    right.append(gcd(right[i-1],a_l[n-i]))
right=right[::-1]

ans=1
for i in range(n):
    ans=max(ans,gcd(left[i],right[i+1]))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

n = int(input())
a_l =[int(i) for i in input().split()]
a_l.append(a_l[n-2])
max_gcd=reduce(math.gcd, a_l)
for i in range(n):
    tmp = a_l[i]
    a_l[i] = a_l[i+1]
    max_gcd=max(max_gcd,reduce(math.gcd, a_l))
    a_l[i] = tmp
print(max_gcd)
Problem p03069 (python)

Fixed submission:
n = int(input())
s_input = input() 

check=s_input.count('.')
ans=check
for s in s_input:
    if s=='.':
        # 変えんでいい
        check-=1
    else:
        check+=1
    ans=min(ans,check)
print(ans)

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

def judge(s,count):
    if s.count("#.")==0:
        return count

    next=""
    for i in range(0,n-1):
        if s[i]=="#" and s[i+1]==".":
            next1 = s[:i] + "##"
            if i<n-2:
                next1+=s[i+2:]
            pat1 = judge(next1,count+1)

            pat2=pat1
            if i > 0 and s[i-1]==".":
                next2 = s[:i] + ".."
                if i < n-2:
                    next2+=s[i+2:]
                pat2 = judge(next2,count+1)
            return min(pat1,pat2)
    return count

print(judge(s_input,0))
Problem p03074 (python)

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

# 1-0-1-0-1の形式で集計する
count=0
now=1
num_list=[]
for c_i in s:
    if c_i == now:
        count+=1
    else:
        num_list.append(count)
        count=1
        now=1-now
num_list.append(count)

# 最後が0のグループだと都合が悪い
if len(num_list)%2==0:
    num_list.append(0)

# 累積和を使って部分列の合計の最大値を求める
max_len=0
now_sum=0
left=0
right=0

for i in range(0,len(num_list),2):
    nextleft=i
    nextright=min(len(num_list),i+2*k+1)

    while left<nextleft:
        now_sum-=num_list[left]
        left+=1
    while right<nextright:
        now_sum+=num_list[right]
        right+=1
    max_len=max(max_len,now_sum)
    
print(max_len)

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

def maxdpt(depth, slist):
    # すべて1の場合は終了
    if slist.count('1') == len(slist): 
        return len(slist)
    
    # 深さ最大の場合は終了
    if depth+1>k:
        return max(list(map(len, slist.split('0'))))

    max_len=0
    str_len=0
    for i,c in enumerate(slist):   # 0の部分文字列を取得
        if c=='1':
            continue
        # 0の部分文字列を仮に変えてみる
        for j in range(i+1,len(slist)):
            #次の1まで
            if slist[j]=='1':
                break
        s_tmp=list(slist)
        for index in range(i,j):
            s_tmp[index]='1'
        s_tmp = "".join(s_tmp)
        max_len=max(max_len,maxdpt(depth+1,s_tmp))
        i=j
    return max_len

print(maxdpt(0,s_base))
Problem p03129 (python)

Fixed submission:
a,b=map(int,input().split())
print('YES' if (a+1)//2>=b else "NO")

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
print('YES' if n=>2*(k-1) else 'NO')
Problem p03150 (python)

Fixed submission:
S = input()
N = len(S)
keyence="keyence"

for i in range(N-1):
    for j in range(i,N):
        try_str = S[:i] + S[j:]
        if try_str == keyence:
            print("YES")
            exit()
print("NO")

Buggy submission (verdict: Runtime Error):
S = input()
keyence_len = len("keyence")
keyence="keyence"

now=0
remove=False
removeout=False
for i in range(len(S)):
    if S[i]==keyence[now]:
        if remove:
            removeout = True
        now+=1
    else:
        if removeout:
            print("NO")
            exit()
        remove=True
if now==keyence_len:
    print("YES")
else:
    print("NO")
Problem p03323 (python)

Fixed submission:
a,b=map(int,input().split())
if a<= 8 and b<= 8:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split)
if a<= 8 and b<= 8:
    print('Yay!')
else:
    print(':(')
Problem p03351 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
if abs(a-c) <= d or (abs(a-b)<=d and abs(b-c)<=d):
    print('Yes')
else:
    print('No')

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

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

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
print(a if b >= a else a-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input())
print(a if b>=a else b)
Problem p03361 (python)

Fixed submission:
height,width=map(int,input().split())
graph = [[s for s in input()] for i in range(height)]

for r in range(height):
    for c in range(width):
        if graph[r][c]==".":
            continue

        if r>0 and graph[r-1][c]=="#":
            continue

        if r<width-1 and graph[r+1][c]=="#":
            continue

        if c>0 and graph[r][c-1]=="#":
            continue

        if c<height-1 and graph[r][c+1]=="#":
            continue

        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
height,width=map(int,input().split())
graph = [[s for s in input()] for i in range(height)]

for r in range(width):
    for c in range(height):
        if graph[r][c]==".":
            continue

        if r>0 and graph[r-1][c]=="#":
            continue

        if r<width-1 and graph[r+1][c]=="#":
            continue

        if c>0 and graph[r][c-1]=="#":
            continue

        if c<height-1 and graph[r][c+1]=="#":
            continue

        print("No")
        exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
height,width=map(int,input().split())
graph = [[s for s in input()] for i in range(height)]

for r in range(width):
    for c in range(height):
        if graph[r][c]==".":
            continue

        if r>1 and graph[r-1][c]=="#":
            continue

        if r<width-1 and graph[r+1][c]=="#":
            continue

        if c>1 and graph[r][c-1]=="#":
            continue

        if c<height-1 and graph[r][c+1]=="#":
            continue

        print("No")
        exit()
print("Yes")
Problem p03369 (python)

Fixed submission:
s = input()
print(700+100*s.count('o'))

Buggy submission (verdict: Runtime Error):
s = int(input())
print(700+100*s.count('o'))
Problem p03371 (python)

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

ans=a*x+b*y
for ci in range(max(x,y)+1):
    sumc = 2*ci*c
    sumc += (x-ci)*a if (x-ci)>0 else 0
    sumc += (y-ci)*b if (y-ci)>0 else 0
    ans=min(ans,sumc)

print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,x,y=map(int,input().split())
ans=a*x+b*y
if x==y:
    ans=min(ans,min(a,b)*x)
    ans=min(2*x*c)
elif x>y:
    ans=min(ans,a*(x-y)+2*y*c)
    ans=min(ans,2*x*c)
else:
    ans=min(ans,b*(y-x)+2*y*c)
    ans=min(ans,2*y*c)
print(ans)
Problem p03387 (python)

Fixed submission:
a,b,c=map(int,input().split())
max_n=max([a,b,c])
diff=3*max_n-a-b-c

if diff%2==0:
  print(diff//2)
else:
  print((diff+3)//2)

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
max_n=max(a,b,c)
diff=a+b+c-3*max_x
print((diff+1)//2)
Problem p03419 (python)

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

# 上端
edge_l=1
if m > 1:
    edge_l+=1
if n > 1:
    edge_l+=1
if m > 1 and n > 1:
    edge_l+=1

edge_l = 1 if edge_l%2==1 else 0

edge_c=3
if n > 1:
    edge_c+=3
edge_c = 1 if edge_c%2==1 else 0

edge_row=edge_l
if m>1:
    edge_row+=edge_l
if m>2:
    edge_row+=(m-2)*edge_c

# 中央部
inner_l = 3
if m > 1:
    inner_l+=3
inner_l = 1 if inner_l%2==1 else 0

inner_c=1 # 絶対に裏

inner_row=inner_l
if m>1:
    inner_row+=inner_l
if m>2:
    inner_row+=(m-2)*inner_c

# 合計
total=edge_row
if n>1:
    total+=edge_row
if n>2:
    total+=(n-2)*inner_row
print(total)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
print((n-2)*(m-2) if n>1 and m>1 else abs(abs(b-m)-1))
Problem p03435 (python)

Fixed submission:
c_list=[]
for i in range(3):
    c_list.append([int(i) for i in input().split()])

for a1 in range(101):
    b1 = c_list[0][0] - a1
    a2 = c_list[1][0] - b1
    a3 = c_list[2][0] - b1
    b2 = c_list[0][1] - a1
    b3 = c_list[0][2] - a1
    if a2 + b2 == c_list[1][1] and a2 + b3 == c_list[1][2] and a3 + b2 == c_list[2][1] and a3 + b3 == c_list[2][2]:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
sum=0
for i in range(3):
  sum+=sum([map(int,input().split())])
print("Yes" if sum%3==0 else "No")
Problem p03447 (python)

Fixed submission:
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Buggy submission (verdict: Runtime Error):
x=input()
a=input()
b=input()
print((x-a)%b)
Problem p03457 (python)

Fixed submission:
n=int(input())
tn,xn,yn=0,0,0
for _ in range(n):
    ti,xi,yi=map(int,input().split())
    td,xd,yd=ti-tn,xi-xn,yi-yn
    if td<xd+yd or (td+xd+yd)%2!=0:
        print('No')
        exit()
    tn,xn,yn=ti,xi,yi
print('Yes')

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

def CanReach(t,x,y,now_t,now_x,now_y):
    if now_x<0 or now_y<0 or now_x>10**5 or now_y>10**5:
        return False

    if t==now_t:
        if x==now_x and y==now_y:
            return True
        else:
            return False

    if CanReach(t,x,y,now_t+1,now_x+1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x-1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x,now_y+1) or \
       CanReach(t,x,y,now_t+1,now_x,now_y-1):
        return True
    return False

now_t,last_x,last_y=0,0,0
for _ in range(n):
    ti,xi,yi=map(int,input().split())
    if CanReach(ti,xi,yi,now_t,last_x,last_y)==False:
        print('No')
        exit()
    now_t,last_x,last_y=ti,xi,yi
print('Yes')

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

def CanReach(t,x,y,now_t,now_x,now_y):
    if now_x<0 or now_y<0 or now_x>10^5 or now_y>10^5:
        return False

    if t==now_t:
        if x==now_x and y==now_y:
            return True
        else:
            return False

    if CanReach(t,x,y,now_t+1,now_x+1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x-1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x,now_y+1) or \
       CanReach(t,x,y,now_t+1,now_x,now_y-1):
        return True
    return False

now_t,last_x,last_y=0,0,0
for _ in range(n):
    ti,xi,yi=map(int,input().split())
    if CanReach(ti,xi,yi,now_t,last_x,last_y)==False:
        print('No')
        exit()
    now_t,last_x,last_y=ti,xi,yi
print('Yes')

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

def CanReach(t,x,y,now_t,now_x,now_y):
    if now_x<0 or now_y<0:
        return False

    if t==now_t:
        if x==now_x and y==now_y:
            return True
        else:
            return False

    if CanReach(t,x,y,now_t+1,now_x+1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x-1,now_y) or \
       CanReach(t,x,y,now_t+1,now_x,now_y+1) or \
       CanReach(t,x,y,now_t+1,now_x,now_y-1):
        return True
    return False

now_t,last_x,last_y=0,0,0
for _ in range(n):
    ti,xi,yi=map(int,input().split())
    if CanReach(ti,xi,yi,now_t,last_x,last_y)==False:
        print('No')
        exit()
    now_t,last_x,last_y=ti,xi,yi
print('Yes')
Problem p03479 (python)

Fixed submission:
import math
x,y=map(int,input().split())
print(len(bin(y//x))-2)

Buggy submission (verdict: Runtime Error):
import numpy as np
x,y=map(int,input().split())
print(math.floor(np.log2(y/x)+1))
Problem p03694 (python)

Fixed submission:
n = int(input())
a_list = [int(i) for i in input().split()]
print(max(a_list) - min(a_list))

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = [int(i) for i in input().split()]
print(max[a_list] - min(a_list))
Problem p03773 (python)

Fixed submission:
a,b=map(int,input().split())
print((a+b)%24)

Buggy submission (verdict: Runtime Error):
a,m=map(int,input().split())
print((a+b)%24)
Problem p03246 (python)

Fixed submission:
import sys
N = int(input())
arr = list(map(int, input().split()))
if N == 2:
    print(0)
    sys.exit(0)


def update(start):
    dic = dict()
    for i in range(start, N, 2):
        if arr[i] in dic:
            dic[arr[i]] += 1
        else:
            dic[arr[i]] = 1
    return sorted(dic.items(), key=lambda ele: ele[1], reverse=True)


tuple_1 = update(0)
tuple_2 = update(1)

what_1, mx_1 = tuple_1[0]
what_2, mx_2 = tuple_2[0]

if what_1 == what_2:
    if len(tuple_1) == 1 and len(tuple_2) == 1:
        print(N//2)
    elif len(tuple_1) == 1:
        print(N//2 - tuple_2[1][1])
    elif len(tuple_2) == 1:
        print(N//2 - tuple_1[1][1])
    else:
        ans1 = N - tuple_1[0][1] - tuple_2[1][1]
        ans2 = N - tuple_1[1][1] - tuple_2[0][1]
        print(min(ans1, ans2))
else:
    print(N - mx_1 - mx_2)

Buggy submission (verdict: Runtime Error):
import sys
N = int(input())
arr = list(map(int, input().split()))
if N == 2:
    print(0)
    sys.exit(0)


def update(start):
    dic = dict()
    for i in range(start, N, 2):
        if arr[i] in dic:
            dic[arr[i]] += 1
        else:
            dic[arr[i]] = 1
    return sorted(dic.items(), key=lambda ele: ele[1], reverse=True)


tuple_1 = update(0)
tuple_2 = update(1)

what_1, mx_1 = tuple_1[0]
what_2, mx_2 = tuple_2[0]

if what_1 == what_2:
    if len(tuple_1) == 1 and len(tuple_2) == 1:
        print(N//2)
    elif len(tuple_1 == 1):
        print(N//2 - tuple_2[1][1])
    elif len(tuple_2 == 1):
        print(N//2 - tuple_1[1][1])
    else:
        ans1 = N - tuple_1[0][1] - tuple_2[1][1]
        ans2 = N - tuple_1[1][1] - tuple_2[0][1]
        print(min(ans1, ans2))
else:
    print(N - mx_1 - mx_2)
Problem p03448 (python)

Fixed submission:
a, b, c, x = map(int, [input() for i in range(4)])

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)

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

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)

Buggy submission (verdict: Runtime Error):
a,b,c,x=map(int, [input()　for i in range(4)])

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)

Buggy submission (verdict: Runtime Error):
a,b,c,x=map(int,[input()　for i in range(4)])

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)

Buggy submission (verdict: Runtime Error):
a,b,c,x=map(int,input()　for i in range(4))

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)

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

count=0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if k*50+j*100+i*500==x:
                count+=1
                
print(count)
Problem p02576 (python)

Fixed submission:
NXT = [int(i) for i in input().split(' ')]
import math
T_total = ( math.ceil( NXT[0]/ NXT[1] )*NXT[2] )

print (T_total)

Buggy submission (verdict: Runtime Error):
import math
T_total = ( math.ceil( N / X )*T )

print (T_total)
Problem p02576 (python)

Fixed submission:
n,x,t = map(int, input().split())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)

Buggy submission (verdict: Runtime Error):
n.x.t = map(int, input().split())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = int(input())
t = int(input())
w = n//x
if (n % x) == 0:
    print(w * t)
else:
    w += 1
    print(w * t)

Buggy submission (verdict: Runtime Error):
N = input()
X = input()
T = input()

wari = int( N / X )

if N % X == 0:
  print (wari)
  else
  wari = wari + 1
  print (wari)
Problem p02690 (python)

Fixed submission:
X = int(input())
Ans = []
for i in range(0, 1000):
  for j in range(-1000, 1000):
    ab = i**5 - j **5
    if ab == X:
      Ans.append([i, j])
ans = Ans[0]
print(ans[0], ans[1])

Buggy submission (verdict: Runtime Error):
X = int(input())
Ans = []
for i in range(-10, 11):
  for j in range(-10, 11):
    ab = i**5 - j **5
    if ab == X:
      Ans.append([i, j])
ans = Ans[0]
print(ans[0], ans[1])
Problem p02576 (python)

Fixed submission:
import math
n,x,t=map(int,input().split())
ans=math.ceil(n/x)*t
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n,x,t=map(int(input().split()))
ans=math.ceiling(n/x)*t
print(ans)
Problem p02973 (python)

Fixed submission:
from bisect import bisect_left

n = int( input() )
a = []
for i in range(n):
    a.append(int(input()))

min_stack = [a[-1]]

for i in range(2,n+1):
    if min_stack[-1] <= a[-i]:
        min_stack.append(a[-i])
    else:
        tmp = min_stack[bisect_left(min_stack, a[-i])]
        if tmp == a[-i]:
            min_stack[bisect_left(min_stack, a[-i]+1)] = a[-i]
        else:
            min_stack[bisect_left(min_stack, a[-i])] = a[-i]

print(len(min_stack))

Buggy submission (verdict: Runtime Error):
n = int( input() )
a = []
for i in range(n):
    a.append(int(input()))

max_color = 1
cnt_color = 1
stack = []
stack.append(a[0])
p = 0

for i in range(1,n):
    if a[i-1] >= a[i]:
        if stack[p] < a[i]:
            cnt_color -= 1
            stack.remove(p)
            p -= 1
        else:
            cnt_color += 1
            stack.append(a[i])
            p += 1
            if cnt_color > max_color:
                max_color += 1

print(max_color)
Problem p02993 (python)

Fixed submission:
password = input()

for i in range(3):
    if password[i] == password[i+1]:
        print('Bad')
        break
    elif i == 2:
        print('Good')

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

for i range(3):
  if pass[i] == pass [i+1]:
  	print('Bad')
  	break
  elif i == 2:
    print('Good')