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

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

D = ii()

if D == 25:
    print('Christmas')
if D == 24:
    print('Christmas Eve')
if D == 23:
    print('Christmas Eve Eve')
if D == 22:
    print('Christmas Eve Eve Eve')

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, K =mi()
A = [ii() for _ in range(N)]

tmp = float('inf')
for i in range(N-K+1):
    if A[i+K-1] - A[i] < tmp:
        tmp = A[i+K-1] - A[i]
print(tmp)
Problem p03219 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

A, B = mi()

print(A + B // 2)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

def ume(x):
    x = str(x)
    if len(x) < 6:
        return '0'*(6-len(x)) + x
    return x

def main():
    N, M = mi()

    l = dp2(0, 3, M)
    cnt = [0]*(N+1)
    ans = dp2(0, 2, M)
    for i in range(M):
        p, y = mi()
        l[i][0], l[i][1], l[i][2] = p-1, y, i
        cnt[p] += 1
    for i in range(N):
        cnt[i+1] += cnt[i]

    l.sort(key=lambda x: x[0])
    for i in range(N):
        ichibu = l[cnt[i]:cnt[i+1]]
        ichibu.sort(key=lambda x: x[1])
        for j in range(cnt[i+1]-cnt[i]):
            ans[ichibu[j][2]][0] =ichibu[j][0]+1
            ans[ichibu[j][2]][1] =j+1
    
    for x, y in ans:
        print(ume(x)+ume(y))


if __name__ == "__main__":
    main()
Problem p03280 (python)

Fixed submission:
A = sorted(list(map(int, input().split())))

print((A[0]-1)*(A[1]-1))

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1':
        i += 1
print(S[i])
Problem p03282 (python)

Fixed submission:
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1' and i <= len(S)-2:
        if K <= i + 1:
                print(S[i])
                exit(0)
        i += 1
print(S[i])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())
 
if len(S) == 1:
        print(S[0])
        exit(0)
 
i = 0
while S[i] == '1' and i <= len(S):
        i += 1
 
print(S[i])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1' and i < len(S):
        i += 1

print(S[i])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

#gosencho = 5 * (10**15)
#gosencho = 5000000000000000

'''
for i in S:
        print(i)
        #K -= int(i) ** gosencho
        K -= pow(int(i), gosencho)
        if K <= 0:
                print(i)
                exit(0)
'''
'''
ans = ''
for i in S:
        for j in range(int(i)**gosencho):
                ans += i

print(ans[K])
'''
if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1':
        i += 1
print(S[i])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

if len(S) == 1:
        print(S[0])
        exit(0)

i = 0
while S[i] == '1':
        i += 1
print(S[i])
Problem p03323 (python)

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

if A < 9 and B < 9:
        print('Yay!')
else:
        print(':(')

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

if A < 9 and b < 9:
        print('Yay!')
else:
        print(':(')
Problem p03330 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, C = mi()
D = li2(C)
S = li2(N)

table = dp2(0, C, 3)
'''
#for num in range(3):
    #for start in range(num, N, 3):
        for color in range(C):
            i = 0
            j = start
            print(i, j)
            while True:
                table[num][color] += D[S[i][j]-1][color]
                if j < 1 or i >= N:
                    break
                j -= 1
                i += 1
'''
for i in range(N):
    for j in range(N):
        for color in range(C):
            table[(i+j)%3][color] += D[S[i][j]-1][color]

ans = float('inf')
for i in range(C):
    for j in range(C):
        for k in range(C):
            if i == j or j == k or k == i:
                continue
            ans = min(ans, table[0][i] + table[1][j] + table[2][k])

print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N, C = mi()
D = li2(C)
S = li2(N)

table = dp2(0, 3, C)
'''
#for num in range(3):
    #for start in range(num, N, 3):
        for color in range(C):
            i = 0
            j = start
            print(i, j)
            while True:
                table[num][color] += D[S[i][j]-1][color]
                if j < 1 or i >= N:
                    break
                j -= 1
                i += 1
'''
for i in range(N):
    for j in range(N):
        for color in range(C):
            table[(i+j)%3][color] += D[S[i][j]-1][color]

ans = float('inf')
for i in range(C):
    for j in range(C):
        for k in range(C):
            if i == j or j == k or k == i:
                continue
            ans = min(ans, table[0][i] + table[1][j] + table[2][k])

print(ans)
Problem p03353 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
from collections import defaultdict #d = defaultdict(int) d[key] += value
import itertools #list(accumulate(A))

S = input()
K = ii()
N = len(S)


alphabets = list('abcdefghijklmnopqrstuvwxyz')
l = []

for alpha in alphabets:
    for i, m in enumerate(S):
        if m == alpha:
            flag = 1
            for j in range(1, min(K+1, N-i+1)):
                l.append(S[i:i+j])
    #print(set(l))
    l = sorted(set(l))
    if len(l) >= K:
        print(l[K-1])
        exit()

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
from collections import defaultdict #d = defaultdict(int) d[key] += value
import itertools #list(accumulate(A))

#S = input()
S = 'abcdefghijklmnopqrstuvwxyz'*200
K = ii()
N = len(S)
'''
N = len(S)
d = defaultdict(int)
for i in range(N+1):
    for j in range(N-i+1):
        d[S[j:j+i+1]] += 1
l = sorted(d.keys())
#print(l)
print(l[K])
'''

alphabets = list('abcdefghijklmnopqrstuvwxyz')

#print(len(alphabets))
l = []
for alpha in alphabets:
    for i, m in enumerate(S):
        if m == alpha:
            for j in range(1, N-i+1):
                l.append(S[i:i+j])

    l = sorted(set(l))
    if len(l) >= K:
        print(l[K-1])
        exit()
Problem p03469 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

S = input()
print(S[:3] + '8' + S[4:])

Buggy submission (verdict: Runtime Error):
import sys
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]

import bisect


N, H = mi()
A = [0]*N
B = [0]*N
for i in range(N):
    A[i], B[i] = mi()

B = sorted(B)
a = max(A)
m = bisect.bisect_left(B, a)
'''
s = 1
e = N
m = (s+e)//2
pre_m = 0
while True:
    m = (s+e)//2
    if B[m-1] > a:
        e = m
    elif B[m-1] <= a:
        s = m
    if s==e:
        m -= 1
        break
    #else:
        #break
    if e-s==1 and pre_m==m:
        break
    pre_m = m
'''
rem = H - sum(B[m:])
if rem >= 0:
    print((N-m)+rem//a+(rem%a==0))
else:
    for i in range(m, N):
        rem += B[i]
        if rem>=0:
            print(N-i)
Problem p03473 (python)

Fixed submission:
import sys
def ii(): return int(sys.stdin.readline())

M = ii()

print(48-M)

Buggy submission (verdict: Runtime Error):
def ii(): return int(sys.stdin.readline())

M = ii()

print(48-M)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
from itertools import accumulate #list(accumulate(A))

Q = ii()
lr = li2(Q)
from collections import deque
que = deque()

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

prime = [0]*(10**5+1)
flag = [0]*(10**5+1)
prime[2] = 1

for i in range(3, 10**5+1, 2):
    if is_prime(i):
        prime[i] = 1

for i in range(3, 10**5+1, 2):
    if prime[i] and prime[(i+1)//2]:
        flag[i] = 1

ans = list(accumulate(flag))

for i in range(Q):
    print(ans[lr[i][1]]-ans[lr[i][0]-1])
Problem p03543 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from itertools import accumulate #list(accumulate(A))

S = input()

for i in range(2):
    if S[i] == S[i+1] == S[i+2]:
        print('Yes')
        exit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**9)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

H, W = mi()
C = li2(10)
a = li2(H)
memo = [C[i][1] for i in range(10)]
'''
tmp = -1
def dfs(column, m):
    if column == 1:
        global tmp
        tmp = max(m, tmp)
    for i in range(10):
        if i != column and C[column][i] < m:
            dfs(i, m-C[column][i])
    #return

for i in range(10):
    if i != 1:
        dfs(i, C[i][1])
        if tmp != -1:
            memo[i] = C[i][1] - tmp
        tmp = -1
'''
INF = 10**9
tmp = 10**9
'''
def dfs(col, m):
    if col == 1:
        global tmp
        tmp = min(m, tmp)
    for i in range(10):
        if i != col and m + C[col][i] < lim:
            dfs(i, m + C[col][i])

for i in range(10):
    if i != 1:
        tmp = INF
        lim = C[i][1]
        dfs(i, 0)
        memo[i] = min(tmp, memo[i])
'''
from collections import deque
for i in range(10):
    que = deque()
    lim = C[i][1]
    for j in range(10):
        if C[i][j] < lim:
            que.append([j, C[i][j]])
    while que != deque():
        #print(que)
        k = que.popleft()
        for j in range(10):
            if C[k[0]][j] + k[1] < lim and k[0] != j:
                if j == 1:
                    memo[i] = min(memo[i], C[k[0]][j] + k[1])
                else:
                    que.append([j, C[k[0]][j] + k[1]])

ans = 0
for i in range(H):
    for j in range(W):
        if abs(a[i][j]) != 1:
            ans += memo[a[i][j]]

print(ans)
Problem p02582 (python)

Fixed submission:
S = input()
if S == 'SSS':
    print(0)
elif S == 'RRR':
    print(3)
elif S == 'RRS' or S == 'SRR':
    print(2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
X, K, D = map(int, input().split())
X_a = abs(X)
if X_a - K * D > D:
    print(X_a - K * D)
else:
    K -= X_a // D
    X_a = X_a % D
    while X_a >= D:
        X_a -= D
        K -= 1
    if  K % 2 == 0:
        print(X_a)
    else:
        print(abs(X_a-D))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
N = input()
ls = map(int, input().split())
tot = 1
for i in ls:
    tot = i*tot
    if tot > 10^18:
        break
    elif tot ==0:
        break
    
if i <= 10^18:
    print(tot)
else:
    print(-1)
Problem p02675 (python)

Fixed submission:
N = int(input())
if N % 10 == 3:
  print('bon')
elif N % 10 == 0 or N % 10 == 1 or N % 10 == 6 or N % 10 == 8:
  print('pon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N = input()
if N % 10 == 3:
  print('bon')
elif N % 10 == 0 or N % 10 == 1 or N % 10 == 6 or N % 10 == 8:
  print('pon')
else:
  print('hon')
Problem p03361 (python)

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

d = [-1, 1]
for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            ls = []
            for i in range(2):
                for j in range(2):
                    hs = h + d[i]
                    ws = w + d[j]
                    if 0 <= hs < H and 0 <= ws < W:
                        ls.append(S[hs][w])
                        ls.append(S[h][ws])
            if '#' not in ls:
                print('No')
                exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
S = []
for h in range(H):
    S_h = list(input())
    S.append(S_h)

d = [-1, 1]
for h in range(H):
    for w in range(W):
        if S[h][w] == '#':
            ls = []
            for i in range(2):
                for j in range(2):
                    hs = h + d[i]
                    ws = w + d[j]
                    if 0 <= hs < H and 0 <= ws < W:
                        ls.append(S[hs][w])
                        ls.append(S[h][ws])

if '#' in ls:
    print('Yes')
else:
    print('No')
Problem p02582 (python)

Fixed submission:
elem = input()
single = elem.count("R")
double = elem.count("RR")
triple = elem.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single > 0:
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
elem = input()
single = s.count("R")
double = s.count("RR")
triple = s.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single > 0:
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
elem = input()
single = s.count("R")
double = s.count("RR")
triple = s.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single == 1:
        print(1)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
elem = input()
single = s.count("R")
double = s.count("RR")
triple = s.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single == 1:
        print(1)
    else:
        print(0)
Problem p02719 (python)

Fixed submission:
n, k = map(int, input().split()) 
t = n % k
if (k-t > t):
    print(t)
else:
    print(k-t)

Buggy submission (verdict: Runtime Error):
while x>0:
    if (k == 1):
        rlist = [0]
        break
    rlist.append(abs(x-k))
    x = abs(x-k)
    min_n = min(rlist)
    if (min_n == abs(x-k)):break
    if (min_n == 0):break
    if(len(set(rlist)) != len(rlist)):
        break

print(min(rlist))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
x = n
min_n = n
rlist = []
while x>0:
    if (k == 1 or k==2):
        rlist = [0]
        break
    rlist.append(abs(x-k))
    x = abs(x-k)
    min_n = min(rlist)
    if (min_n == abs(x-k)):break
    if (min_n == 0):break
    if(len(set(rlist)) != len(rlist)):
        break

print(min(rlist))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
x = n
min_n = n
rlist = []
while x>0:
    if (k == 1 or k==2):
        rlist = [0]
        break
    rlist.append(abs(x-k))
    x = abs(x-k)
    min_n = min(rlist)
    if (min_n == abs(x-k)):break
    if (min_n == 0):break
print(min(rlist))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
x = n
min_n = n
rlist = []
while x>0:
    if (k == 1):
        rlist = [0]
        break
    rlist.append(abs(x-k))
    x = abs(x-k)
    min_n = min(rlist)
    if (min_n == abs(x-k)):break
    if (min_n == 0):break
print(min(rlist))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
x = n
min_n = n
rlist = []
while x>0:
    rlist.append(abs(x-k))
    x = abs(x-k)
    min_n = min(rlist)
    if (min_n == abs(x-k)):break
print(min(rlist))
Problem p03071 (python)

Fixed submission:
import numpy as np
a,b= map(int,input().split())
max_number = np.array([a+b,2*a-1,2*b-1]).max()
print(max_number)

Buggy submission (verdict: Runtime Error):
#coding:utf-8

import sys
import numpy as np

a = int(sys.argv[1])
b = int(sys.argv[2])

max_number = np.array([a+b,2*a-1,2*b-1]).max()
print(max_number)
Problem p02582 (python)

Fixed submission:
a=input()
sum=0
if a[0]=='R':
    sum=1
    if a[0]==a[1]:
        sum=2
        if a[1]==a[2]:
            sum=3
else :
    if a[1]=='R':
        sum=1
        if a[2]==a[1]:
            sum =2
    elif a[2]=='R':
        sum=1
print (sum)

Buggy submission (verdict: Runtime Error):
a=input()
sum=0
for i in a:
  if i=='R'
  sum=sum+1
print (sum)

Buggy submission (verdict: Runtime Error):
a=input()
b=[]
for i in f:
  b.append(i)
cons=0
for j in b:
  if j=='R':
    cons=cons+1
print cons
Problem p02582 (python)

Fixed submission:
s = input().upper()
if s.count('RRR') == 1:
  print(3)
elif s.count('RR') == 1:
  print(2)
elif s.count('R') > 0:
  print(1)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
S = input()
if S.contains("RRR"):
    print("3")
elif S.contains("RR"):
    print("2")
elif S.contains("R"):
    print("1")
else:
    print("0")
Problem p02628 (python)

Fixed submission:
n = list(int(num) for num in input().strip().split())
lst = list(int(num) for num in input().strip().split())[:n[0]]
result = []
for i in range(n[1]):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
lst = []
result = []
for i in range(n):
    lst.append(int(input()))
for i in range(k):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))

Buggy submission (verdict: Runtime Error):
n, k = int(input()), int(input())
lst = []
result = []
for i in range(n):
    lst.append(int(input()))
for i in range(k):
    temp = min(lst)
    result.append(temp)
    lst.remove(temp)
print(sum(result))
Problem p02730 (python)

Fixed submission:
n = input()
x = len(n)

if n == n[::-1]:
    if n[:((x-1)//2)] == n[:((x-1)//2)][::-1]:
        if n[((x+3)//2)-1:] == n[((x+3)//2)-1:][::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
num=str(input())
temp=num
rev=0
while(num>0):
    dig=num%10
    rev=rev*10+dig
    num=num//10
if(temp==rev):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
def isPalindrome(str): 
 
    for i in xrange(0, len(str)/2):  
        if str[i] != str[len(str)-i-1]: 
            return False
    return True
  
s = input()
ans = isPalindrome(s) 
  
if (ans): 
    print("Yes") 
else: 
    print("No")