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

Fixed submission:
def resolve():
    N, K = list(map(int, input().split()))
    S = input()
    seq = []
    cnt = 0
    for i in range(len(S)):
        if i == N-1 or S[i] != S[i+1]:
            seq.append([cnt+1, S[i]])
            cnt = 0
        else:
            cnt += 1
    #print(seq)
    left = 0
    right = 0
    maxlen = 0
    val = 0
    n_rev = 0
    for left in range(0, len(seq)):
        while (right < len(seq) and (n_rev < K or seq[right][1]=="1")):
            #print("left={}, right={}, n_rev={}".format(left, right, n_rev))
            cnt, state = seq[right]
            val += cnt
            if state == "0":
                n_rev += 1
            right += 1
        maxlen = max(maxlen, val)
        cnt, state = seq[left]
        val -= cnt
        if state == "0":
            n_rev -= 1
        if left == right:
            right += 1
    print(maxlen)
    

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, K = list(map(int, input().split()))
    S = input()
    S_small = ""
    cnt = 0
    for c in S:
        if c == "1":
            cnt += 1
        else:
            if cnt > 0:
                S_small += str(cnt)
                cnt = 0
            S_small += "0"
    if cnt > 0:
        S_small += str(cnt)
    S_small = list(S_small)
    #print(S_small)
    sizes = []
    opn = False
    cnt = 0
    idx = 0
    start = 0
    for end, c in enumerate(S_small):
        if c == "0":
            opn = True
            cnt += 1
        else:
            if opn:
                cnt += int(c)
                sizes.append((idx, cnt, start, end))
                idx += 1
                cnt = int(c)
                start = end
                opn = False
            else:
                cnt += int(c)
    if start != end:
        sizes.append((idx, cnt, start, None))
    #print(sizes)
    if sizes == []:
        print(N)
        return
    maxidx, maxcnt, _, __ = max(sizes, key=lambda x: x[1])
    leftidx = maxidx - 1 if maxidx > 0 else None
    rightidx = maxidx + 1 if maxidx < len(sizes)-1 else None
    ans = maxcnt
    for j in range(K-1):
        if leftidx is not None and leftidx >= 0:
            _, leftcnt, left_leftidx, left_rightidx = sizes[leftidx]
            left_leftedge, left_rightedge = int(S_small[left_leftidx]), int(S_small[left_rightidx])
            leftdiff = leftcnt - left_rightedge
        else:
            leftdiff = 0

        if rightidx is not None and rightidx <= len(sizes)-1:
            _, rightcnt, right_leftidx, right_rightidx = sizes[leftidx]
            right_leftedge, right_rightedge = int(S_small[right_leftidx]), int(S_small(right_rightidx))
            rightdiff = rightcnt - right_leftedge
        else:
            rightdiff = 0

        if leftidx < 0 and rightidx > len(sizes)-1:
            break

        if rightdiff < leftdiff:
            ans += leftdiff
            leftidx -= 1
        else:
            ans += rightdiff
            rightidx += 1
    print(ans)

    

if '__main__' == __name__:
    resolve()
Problem p03087 (python)

Fixed submission:
def resolve():
    (N, Q) = list(map(int, input().split(" ")))
    S = input()
    LRs = [list(map(int, input().split(" "))) for i in range(Q)]
    mem = [0] * N
    for i in range(N-1):
        if S[i] == "A" and S[i+1] == "C":
            mem[i+1] = mem[i] + 1
        else:
            mem[i+1] = mem[i]

    for (l, r) in LRs:
        print(mem[r-1]-mem[l-1])

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    (N, Q) = list(map(int, input().split(" ")))
    S = input()
    LRs = [list(map(int, input().split(" "))) for i in range(Q)]
    mem = [S[i:i+2] == "AC" for i in range(N-1)]

    for (l, r) in LRs:
        print(mem[l-1:r-1].sum(True))

if '__main__' == __name__:
    resolve()
Problem p03128 (python)

Fixed submission:
def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    required = [None]+[2,5,5,4,5,6,3,7,6]
    dp = [0 for _ in range(max(10, N+1))]
    candidates = {}
    for a in A:
        req = required[a]
        if dp[req] < a:
            dp[req] = a
            candidates[req] = a
    #print(dp)
    #print(candidates)
    for i in range(N+1):
        for n_match, num in candidates.items():
            if i - n_match >= 0 and dp[i-n_match] != 0:
                dp[i] = max(dp[i], dp[i-n_match]*10+num)
    #print(dp)
    print(dp[N])

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    required = [None]+[2,5,5,4,5,6,3,7,6]
    dp = [0 for _ in range(N+1)]
    candidates = {}
    for a in A:
        req = required[a]
        if dp[req] < a:
            dp[req] = a
            candidates[req] = a
    #print(dp)
    #print(candidates)
    for i in range(N+1):
        for n_match, num in candidates.items():
            if i - n_match >= 0 and dp[i-n_match] != 0:
                dp[i] = max(dp[i], dp[i-n_match]*10+num)
    #print(dp)
    print(dp[N])

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    required = [10**18]+[2,5,5,4,5,6,3,7,6]
    dp = [0 for _ in range(N+1)]
    candidates = {}
    for a in A:
        req = required[a]
        if dp[req] < a:
            dp[req] = a
            candidates[req] = a
    #print(dp)
    #print(candidates)
    for i in range(N+1):
        for n_match, num in candidates.items():
            if i - n_match >= 0 and dp[i-n_match] != 0:
                dp[i] = max(dp[i], int(str(dp[i-n_match])+str(num)))
    #print(dp)
    print(dp[N])

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    required = [10**18]+[2,5,5,4,5,6,3,7,6]
    dp = [0 for _ in range(N+1)]
    candidates = {}
    for a in A:
        req = required[a]
        if dp[req] < a:
            dp[req] = a
            candidates[req] = a
    #print(dp)
    #print(candidates)
    for i in range(N+1):
        for n_match, num in candidates.items():
            if i - n_match >= 0 and dp[i-n_match] != 0:
                dp[i] = max(dp[i], int(str(dp[i-n_match])+str(num)))
    #print(dp)
    print(dp[N])

if '__main__' == __name__:
    resolve()
Problem p03160 (python)

Fixed submission:
def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [0] * N

    dps[0] = 0
    dps[1] = abs(hs[1] - hs[0])
    for i in range(2, N):
        dps[i] = min(dps[i-1]+abs(hs[i]-hs[i-1]), dps[i-2]+abs(hs[i]-hs[i-2]))
    
    print(dps[-1])

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)

def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [None] * N

    def rec(dest):
        if dest == 0:
            dps[dest] = 0
        if dest == 1:
            dps[dest] = abs(hs[1]-hs[0])

        if dps[dest] is None:
            dps[dest] = min(rec(dest-1)+abs(hs[dest]-hs[dest-1]), rec(dest-2)+abs(hs[dest]-hs[dest-2]))
        
        return dps[dest]

    print(rec(N-1))

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [None] * N

    def rec(dest):
        if dest == 0:
            dps[dest] = 0
        if dest == 1:
            dps[dest] = abs(hs[1]-hs[0])

        if dps[dest] is None:
            dps[dest] = min(rec(dest-1)+abs(hs[dest]-hs[dest-1]), rec(dest-2)+abs(hs[dest]-hs[dest-2]))
        
        return dps[dest]

    print(rec(N-1))

if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    hs = list(map(int, input().split(" ")))
    dps = [None] * N

    def rec(dest):
        if dest == 0:
            return 0
        if dest == 1:
            return abs(hs[1]-hs[0])

        if dps[dest] is None:
            dps[dest] = min(rec(dest-1)+abs(hs[dest]-hs[dest-1]), rec(dest-2)+abs(hs[dest]-hs[dest-2]))
        
        return dps[dest]

    print(rec(N-1))

if __name__ == '__main__':
    resolve()
Problem p03238 (python)

Fixed submission:
def resolve():
    N = int(input())
    if N==1:
        print("Hello World")
        return
    A = int(input())
    B = int(input())
    print(A+B)


if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    conds = [list(map(int, input().split(" "))) for i in range(N)]
    
    # [[cx, cy, H]]
    candidates = []

    first = sorted(conds, reverse=True, key=lambda x:x[2])[0]
    for cx in range(101):
        for cy in range(101):
            H = abs(first[0]-cx)+abs(first[1]-cy)+first[2]
            for n in range(1, N):
                cond = conds[n]
                if cond[2] == 0:
                    if abs(cond[0]-cx)+abs(cond[1]-cy) < cond[2]: 
                        ansflg = False
                        break
                else:
                    if abs(cond[0]-cand[0])+abs(cond[1]-cand[1])+cond[2] != H:
                        ansflg = False
                        break
            else:
                print("{} {} {}".format(cx, cy, H))
                exit()


if '__main__' == __name__:
    resolve()
Problem p03282 (python)

Fixed submission:
def resolve():
    S = input()
    K = int(input())
    cnt = 0
    
    for s in S:
        if s != "1":
            break
        cnt += 1
    if cnt >= K:
        print("1")
    else:
        print(S[cnt])


if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    S = input()
    K = int(input())
    cnt = 0
    
    for s in S:
        if s != "1":
            break
        cnt += 1
    if cnt > K:
        print("1")
    else:
        print(S[cnt])


if '__main__' == __name__:
    resolve()
Problem p03353 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10000)
def resolve():
    s = input()
    K = int(input())
    mem = []
    for i in range(1, K+1): # window size
        for j in range(len(s)): # window starts at
            subs = s[j:j+i]
            if subs not in mem:
                mem.append(subs)
    mem.sort()
    # print(mem)
    print(mem[K-1])
    
    
if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10000)
def resolve():
    s = input()
    K = int(input())
    mem = []
    kinds = list(set(s)).sort()
    skips = []
    if len(kinds) > K:
        skips = kinds[K+1:]
    for j in range(len(s)): # window starts at
        if s[j] in skips:
            continue
        for i in range(1, len(s)+1): # window size
            subs = s[j:j+i]
            mem.append(subs)
    mem = sorted(list(set(mem)))
    # print(mem)
    print(mem[K-1])


if '__main__' == __name__:
    resolve()
Problem p03386 (python)

Fixed submission:
import sys

def resolve():
    A, B, K = list(map(int, input().split(" ")))
    out = []
    for i in range(A, A+K):
        if i <= B:
            out.append(i)
    for j in range(B-K+1, B+1):
        if j >= A and not j in out:
            out.append(j)
    
    [print(s) for s in out]

if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
import sys

def resolve():
    A, B, K = list(map(int, input().split(" ")))
    L = list(range(A, B+1))
    for s in sorted(list(set(L[:K]+L[-K:]))):
        print(s)

if '__main__' == __name__:
    resolve()
Problem p03846 (python)

Fixed submission:
import sys
readline = sys.stdin.readline

def resolve():
    N = int(input())
    # A = input().replace(" ", "")
    A = readline().rstrip().split()
    import collections
    counter = collections.Counter(A)
    if N % 2 == 1:
        if counter["0"] != 1:
            print("0")
            return
        for k, v in counter.items():
            if k == "0":
                continue
            if int(k) % 2 == 1:
                print("0")
                return
            if v != 2:
                print("0")
                return
    else:
        for k, v in counter.items():
            if int(k) % 2 == 0:
                print("0")
                return
            if v != 2:
                print("0")
                return
    
    print( (2**(N//2)) % (10**9+7) )




if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    # A = input().replace(" ", "")
    A = list(map(int, readline().rstrip().split()))
    import collections
    counter = collections.Counter(A)
    if N % 2 == 1:
        if counter["0"] != 1:
            print("0")
            return
        for k, v in counter.items():
            if k == "0":
                continue
            if int(k) % 2 == 1:
                print("0")
                return
            if v != 2:
                print("0")
                return
    else:
        for k, v in counter.items():
            if int(k) % 2 == 0:
                print("0")
                return
            if v != 2:
                print("0")
                return
    
    print( (2**(N//2)) % (10**9+7) )




if '__main__' == __name__:
    resolve()
Problem p04013 (python)

Fixed submission:
def resolve():
    N, A = list(map(int, input().split()))
    X = [int(i) - A for i in input().split()]
    d = {0: 1}
    for x in X:
        for _sum, count in list(d.items()):
            d[_sum+x] = d.get(_sum+x, 0) + count

    print(d[0]-1)
    


if '__main__' == __name__:
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    N, A = list(map(int, input().split()))
    X = sorted(list(map(int, input().split())))
    cnt = 0
    for bits in range(1, 1<<N):
        flags = list(bin(bits)[2:].zfill(N))
        _X = [x for i, x in enumerate(X) if flags[i]=="1"]
        cnt += 1 if sum(_X)/len(_X) == A 
    print(cnt)
    


if '__main__' == __name__:
    resolve()
Problem p04032 (python)

Fixed submission:
def resolve():
    S = list(input())
    if len(S) == 2:
        if S[0] == S[1]:
            print(1, 2)
        else:
            print(-1, -1)
        return
    for i in range(len(S)-2):
        if S[i] == S[i+1] or S[i+1] == S[i+2] or S[i+2] == S[i]:
            print(i+1, i+3)
            return
    print(-1, -1)


if __name__ == '__main__':
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    S = list(input())
    if len(S) == 2:
        print(-1, -1)    
    for i in range(len(S)-3):
        if S[i] == S[i+1] or S[i+1] == S[i+2] or S[i+2] == S[i]):
            print(i+1, i+3)
            return
    print(-1, -1)


if __name__ == '__main__':
    resolve()
Problem p02641 (python)

Fixed submission:
X, N = list(map(int,input().split()))
if N !=0:
  P = list(map(int,input().split()))
  ab = 100
  for i in range(-100,200):
    if i not in P:
      if abs(X-i)<ab:
        ab = abs(X-i)
        ans = i
  print(ans)
else:
  print(X)

Buggy submission (verdict: Runtime Error):
X, N = list(map(int,input().split()))
if N !=0:
  P = list(map(int,input().split()))
  ab = 100
  for i in range(101):
    if i not in P:
      if abs(X-i)<ab:
        ab = abs(X-i)
        ans = i
      elif abs(X-i)==ab:
        ans = min(ans,i)
  print(ans)
else:
  print(X)

Buggy submission (verdict: Runtime Error):
10 5
4 7 10 6 5
Problem p02724 (python)

Fixed submission:
X = int(input())
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)

Buggy submission (verdict: Runtime Error):
X = input()
tmp = X // 500
ans = tmp * 1000 + X % 500 - ((X % 500) % 5)
print(ans)
Problem p03262 (python)

Fixed submission:
import fractions
a = list(map(int,input().split()))
N = a[0]
b = []
x = list(map(int,input().split()))
x.append(a[1])
x.sort()
flag = 0
for i in range(N):
    c = x[i+1] - x[i]
    if flag == 1:
        ans = fractions.gcd(c, ans) # 最大公約数を求める
    else:
        ans = c # 数列が一つの場合は差が答え
    b.append(c)
    flag = 1
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
a = list(map(int,input().split()))
N = a[0]
b = []
x = list(map(int,input().split()))
x.append(a[1])
x.sort()
flag = 0
for i in range(N):
    c = x[i+1] - x[i]
    if flag == 1:
        ans = fractions.gcd(c, b[i-1]) # 最大公約数を求める
    b.append(c)
    flag = 1
print(ans)
Problem p03273 (python)

Fixed submission:
import sys
H_W = list(map(int,input().split()))
H = H_W[0]
W = H_W[1]
b = [[0 for i in range(W)] for j in range(H)]
a = [[str(c) for c in l.strip()] for l in sys.stdin]

# .を0に, #を1にした新しい配列bを作る
for i in range(H):
    for j in range(W):
        if a[i][j] == '#':
            b[i][j] = 1

# 列と行ごとにすべて0のものを探す
w = [0] * W
h = [0] * H
for i in range(H):
    for j in range(W):
        h[i] = h[i] + b[i][j]
        w[j] = w[j] + b[i][j]

#print(h)
#print(w)
# 全ての要素が0の列と行を削除する
i = 0
c = 0
j = 0
for i in range(H):
    if h[i] == 0:
        del a[j]
        H = H - 1
        j = j - 1
    j = j + 1
#print(a)

k = 0
for i in range(W):
    if w[i] == 0:
        for j in range(H):
            del a[j][k]
        W = W - 1
        k = k - 1
    k = k + 1
#print(a)
# 答え
for i in range(H):
    flag = 0
    for j in range(W):
        if flag == 0:
            ans = a[i][j]
            flag = 1
        else:
            ans = ans + a[i][j]
    print(ans)

Buggy submission (verdict: Runtime Error):
import sys
H_W = list(map(int,input().split()))
H = H_W[0]
W = H_W[1]
b = [[0 for i in range(W)] for j in range(H)]
a = [[str(c) for c in l.strip()] for l in sys.stdin]

# .を0に, #を1にした新しい配列bを作る
for i in range(H):
    for j in range(W):
        if a[i][j] == '#':
            b[i][j] = 1

# 列と行ごとにすべて0のものを探す
w = [0] * W
h = [0] * H
for i in range(H):
    for j in range(W):
        h[i] = h[i] + b[i][j]
        w[j] = w[j] + b[i][j]

# 全ての要素が0の列と行を削除する
for i in range(H):
    if h[i] == 0:
        del a[i]
        H = H -1
    if w[i] == 0:
        for j in range(H):
            del a[j][i]
        W = W - 1
# 答え
for i in range(H):
    flag = 0
    for j in range(W):
        if flag == 0:
            ans = a[i][j]
            flag = 1
        else:
            ans = ans + a[i][j]
    print(ans)
Problem p03282 (python)

Fixed submission:
N = int(input())
K = int(input())
n = N 
ans = n
c = 0
co = 0

while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
#print(c)
while c > -1: #上の桁から見ていく
    m = N // (10 ** c)
    d = m % 10
    #print(m)
    #print(d)
    if d == 1: # 1がどこまで連続しているかを調べる
        co = co + 1
    else:      #初めて1以外の数がでてきたらそれを一旦答えとする
        ans = d 
        break
    c = c - 1
if K <= co: #1が連続しているところを答える場合は答えは1
        ans = 1

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
n = N 
ans = 0
c = 0
co
while n > 10: #桁数を数える
    c = c + 1 
    n = n // 10
while c > 0: 
    m = N // (10 * c)
    d = m % 10
    if d == 1:
        co = co + 1
    else:
        ans = d
        break
    c = c - i
if K < co:
    ans = n
print(ans)
Problem p03289 (python)

Fixed submission:
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
j = 0

if A[0] == 'A':
    if A[0].isupper():
        flag = flag + 1
#print(flag)
count = 0
i=2
while(1):
    if A[i] == 'C':
        if A[i].isupper():
            count = count + 1
    i = i + 1
    if (L-2-i < 0):
        break
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
count = 0
for i in range(1,L):
    #print(A[i].isupper())
    if A[i].isupper():
        count = count + 1
#print(count)
if count == 1:
    flag = flag + 1
#print(flag)
if flag == 3:
    ans = 'AC'

print(ans)

Buggy submission (verdict: Runtime Error):
A = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].isupper():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'

print(ans)

Buggy submission (verdict: Runtime Error):
 = list(input())
L = len(A)

ans = 'WA'
flag = 0
f = 0
count = 0
if A[0] == 'A':
    flag = flag + 1

for i in range(2,L-1):
    if A[i] == 'C':
        count = count + 1
        if f == 0:
            j = i
            f = 1
if count == 1:
    flag = flag + 1

count = 0
for i in range(1,L-1):
    if A[i].islower():
        conut = count + 1
        if i == j:
            count = count - 1
if count == 0:
    flag = flag + 1

if flag == 3:
    ans = 'AC'
    
print(ans)
Problem p03308 (python)

Fixed submission:
N = int(input())
A = input()
A = A.split()
L = len(A)
B =[]
for i in range(L):
    B.append(int(A[i]))
B.sort(reverse=True)
ans = B[0] - B[L-1]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input()
A = A.split()
L = len(A)
B =[]
for i in range(L):
    B.append(int(a[i]))
B.sort(reverse=True)
ans = B[0] - B[L-1]

print(ans)
Problem p03309 (python)

Fixed submission:
import math
N = int(input())
A = input()
A = A.split()
B =[]
C = []
ans1 = 0
ans2 = 0
for i in range(N):
    B.append(int(A[i]))
    C.append(int(A[i])-i)
C.sort(reverse=True)

n = math.floor(N/2)
b = C[n]
b1 = C[n-1]

for i in range(N):
    ans1 = ans1 + abs(B[i]-(i+b))
for i in range(N):
    ans2 = ans2 + abs(B[i]-(i+b1))
ans = min(ans1, ans2)
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input()
A = A.split()
B =[]
C = []
ans = 0
for i in range(N):
    B.append(int(A[i]))
    C.append(int(A[i]))
C.sort(reverse=True)
"""
Max = C[0]
b = Max - N
"""
b = C[N/2]
for i in range(N):
    ans = ans + abs(B[i]-(i+b+1))

ans = ans
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = input()
A = A.split()
B =[]
C = []
ans1 = 0
ans2 = 0
for i in range(N):
    B.append(int(A[i]))
    C.append(int(A[i]))
C.sort(reverse=True)
Max = C[0]
b = Max - N
for i in range(N):
    ans1 = ans + abs(B[i]-(i+b+1))
for i in range(N):
    ans2 = ans + abs(B[i]-(i+1))
if ans1>ans2:
    ans = ans1
else:
    ans = ans2

print(ans)
Problem p03324 (python)

Fixed submission:
a = input()
a = a.split()
D = int(a[0])
N = int(a[1])
ans = (100 ** D) * N
if N == 100:
    ans = ans + (100 ** D)
print(ans)

Buggy submission (verdict: Runtime Error):
a = input()
a = a.split()
D = int(a[0])
N = int(a[1])
ans = (100 ** D) * N
if N = 100:
    ans = ans + (100 ** D)
print(ans)
Problem p02582 (python)

Fixed submission:
s=list(input())
count=0

if 'R' in s:
  count+=1
for i in range(len(s)-1):
  if s[i]==s[i+1] and s[i]=='R':
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
x,k,d= map(int,input().split())
x=abs(x)
if x>d*k:
  print(x-d*k)
else:
  m=x//d
  k=(k-m)%2
  print(abs((x%d)-k*d))

Buggy submission (verdict: Runtime Error):
x,k,d= map(int,input().split())
s=[]
x=abs(x)
if x>d*k:
  print(x-d*k)
else:
  for i in range(k):
    s.append(abs(x-d*i))
    s.sort()
  print(s[0])