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

Fixed submission:
N = int(input())
if N == 1:
    print('Hello World')
else:
    A = int(input())
    B = int(input())
    print(A+B)

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

p = []

for i in range(N):
    X1, Y1, H1 = map(int, input().split())
    if H1 != 0:
        p.append([X1, Y1, H1])

if len(p) == 1:
    print(p[0][0], p[0][1], p[0][2])
    exit()


for i in range(101):
    for j in range(101):
        h = -1
        fg = True
        for t in p:
            if h == -1:
                h = t[2] + abs(i - t[0]) + abs(j - t[1])

            else:
                ht = t[2] + abs(i - t[0]) + abs(j - t[1])
                if h == ht:
                    h = ht
                else:
                    fg = False
                    break

        if fg:
            print(i, j, h)
            exit()
Problem p03413 (python)

Fixed submission:
import numpy as np


def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    best, solution = int(-1e10), []
    for p in range(2):
        c = a.copy()

        indexes = list(range(p, n, 2))
        if len(indexes) == 0:
            continue

        maks = max([c[i] for i in indexes])
        pick = next((i for i in indexes if c[i] == maks))
        chosen = set([pick] if maks <= 0 else [i for i in indexes if c[i] > 0])
        is_chosen = [(i in chosen) for i in range(n)]

        tot, res = sum([c[i] for i in chosen]), []
        for i in reversed(range(n)):
            if not is_chosen[i]:
                if i == 0 or i + 1 == len(c):
                    res += [i]
                    del c[i], is_chosen[i]
                elif is_chosen[i - 1] == is_chosen[i + 1]:
                    res += [i]
                    c[i - 1] += c[i + 1]
                    del c[i + 1], c[i], is_chosen[i + 1], is_chosen[i]

        for end in (-1, 0):
            while len(c) > 1 and not is_chosen[end]:
                res += [end]
                del c[end], is_chosen[end]

        if tot > best:
            best, solution = tot, np.array(res) + 1

    print(best, len(solution), *solution, sep='\n')


if __name__ == '__main__':
    main()

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


def main():
    n = int(input())
    a = [int(x) for x in input().split()]

    best, solution = int(-1e10), []
    for p in range(2):
        c = a.copy()

        indexes = list(range(p, n, 2))
        if len(indexes) == 0:
            continue

        maks = max([c[i] for i in indexes])
        pick = next((i for i in indexes if c[i] == maks))
        chosen = set([pick] if maks <= 0 else [i for i in indexes if c[i] > 0])
        is_chosen = [(i in chosen) for i in range(n)]

        tot, res = sum([c[i] for i in chosen]), []
        for i in reversed(range(n)):
            if not is_chosen[i]:
                if i == 0 or i + 1 == len(c):
                    res += [i]
                    del c[i], is_chosen[i]
                elif is_chosen[i - 1] == is_chosen[i + 1]:
                    res += [i]
                    c[i - 1] += c[i + 1]
                    del c[i + 1], c[i], is_chosen[i + 1], is_chosen[i]

        if tot > best:
            while len(c) > 1 and not is_chosen[c[0]]:
                del c[0], is_chosen[0]
            while len(c) > 1 and not is_chosen[c[-1]]:
                del c[-1], is_chosen[-1]
            best, solution = tot, np.array(res) + 1

    print(best, len(solution), *solution, sep='\n')


if __name__ == '__main__':
    main()
Problem p03419 (python)

Fixed submission:
def main():
    n, m = map(int, input().split())
    print(compute(min(n, m), max(n, m)))


def compute(n, m):
    if n == 1 and m == 1:
        return 1
    if n == 1:
        return max(0, m - 2)
    return (n - 2) * (m - 2)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    res = 0

    for (a, k) in [[int(x) for x in input().split()] for _ in range(n)]:
        while a >= k:
            m, u, v = a // k, (a - k * m), (m + 1)
            if a % k == 0 or u % v == 0:
                res ^= m
                break
            x = (u // v)
            a -= (x + 1) * v

    print('Takahashi' if res != 0 else 'Aoki')


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

Fixed submission:
def main():
    n = int(input())
    res = 0
    for (a, k) in [map(int, input().split()) for _ in range(n)]:
        while a >= k:
            m = a // k
            if a % k == 0:
                res ^= m
                break
            x = (a - k * m - 1) // (m + 1)
            a -= max(1, x) * (m + 1)
    print('Takahashi' if res != 0 else 'Aoki')


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    n = int(input())
    res = 0

    for (a, k) in [[int(x) for x in input().split()] for _ in range(n)]:
        while a >= k:
            m, u = a // k, (a - k * m)
            if a % k == 0 or (a % k) % (m + 1) == 0:
                res ^= m
                break
            x = u // (m + 1)
            a -= (x + 1) * (m + 1)

    print('Takahashi' if res != 0 else 'Aoki')


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

Fixed submission:
from fractions import gcd
from functools import reduce

N,X = map(int, input().split())
xn = list(map(lambda x: int(x)-X, input().split()))
print(abs(reduce(gcd, xn)))

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

N,X = map(int, input().split())
xn = list(map(lambda x: int(x)-X, input().split()))
print(reduce(gcd, xn))
Problem p03283 (python)

Fixed submission:
N,M,Q = map(int,input().split())
T = [[0 for _ in range(N+1)] for _ in range(N+1)]
for i in range(M):
  L,R = map(int, input().split())
  T[L][R] += 1
for l in range(1,N+1):
  for r in range(1,N+1):
    T[l][r] += T[l-1][r]+T[l][r-1]-T[l-1][r-1]
ans = []
for i in range(Q):
  p,q = map(int, input().split())
  ans.append(T[p-1][p-1]+T[q][q]-T[p-1][q]-T[q][p-1])
print('\n'.join(map(str,ans)))

Buggy submission (verdict: Runtime Error):
N,M,Q = map(int,input().split())
T = [[0 for _ in range(N+1)] for _ in range(N+1)]
for i in range(M):
  L,R = map(int, input().split())
  T[L][R] += 1
pprint(T)
for l in range(1,N+1):
  for r in range(1,N+1):
    T[l][r] += T[l-1][r]+T[l][r-1]-T[l-1][r-1]
ans = []
pprint(T)
for i in range(Q):
  p,q = map(int, input().split())
  ans.append(T[p-1][p-1]+T[q][q]-T[p-1][q]-T[q][p-1])
print('\n'.join(map(str,ans)))
quit()
Problem p03287 (python)

Fixed submission:
from collections import Counter
N,M=map(int,input().split())
A=list(map(int,input().split()))
A.insert(0,0)
cnt = Counter()
for i in range(N): A[i+1] += A[i]
for i in range(N+1): cnt[A[i]%M] += 1
print(sum(n*(n-1)//2 for n in cnt.values()))

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
A=list(map(int,input().split()))
aa = [0]*(N+1)
tbl = [0]*M
cnt = 0
for i in range(N):
  aa[i+1] = aa[i]+A[i]
  am = aa[i+1] % M
  tbl[am] += 1
  cnt += tbl[am]-1
am = aa[i+1] % M
tbl[am] += 1
cnt += tbl[am]-1
print(int(cnt))
Problem p03425 (python)

Fixed submission:
from itertools import combinations
from collections import Counter
N = int(input())
S = Counter()
for _ in range(N):
  S[input()[0]] += 1
print(sum([S[p0]*S[p1]*S[p2] for p0,p1,p2 in combinations('MARCH', 3)]))
quit()

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N = int(input())
d = [0]*128
for _ in range(N): dic[ord(input()[0])] += 1
print(sum([d[ord(p0)]*d[ord(p1)]*d[ord(p2)] for p0,p1,p2 in combinations('MARCH', 3)]))

Buggy submission (verdict: Runtime Error):
from itertools import combinations
N = int(input())
S = Counter()
for _ in range(N):
  S[input()[0]] += 1
print(sum([S[p0]*S[p1]*S[p2] for p0,p1,p2 in combinations('MARCH', 3)]))
Problem p03240 (python)

Fixed submission:
n = int(input())

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)

info = sorted(info,key = lambda x: x[2])
end = 0

for x in range(101):
    for y in range(101):
        H = info[n-1][2] + abs(x-info[n-1][0]) + abs(y-info[n-1][1])
        for i in range(n-1):
            if info[i][2] != max(0,H - abs(x-info[i][0]) - abs(y- info[i][1])):
                break
        else:
            print(x,y,H)
            end = 1
            
        if end == 1:
            break
    if end == 1:
        break

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

info = []
for i in range(n):
    pre = list(map(int,input().split(" ")))
    info.append(pre)
    
end = 0
if n >=3:
    for x in range(101):
        for y in range(101):
            H = info[0][2] + abs(x-info[0][0]) + abs(y-info[0][1])
            if H <= 10**9
                for i in range(1,n):
                    if info[i][2] != H - abs(x-info[i][0]) - abs(y- info[i][1]):
                        break
                else:
                    print(x,y,H)
                    end = 1
                
                if end == 1:
                    break
            if end == 1:
                break
elif n ==2:
    info = sorted(info, key = lambda x:x[2])
    if info[0][0] > info[1][0]:
        h = info[1][2] + info[1][0]
        x = 0
    else:
        h = info[1][2] + 100- info[1][0]
        x = 100
    if info[0][1] > info[1][1]:
        h += info[1][1]
        y = 0
    else:
        h += 100 - info[1][1]
        y =100
    ans = list(map(str,(x,y,h)))
    print(" ".join(ans))
Problem p03262 (python)

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

def minus_x(t):
    return abs(int(t) - x)
cities = sorted(list(map(minus_x,input().split(" "))))

def gcd(a,b):
    while b>0:
        a,b = b,a%b
    return a

if n == 1:
    ans = cities[0]
else:
    ans = gcd(cities[0],cities[1])
    for i in range(2,n-1):
        ans = gcd(cities[i],ans)

print(ans)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split(" "))

def minus_x(t):
    return int(t) - x
cities = list(map(minus_x,input().split(" ")))

import math
if n == 1:
    ans = cities[0]
else:
    ans = math.gcd(cities[0],cities[1])
    for i in range(2,n-1):
        ans = math.gcd(cities[i],ans)

print(ans)
Problem p03274 (python)

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

minus = 0
while minus < N and array[minus]<0:
    minus += 1

first,last = max(minus-K,0),min(minus,N-K)

ans = 2*(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

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

minus = 0
while array[minus] < 0 and minus < N:
    minus += 1

#first,last = max(minus-K,0),min(minus,N-K)
first = 0
last = N-K
ans = 2*(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

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

minus = 0
while array[minus] < 0 and minus < N:
    minus += 1

first,last = max(minus-K,0),min(minus,N-K)

ans = 2*(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

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

minus = 0
while array[minus] < 0 and minus < N:
    minus += 1

first,last = max(minus-K,0),min(minus,N-K)

ans = 2(array[N-1]- array[0])

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

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

minus = 0
while array[minus] < 0 and minus < N:minus += 1
plus = N-minus

first,last = max(minus-K,0),min(minus,N-K)

ans = array[N-1]- array[0]

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),abs(p_dist))*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)

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

minus = 0
while array[minus] < 0 and minus < N:minus += 1
plus = N-minus

first,last = max(minus-K,0),min(minus,N-K)

ans = array[N-1]- array[0]

for i in range(first,last+1):
    m_dist, p_dist = array[i], array[K-1+i]
    if m_dist*p_dist <=0:
        dist_i = min(abs(m_dist),p_dist)*2+max(abs(m_dist),p_dist)
    else:
        dist_i = max(abs(m_dist),abs(p_dist))
    ans = min(ans,dist_i)

print(ans)
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k <= idx or idx == len(s):
    print(1)
else:
    print(s[idx])

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())
idx = 0
while idx < len(s) and s[idx] == '1':
    idx += 1
if k < idx:
    print(1)
else:
    print(s[idx])
Problem p03320 (python)

Fixed submission:
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**17
    for i in range(18):
        for j in range(1000):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    ls.append([0, MAX])

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**15
    for i in range(16):
        for j in range(100):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    ls.append([0, MAX])

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def digit_sum(a):
    res = 0
    while a:
        res += a % 10
        a /= 10
        a = int(a)
    return res

def main():

    d = {}
    MAX = 10**15
    for i in range(16):
        for j in range(100):
            if i == 0 and j == 0: continue
            tmp = int(str(j) + str(9) * i)
            if tmp > MAX: continue
            d[tmp] = tmp / digit_sum(tmp)

    ls = []
    for a, b in d.items():
        ls.append([b, a])
    ls.sort()

    k = int(input())

    idx, last = 0, 0
    while k:
        while ls[idx][1] < last: idx += 1
        print(ls[idx][1])
        k -= 1
        last = ls[idx][1]
        idx += 1

    """while True:
        k = int(input())
        if k == 0:
            return True
        print(">", k / digit_sum(k))
    """

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

Fixed submission:
a=input().split()
if a[1]=='+':
  print(int(a[0])+int(a[2]))
else:
  print(int(a[0])-int(a[2]))

Buggy submission (verdict: Runtime Error):
a=input().split()
if a[1]=='+':
  print(a[0]+a[2])
else:
  print(a[0]-a[2])
Problem p03943 (python)

Fixed submission:
a=map(int,input().split())
a=list(a)
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a=map(int,input().split())
a.sort()
if a[0]+a[1]==a[2]:
  print("Yes")
else:
  print("No")
Problem p03773 (python)

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

ans1 = A + B


if ans1 >= 24:
    ans2 = ans1 - 24
    print(ans2)
else:
    print(ans1)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())

ans1 = A + B


if ans1 >= 24:
    ans2 = ans1 - 24
    print(ans2)
else:
    print(ans1)
Problem p04043 (python)

Fixed submission:
x = list(map(int, input().split()))
x.sort()

if x == [5, 5, 7]:
    print("YES")
else:
    print("NO")

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

Iloha = []

for i in range(N):
    S = input()
    Iloha.append(S)

Iloha.sort()

print("".join(Iloha))
Problem p03239 (python)

Fixed submission:
# -*- coding: utf-8 -*-

n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

A.sort(key=lambda x: x[1])

if A[0][1] > t:
    print("TLE")
else:
    min = A[0][0]
    for i in A:
        if i[1] > t:
            break
        
        if min > i[0]:
            min = i[0]
        
    print(min)

Buggy submission (verdict: Runtime Error):

n,t =  (int(x) for x in input().split())

A = []
for i in range(n):
    c,ti  =  (int(x) for x in input().split())
    A.append([c,ti])

B = []
for i in A:
    if A[1] < t:
        B.append(i)

if len(B):
    B.sort(key=lambda x: x[0])
    print(B[0])
else:
    print("TLE")
Problem p03261 (python)

Fixed submission:
#-*- coding:utf-8 -*-
"""
高橋くんは今日も1人でしりとりの練習をしています。

しりとりとは以下のルールで遊ばれるゲームです。

・はじめ、好きな単語を発言する
・以降、次の条件を満たす単語を発言することを繰り返す
　・その単語はまだ発言していない単語である
　・その単語の先頭の文字は直前に発言した単語の末尾の文字と一致する

高橋くんは、10秒間にできるだけ多くの単語を発言する練習をしています。
高橋くんが発言した単語の個数Nとi番目に発言した単語Wiが与えられるので、
どの発言もしりとりのルールを守っていたかを判定してください。
"""
def check(words):
    answer = "Yes"

    # 同じ単語を使っていないか確認
    for i in range(0, len(words)):
        for j in range(i+1, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    # 単語の最初と最後が一致しているか確認
    for i in range(0, len(words)-1):
        if(words[i][-1] != words[i+1][0]):
            answer = "No"

    return answer


def main(words):
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  # 単語の個数の読み込み
    str = [input() for i in range(0, num)]  # 単語の読み込み
    main(str)

Buggy submission (verdict: Runtime Error):
#-*- coding:utf-8 -*-
"""
高橋くんは今日も1人でしりとりの練習をしています。

しりとりとは以下のルールで遊ばれるゲームです。

・はじめ、好きな単語を発言する
・以降、次の条件を満たす単語を発言することを繰り返す
　・その単語はまだ発言していない単語である
　・その単語の先頭の文字は直前に発言した単語の末尾の文字と一致する

高橋くんは、10秒間にできるだけ多くの単語を発言する練習をしています。
高橋くんが発言した単語の個数Nとi番目に発言した単語Wiが与えられるので、
どの発言もしりとりのルールを守っていたかを判定してください。
"""
def check(words):
    answer = "Yes"
    for i in range(0, len(words)):
        for j in range(i, len(words)):
            if(words[i] == words[j]):
                answer = "No"

    return answer


def main(str):
    words = str.split()
    answer = check(words)
    print(answer)


if __name__ == "__main__":
    num = int(input())  # 単語の個数の読み込み
    str = [input() for i in range(0, num)]  # 単語の読み込み
    main(str)
Problem p03264 (python)

Fixed submission:
import numpy as np


def num_even_odd(num):
    num_odd = np.ceil(num/2)
    num_even = num//2
    return num_odd, num_even


def main(num):
    odds, evens = num_even_odd(num)
    print(int(odds * evens))


if __name__ == "__main__":
    main(int(input()))

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


def num_even_odd(num):
  num_odd = np.ceil(num/2)
  num_even = num//2
  return num_odd, num_even


def main(num):
  odds, evens = num_even_odd(num)
  print(odds * evens)


if __name__ == "__main__":
  main(input())
Problem p03962 (python)

Fixed submission:
s = list(map(int, input().split()))
s = list(set(s))
print(len(s))

Buggy submission (verdict: Runtime Error):
s = [int(input()) for i in range(3)]
s = list(set(s))
print(len(s))
Problem p04011 (python)

Fixed submission:
s = [int(input()) for i in range(4)]
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split()))
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])

Buggy submission (verdict: Runtime Error):
s = list(map(int, input().split()))
if s[0] > s[1]:
    print((s[1] * s[2] + (s[0] - s[1]) * s[3]))
          
else:
    print(s[0]*s[2])
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
#106a
a,b=map(int,input().split())
pritn((a-1)*(b-1))
Problem p03281 (python)

Fixed submission:
#107b
n=int(input())


if n<105:
    print(0)
elif n<135:
    print(1)
elif n<165:
    print(2)
elif n<189:
    print(3)
elif n<195:
    print(4)
else:
    print(5)

Buggy submission (verdict: Runtime Error):
#106b
n = int(input())
ans=0
for i in range(1,n+1,2):
    c=0
    for j in range(1,i+1):
        if i%j==0:
            c+=1
            
    if c==8:
        a+=1
print(ans)

Buggy submission (verdict: Runtime Error):
#106b
n = int(input())
ans=0
for i in range(1,n+1,2):
    c=0
    for j in range(1,i+1):
        print(i,j)
        if i%j==0:
            c+=1
            
    if c==8:
        a+=1
print(ans)
Problem p03284 (python)

Fixed submission:
n,k=map(int,input().split())
print(0 if n%k==0 else 1)

Buggy submission (verdict: Runtime Error):
#105b
n=int(input())
x = n//4
if n%4==0 or n%11==0:
    print('Yes')
    exit()
else:
    for i in range(x):
        for j in range(x):
            temp=4*i+7*j
            if temp==n:
                print('Yes')
                exit()
print('No')
Problem p03292 (python)

Fixed submission:
#103a
a=list(map(int,input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
参りました
Problem p03351 (python)

Fixed submission:
#97a
a,b,c,d=map(int,input().split())

if a<=b<=c or c<=b<=a:
    if abs(a-b)<=d and abs(c-b)<=d:
        print('Yes')

    else:
        print('No')
else:
    if abs(a-c)<=d:
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
#97a
n = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
print(array[-1])

Buggy submission (verdict: Runtime Error):
#97a
a,b,,c,d=map(int,input().split())
print('Yes' if b-a>=d and c-b>=d else 'No')
Problem p03352 (python)

Fixed submission:
#97b
x = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= x:
            array.append(a)
array.sort(reverse=True)
print(array[0])

Buggy submission (verdict: Runtime Error):
#97b
x = int(input())
array = []
for i in range(1,33):
    for j in range(2,10):
        a = i**j
        if a <= n:
            array.append(a)
array.sort(reverse=True)
print(array[0])
Problem p03378 (python)

Fixed submission:
#94b
n,m,x=map(int,input().split())
a=map(int,input().split())

up=0
down=0

for i in a:
    if i>x:
        up+=1
    else:
        down+=1
print(min(up,down))

Buggy submission (verdict: Runtime Error):
#94b
n,m,x=map(int,input().split())
ans=[0 for i in range(n+2)]
a=map(int,input().split())
for i in a:
    i=i+
    ans[i]=1

if x==n:
    print(0)
else:
    print(min(sum(ans[:x+1]),sum(ans[-x:])))