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

Fixed submission:
def calc_distance(maze):
    sx,sy,gx,gy = 0,0,w-1,h-1
    #maze = maze.split()
    INF = 10000000000
    field_x_length = w
    field_y_length = h
        
    distance = []
    for i in range(field_y_length):
        distance.append([])
        for j in range(field_x_length):
            distance[i].append(INF)
        
    queue = []
    queue.insert(0, (sy,sx))
    distance[sy][sx] = 0
        
    while queue:
        y, x = queue.pop()
        if(x == gx and y == gy):
            break
                
        for i in range(0,4):
            nx, ny = x +[1,0,-1,0][i], y +[0,1,0,-1][i]
                
            if(0 <= nx and nx < field_x_length and 0 <= ny and ny < field_y_length and maze[ny][nx] != '#' and distance[ny][nx] == INF):
                queue.insert(0,(ny, nx))
                distance[ny][nx] = distance[y][x] + 1
    return distance[gy][gx]
    
h,w = map(int, input().split())
maze = [input() for _ in range(h)]

import collections
count = 0
for i in range(0,h):
    c = collections.Counter(maze[i])
    count += c["#"]

if (calc_distance(maze) < 200):
    print(w*h - count - calc_distance(maze) -1)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
def calc_distance(maze):
    sx,sy,gx,gy = 0,0,w-1,h-1
    #maze = maze.split()
    INF = 10000000000
    field_x_length = w
    field_y_length = h
        
    distance = []
    for i in range(field_y_length):
        distance.append([])
        for j in range(field_x_length):
            distance[i].append(INF)
        
    queue = []
    queue.insert(0, (sy,sx))
    distance[sy][sx] = 0
        
    while True:
        y, x = queue.pop()
        if(x == gx and y == gy):
            break
                
        for i in range(0,4):
            nx, ny = x +[1,0,-1,0][i], y +[0,1,0,-1][i]
                
            if(0 <= nx and nx < field_x_length and 0 <= ny and ny < field_y_length and maze[ny][nx] != '#' and distance[ny][nx] == INF):
                queue.insert(0,(ny, nx))
                distance[ny][nx] = distance[y][x] + 1
    return distance[gy][gx]
    
h,w = map(int, input().split())
maze = [input() for _ in range(h)]

import collections
count = 0
for i in range(0,h):
    c = collections.Counter(maze[i])
    count += c["#"]


print(w*h - count - calc_distance(maze) -1)
Problem p03612 (python)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
st = []
c = 0
for i in range(0,n):
    if (p[i] == i+1):
        st.append(1)
    else:
        st.append(0)
def cal(a):   
    global c    
    if (st[a]== 1 and  st[a+1]==1):
        c += 1
        return a+2
    return a+1
p=0           
while (p < n-1):
    p = cal(p)
    
y = st.count(1)
print(y-c)

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
st = []
c = 0
for i in range(0,n):
    if (p[i] == i+1):
        st.append(1)
    else:
        st.append(0)
def cal(a):
    global c
    for j in range(a,n-1):
        if (st[j] == 1 and  st[j+1]==1):
            c += 1
            cal(j+2)
    return c
           
x = cal(0)
y = st.count(1)
print(y-x)
Problem p03625 (python)

Fixed submission:
import sys
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.reverse()
ans = []
for i in range(0,n-1):
    if(a[i]==a[i+1]):
        ans.append(a[i])
if len(ans) <2:
    print(0)
    sys.exit()
        
if (ans[0]==ans[1] and ans[1]!=ans[2]):
    print(ans[0]*ans[2])
    sys.exit()

print(ans[0]*ans[1])

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
a = list(map(int, input().split()))
a.sort()
a.reverse()
ans = []
for i in range(0,n-1):
    if(a[i]==a[i+1]):
        ans.append(a[i])
if (ans[0]==ans[1] and ans[1]!=ans[2]):
    print(ans[0]*ans[2])
    sys.exit()
if len(ans) <2:
    print(0)
    sys.exit()
print(ans[0]*ans[1])
Problem p03126 (python)

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

for i in range(n):
  f.append(list(map(int, input().split())))

num = [0 for i in range(m+1)]
  
for i in range(n):
  for j in range(1, len(f[i])):
    num[f[i][j]] += 1
    
    
cnt = 0
for i in num:
  if i == n:
    cnt += 1
    
    
print(cnt)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
f = []

for i in range(n):
  f.append(list(map(int, input().split())))

num = [0 for i in range(m+1)]
  
for i in range(n):
  for j in range(1, len(f[i])):
    num[f[i][j]] += 1
    
    
cnt = 0
for i in num:
  if i = n:
    cnt += 1
    
    
print(cnt)
Problem p02607 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(0, n, 2):
    if a[i] % 2 != 0:
        res += 1

print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(1, n + 1, 2):
    if a[i] % 2 != 0:
        res += 1

print(res)
Problem p02646 (python)

Fixed submission:
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if abs(b - a) <= (v - w) * t:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
x = b - a
y = v - w
n = (a + v * t) - (b + w)
if y <= 0:
    print("NO")
if　n >= 0:
    print("YES")
else:
    print("NO")
Problem p03310 (python)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))
F = [int()] * n
F[0] = A[0]
for b in range(1, n):
    F[b] = F[b - 1] + A[b]


res = [0]*4
data = [10 ** 18] * 2
ex = [0]*4
ans = 10 ** 18
s = 0
t = 2
for i in range(1, n - 2):
    bl = [True, True]
    for j in range(s, i):
        res[0] = F[j]
        res[1] = F[i] - F[j]
        if not bl[0]:
            break
        if data[0] > abs(res[1] - res[0]) or j == s:
            s = j
            ex[0] = res[0]
            ex[1] = res[1]
            data[0] = abs(res[1] - res[0])
        else:
            bl[0] = False
    for k in range(t, n):
        res[2] = F[k] - F[i]
        res[3] = F[n - 1] - F[k]
        if not bl[1]:
            break
        if data[1] > abs(res[3] - res[2]) or k == t:
            t = k
            ex[2] = res[2]
            ex[3] = res[3]
            data[1] = abs(res[3] - res[2])
        else:
            bl[1] = False
    ans = min(ans, max(ex) - min(ex))

print(ans)

Buggy submission (verdict: Runtime Error):
data = [10 ** 18] * 2
ex = [0]*4
ans = 10 ** 18
s = 0
t = 2
for i in range(1, n - 2):
    bl = [True, True]
    for j in range(s, i):
        res[0] = F[j]
        res[1] = F[i] - F[j]
        if not bl[0]:
            break
        if data[0] > abs(res[1] - res[0]) or j == s:
            s = j
            ex[0] = res[0]
            ex[1] = res[1]
            data[0] = abs(res[1] - res[0])
        else:
            bl[0] = False
    for k in range(t, n):
        res[2] = F[k] - F[i]
        res[3] = F[n - 1] - F[k]
        if not bl[1]:
            break
        if data[1] > abs(res[3] - res[2]) or k == t:
            t = k
            ex[2] = res[2]
            ex[3] = res[3]
            data[1] = abs(res[3] - res[2])
        else:
            bl[1] = False
    ans = min(ans, max(ex) - min(ex))

print(ans)
Problem p02576 (python)

Fixed submission:
# 問題：https://atcoder.jp/contests/abc176/tasks/abc176_a

n, x, t = map(int, input().strip().split())
res = (n-1) // x + 1
res *= t
print(res)

Buggy submission (verdict: Runtime Error):
# 問題：https://atcoder.jp/contests/abc176/tasks/abc176_d

import numpy as np

h, w = map(int, input().strip().split())
cx, cy = map(int, input().strip().split())
dx, dy = map(int, input().strip().split())
cx -= 1
cy -= 1
dx -= 1
dy -= 1
qx = [cx]
qy = [cy]

s = [input() for _ in range(h)]
reached = np.zeros((h, w))
for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            reached[i].append(0)
        if s[i][j] == '#':
            reached[i].append(1)
res = 0

while qx:
    pre_qx = []
    pre_qy = []
    while qx:
        x = qx.pop(0)
        y = qy.pop(0)
        if reached[x][y] == 1:
            continue
        pre_qx.append(x)
        pre_qy.append(y)
        reached[x][y] = 1
        if x > 0 and reached[x-1][y] == 0:
            qx.append(x-1)
            qy.append(y)
        if x < h-1 and reached[x+1][y] == 0:
            qx.append(x+1)
            qy.append(y)
        if y > 0 and reached[x][y-1] == 0:
            qx.append(x)
            qy.append(y-1)
        if y < w-1 and reached[x][y+1] == 0:
            qx.append(x)
            qy.append(y+1)
    if reached[dx][dy] == 1:
        break
    res += 1
    while pre_qx:
        x = pre_qx.pop(0)
        y = pre_qy.pop(0)
        lx = max(x-2, 0)
        rx = min(x+3, h)
        ly = max(y-2, 0)
        ry = min(y+3, w)
        for i in range(lx, rx):
            for j in range(ly, ry):
                if reached[i][j] == 0:
                    qx.append(i)
                    qy.append(j)

if reached[dx][dy] == 0:
    res = -1

print(res)
Problem p02628 (python)

Fixed submission:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
A = list(map(int, input().split()))
result = 0
for i in range(N):
    for j in range(i):
        if A[i-j-1] > A[i-j]:
            tmp = A[i-j]
            A[i-j] = A[i-j-1]
            A[i-j-1] = tmp

for i in range(K):
    result += A[i]

print(result)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N, K = map(int, input().split())
A = list(map(int, input().split()))
result = 0
for i in range(N):
    for j in range(i):
        if A[i-j-1] > A[i-j]:
            tmp = A[i-j]
            A[i-j] = A[i-j-1]
            A[i-j-1] = tmp
        print(A)

for i in range(K):
    result += A[i]

print(result)
Problem p03044 (python)

Fixed submission:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc126_d


class Graph():

    def __init__(self):
        self.adjacency_dict = {}
        self.weight = []
    
    def add_vertex(self, v):
        self.adjacency_dict[v] = []
        self.weight.append([])

    def add_edge(self, v1, v2, w):
        self.adjacency_dict[v1].append(v2)
        self.adjacency_dict[v2].append(v1)
        self.weight[v1].append(w)
        self.weight[v2].append(w)

    def get_vertexes(self):
        return self.adjacency_dict.keys()

    def get_edges(self, v):
        return self.adjacency_dict[v], self.weight[v]

    def print_graph(self):
        print(self.adjacency_dict)

n = int(input())

res = []
g = Graph()
for i in range(n):
    res.append(-1)
    g.add_vertex(i)

for i in range(n-1):
    u, v, w = map(int, input().strip().split())
    g.add_edge(u-1, v-1, w % 2)

q = []
res[0] = 0
q.append(0)
while(len(q) > 0):
    v = q.pop()
    u_l, w_l = g.get_edges(v)
    for u, w in zip(u_l, w_l):
        if res[u] != -1:
            continue
        res[u] = (res[v] + w) % 2
        q.append(u)

for i in range(n):
    print(res[i])

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 問題：https://atcoder.jp/contests/abc126/tasks/abc126_d


class Graph():

    def __init__(self):
        self.adjacency_dict = {}
    
    def add_vertex(self, v):
        self.adjacency_dict[v] = []

    def add_edge(self, v1, v2):
        self.adjacency_dict[v1].append(v2)
        self.adjacency_dict[v2].append(v1)

    def get_vertexes(self):
        return self.adjacency_dict.keys()

    def get_edges(self, v):
        return self.adjacency_dict[v]

    def print_graph(self):
        print(self.adjacency_dict)

import numpy as np
n = int(input())
p = np.full((n, n), 0)

res = []
g = Graph()
for i in range(n):
    res.append(-1)
    g.add_vertex(i)

for i in range(n-1):
    u, v, w = map(int, input().strip().split())
    g.add_edge(u-1, v-1)
    p[u-1][v-1] = w % 2
    p[v-1][u-1] = w % 2

q = []
res[0] = 0
q.append(0)
while(len(q) > 0):
    v = q.pop()
    for u in g.get_edges(v):
        if res[u] != -1:
            continue
        w = p[u][v]
        res[u] = (res[v] + w) % 2
        q.append(u)

for i in range(n):
    print(res[i])
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().strip().split())
h, w = map(int, input().strip().split())

res = (H - h) * (W - w)
print(res)

Buggy submission (verdict: Runtime Error):
3 2
2 1
Problem p02658 (python)

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

x = 10**18
ans = 1
for a in A:
    if ans != -1:
        ans *= a
    if ans > x:
        ans = -1
    if a == 0:
        ans = 0
        break
print(ans)

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

N = int(input())
A = list(map(int, input().split()))

ans = 1
for a in A:
    ans *= a
    if ans > 10**18:
        ans = -1
        continue
    if a == 0:
        ans = 0
        break
print(ans)
Problem p02684 (python)

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

m = {}
for i, a in enumerate(A):
    m[i+1] = a

visited = []
cycle = set()
current_city = 1
visited.append(current_city)
cycle.add(current_city)
cycle_start_index = -1
while 1:
    current_city = m[current_city]
    if current_city in cycle:
        cycle_start_index = visited.index(current_city)
        break
    else:
        visited.append(current_city)
        cycle.add(current_city)

cycle_before = visited[:cycle_start_index]
cycle_after = visited[cycle_start_index:]
if len(cycle_before) - 1 < K:
    print(cycle_after[(K - len(cycle_before)) % len(cycle_after)])
else:
    print(cycle_before[K])

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

m = {}
for i, a in enumerate(A):
    m[i+1] = a

visited = []
cycle = set()
current_city = 1
visited.append(current_city)
cycle.add(current_city)
cycle_start_index = -1
while 1:
    current_city = m[current_city]
    if current_city in cycle:
        cycle_start_index = visited.index(current_city)
        break
    else:
        visited.append(current_city)
        cycle.add(current_city)

cycle_before = visited[:cycle_start_index]
cycle_after = visited[cycle_start_index:]
if len(cycle_before) > K:
    print(cycle_after[(K - len(cycle_before)) % len(cycle_after)])
else:
    print(cycle_before[K - 1])
Problem p02732 (python)

Fixed submission:
from math import factorial

N = int(input())
A = list(map(int, input().split()))

def comb(n, r):
    if n - r < 0:
        return 0
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))

nums = [0] * (N + 1)
for i, v in enumerate(A):
    nums[v] += 1
combs = list(map(lambda n: comb(n, 2), nums))
total = sum(combs)

for k, val in enumerate(A):
    print(total - (nums[val] - 1))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb

N, M = map(int, input().split())

print(int(comb(N, 2) + comb(M, 2)))

Buggy submission (verdict: Runtime Error):
from math import factorial

N = int(input())
A = list(map(int, input().split()))

def comb(n, r):
    if n - r < 0:
        return 0
    else:
        return factorial(n) // (factorial(n - r) * factorial(r))

nums = [0] * N
for i, v in enumerate(A):
    nums[v] += 1
combs = list(map(lambda n: int(comb(n, 2)), nums))
total = sum(combs)

for k, val in enumerate(A):
    count = comb(nums[val] - 1, 2)
    print(total - combs[val] + count)

Buggy submission (verdict: Runtime Error):
from math import factorial

N = int(input())
A = list(map(int, input().split()))

def comb(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

for k, val in enumerate(A):
    count = 0
    nums = [0] * N
    for i, v in enumerate(A):
        if k == i:
            continue
        nums[v] += 1
    combs = list(map(lambda n: int(comb(n, 2)), filter(lambda n: n > 1, nums)))
    print(sum(combs))

Buggy submission (verdict: Runtime Error):
from scipy.misc import comb

N = int(input())
A = list(map(int, input().split()))

for k, val in enumerate(A):
    count = 0
    nums = [0] * N
    for i, v in enumerate(A):
        if k == i:
            continue
        nums[v] += 1
    combs = list(map(lambda n: int(comb(n, 2)), nums))
    print(sum(combs))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

N = int(input())
A = list(map(int, input().split()))

for k, val in enumerate(A):
    count = 0
    nums = [0] * N
    for i, v in enumerate(A):
        if k == i:
            continue
        nums[v] += 1
    combs = list(map(lambda n: int(comb(n, 2)), nums))
    print(sum(combs))
Problem p03309 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
Ad.sort()
l = len(Ad)
if l % 2 == 1:
    b = Ad[l//2]
    ans = sum(map(lambda x:abs(x-b), Ad))
else:
    b1, b2 = Ad[l//2], Ad[l//2-1]
    ans = min(sum(map(lambda x:abs(x-b1), Ad)), sum(map(lambda x:abs(x-b2), Ad)))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
Ad = [A[i]-(i+1) for i in range(N)]
max_Ad = max(abs(Ad))
min_total = float("inf")

for b in range(0, max_Ad+1):
    map(lambda x: x-b, Ad)
    total = sum(abs(Ad))
    if min_total > total:
        min_total = total
print(min_total)
Problem p02603 (python)

Fixed submission:
n=int(input())
I=list(map(int,input().split()))
num=1000
for i in range(n-1):
    if I[i]<I[i+1]:
        p=num//I[i]
        num-=p*I[i]
        num+=p*I[i+1]

print(num)

Buggy submission (verdict: Runtime Error):
n=int(input())
I=list(map(int,input().split()))
num=1000
for i in range(n-1):
    if I[i]<I[i+1]:
        p=num//I[i])
        num-=p*I[i]
        num+=p*I[i+1]

print(num)

Buggy submission (verdict: Runtime Error):
n=int(input())
I=list(map(int,input().split()))
num=1000
if max(I)==I[0]:
    print("1000")
    exit()
for i in range(1,n+1):
    if I[i-1]<I[i]:
        num-=(num//I[i-1])*I[i-1]
        num+=(num//I[i-1])*I[i]

print(num)
Problem p02606 (python)

Fixed submission:
L,R,d=list(map(int,input().split()))
I=R-L+1
if L%d==0 and R%d==0:
    I=R-L
    print((I//d)+1)
else:
    print(I//d)

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

for h in range(1,N+1):
    num=0
    for i in range(1,N):
        for j in range(1,N):
            for k in range(1,N):
                if i**2+j**2+k**2+i*j+j*k+k*i==h:
                    num+=1
    print(num)

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

for h in range(1,N+1):
    num=0
    for i in range(1,h):
        for j in range(1,h):
            for k in range(1,h):
                if i**2+j**2+k**2+i*j+j*k+k*i==h:
                    num+=1
    print(num)
Problem p02607 (python)

Fixed submission:
N=int(input())
table=list(map(int,input().split()))
num=0
for i in range(1,N+1):
    if i%2==1 and (table[i-1])%2==1:
        num+=1
print(num)

Buggy submission (verdict: Runtime Error):
N=int(input())
table=list(map(int,input().split()))
num=0
for i in table:
    if i%2==1 and (table[i])%2==1:
        num+=1
    print(num)
Problem p02639 (python)

Fixed submission:
S=list(map(int,input().split()))
for i in range(5):
    if S[i]==0:
        print(i+1)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b)
Problem p02641 (python)

Fixed submission:
x,n=map(int,input().split())
I=list(map(int,input().split()))
S=[]
T=[]
ans=[]
for i in range(-200,200):
    S.append(i)
    if i in I:
        S.remove(i)
for j in range(len(S)):
    if j==0:
        T.append(S[0])
    elif abs(x-S[j-1])>abs(x-S[j]):
        T.clear()
        T.append(S[j])
print(min(T))

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
I=list(map(int,input().split()))
S=[]
T=[]
ans=[]
for i in range(1,101):
    S.append(i)
    if i in I:
        S.remove(i)
for j in range(len(S)):
    if j==0:
        T.append(S[0])
    elif abs(x-S[j-1])>abs(x-S[j]):
        T.clear()
        T.append(S[j])
print(min(T))

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
I=list(map(int,input().split()))
S=[]
T=[]
ans=[]
for i in range(1,101):
    S.append(i)
    if i in I:
        S.remove(i)
for j in range(len(S)-1):
    if j==0:
        T.append(S[0])
    elif abs(x-S[j])>abs(x-S[j+1]):
        T.clear()
        T.append(S[j+1])
print(min(T))

Buggy submission (verdict: Runtime Error):
x,n=map(int,input().split())
I=list(map(int,input().split()))
S=[]
T=[]
ans=[]
for i in range(100):
    S.append(i)
    if i in I:
        S.remove(i)
for j in range(len(S)-1):
    if j==0:
        T.append(S[0])
    elif abs(x-S[j])>abs(x-S[j+1]):
        T.clear()
        T.append(S[j+1])
print(min(T))
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().input())
print(a*b)
Problem p02677 (python)

Fixed submission:
import math
a,b,h,m=map(int,input().split())
deg_a=6*m
deg_b=30*h+m/2
deg_c=abs((deg_a)-(deg_b))
rad=math.radians(deg_c)
c=a**2+b**2-2*a*b*math.cos(rad)
print(c**0.5)

Buggy submission (verdict: Runtime Error):
import math
a,b,h,w=map(int,input().split())
deg_a=6*m
deg_b=30*h+m/2
deg_c=abs((deg_a)-(deg_b))
rad=math.radians(deg_c)
c**2=a**2+b**2-2*a*b*math.cos(rad)
print(c**0.5)
Problem p02687 (python)

Fixed submission:
S=str(input())
if S=="ABC":
    print("ARC")
elif S=="ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
S=str(input())
if S="ABC":
    print("ARC")
elif S="ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
S=input()
if S="ABC":
    print("ARC")
elif S="ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
S=input()
if S="ABC":
    print("ARC")
elif S="ARC":
    print("ABC")
Problem p02755 (python)

Fixed submission:
import math
a,b=map(int,input().split())
ans=[]
for i in range(1251):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        ans.append(i)
if len(ans)!=0:
    print(min(ans))
else:
    print("-1")

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans=[]
for i in range(1251):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        ans.append(i)
print(min(ans))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
ans=[]
for i in range(1250):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        ans.append(i)
print(min(ans))
Problem p02801 (python)

Fixed submission:
S=input()
I="abcdefghijklmnopqrstuvwxyz"
for i in range(26):
    if S==I[i]:
        print(I[i+1])
        exit()

Buggy submission (verdict: Runtime Error):
I="abcdefghijklmnopqrstuvwxyz"
for i in range(25):
    if I[i]==input():
        print(I[i+1])