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

Fixed submission:
def A():
    n, x, t = map(int, input().split())
    print(t * ((n+x-1)//x))

def B():
    n = list(input())
    s = 0
    for e in n:
        s += int(e)
    print("Yes" if s % 9 == 0 else "No")

def C():
    int(input())
    a = list(map(int, input().split()))
    l = 0
    ans = 0
    for e in a:
        if e < l: ans += l - e
        l = max(l, e)
    print(ans)

def E():
    h, w, m = map(int, input().split())
    row = [0] * h
    col = [0] * w
    exist = set([])
    th = 1000000000
    for i in range(m):
        x, y = map(int, input().split())
        x -= 1
        y -= 1
        row[x] += 1
        col[y] += 1
        exist.add(x*th + y)

    max_row = max(row)
    max_col = max(col)
    candi_row = []
    candi_col = []
    for i in range(h):
        if row[i] == max_row: candi_row.append(i)
    for i in range(w):
        if col[i] == max_col: candi_col.append(i)

    ans = max_row + max_col
    for x in candi_row:
        for y in candi_col:
            if x*th + y in exist: continue
            print(ans)
            return
    print(ans - 1)

E()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
from collections import deque

h, w = map(int, input().split())
ch, cw = map(int, input().split())
gh, gw = map(int, input().split())

s = []
for i in range(h):
   s.append(input().rstrip('\n'))

INF = 10 ** 10
d = [INF] * (h*w)

A = 10**18
B = 10**9

nex = []
for i in range(-2, 3):
    for j in range(-2, 3):
        if (i, j) in [(-1,0),(1,0),(0,-1),(0,1),(0,0)]:
            continue
        else:
            nex.append((i,j))

d[(ch-1) * w + (cw-1)] = 0

T = ((-1,0), (1,0), (0,1), (0,-1))

q = [(ch-1)*A + (cw-1)*B + 0]
use = [0] * (h * w)

for x in q:
    curh = (x // A)
    x -= curh * A
    curw = (x // B)
    cnt = x - curw * B
    tmp = curh * w + curw
    if d[tmp] < cnt or use[tmp]: continue
    d[tmp] = cnt
    use[tmp] = 1

    for dh, dw in T:
        nh = curh + dh
        nw = curw + dw
        if nh >= 0 and nh < h and nw >= 0 and nw < w and s[nh][nw] == '.' and d[nh * w + nw] > cnt:
            d[nh * w + nw] = cnt
            use[nh * w + nw] = 0
            q.append(nh*A + nw*B + cnt)
    for dh, dw in nex:
        nh = curh + dh
        nw = curw + dw
        if nh >= 0 and nh < h and nw >= 0 and nw < w and s[nh][nw] == '.' and d[nh * w + nw] > cnt:
            d[nh * w + nw] = cnt + 1
            use[nh * w + nw]
            q.append(nh*A + nw*B + cnt+1)

# for item in d:
#     print(item)
gh -= 1
gw -= 1

if d[gh*w + gw] == INF:
    print(-1)
else:
    print(d[gh*w + gw])
Problem p03127 (python)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


N = int(input())
A = list(map(int, input().split()))
num = A[0]
for i in range(N):
    num = gcd(num, A[i])
print(num)

Buggy submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int, input().split()))
newA = np.array(A)
num = np.gcd.reduce(newA)
print(num)

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N = int(input())
A = list(map(int, input().split()))
num = reduce(math.gcd, A)
print(num)
Problem p03242 (python)

Fixed submission:
n=input()
ans=""
for i in range(3):
  if n[i]=="1":
    ans+="9"
  else:
    ans+="1"
print(ans)

Buggy submission (verdict: Runtime Error):
n=input()
for i in range(3):
  if n[i]=="1":
    n[i]="9"
  else:
    n[i]="1"
print(n)

Buggy submission (verdict: Runtime Error):
n=input()
for i in range(3):
  if n[i]=="1":
    n[i]=9
  else:
    n[i]=1
print(n)

Buggy submission (verdict: Runtime Error):
n=list(input())
for i in range(3):
  if n[i]=="1":
    n[i]=9
  else:
    n[i]=1
s=" "
for i in range(3):
  s+="n[i]"
print(int(s))

Buggy submission (verdict: Runtime Error):
n=list(input())
for i in range(3):
  if n[i]=="1":
    n[i]=9
  else:
    n[i]=1
s=""
for i in range(3):
  s+="n[i]"
print(int(s))

Buggy submission (verdict: Runtime Error):
n=list(input())
for i in range(3):
  if n[i]==1:
    n[i]=9
  else:
    n[i]=1
s=""
for i in range(3):
  s+="n[i]"
print(int(s))

Buggy submission (verdict: Runtime Error):
n=list(input())
for i in range(3):
  if n[i]==1:
    n[i]=9
  else:
    n[i]=1
s=""
for i in range(3):
  s+=n[i]
print(int(s))

Buggy submission (verdict: Runtime Error):
n=list(input())
for i in range(3):
  if n[i]==1:
    n[i]=9
  else:
    n[i]=1
s=""
for i in range(3):
  s+=n[i]
print(s)

Buggy submission (verdict: Runtime Error):
n=input()
for i in range(3):
  if n[i]==1:
    n[i]=9
  else:
    n[i]=1
print("n")

Buggy submission (verdict: Runtime Error):
n=input()
for i in range(3):
  if n[i]==1:
    n[i]=9
  else:
    n[i]=1
print(n)
Problem p02699 (python)

Fixed submission:
N,M=map(int,input().split())
if(N>M):
    print("safe")
elif(N<=M):
    print("unsafe")

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
if(N>M):
    print("safe")
else if(N<=M):
    print("unsafe")
Problem p02759 (python)

Fixed submission:
N = int(input())
if N%2==0:
	print(int(N/2))
else:
	print(int((N+1)/2))

Buggy submission (verdict: Runtime Error):
N = int(input())
if N%2==0:
  print(N/2)
if N==1:
  print("1")
if N==3:
  print("2")
if else:
  print(N/2+1)
Problem p02771 (python)

Fixed submission:
A,B,C=map(int,input().split())
if A==B and A !=C:
	print("Yes")
elif A==C and A!=B:
	print("Yes")
elif B==C and B !=A:
	print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
    A,B,C=map(int,input().split())
    if A==B and A !=C:
        print("Yes")
    elif A==C and A!=B:
        print("Yes")
    elif B==C and B !=A:
        print("Yes")
    else:
        print("No")
Problem p02847 (python)

Fixed submission:
S=str(input())
A={"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(A[S])

Buggy submission (verdict: Runtime Error):
S=str(input())
a={"SUN":7,"MON":6,"TUE":5,"WED":4,"THU":3,"FRI":2,"SAT":1}
print(a(S))
Problem p03041 (python)

Fixed submission:
x,y=map(int,input().split())
S=list(map(str,input()))
if S[y-1]=="A":
    for i in range(x):
        S[y-1]="a"
        print(S[i],end="")
elif S[y-1]=="B":
    for i in range(x):
        S[y-1]="b"
        print(S[i],end="")
elif S[y-1]=="C":
    for i in range(x):
        S[y-1]="c"
        print(S[i],end="")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input().split())
S=list(map(str,input()))
if S[y]=="A":
    for i in range(x):
        S[y]="a"
        print(S[i],end="")
elif S[y]=="B":
    for i in range(x):
        S[y]="b"
        print(S[i],end="")
elif S[y]=="C":
    for i in range(x):
        S[y]="c"
        print(S[i],end="")
Problem p02723 (python)

Fixed submission:
s = input()
if(s[2]==s[3]):
  if(s[4]==s[5]):
    print('Yes')
  else:
    print('No')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if(s[2]==s[3]):
  if(s[4]==s[5]):
    print('Yes')
  else:
    print('No')
else:    
print('No')

Buggy submission (verdict: Runtime Error):
s = input()
if(s[2]==s[3]):
  if(s[4]==s[5]):
    print('Yes')
    return None
print('No')
Problem p02766 (python)

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

ans = -1
for i in range(1, 40):
    if K ** (i - 1) <= N < K ** i:
        ans = i

print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, K;
    cin >> N >> K;
    ll ans = 0;
    ll tmp = 0;
    while (pow(K, tmp) <= N) {
        tmp++;
    }
    rep2(i, 1, tmp + 1) {
        if (pow(K, i - 1) <= N && N < pow(K, i)) {
            ans = max(ans, i);
        }
    }
    cout << ans << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}
Problem p02987 (python)

Fixed submission:
S = input()
if len(set(list(S))) == 2:
    tmp = list(set(list(S)))
    if S.count(tmp[0]) == 2 and  S.count(tmp[1]) == 2:
        print("Yes")
    else:
        print("No")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = input()

from collections import defaultdict

dic = defaultdict(int)

for s in S:
    dic[s] += 1
    
if len(dic) == 2:
    for k, v in dic:
        if v == 2:
            continue
        else:
            print("No")
            exit()
    print("Yes")
else:
    print("No")
Problem p03011 (python)

Fixed submission:
P, Q, R = map(int, input().split())

print(P + Q + R - max(P, Q, R))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
a_list = [int(input()) for _ in range(M)]

mod = 10 ** 9 + 7

dp = [0] * (N + 100)
dp[0] = 1
a_set = set(a_list)

for i in range(N):
    if i in a_set:
        continue
    else:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod

print(dp[N] % mod)
Problem p03053 (python)

Fixed submission:
H, W = map(int, input().split())
items = []
black = []
for i in range(H):
    tmp = list(input())
    for j in range(W):
        if tmp[j] == "#":
            black.append((i, j))
    items.append(tmp)

que = []
for b in black:
    que.append(b)

ans = 0
d4 = [(1, 0), (0, -1), (-1, 0), (0, 1)]
next_que = que
while len(que) != H * W:
    tmp = next_que
    next_que = []
    for b in list(tmp):
        x, y = b[0], b[1]
        for d in d4:
            dx = d[0]
            dy = d[1]
            if 0 <= x + dx <= H - 1 and 0 <= y + dy <= W - 1:
                tar = items[x + dx][y + dy]
                if tar == ".":
                    next_que.append((x + dx, y + dy))
                    que.append((x + dx, y + dy))
                    items[x + dx][y + dy] = "#"
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
items = []
black = []
for i in range(H):
    tmp = input()
    for j in range(W):
        if tmp[j] == "#":
            black.append((i, j))
    items.append(list(tmp))

que = []

for b in black:
    que.append(b)

ans = 0
d4 = [(1, 0), (0, -1), (-1, 0), (0, 1)]
next_que = que.copy()
while len(que) != H * W:
    tmp = next_que.copy()
    next_que = []
    for b in list(tmp):
        x, y = b[0], b[1]
        for d in d4:
            dx = d[0]
            dy = d[1]
            if 0 <= x + dx <= H - 1 and 0 <= y + dy <= W - 1:
                tar = items[x + dx][y + dy]
                if tar == ".":
                    next_que.append((x + dx, y + dy))
                    que.append((x + dx, y + dy))
                    items[x + dx][y + dy] = "#"
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque

H, W = map(int, input().split())
items = []
black = []
for i in range(H):
    tmp = input()
    for j in range(W):
        if tmp[j] == "#":
            black.append((i, j))
    items.append(list(tmp))

que = deque()

for b in black:
    que.append(b)

ans = 0
d4 = [(1, 0), (0, -1), (-1, 0), (0, 1)]
next_que = que.copy()
while len(que) != H * W:
    tmp = next_que.copy()
    next_que = []
    for b in list(tmp):
        x, y = b[0], b[1]
        for d in d4:
            dx = d[0]
            dy = d[1]
            if 0 <= x + dx <= H - 1 and 0 <= y + dy <= W - 1:
                tar = items[x + dx][y + dy]
                if tar == ".":
                    next_que.append((x + dx, y + dy))
                    que.append((x + dx, y + dy))
                    items[x + dx][y + dy] = "#"
    ans += 1
print(ans)
Problem p03135 (python)

Fixed submission:
T, x = map(int, input().split())
print(T/x)

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

x_list.sort()
ans = 0

margin = [0] * (M - 1)
f = x_list[0]
for i in range(1, M):
    margin[i - 1] = x_list[i] - f
    f = x_list[i]
margin = sorted(enumerate(margin), key=lambda x: (-x[1], x[0]))
cnt = [0]
for i, v in margin:
    cnt.append(i + 1)
    if len(cnt) == N:
        break

start = 0
prev = x_list[0]
for i, c in enumerate(cnt[1:]):
    for j in range(start, c):
        ans += x_list[j] - prev
        prev = x_list[j]
    start = c
    prev = x_list[c]
last = cnt[-1]
for i in range(last, M):
    if i == last:
        prev = x_list[i]
    else:
        ans += x_list[i] - prev
        prev = x_list[i]
print(ans)
Problem p03221 (python)

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

shi_map = []

for i in range(M):
    p, y = map(int, input().split())
    shi_map.append([i, p, y])

shi_map = sorted(shi_map, key=lambda x: (x[1], x[2]))

result = {}
shi_count = {}
for i, p, y in shi_map:

    if p in shi_count:
        c = shi_count[p]
        count = c + 1
        shi_count[p] = count
    else:
        shi_count[p] = 1
        count = 1
    result[i] = [p, count]
result = list(sorted(result.items(), key=lambda x: x[0]))

for i, p in result:

    p2 = str(p[0]).zfill(6)

    y = str(p[1]).zfill(6)
    r = p2+y
    print(r)

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

p_list = []
y_list = []
shi_map = {}

for i in range(M):
    p, y = map(int, input().split())
    p_list.append(p)
    y_list.append(y)
    if p in shi_map:
        shi_map[p].append(y)
    else:
        shi_map[p] = [y]
shi_map = sorted(shi_map.items(), key=lambda x: x[0])
shi_map = dict(shi_map)
count_p = len(set(p_list))
shi_list = list(map(sorted, shi_map.values()))
for i in range(M):
    p = p_list[i]
    y = y_list[i]
    if p > count_p:
        s = shi_list[p - 2 - count_p]
    else:
        s = shi_list[p-1]
    j = s.index(y)
    p_str = str(p).zfill(6)
    j_str = str(j+1).zfill(6)
    print(p_str + j_str)

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

p_list = []
y_list = []
shi_map = {}

for i in range(M):
    p, y = map(int, input().split())
    p_list.append(p)
    y_list.append(y)
    if p in shi_map:
        shi_map[p].append(y)
    else:
        shi_map[p] = [y]
count_p = len(set(p_list))
shi_list = list(map(sorted, shi_map.values()))
for i in range(M):
    p = p_list[i]
    y = y_list[i]
    if p > count_p:
        s = shi_list[p - 1 - count_p]
    else:
        s = shi_list[p-1]
    j = s.index(y)
    p_str = str(p).zfill(6)
    j_str = str(j+1).zfill(6)
    print(p_str + j_str)

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

p_list = []
y_list = []
shi_map = {}

for i in range(M):
    p, y = map(int, input().split())
    p_list.append(p)
    y_list.append(y)
    if p in shi_map:
        shi_map[p].append(y)
    else:
        shi_map[p] = [y]
count_p = len(set(p_list))
shi_list = list(map(sorted, shi_map.values()))
for i in range(M):
    p = p_list[i]
    y = y_list[i]
    s = shi_list[p-1-count_p]
    j = s.index(y)
    p_str = str(p).zfill(6)
    j_str = str(j+1).zfill(6)
    print(p_str + j_str)
Problem p03634 (python)

Fixed submission:
n = int(input())
graph = [dict() for _ in range(n)]

for i in range(n - 1):
    a, b, c = map(int, input().split())
    graph[a - 1][b - 1] = c
    graph[b - 1][a - 1] = c

q, k = map(int, input().split())
xy = []
for i in range(q):
    x, y = map(int, input().split())
    xy.append([x-1, y-1])
depth = [0 for _ in range(n)]
prev = [False for _ in range(n)]
depth[k-1] = 0

import sys
sys.setrecursionlimit(10 ** 6)


def dfs(now, graph, depth, prev):
    if len(graph[now]) == 0 or prev[now]:
        return
    prev[now] = True
    for k, v in graph[now].items():
        if not prev[k]:
            depth[k] += depth[now] + v
            dfs(k, graph, depth, prev)
    return depth


depth = dfs(k-1, graph, depth, prev)
for x, y in xy:
    print(depth[x] + depth[y])

Buggy submission (verdict: Runtime Error):
n = int(input())
graph = [dict() for _ in range(n)]

for i in range(n - 1):
    a, b, c = map(int, input().split())
    graph[a - 1][b - 1] = c
    graph[b - 1][a - 1] = c

q, k = map(int, input().split())
xy = []
for i in range(q):
    x, y = map(int, input().split())
    xy.append([x - 1, y - 1])
depth = [0 for _ in range(n)]
prev = [False for _ in range(n)]
depth[k - 1] = 0

import sys

sys.setrecursionlimit(10 ** 5)


def dfs(now, prev, cost, graph, depth):
    depth[now] = cost
    for k, v in graph[now].items():
        if k == prev:
            continue
        dfs(k, now, cost + v,  graph, depth)
    return depth


depth = dfs(k - 1, -1, 0, graph, depth)
for x, y in xy:
    print(depth[x] + depth[y])

Buggy submission (verdict: Runtime Error):
n = int(input())
graph = [dict() for _ in range(n)]

for i in range(n - 1):
    a, b, c = map(int, input().split())
    graph[a - 1][b - 1] = c
    graph[b - 1][a - 1] = c

q, k = map(int, input().split())
xy = []
for i in range(q):
    x, y = map(int, input().split())
    xy.append([x - 1, y - 1])
depth = [0 for _ in range(n)]
prev = [False for _ in range(n)]
depth[k - 1] = 0




def dfs(now, prev, cost, graph, depth):
    depth[now] = cost
    for k, v in graph[now].items():
        if k == prev:
            continue
        dfs(k, now, cost + v,  graph, depth)
    return depth


depth = dfs(k - 1, -1, 0, graph, depth)
for x, y in xy:
    print(depth[x] + depth[y])
Problem p03723 (python)

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

sum_num = A + B + C

before_A = A
before_B = B
before_C = C
count = 1

if before_A % 2 == 1 or before_B % 2 == 1 or before_C % 2 == 1:
    print(0)
    exit()

while True:
    after_A = (sum_num - before_A) // 2
    after_B = (sum_num - before_B) // 2
    after_C = (sum_num - before_C) // 2
    if after_A == before_A and after_B == before_B and after_C == before_C:
        print(-1)
        exit()

    if after_A % 2 == 0 and after_B % 2 == 0 and after_C % 2 == 0:
        count += 1
        before_A = after_A
        before_B = after_B
        before_C = after_C

    else:
        print(count)
        exit()

Buggy submission (verdict: Runtime Error):
H, W, K = map(int, input().split())
items = []

start = []
diff = float("inf")
p = []
prev = [[False] * W for _ in range(H)]
for i in range(H):
    items.append(list(input()))
    for j in range(W):
        s = items[i][j]
        if s == "S":
            start = [i, j]
            diff = min(diff, min(i, H - 1 - i, min(j, W - 1 - j)))
            p = [i, j]
            prev[i][j] = True

from collections import deque

que = deque([])

dx = [-1, 0, 0, 1]
dy = [0, 1, -1, 0]

for i in range(4):
    x = dx[i]
    y = dy[i]
    if 0 <= start[0] + y <= H - 1 and 0 <= start[1] + x <= W - 1:
        tmp = items[start[0] + y][start[1] + x]
        if tmp == ".":
            que.append((start[0] + y, start[1] + x))
k = K
while len(que) != 0:
    q = que.popleft()
    a = q[0]
    b = q[1]
    if abs(start[0] - a) + abs(start[1] - b) > K:
        continue

    prev[a][b] = True
    c = min(min(a, H - 1 - a), min(b, W - 1 - b))
    if c < diff:
        diff = c
        p = (a, b)

    for i in range(4):
        x = dx[i]
        y = dy[i]
        if 0 <= a + y <= H - 1 and 0 <= b + x <= W - 1:
            if prev[a + y][b + x]:
                continue
            tmp = items[a + y][b + x]
            if tmp == ".":
                que.append((a + y, b + x))
    k -= 1

ans = 1
if diff == 0:
    print(ans)
else:
    print(ans + (K - 1 + diff) // K)
Problem p03821 (python)

Fixed submission:
N = int(input())
a_list = []
b_list = []

for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

count = 0
for i in range(N-1, -1, -1):
    a = a_list[i]
    b = b_list[i]
    if a == 0:
        continue
    if b == 1:
        continue

    if count > 0:
        a += count
    if a % b == 0:
        continue

    margin = b - (a % b)
    count += margin
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
a_list = []
b_list = []

for i in range(N):
    a, b = map(int, input().split())
    a_list.append(a)
    b_list.append(b)

count = 0
for i in range(N-1, -1, -1):
    a = a_list[i]
    b = b_list[i]
    if b == 1:
        continue

    if b % a == 0:
        continue

    if count > 0:
        a += count

    margin = b - (a % b)
    count += margin
print(count)
Problem p02777 (python)

Fixed submission:
s,t=map(str, input().split())
a,b=map(int, input().split())
u=input()
if s==u:
    if t==u:
        print(a-1,b-1)
    else:
        print(a-1,b)
else:
    if t==u:
        print(a,b-1)
    else:
        print(a,b)

Buggy submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
tester=True
for i in range(n):
    for j in range(i+1,n):  
        if l[i]==l[j]:
            tester=False
            break

if tester==True:
    print('YES')
else:
    print('NO')
Problem p02831 (python)

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

Buggy submission (verdict: Runtime Error):
import fraction
a,b=map(int,input().split())
print((a*b)//fraction.gcd(a,b))

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
print((a*b)//math.gcd(a,b))
Problem p02860 (python)

Fixed submission:
n=int(input())
s=input()
if n%2==1:
  print("No")
else:
  for i in range(n//2):
    if s[i]!=s[n//2+i]:
      print("No")
      break
    elif i==n//2-1:
      print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
s=input()
if n%2==1:
  print(No)
else:
  for i in range(n//2):
    if s[i]!=s[n//2+i]:
      print(No)
      break
    elif i==n//2:
      print(Yes)
Problem p02570 (python)

Fixed submission:
D, T, S = map(int, input().split())
if D<=T*S:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
count=10000000000
COUNT=0
for j in range(len(s)-len(t)-1):
    for i in range(len(t)):
        if not t[i]==s[j]:
            COUNT+=1
    count=min(count,COUNT)
print(count)
Problem p02578 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
sum=0
sa=0
for i in range(N-1):
  if A[i] <= A[i+1]:
    continue
  else:
    sa = A[i]-A[i+1]
    A[i+1]=A[i]
    sum += sa
print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
sum=0
for i in range(N-1):
  if A[i] < A[i+1]:
    continue
  else:
    sa = A[i]-A[i+1]+1
    A[i+1]=A[i]+1
    sum += sa
print(sa)
Problem p02594 (python)

Fixed submission:
X = int(input())
if 30 <= X:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
X = int(input())
if 30 <= x:
  print("Yes")
else:
  print("No")
Problem p02596 (python)

Fixed submission:
def calc(k):
    cur = 0
    for i in range(1, 10 ** 7):
        cur *= 10
        cur += 7
        cur %= k
        if cur == 0:
            return i

    return -1


k = int(input())
print(calc(k))

Buggy submission (verdict: Runtime Error):
K = int(input())
x = 7
count = 1

if 7%K==0:
  print("1")
  exit(0)
if 77%==0:
  print("2")
  exit(0)
if 777%==0:
  print("3")
  exit(0)
if 7777%==0:
  print("4")
  exit(0)
if 77777%==0:
  print("5")
  exit(0)
if 777777%==0:
  print("6")
  exit(0)
if 7777777%==0:
  print("7")
  exit(0)
  
print("-1")

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

if 7%K==0:
  print("1")
  exit(0)
if 77%==0:
  print("2")
  exit(0)
if 777%==0:
  print("3")
  exit(0)
if 7777%==0:
  print("4")
  exit(0)
if 77777%==0:
  print("5")
  exit(0)
if 777777%==0:
  print("6")
  exit(0)
if 7777777%==0:
  print("7")
  exit(0)
  
print("-1")
Problem p02627 (python)

Fixed submission:
x = input()
if x.islower():
  print("a")
else:
  print("A")

Buggy submission (verdict: Runtime Error):
n = int(input())
AL = [chr(ord('a') + i) for i in range(26)]

def number_to_alphabet(n):
    N = n-1
    a = ''
    while True:
        d = N % 26
        a = AL[d]+ a
        if N == 0: break
        N = N//26-1
        if N < 0: break
    return a

print(number_to_alphabet(n))