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

Fixed submission:
n,m = map(int,input().split())
if m != 0:
    l = [list(input().split()) for i in range(m)]
    p,s = [list(i) for i in zip(*l)]
t = [0] * n
ac = 0
wa = 0

for i in range(m):
    if s[i] == 'WA' and t[int(p[i])-1] != 'AC':
        t[int(p[i])-1] += 1
    elif s[i] == 'AC' and t[int(p[i])-1] != 'AC':
        ac += 1
        wa += t[int(p[i])-1]
        t[int(p[i])-1] = 'AC'

print(ac,wa)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
l = [list(input().split()) for i in range(m)]
p,s = [list(i) for i in zip(*l)]
t = []
x = 0
y = 0

for i in range(m):
    if not p[i] in t:
        if s[i] == 'WA':
            y += 1
        else:
            t.append(p[i])
            x += 1

print(x,y)
Problem p02841 (python)

Fixed submission:
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if m1 == m2:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
m1,d1 = map(int,input().split())
m2,d2 = map(int,input().split())

if mi == m2:
    print(0)
else:
    print(1)
Problem p02861 (python)

Fixed submission:
import itertools
import math
n = int(input())                    #n = 町の個数
l = [list(map(int,input().split())) for i in range(n)]
x,y = [list(i) for i in zip(*l)]    #x,y = 町の座標
l = list(range(n))                  
z = list(itertools.permutations(l)) #z = 経路の組み合わせ
m = math.factorial(n)               #m = 経路の個数
t = 0                               #t = 長さの合計

for i in range(m):
    for j in range(n - 1):
        t += math.sqrt((x[z[i][j]] - x[z[i][j+1]]) ** 2 + (y[z[i][j]] - y[z[i][j+1]]) ** 2)

print(t / m)

Buggy submission (verdict: Runtime Error):
import itertools
import math
n = int(input())
m = math.factorial(n)
l = [list(map(int,input().split())) for i in range(n)]
x,y = [list(i) for i in zip(*l)]
z = list(range(n))
z = list(itertools.permutations(l))
ans = 0
for i in range(m):
    for j in range(n-1):
        ans += math.sqrt((x[z[i][j]] - x[z[i][j+1]]) ** 2 + (y[z[i][j]] - y[z[i][j+1]]) ** 2)
print(ans / m)
Problem p02898 (python)

Fixed submission:
n,k = map(int,input().split())
h = list(map(int,input().split()))
c = 0

for i in range(n):
    if h[i] >= k:
        c += 1

print(c)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int,inpu().split()))
c = 0

for i in range(n):
    if h[i] >= k:
        c += 1

print(c)
Problem p02909 (python)

Fixed submission:
s = input()
a ='Sunny'
b ='Cloudy'
c ='Rainy'
if s == a:
    print(b)
elif s == b:
    print(c)
else:
    print(a)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
l = [[] for i in range(n+1)]
l[0] = ['0',0]
ans = 0
for i in range(1,n+1):
    l[i] = [s[i-1:],i]
l.sort()
for i in range(n):
    for j in range(i+1,n):
        m = min(len(l[i][0]),len(l[j][0]))
        x = l[i][0]
        y = l[j][0]
        z = 0
        while z < m:
            if x[z] != y[z]:
                break
            z += 1
        if z > l[i][1] - l[j][1]:
            z = l[i][1] - l[j][1]
        ans = max(z,ans)
print(ans)
Problem p02917 (python)

Fixed submission:
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n-2):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n - 1):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

Buggy submission (verdict: Runtime Error):
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n - 1)
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))
Problem p02939 (python)

Fixed submission:
s = list(input())
i = len(s)
p = 0
while i >= 3:
    if s[i-1] == s[i-2]:
        i -= 3
        p += 2
    else:
        i -= 1
        p += 1

if i <= 1:
    print(p+i)
else:
    if s[i-1] == s[i-2]:
        print(p+1)
    else:
        print(p+2)

Buggy submission (verdict: Runtime Error):
s = input()
t = s[0]
p = 1
i = 1
while i < len(s):
    if s[i] == t:
        i += 2
    else:
        i += 1
    t = s[i-1]
    p += 1

print(p)
Problem p02946 (python)

Fixed submission:
k,x = map(int,input().split())
t = []
for i in range(x-k+1,x+k):
    t.append(str(i))
print(' '.join(t))

Buggy submission (verdict: Runtime Error):
k,x = map(int,input().split())
a = x-k+1
b = x+k
c = list(range(a,b))
str(c)
print(' '.join(c))
Problem p02988 (python)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
c = 0

for i in range(1,n-1):
    if p[i-1] < p[i] and p[i] < p[i+1]:
        c = c + 1

    if p[i-1] > p[i] and p[i] > p[i+1]:
        c = c + 1

print(c)

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

for i in range(1,n - 1):
    if p[n - 1] < p[n] and p[n] < p[n + 1]:
        c = c + 1

print(c)
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):
s = int(input())
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print('Bad')
else:
    print('Good')
Problem p03000 (python)

Fixed submission:
N,X = map(int,input().split())
L = list(map(int,input().split()))
C = 1
M = 0

for i in range(N):
    M = M + L[i]
    if M > X:
        print(C)
        exit(0)
    
    C = C + 1

print(C)

Buggy submission (verdict: Runtime Error):
N,X = map(int,input().split())
L = list(map(int,input().split()))
C = 1
M = 0

for i in range(N + 1):
    M = M + L[i]
    if M >= X:
        print(C)
        exit(0)
    
    C = C + 1

print(C)
Problem p03024 (python)

Fixed submission:
s = list(input())
i = len(s)
o = s.count('o')

if o >= 8:
    print('YES')
else:
    i = 15 - i
    if 8 - o <= i:
        print('YES')
    else:
        print('NO')

Buggy submission (verdict: Runtime Error):
s = list(input())
i = len(s)
o = s.count('o')

if o >= 8:
    print('YES')
else:
    s = 15 - s
    if 8 - o <= s:
        print('YES')
    else:
        print('NO')
Problem p03076 (python)

Fixed submission:
t = []
for i in range(5):
    t.append(int(input()))

s = []
for i in range(5):
    s.append(t[i] % 10)

o = 5
p = 10
for i in range(5):
    if s[i] > 0:
        if p > s[i]:
            o = i
            p = s[i]

m = 0
for i in range(5):
    if i != o:
        if s[i] == 0:
            m += t[i]
        else:
            m += t[i] - t[i] % 10 + 10

if o != 5:
    m += t[o]
print(m)

Buggy submission (verdict: Runtime Error):
t = []
for i in range(5):
    t.append(int(input()))

s = []
for i in range(5):
    s.append(t[i] % 10)

p = 10
for i in range(5):
    if s[i] > 0:
        if p > s[i]:
            o = i
            p = s[i]

m = 0
for i in range(5):
    if i != o:
        if s[i] == 0:
            m += t[i]
        else:
            m += t[i] - t[i] % 10 + 10

m += t[o]
print(m)
Problem p03086 (python)

Fixed submission:
s = input()
a = ['A','C','G','T']
c = 0
j = 0

for i in range(len(s)):
    if s[i] in a:
        j += 1
    else:
        if j > c:
            c = j
            j = 0

if j > c:
    print(j)
else:
    print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(map(int,input().split()))
l.sort(reverse = True)

if l[0] < sum(l[1:n]):
    print('Yes')
else:
    print('No')
Problem p03139 (python)

Fixed submission:
n,a,b = map(int,input().split())
l = []

l.append(min(a,b))

if n >= a + b:
    l.append(0)
else:
    l.append(a + b - n)

print(l[0],l[1])

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
l = []

l.append(min(a,b))

if n >= a + b:
    l.append(0)
else:
    l.append(a + b - n)

print(''.join(l))
Problem p03149 (python)

Fixed submission:
n = list(input().split())

if '1' in n:
    if '9' in n:
        if '7' in n:
            if '4' in n:
                print('YES')
                exit(0)

print('NO')

Buggy submission (verdict: Runtime Error):
n = list(input().split())
print(n)

if n in ('1'):
    if n in ('9'):
        if n in ('7'):
            if n in ('4'):
                print('YES')
                exit(0)

print('NO')
Problem p03160 (python)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))
dp = [0] * n

dp[1] = abs(h[0] - h[1])

for i in range(2,n):
    p = abs(h[i] - h[i-2]) + dp[i-2]
    q = abs(h[i] - h[i-1]) + dp[i-1]
    if p <= q:
        dp[i] = p
    else:
        dp[i] = q

print(dp[-1])

Buggy submission (verdict: Runtime Error):
n = int(input())
p = list(map(float,input().split()))
dp = [[0] * (n+1) for i in range(n+1)]
dp[0][0] = 1
for i in range(1,n+1):
    for j in range(i+1):
        if j > 0:
            dp[i][j] = dp[i-1][j]*(1-p[i-1])+dp[i-1][j-1]*p[i-1]
        else:
            dp[i][j] = dp[i-1][j]*(1-p[i-1])
ans = 0
for i in range(n//2+1,n+1):
    ans += dp[n][i]
print(ans)
Problem p03166 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
def f(x):
    if flg[x]:
        flg[x] = 0
        p = 0
        for y in glaph[x]:
            p = max(p,f(y)+1)
        dp[x] = p
    return dp[x]
n,m = map(int,input().split())
flg = [1]*(n+1)
dp = [0]*(n+1)
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
def f(x):
    if flg[x]:
        flg[x] = 0
        p = 0
        for y in glaph[x]:
            p = max(p,f(y)+1)
        dp[x] = p
    return dp[x]
n,m = map(int,input().split())
flg = [1]*(n+1)
dp = [0]*(n+1)
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
def f(x):
    if flg[x]:
        flg[x] = 0
        p = 0
        for y in glaph[x]:
            p = max(p,f(y)+1)
        dp[x] = p
    return dp[x]
n,m = map(int,input().split())
flg = [1]*(n+1)
dp = [0]*(n+1)
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
def f(x):
    if flag[x]:
        return dp[x]
    flag[x] = 1
    p = 0
    for y in glaph[x]:
        p = max(p,f(y)+1)
    dp[x] = p
    return dp[x]
n,m = map(int,input().split())
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
flag = [0]*(n+1)
dp = [0]*(n+1)
for i in range(1,n+1):
    f(i)
print(max(dp))

Buggy submission (verdict: Runtime Error):
def f(x):
    if flag[x]:
        return dp[x]
    flag[x] = 1
    p = 0
    for y in glaph[x]:
        p = max(p,f(y)+1)
    dp[x] = p
    return dp[x]
n,m = map(int,input().split())
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
flag = [0]*(n+1)
dp = [0]*(n+1)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
def f(x):
    if flag[x]:
        return dp[x]
    flag[x] = 1
    p = 0
    for y in glaph[x]:
        p = max(p,f(y)+1)
    dp[x] = p
    return dp[x]
n,m = map(int,input().split())
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
flag = [0]*(n+1)
dp = [0]*(n+1)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)

Buggy submission (verdict: Runtime Error):
def f(x):
    if len(glaph[x]) == 0:
        return dp[x]
    y = 0
    for i in glaph[x]:
        y = max(y,f(i)+1)
    dp[x] = y
    return dp[x]
n,m = map(int,input().split())
glaph = [[] for i in range(n+1)]
for _ in range(m):
    x,y = map(int,input().split())
    glaph[x].append(y)
dp = [0]*(n+1)
ans = 0
for i in range(1,n+1):
    ans = max(ans,f(i))
print(ans)
Problem p03196 (python)

Fixed submission:
from math import sqrt
from math import floor
n,p = map(int,input().split())
l = [p]
for i in range(2,floor(sqrt(p))+1):
    if p % i == 0:
        l.append(i)
        l.append(p//i)
l.sort()
s = [1]
i = 0
while p > 1:
    if p % l[i] == 0:
        s.append(l[i])
        p = p // l[i]
    else:
        i += 1
ans = 1
x = s[0]
y = 1
for i in s[1:]:
    if x == i:
        y += 1
    else:
        while y >= n:
            ans *= x
            y -= n
        x = i
        y = 1
while y >= n:
    ans *= x
    y -= n
print(ans)

Buggy submission (verdict: Runtime Error):
from math import sqrt
from math import floor
n,p = map(int,input().split())
l = [p]
for i in range(2,floor(sqrt(p))+1):
    if p % i == 0:
        l.append(i)
        l.append(p//i)
l.sort()
s = []
i = 0
while p > 1:
    if p % l[i] == 0:
        s.append(l[i])
        p = p // l[i]
    else:
        i += 1
print(s[0]*s[-1])

Buggy submission (verdict: Runtime Error):
from math import gcd
n,p = map(int,input().split())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
m = make_divisors(p)
x = []
i = 1
while p != 1:
    if p % m[i] == 0:
        x.append(m[i])
        p = p // m[i]
    else:
        i += 1
print(gcd(x[0],x[-1]))
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
#n = 候補の数
n = int(input())
#t - h[i] * 0.006
#a = 基準温度
t,a = map(int,input().split())
h = list(map(int,input().split()))
#o = 計算結果格納
o = []

for i in range(n):
    o.append(t - h[i] * 0.006)

#p = 基準温度に最も近い場所の差
p = abs(a - o[0])
#q = 基準地点の番号
q = 0
for i in range(n)[1:]:
    if abs(a - o[i]) < p:
        p = abs(a - o[i])
        q = i

print(q + 1)
Problem p03231 (python)

Fixed submission:
from math import gcd
n,m = map(int,input().split())
z = n * m // gcd(n,m)
s = input()
t = input()
n = z // n
m = z // m
x = 0
y = 0
i = 0
j = 0
while x < z and y < z:
    if x > y:
        y += m
        j += 1
    elif x < y:
        x += n
        i += 1
    else:
        if s[i] != t[j]:
            print(-1)
            exit(0)
        x += n
        y += m
        i += 1
        j += 1
print(z)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = n
while a % m != 0:
    a += n
    if a >= 10 ** 10:
        print(-1)
        exit(0)
l = ['0'] * a
s = input()
t = input()
for i in range(n):
    l[a//n*i] = s[i]
for i in range(m):
    if l[a//m*i] != '0':
        if l[a//m*i] != t[i]:
            print(-1)
            exit(0)
    else:
        l[a//m*i] = t[i]
print(a)

Buggy submission (verdict: Runtime Error):
from math import gcd
n,m = map(int,input().split())
a = (n * m) // gcd(n,m)
l = ['0'] * a
s = input()
t = input()
for i in range(n):
    l[a//n*i] = s[i]
for i in range(m):
    if l[a//m*i] != '0':
        if l[a//m*i] != t[i]:
            print(-1)
            exit(0)
    else:
        l[a//m*i] = t[i]
print(a)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = n
while a % m != 0:
    a += n
    if a >= 10 ** 12:
        print(-1)
        exit(0)
l = ['0'] * a
s = input()
t = input()
for i in range(n):
    l[a//n*i] = s[i]
for i in range(m):
    if l[a//m*i] != '0':
        if l[a//m*i] != t[i]:
            print(-1)
            exit(0)
    else:
        l[a//m*i] = t[i]
print(a)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = n
while a % m != 0:
    a += n
l = ['0'] * a
s = input()
t = input()
for i in range(n):
    l[a//n*i] = s[i]
for i in range(m):
    if l[a//m*i] != '0':
        if l[a//m*i] != t[i]:
            print(-1)
            exit(0)
    else:
        l[a//m*i] = t[i]
print(a)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = list(input())
t = list(input())
ans = n
while ans % m != 0:
    ans += n
l = ['0'] * ans
j = 0
for i in range(n):
    z = j * (ans // n)
    l[z] = s[i]
    j += 1
j = 0
for i in range(m):
    z = j * (ans // m)
    if l[z] == '0' or l[z] == t[i]:
        l[z] = s[i]
        j += 1
    else:
        print(-1)
        exit(0)
print(ans)
Problem p03243 (python)

Fixed submission:
n = int(input())
l = list(range(111,1000,111))

if n % 111 == 0:
    print(n)
else:
    print(l[n // 111])

Buggy submission (verdict: Runtime Error):
n = int(input())
l = list(range(111,1000,111))

print(l[n // 111])
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int,input().split())
xl = list(map(int,input().split()))
yl = list(map(int,input().split()))
xl.append(x)
yl.append(y)
xl.sort()
yl.sort()

if xl[-1] < yl[0]:
    print('No War')
else:
    print('War')

Buggy submission (verdict: Runtime Error):
n,m,x,y = map(int,input().split())
xl = list(input().split())
yl = list(input().split())
xl.sort(reverse = True)
yl.sort()

if xl[0] < x and yl[0] >= y:
    print('No War')
else:
    print('War')
Problem p03285 (python)

Fixed submission:
n = int(input())

for i in range(n):
    for j in range(n):
        if 4 * i + 7 * j == n:
            print('Yes')
            exit(0)

print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
cakeA = round(N / 4)
cakeB = round(N / 7)
count = 0

for a in round(cakeA):
    for b in round(cakeB):
        if (4 * a)+(7 * b) == N:
            count = count + 1
print(count)
Problem p03316 (python)

Fixed submission:
n = int(input())
i = n
m = 0
while i > 0:
    m += i % 10
    i = i // 10

if n % m != 0:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
i = n
m = 0
while i > 0
    m += i % 10
    i = i // 10

if n % m != 0:
    print('No')
else:
    print('Yes')
Problem p03371 (python)

Fixed submission:
a,b,c,x,y = map(int,input().split())
l = 0
p = x

if x > y:
    l += (x - y) * a
    p = y
elif x < y:
    l += (y - x) * b
    p = x
else:
    pass
l += p * 2 * c
n = max(x,y) * 2 * c
m = x * a + y * b
print(min(l,n,m))

Buggy submission (verdict: Runtime Error):
a,b,c,x,y = map(int,input().split())
l = 0

if x > y:
    l += (x - y) * a
    p = y
elif x < y:
    l += (y - x) * b
    p = x
else:
    pass
l += p * 2 * c
n = max(x,y) * 2 * c
m = x * a + y * b
print(min(l,n,m))
Problem p03393 (python)

Fixed submission:
s = list(input())
m = list('zyxwvutsrqponmlkjihgfedcba')
if len(s) < 26:
    for i in m[::-1]:
        if not i in s:
            s.append(i)
            break
    print(''.join(s))
else:
    x = s[-1]

    for i in range(25)[::-1]:
        if x > s[i]:
            y = m.index(s[i])
            s = s[:i]
            for j in range(y)[::-1]:
                if not m[j] in s:
                    s.append(m[j])
                    break
            break
        else:
            x = s[i]
        if i == 0:
            print(-1)
            exit(0)
    print(''.join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
m = list('zyxwvutsrqponmlkjihgfedcba')
if len(s) < 26:
    for i in m[::-1]:
        if not j in s:
            s.append(j)
            break
    print(''.join(s))
else:
    if s == m:
        print(-1)
    else:
        x = s[-1]
        for i in range(25)[::-1]:
            if x > s[i]:
                s = s[:i]
                s.append(x)
                break
            if i == 0:
                z = m.index(s[0])
                s = m[z-1]
                break
        print(''.join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
m = list('zyxwvutsrqponmlkjihgfedcba')
if len(s) < 26:
    for i in m:
        if not i in s:
            s.append(_)
            break
    print(''.join(s))
else:
    if s == m:
        print(-1)
    else:
        x = s[-1]
        for i in range(25)[::-1]:
            if x > s[i]:
                s = s[:i]
                s.append(i)
                break
            if i == 0:
                z = m.index(s[0])
                s = m[z-1]
        print(''.join(s))

Buggy submission (verdict: Runtime Error):
s = list(input())
n = list('abcdefghijklmnopqrstuvwxyz')
if len(s) < 26:
    for _ in m:
        if not _ in s:
            s.append(_)
            break
    print(''.join(s))
else:
    if s == n[::-1]:
        print(-1)
    else:
        x = s[-1]
        for _ in range(25)[::-1]:
            if x > s[_]:
                s = s[:_]
                s.append(x)
                break
        print(''.join(s))

Buggy submission (verdict: Runtime Error):
s = input()
if s == 'zyxwvutsrqponmlkjihgfedcba':
    print(-1)
    exit(0)
l = list('abcdefghijklmnopqrstuvwxyz')
for i in range(26):
    if l[i] != s[i]:
        print(s[:i-1] + l[i])
        exit(0)
Problem p03415 (python)

Fixed submission:
a = input()
b = input()
c = input()

print(a[0] + b[1] + c[2])

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
t = 0

for i in range(a,b+1):
    if i % 100 == i // 1000:
        t += 1
    if i % 100 * 10 == i // 1000:
        t += 1

print(t)
Problem p03423 (python)

Fixed submission:
n = int(input())
if n < 3:
    print(0)
else:
    print(n // 3)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split())
s = set(s)
print(s)
if len(s) == 3:
    print('Three')
else:
    print('Four')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [input().split]
if len(set(s)) == 3:
    print('Three')
else:
    print('Four')
Problem p03424 (python)

Fixed submission:
n = int(input())
s = list(input().split())
s = set(s)
if len(s) == 3:
    print('Three')
else:
    print('Four')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split)
if len(set(s)) == 3:
    print('Three')
else:
    print('Four')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = list(input().split)

print(len(set(s)))
Problem p03434 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
list.sort(a,reverse = True)
k = 0
l = 0

for i in range(n)[::2]:
    k += a[i]

for i in range(n)[1::2]:
    l += a[i]

print(k - l)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse = True)
Alice = sum(a[::2])
Bob = sum(a[1::2])
print(Alice - )
Problem p03469 (python)

Fixed submission:
a,b,c = input().split('/')
a = '2018'
print(a + '/' + b + '/' + c)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split(/)
a = '2018'
print(a + '/' + b + '/' + c)
Problem p03471 (python)

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

for i in range(0,n+1):
    for j in range(0,n+1-i):
        k = max(0,n-i-j)
        if 10000*i + 5000*j + 1000*k == y:
            print(i,j,k)
            exit(0)

print(-1,-1,-1)

Buggy submission (verdict: Runtime Error):
import itertools

n,y = map(int,input().split())
a = [1000,5000,10000]
l = list(itertools.product(a,repeat = n))
print(l)

for i in range(len(l)):
    if sum(l[i]) == y:
        o = l[i].count(10000)
        p = l[i].count(5000)
        q = l[i].count(1000)
        print(o + ' ' + p + ' ' + q)
        exit(0)

print('-1 -1 -1')
Problem p03485 (python)

Fixed submission:
import math
a,b = map(int,input().split())
ave = (a + b) / 2
print(math.ceil(ave))

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ave = (a + b) / 2
print(math.cell(ave))