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

Fixed submission:
import numpy as np

x = int(input())
k = 0
A = 0
B = 0
for i in range(0, 1000):
    I = i**5
    j = I - x
    J = abs(j)
    k = 0
    while k <= J**(0.2):
        if k**5 == J:
            A = i
            B = k*(np.sign(j))
            break
        k += 1
print(str(A) + ' ' + str(B))

Buggy submission (verdict: Runtime Error):
x = int(input())
k = 0
A = 0
B = 0
for i in range(0, 100):
    I = i**5
    j = I - x
    J = abs(j)
    k = 0
    while k <= J**(0.2):
        if k**5 == J:
            A = i
            B = int(J**(0.2))*(int(j/J))
            break
        k += 1
print(str(A) + ' ' + str(B))

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(0, 100):
    I = i**5
    j = I - x
    J = abs(j)
    if J**(0.2) == J**(0.2)//1:
        A = i
        B = int(J**(0.2))*(int(j/J))
        break
print(str(A) + ' ' + str(B))

Buggy submission (verdict: Runtime Error):
x = int(input())
for i in range(0, 100):
    I = i**5
    j = I - x
    J = abs(j)
    if J**(0.2) == J**(0.2)//1:
        A = i
        B = int(J**(0.2))*(int(j/J))
        break
print(str(A) + ' ' + str(B))
Problem p03061 (python)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
s1 = [0]*(n+1)
s2 = [0]*(n+1)
s1[0] = 0
s1[1] = a[0]
s2[0] = 0
s2[n] = a[n-1]
for i in range(2, n+1):
    s1[i] = gcd(s1[i-1], a[i-1])
    s2[n-i+1] = gcd(s2[n-i+2], a[n-i])
if s1[n-1] >= s2[2]:
    ans = s1[n-1]
else:
    ans = s2[2]
for i in range(2, n):
    b = gcd(s1[i-1], s2[i+1])
    if ans <= b:
        ans = b
print(ans)

Buggy submission (verdict: Runtime Error):
import fractions
n = int(input())
a = list(map(int, input().split()))
s = [0]
small = 10**9
c = 0
for i in range(n-1):
    s.append(fractions.gcd(a[i], a[i+1]))
    if fractions.gcd(a[i], a[i+1]) <= small:
        small = fractions.gcd(a[i], a[i+1])
        c = i+1
s.append(fractions.gcd(a[n-1], a[0]))
if fractions.gcd(a[n-1], a[0]) <= small:
    small = fractions.gcd(a[n-1], a[0])
    c = n
if c != 1 and c != n:
    if s[c-1] > s[c+1]:
        d = c+1
    else:
        d = c-1
if c == 1:
    if s[n] > s[2]:
        d = 2
    else:
        d = n
if c == n:
    if s[n-1] > s[1]:
        d = 1
    else:
        d = n-1
del s[c]
del s[d]
del s[0]
if n == 2:
    ans = max(a)
else:
    ans = min(s)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
s = [0]
small = 10**9
c = 0
for i in range(n-1):
    s.append(math.gcd(a[i], a[i+1]))
    if math.gcd(a[i], a[i+1]) <= small:
        small = math.gcd(a[i], a[i+1])
        c = i+1
s.append(math.gcd(a[n-1], a[0]))
if math.gcd(a[n-1], a[0]) <= small:
    small = math.gcd(a[n-1], a[0])
    c = n
if c != 1 and c != n:
    if s[c-1] > s[c+1]:
        d = c+1
    else:
        d = c-1
if c == 1:
    if s[n] > s[2]:
        d = 2
    else:
        d = n
if c == n:
    if s[n-1] > s[1]:
        d = 1
    else:
        d = n-1
del s[c]
del s[d]
del s[0]
if n == 2:
    ans = max(a)
else:
    ans = min(s)
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
s = [0]
small = 10**9
c = 0
for i in range(n-1):
    s.append(math.gcd(a[i], a[i+1]))
    if math.gcd(a[i], a[i+1]) <= small:
        small = math.gcd(a[i], a[i+1])
        c = i+1
s.append(math.gcd(a[n-1], a[0]))
if math.gcd(a[n-1], a[0]) <= small:
    small = math.gcd(a[n-1], a[0])
    c = n
if c != 1 and c != n:
    if s[c-1] > s[c+1]:
        d = c+1
    else:
        d = c-1
if c == 1:
    if s[n] > s[2]:
        d = 2
    else:
        d = n
if c == n:
    if s[n-1] > s[1]:
        d = 1
    else:
        d = n-1
del s[c]
del s[d]
del s[0]
if n == 2:
    ans = max(a)
else:
    ans = min(s)
print(ans)
Problem p02608 (python)

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


n = int(input())
if n==1:
    print(0)
else:
    max_x = int(((2*n-3)**0.5-1)//1)
    list_count = [0]*n
    for x in range(1,max_x+1):
        for y in range(1, max_x+2-x):
            for z in range(1, max_x+2-x-y):
                s = x**2+y**2+z**2+x*y+y*z+z*x
                if s>n:
                    continue
                else:
                    list_count[s-1] += 1
    for i in range(n):
        print(list_count[i])

Buggy submission (verdict: Runtime Error):
import sys

def input():
    return sys.stdin.readline()[:-1]


n = int(input())

max_x = int(((2*n-3)**0.5-1)//1)
list_count = [0]*n
for x in range(1,max_x+1):
    for y in range(x, max_x+2-x):
        for z in range(y, max_x+2-x-y):
            s = x**2+y**2+z**2+x*y+y*z+z*x
            if s>=n:
                continue
            if len(set([x,y,z]))==3:
                list_count[s-1] += 6
            elif len(set([x,y,z]))==2:
                list_count[s-1] += 3
            else:
                list_count[s-1] += 1
for i in range(n):
    print(list_count[i])
Problem p02647 (python)

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


n, k = map(int, input().split())
a_li = list(map(int, input().split()))

if k>=42:
    print(*[n]*n)
    exit()

for i in range(k):
    b = [0] * n
    for j in range(n):
        l = max(0, j-a_li[j])
        r = min(n-1, j+a_li[j])
        b[l] += 1
        if (r+1<n):
            b[r+1] -= 1
    for j in range(n-1):
        b[j+1] += b[j]
    a_li = b
print(*a_li)

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

def input():
    return sys.stdin.readline()[:-1]


n, k = map(int, input().split())
a_li = list(map(int, input().split()))

for _ in range(k):
    b_li = [0 for _ in range(n)]
    for i in range(n):
        l = max(0, i-a_li[i])
        r = min(n-1, i+a_li[i])
        for j in range(l, r+1):
            b_li[j] += 1
    a_li = b_li
    
print(' '.join(map(str, a_li)))
Problem p03029 (python)

Fixed submission:
A,P=input().split()
A=int(A)
P=int(P)
print((A*3+P)//2)

Buggy submission (verdict: Runtime Error):
N=input()
N=int(N)
S=[100]*N
P=[100]*N
for num in range(N):
    S[num]=input().split()
    S[num].append(num+1)
    S[num][1]=int(S[num][1])

S.sort()
flag=0
flag2=0
while(flag==0):
    flag2=0
    for num in range(0,N-1):
        if(S[num][0]==S[num+1][0]):
            if(S[num][1]<S[num+1][1]):
                S[num],S[num+1]=S[num+1],S[num]
                flag2=1
    if(flag2==0):
        flag=1
    
            

for num in range(N):
    print(S[num][2])
Problem p02642 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
m = 10 ** 6 + 1
cnt = [0] * m
for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, m, x):
        cnt[i] += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
m = (10 ** 6 + 1)
cnt = [0] * m
for x in a:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    for i in range(x, m, x):
        cnt += 1
ans = 0
for x in a:
    if cnt[x] == 1:
        ans += 1
print(ans)
Problem p02690 (python)

Fixed submission:
x = int(input())
for a in range(-200, 200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == x:
            print(a, b)
            exit()

Buggy submission (verdict: Runtime Error):
x = int(input())
for a in range(-200, 200):
    for b in range(-200, 200):
        if a ** 5 - b ** 5 == x:
            print(a+" "+b)
            break
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
print(c, a, b)
Problem p02927 (python)

Fixed submission:
m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(22, d + 1):
        if str(j)[0] != "1" and str(j)[1] != "1":
            if i == int(str(j)[0]) * int(str(j)[1]):
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
import os
f = open('input.txt', 'r')
sys.stdin = f

m, d = map(int, input().split())
ans = 0
for i in range(4, m + 1):
    for j in range(20, d + 1):
        if i == int(str(j)[0]) * int(str(j)[1]):
            ans += 1
print(ans)
Problem p02971 (python)

Fixed submission:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_max = max(a)
ind_M = a.index(a_max)
tmpl = a
tmpl.pop(ind_M)
for i in range(n):
    if i != ind_M:
        print(a_max)
    else:
        print(max(tmpl))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_max = max(a)
ind_M = a.index(a_max)
oth = max(max(a[:ind_M]), max(a[ind_M+1:]))
for i in range(n):
    if i != ind_M:
        print(a_max)
    else:
        print(oth)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_max = max(a)
for i in range(n):
    if a[i] == a_max:
        print(max(max(a[:i]), max(a[i+1:])))    
    else:
        print(a_max)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
a_max = max(a)
for i in range(n):
    if a[i] == a_max:
        a.pop(i)
        print(max(a))
    else:
        print(a_max)
Problem p02983 (python)

Fixed submission:
L, R = map(int, input().split())
mod = 2019
ans = mod
for l in range(L, L + mod + 2):
    for r in reversed(range(R - mod - 2, R + 1)):
        if l >= r:
            break
        ans = min(ans, (l * r) % mod)
print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 5000
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 10 ** 9 + 7
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)

Buggy submission (verdict: Runtime Error):
L, R = map(int, input().split())
if (R - L + 1) >= 2019:
    print(0)
else:
    ans = 10 ** 9 + 7
    for i in range(L, R + 1):
        for j in range(L + 1, R + 1):
            ans = min(ans, i * j % 2019)
print(ans)
Problem p02993 (python)

Fixed submission:
s = input()
if (s[0] == s[1] or s[1] == s[2] or s[2] == s[3]):
    print("Bad")
else:
    print("Good")

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

using namespace std;

int main(){

    string s;
    cin >> s;

    if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]){
        cout << "Bad" << endl;
    }
    else{
        cout << "Good" << endl;
    }

    return 0;
}
Problem p03085 (python)

Fixed submission:
b = input()
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])

Buggy submission (verdict: Runtime Error):
b = int(input())
ans = {'A': 'T', 'T': 'A', 'C': 'G', 'G': 'C'}
print(ans[b])
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
ans_list = []
for i in reversed(range(1, min(a, b)+1)):
    if (a % i == 0) and (b % i == 0):
            ans_list.append(i)
print(ans_list[k-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans_list = []
for i in reversed(range(1, min(a, b))):
    if (a % i == 0) and (b % i == 0):
            ans_list.append(i)
print(ans_list[k-1])
Problem p03136 (python)

Fixed submission:
N = int(input())
L = input().split()
L = [int(s) for s in L]
i = 0
L_max = L[0]
for i in range(len(L)):
    if L_max < L[i]:
        L_max = L[i]
if L_max < sum(L) - L_max:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
L = input().split()
L = [int(s) for s in L]
i = 0
L_max = 0
for i in range(len(L)):
    if L[i] < L[i+1]:
        L_max = L[i+1]
if L_max > sum(L):
    print("Yes")
else:
    print("No")
Problem p03145 (python)

Fixed submission:
x, y, z = map(int, input().split())
print(int(x * y / 2))

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
if an.index(1 or 2) == 0:
    print(4)
else:
    print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(1 or 2 or 4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(1 or 2 or 4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input()split())
print(x * y / 2)

Buggy submission (verdict: Runtime Error):
x, y, z = int(input()split())
print(x * y / 2)
Problem p03146 (python)

Fixed submission:
s = int(input())
an = []
an.append(s)
n = s
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
if an.index(1) == 0:
            print(4)
elif an.index(2) == 0:
            print(4)
else:
    print(an.index(4) + 4)

Buggy submission (verdict: Runtime Error):
s = int(input())
an = []
an.append(s)
n = s
if an.index(1 or 2) == 0:
    print(4)
while an.count(4) != 2:
    if n % 2 == 0:
        n /= 2
        an.append(int(n))
    else:
        n = 3 * n + 1
        an.append(int(n))
print(an.index(4) + 4)
Problem p03284 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
for i in range(N//4):
    for j in range(N//7):
        if(4*i + 7+j == N):
            print("Yes")
            exit()
print("No")
Problem p03292 (python)

Fixed submission:
A = sorted(map(int, input().split()))
print(A[2] - A[0])

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
for _ in range(len(s)):
    if s == t:
        print('Yes')
        break
    s = s[-1] + s[:-1]
else:
    print('No')
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a-c) <= d:
    print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if abs(a-c) <= d || abs(a-b) <= d and abs(b-c) <= d:
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
S = input()
print(S[:3] + "8" + S[4:])

Buggy submission (verdict: Runtime Error):
S = input()
S[3] = "8"
print(S)

Buggy submission (verdict: Runtime Error):
S = input()
S[3] = 8
print(S)
Problem p03623 (python)

Fixed submission:
x, a, b = map(int, input().split())
if abs(x - a) >= abs(x - b):
    print("B")
else:
    print("A")

Buggy submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
if abs(x - a) >= abs(x - b):
    print("B"):
else:
    print("A")
Problem p03624 (python)

Fixed submission:
S = list(input())
a_to_z = "abcdefghijklmnopqrstuvwxyz"
S.sort()
ans = "None"
for string in a_to_z:
    if string not in S:
        ans = string
        break
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(input())
a_to_z = "abcdefghijklmnopqrstuvwxyz"
s.sort()
ans = "None"
for string in a_to_z:
    if string not in S:
        ans = string
        break
print(ans)
Problem p03760 (python)

Fixed submission:
o = input()
e = input()
ans = ""
for i in range(len(e)):
    ans += o[i] + e[i]
if len(o) > len(e):
    ans += o[-1]
print(ans)

Buggy submission (verdict: Runtime Error):
o = input()
e = input()
ans = ""
for i in range(len(o)):
    ans += o[i] + e[i]
print(ans)
Problem p04033 (python)

Fixed submission:
a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print("Zero")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if 0 <= a:
    print("Positive")
elif b < 0:
    if (b - a + 1) % 2 == 0:
        print("Positive")
    else:
        print("Negative")
else:
    print(Zero)
Problem p03598 (python)

Fixed submission:
import math

n = int(input())
k = int(input())
xs = list(map(int, input().strip().split()))

print(2*sum([min([x, k - x]) for x in xs]))

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
k = int(input())
xs = [int(input()) for i in range(n)]

print(2*sum([min([x, k - x]) for x in xs]))

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
k = int(input())
xs = [int(input()) for i in range(n)]

print(2*sum(min([x, k - x])))
Problem p02642 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*3)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        if i-1>=0 or i+1<n:
            flag[num] = False
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * (a[-1]*2)
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        flag[num] = False
        continue
    for j in range(2, a[-1]//num+2):
        flag[j*num] = False
counter = 0
for i in a:
    if flag[i]:
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
import numpy as np
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i, num in enumerate(a):
    if a[(i-1)%n]==num or a[(i+1)%n]==num:
        flag[i] = False
        continue
    div = make_divisors(num)
    for d in div:
        if d == num:
            continue
        if d in a:
            flag[i] = False
print(np.count_nonzero(flag))

Buggy submission (verdict: Runtime Error):
import numpy as np
import sympy as sp
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i, num in enumerate(a):
    div = sp.divisors(num)
    for d in div:
        if d == num:
            if a.count(d)>1:
                flag[i] = False
            continue
        if d in a:
            flag[i] = False
print(np.count_nonzero(flag))

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = list(map(int, input().split()))
a.sort()
flag = [True] * n
for i, num in enumerate(a):
    if flag[i]:
        for j in range(i+1, n):
            if a[j]%num == 0:
                flag[j] = False
print(int(np.count_nonzero(flag)))
Problem p02613 (python)

Fixed submission:
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  x = input()
  if x == 'AC':
    ac += 1
  elif x == 'WA':
    wa += 1
  elif x == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x ', ac)
print('WA x ', wa)
print('TLE x ', tle)
print('RE x ', re)

Buggy submission (verdict: Runtime Error):
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  x = input()
  if x == 'AC':
    ac += 1
  elif x == 'WA':
    wa += 1
  elif x == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x ', ac)
print('WA x ', waz)
print('TLE x ', tle)
print('RE x ', re)
Problem p02664 (python)

Fixed submission:
t= list(input())
if t[-1] == '?':
  t[-1] = 'D'

if t[0] == '?':
  if t[1] == 'D':
    t[0] = 'P'
  elif t[1] == 'P':
    t[0] = 'D'
  else:
    t[0] = 'P'
    t[1] = 'D'

for i in range(1, len(t)-1):
  if t[i] == '?':
    if t[i-1] == 'P':
      t[i] = 'D'
    elif t[i-1] == 'D':
      if t[i+1] == 'P':
        t[i] = 'D'
      elif t[i+1] == 'D':
        t[i] = 'P'
      else:
        t[i] = 'P'
        t[i+1] = 'D'
    
    
print(''.join(t))

Buggy submission (verdict: Runtime Error):
t[i] == '?' and t[i+1] == 'D':
Problem p02681 (python)

Fixed submission:
s = input()
t = input()

if s+t[-1] == t:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

if s = t[:-1]:
  print('Yes')
else:
  print('No')
Problem p02705 (python)

Fixed submission:
import math
r = int(input())
pi = math.pi
print(r*2*pi)

Buggy submission (verdict: Runtime Error):
r = int(input())
prinrt(2*r*3.141592)
Problem p02747 (python)

Fixed submission:
s = input()
hi = [s[i:i+2] for i in range(0, len(s), 2)]

a = 0
for i in range(len(hi)):
  if hi[i] != 'hi':
    a += 1
    break
    
if a == 1:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
s = input()
s = list(s)

a = 0
if s[-2] == 'h' and s[-1] == 'i':
  a += 1
  
if len(s) == 2:
  if s[0] == 'h' and s[1] == 'i':
    a += 1
elif len(s) > 2:
  for i in range(len(s)-2):
    if s[i] == 'h':
      if s[i+1] == 'i' and s[i+2] != 'i':
        a += 1
        break
    
if a >= 1:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
s = input()
s = list(s)

if len(s) < 2:
  a = 0
elif len(s) == 2:
  if s[0] == 'h' and s[1] == 'i':
    a = 1
  else:
    a = 0
else:
  for i in range(len(s)-2):
    if s[i] == 'h':
      if s[i+1] == 'i' and s[i+2] != 'i':
        a += 1
    
if a >= 1:
  print('Yes')
else:
  print('No')
Problem p02795 (python)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
        
if h >= w:
  if n%h == 0:
    s = int(n/h)
  else:
    s = int(n/h)+1
    
else:
  if n%w == 0:
    s = int(n/w)
  else:
    s = int(n/w)+1

print(s)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

if a[2]%b == 0:
    s = int(a[2]/b)
else:
    s = int(a[2]/b)+1

print(s)

Buggy submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a[0] >= a[1]:
    b = a[0]
    c = a[1]
else:
    b = a[1]
    c = a[0]

s = int(a[2]/b)+1

print(s)
Problem p02865 (python)

Fixed submission:
n = int(input())


if n%2 == 0:
  print(int(n/2-1))
else:
  print(int(n/2))

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

sum = 1
if d[0] == 0 and d.count(0)==1:
  for i in range(1, n):
    if int(d[i]) >2:
      sum *= int(d[i]) 
  print(sum)
else:
  print("0")
Problem p04029 (python)

Fixed submission:
import numpy as np
n = int(input())

list = np.array(range(n+1))

print(sum(list))

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

for i in range(n):
  sum += n
  
print(sum)
Problem p04043 (python)

Fixed submission:
a,b,c=map(int,input().split())
s=a+b+c
if s == 17:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
if A==5 and B==5 and C==7:
  print('Yes')
elif A==5 and B==7 and C==5:
  print('Yes')
elif A==7 and B==5 and C==5:
  print('Yes')
else:
  print('No')
Problem p02861 (python)

Fixed submission:
# C
import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
sum = 0
for i in range(N):
    for j in range(N):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = sum/N
print(ans)

Buggy submission (verdict: Runtime Error):
# C
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
sum = 0
for i in range(N):
    for j in range(N):
        sum += math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)

ans = sum/N
print(ans)