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

Fixed submission:
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 if num == -1 else num for num in nums]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [-1] * n
for _ in range(m):
    s,c = map(int,input().split(" "))
    if n > 1 and s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != -1 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
nums = [0 for num in nums if num == -1 else num]
if n == 1:
    print(nums[0])
    sys.exit(0)
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if c >= 10 or c < 0:
        print(-1)
        sys.exit(0)
    if s >= n:
        print(-1)
        sys.exit(0)
    if s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if s == 1 and c == 0:
        print(-1)
        sys.exit(0)
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split(" "))
nums = [0] * m
for _ in range(m):
    s,c = map(int,input().split(" "))
    if nums[s-1] != 0 and c != nums[s-1]:
        print(-1)
        sys.exit(0)
    nums[s-1] = c
if nums[0] == 0:
    nums[0] = 1
print("".join(map(str,nums)))
Problem p02803 (python)

Fixed submission:
from collections import deque
w,h = list(map(int,input().split(" ")))
path = [input() for _ in range(w)]

def bfs(sw,sh):
    res = 0
    dw = [-1,1,0,0]
    dh = [0,0,1,-1]
    dist = [[-1 for _ in range(h)] for _ in range(w)]
    dist[sw][sh] = 0
    queue = deque()
    queue.append((sw,sh))
    while len(queue) != 0:
        cw,ch = queue.popleft()
        for i in range(4):
            nw,nh = cw + dw[i], ch + dh[i]
            if not (0<= nw < w and 0 <= nh < h): continue
            if path[nw][nh] == "#": continue
            if dist[nw][nh] != -1: continue
            dist[nw][nh] = dist[cw][ch] + 1
            queue.append((nw,nh))
            res = max(res, dist[nw][nh])
    return res

ans = 0
for i in range(w):
    for j in range(h):
        if path[i][j] == "#":
            continue
        ans = max(ans, bfs(i,j))
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import deque
w,h = list(map(int,input().split(" ")))
path = [input() for _ in range(w)]

def bfs(sw,sh):
    res = 0
    dw = [-1,1,0,0]
    dh = [0,0,1,-1]
    dist = [[-1 for _ in range(w)] for _ in range(h)]
    dist[sw][sh] = 0
    queue = deque()
    queue.append((sw,sh))
    while len(queue) != 0:
        cw,ch = queue.popleft()
        for i in range(4):
            nw,nh = cw + dw[i], ch + dh[i]
            if not (0<= nw < w and 0 <= nh < h): continue
            if path[nw][nh] == "#": continue
            if dist[nw][nh] != -1: continue
            dist[nw][nh] = dist[cw][ch] + 1
            queue.append((nw,nh))
            res = max(res, dist[nw][nh])
    return res

ans = 0
for i in range(w):
    for j in range(h):
        if path[i][j] == "#":
            continue
        ans = max(ans, bfs(i,j))
print(ans)
Problem p02818 (python)

Fixed submission:
a,b,k = list(map(int,input().split(" ")))

if a > k:
    a -= k
    print(str(a) + " " + str(b))
else:
    left = k - a
    b -= left
    if b < 0:
        b = 0
    print(str(0) + " " + str(b))

Buggy submission (verdict: Runtime Error):
a,b,k = list(map(int,input().split(" ")))

if a > k:
    a -= k
    print(str(a) + " " + b)
else:
    left = k - a
    b -= left
    print(str(0) + " " + b)
Problem p02899 (python)

Fixed submission:
n = int(input())
nums = list(map(int,input().split(" ")))
res = [0 for _ in range(len(nums))]
for i in range(len(nums)):
    index = i+1
    cnt = nums[i]
    res[cnt-1] = index
print(*res,sep=" ")

Buggy submission (verdict: Runtime Error):
nums = list(map(int,input().split(" ")))
res = [0 for _ in range(len(nums))]
for i in range(len(nums)):
    index = i+1
    cnt = nums[i]
    res[cnt-1] = index
print(res)
Problem p02732 (python)

Fixed submission:
import collections
import math
def calculateProb(counts):
    ways = 0
    for key in counts.keys():
        if counts[key] < 2:
            continue
        else:
            val = counts[key]
            ret = val*(val-1)/2
            ways += ret
    return ways

def getfact(val):
    if val < 2:
        return 0
    return val*(val-1)/2


n = int(input())

values = list(map(int, input().split(' ')))
counts = collections.Counter(values)

ways = calculateProb(counts)
for k in range(n):
    curVal = values[k]
    count = counts[curVal]
    temp = ways
    ways = ways - getfact(count)  + getfact(count - 1)
    print(int(ways))
    ways = temp

Buggy submission (verdict: Runtime Error):
import collections
import math
def calculateProb(counts):
    ways = 0
    for key in counts.keys():
        if counts[key] < 2:
            continue
        if counts[key] in cache:
            ways += cache[counts[key]]
        else:
            val = counts[key]
            cache[val] = math.factorial(val)/math.factorial(2)/math.factorial(val - 2)
            ways += cache[val]
    return ways

def getfact(val):
    if val < 2:
        return 0
    return math.factorial(val)/math.factorial(2)/math.factorial(val - 2)


n = int(input())

values = list(map(int, input().split(' ')))
counts = collections.Counter(values)

cache = {}
ways = calculateProb(counts)
for k in range(n):
    curVal = values[k]
    count = counts[curVal]
    temp = ways
    ways = ways - getfact(count)  + getfact(count - 1)
    print(int(ways))
    ways = temp

Buggy submission (verdict: Runtime Error):
import collections
import math
def calculateProb(counts):
    ways = 0
    for key in counts.keys():
        if counts[key] < 2:
            continue
        if counts[key] in cache:
            ways += cache[counts[key]]
        else:
            val = counts[key]
            cache[val] = math.factorial(val)/math.factorial(2)/math.factorial(val - 2)
            ways += cache[val]
    return ways

        


n = int(input())

values = list(map(int, input().split(' ')))
counts = collections.Counter(values)

cache = {}

for k in range(n):
    curVal = values[k]
    counts[curVal] -= 1
    print(int(calculateProb(counts)))
    counts[curVal] += 1
Problem p02783 (python)

Fixed submission:
H,A=map(int,raw_input().split())
ans=0
for i in range(1,100000):
  H = H-A
  ans += 1
  if H<=0:
    break
print ans

Buggy submission (verdict: Runtime Error):
H,A=map(int,raw_input().split())
ans=0
for i in range(1,10000):
  H = H-A
  ans += 1
  if H=<0:
    break
print ans
Problem p02811 (python)

Fixed submission:
K,X=map(int,raw_input().split())
if K*500>=X:
  print "Yes"
else:
  print "No"

Buggy submission (verdict: Runtime Error):
K,X=map(int,raw_input().split())
if K*500>=X:
  print "Yes"
else:
  print "No"

Buggy submission (verdict: Runtime Error):
K,X=map(int,raw_input().split())
if K*500>=X:
  print "Yes"
else:
  print "No"
Problem p02923 (python)

Fixed submission:
N = int(raw_input())
H = list(map(int,raw_input().split()))
ans = []
count = 0
i = 0
while i <= N:
  if N == 1:
    ans.append(0)
    break
  if H[i] >= H[i+1]:
    count = count + 1
  else:
    ans.append(count)
    count=0
  i = i+1
  if i == N-1:
    ans.append(count)
    break

print max(ans)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
H = list(map(int,raw_input().split()))
ans = []
count = 0
i = 0
while i <= N:
  if H[i] >= H[i+1]:
    count = count + 1
  else:
    ans.append(count)
    count=0
  i = i+1
  if i == N-1:
    ans.append(count)
    break

print max(ans)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
H = list(map(int,raw_input().split()))
ans = []
count = 0
for i in range(0,N-1):

  for j in range(i,N-1):
    if H[j]>=H[j+1]:
      count = count + 1
    else:
      ans.append(count)
      count = 0
      break
    if j == N-2:
      ans.append(count)
      count = 0
print max(ans)
Problem p04043 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b, c = map(int, raw_input().split())
sum = a+b+c
if sum == 17:
  print "YES"
else: 
  print "NO"

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b, c = map(int, raw_input().split())
sum = a+b+C
if sum == 17:
 print "YES"
else: 
 print "NO"

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
a, b, c = map(int, raw_input().split())
sum = a+b+C
if sum == 17:
  	print "YES"
else: 
	print "NO"

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(raw_input())
# スペース区切りの整数の入力
a, b, c = map(int, raw_input().split())
sum = a+b+C
if sum = 17:
  	print "YES"
else: 
	print "NO"

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b, c = map(int, raw_input().split())
sum = a+b+C
if sum == 17:
  	print "YES"
else 
	print "NO"

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
#a = int(raw_input())
# スペース区切りの整数の入力
a, b, c = map(int, raw_input().split())
sum = a+b+C
if sum = 17:
  	print "YES"
else 
	print "NO"
Problem p04044 (python)

Fixed submission:
N,L = map(int, raw_input().split())
a = []
s = ""
for i in range(N):
    b = raw_input()
    a.append(b)
a.sort()
for i in range(N):
    s += a[i] 
print s

Buggy submission (verdict: Runtime Error):
N = input()
a = []
s = ""
for i in range(N):
    b = raw_input()
    a.append(b)
a.sort()
for i in range(N):
    s += a[i] 
print s
Problem p02780 (python)

Fixed submission:
import numpy as np
n,k = map(int, input().split())
p = np.array(list(map(int, input().split())))
m = (p+1)/2
s = sum(m[:k])
r = s
for i in range(n-k):
    s -= m[i]
    s += m[i+k]
    r = max(r,s)
print(r)

Buggy submission (verdict: Runtime Error):
import numpy as np
n,k = map(int(input().split()))
p = np.array(list(map(int, input().split())))
m = (p+1)/2
s = sum(m[:k])
r = s
for i in range(n-k):
    s -= m[i]
    s += m[i+k]
    r = max(r,s)
print(r)
Problem p02811 (python)

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

if k*500 >= x:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
x = int(input())

if k*500 >= x:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
k = int(input())
x = int(input())

if k*500 > x:
    print("Yes")
else:
    print("No")
Problem p02741 (python)

Fixed submission:
if __name__ == '__main__':
    l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    n = int(input())
    print(l[n - 1])

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    k = int(input())
    print(l[k + 1])
Problem p02756 (python)

Fixed submission:
if __name__ == '__main__':
    d = input()
    n = int(input())
    qs = [input() for e in range(n)]
    s = []
    e = []
    r = False
    for q in qs:
        if q == '1':
            r = not(r)
        elif q.startswith("2 1"):
            e.append(q[-1]) if r else s.append(q[-1])
        else:
            s.append(q[-1]) if r else e.append(q[-1])
    print("".join(e[::-1]) + d[::-1] + "".join(s) if r else "".join(s[::-1]) + d + "".join(e))

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    d = input()
    n = int(input())
    for _ in range(n):
        q = input()
        d = d[::-1] if q[0] == ('1') else d = q[-1]+d if q[:3] == ("2 1") else d=d+q[-1]      
    print(d)
Problem p02760 (python)

Fixed submission:
if __name__ == '__main__':
    a = [list(map(int, input().split())) for e in range(3)]
    n = int(input())
    b = [int(input()) for _ in range(n)]
    c = 'No'
    for i in range(len(a)):
        for j in range(len(a)):
            if a[i][j] in b:
                a[i][j] = 0

    for i in range(len(a)):
         if {a[i][j] for j in range(len(a))} == {0}:
             c = 'Yes'
         if {a[j][i] for j in range(len(a))} == {0}:
            c = 'Yes'
    if {a[j][j] for j in range(len(a))} == {0}:
        c = 'Yes'
    if {a[-(j+1)][j] for j in range(len(a))} == {0}:
        c = 'Yes'
    print(c)

Buggy submission (verdict: Runtime Error):
60 88 34
92 41 43
65 73 48
10
60
43
88
11
48
73
65
41
92
34
Problem p03086 (python)

Fixed submission:
def all_part_string(s):
    r = range(len(s))
    return [s[i:j+1] for i in r for j in r if s[i:j+1] != '']

def contains_only(s, l):
    return False if [a for a in [e for e in s if e not in l] if a != ''] else True

if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    s = input()
    ss = all_part_string(s)
    o = [e for e in ss if contains_only(e, "ACGT")]
    print(0 if len(sorted(o, key=len, reverse=True)) == 0 else len(sorted(o, key=len, reverse=True)[0]))
Problem p03281 (python)

Fixed submission:
def count_divisor(n):
    a = 0
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a += 1
            if i != n // i:
                a += 1
    return a

if __name__ == '__main__':
    n = int(input())
    c = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue
        if count_divisor(i) == 8:
            c += 1
    print(c)

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
    n = int(input())
    c = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue
        if count_divisor(i) == 8:
            c += 1
    print(c)
Problem p02756 (python)

Fixed submission:
from collections import deque
s = deque(input())
q = int(input())
lis = [list(input().split()) for _ in range(q)]
rev = 0
z = 0

for i in lis:
    if i[0] == "2":
        if (rev + int(i[1])) % 2 == 1:
            s.appendleft(i[2])
        else:
            s.append(i[2])
        z = 1
    else:
        if z == 1:
            rev += 1
        
if rev % 2 == 1:
    s = reversed(s)
print("".join(s))

Buggy submission (verdict: Runtime Error):
from collections import deque
s = deque(input())
q = int(input())
r = 0
z = 0
to = 0
for i in range(q):
    
    try:
        t,f,c = input().split()
        if (r + int(f)) % 2 == 1:
            s.appendleft(c)
    
        else:
            s.append(c)
        r = 0
        z = 1
    except:
        if z == 0:
            pass
        else:
            r += 1
        z = 1
        to += 1
    print(s)
if to % 2 == 1:
    s = reversed(s)
print("".join(s))
Problem p02802 (python)

Fixed submission:
n,m = map(int,input().split())
ps = [list(input().split()) for _ in range(m)]
aw = ["WA"] * n
wacnt = [0] * n
ac = 0
wa = 0
for i in ps:
    if aw[int(i[0])-1] == "WA":
        if i[1] == "AC":
            ac += 1
            wa += wacnt[int(i[0])-1]
            aw[int(i[0])-1] = "AC"
        else:
            wacnt[int(i[0])-1] += 1
    else:
        pass
print(ac,wa)

Buggy submission (verdict: Runtime Error):
ps = [list(input().split()) for _ in range(m)]
aw = ["WA"] * n
ac = 0
wa = 0
for i in ps:
    if i[1] == "WA":
        if aw[int(i[0])-1] == "WA":
            wa += 1
        else:
            pass
    else:
        if aw[int(i[0])-1] =="WA":
            ac += 1
            aw[int(i[0])-1] = "AC"
        else:
            pass
print(ac,wa)
Problem p03000 (python)

Fixed submission:
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

for _ in range(n):
    ans = ans + l[i]
    if ans <= x:
        i += 1
    
print(i+1)

Buggy submission (verdict: Runtime Error):
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

while True:
    ans = ans + l[i]
    if ans > x:
        break

    i += 1
    
print(i+1)
Problem p03147 (python)

Fixed submission:
n = int(input())
v = list(map(int, input().split()))
ans = v[0]
for i in range(1, n):
    ans += max(v[i]-v[i-1], 0)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
v = list(map(int, input().split()))
ans = v[0]
for i in range(1, n):
    ans += max(v[i]-v[i-1], 0)
print(cnt)
Problem p03244 (python)

Fixed submission:
from collections import Counter
n = int(input())
v = list(map(int,input().split()))

e = Counter(v[::2])
o = Counter(v[1::2])

ev = sorted([(k,i) for k, i in e.items()],key = lambda z:z[1],reverse = True) + [(0,0)]
od = sorted([(k,i) for k, i in o.items()],key = lambda z:z[1],reverse = True) + [(0,0)]

if ev[0][0] != od[0][0]:
    print(n - ev[0][1] - od[0][1])
else:
    print(n - max(ev[0][1] + od[1][1], ev[1][1] + od[0][1]))

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

e = Counter(v[::2])
o = Counter(v[1::2])

e = sorted([(k,v) for k, v in e.items()],key = lambda z:z[1],reverse = True) + [(0,0)]
o = sorted([(k,v) for k, v in o.items()],key = lambda z:z[1],reverse = True) + [(0,0)]

if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    print(n - max(e[0][1] + o[1][1], e[1][1] + o[0][1]))

Buggy submission (verdict: Runtime Error):
from collections import deque
n = int(input())
v = list(map(int,input().split()))

e = Counter(v[::2])
o = Counter(v[1::2])

e = sorted([(k,v) for k, v in e.items()],key = lambda z:z[1],reverse = True) + [(0,0)]
o = sorted([(k,v) for k, v in o.items()],key = lambda z:z[1],reverse = True) + [(0,0)]

if e[0][0] != o[0][0]:
    print(n - e[0][1] - o[0][1])
else:
    print(n - max(e[0][1] + o[1][1], e[1][1] + o[0][1]))
Problem p03457 (python)

Fixed submission:
import sys
n = int(input())

for i in range(n):
    t,x,y = map(int,input().split())
    
    if (x+y) > t or (x+y+t) % 2 == 1:
        print("No")
        sys.exit()
        
print("Yes")

Buggy submission (verdict: Runtime Error):
import sys
n = int(input())
ts=0
xs=0
ys=0
ans = "Yes"
for i in range(n):
    t,x,y = map(int,input().split())
    
    if (t-ts) % (abs(x-xs)+abs(y-ys)) == 0 and t-ts >= (abs(x-xs)+abs(y-ys)):
        xs = x
        ys = y
        ts = t
    else:
        ans = "No"
print(ans)
Problem p03624 (python)

Fixed submission:
import sys
lis = list('abcdefghijklmnopqrstuvwxyz')
s = sorted(set(input()))
for i in lis:
    if i not in s:
        print(i)
        sys.exit()
print("None")

Buggy submission (verdict: Runtime Error):
import sys
lis = list('abcdefghijklmnopqrstuvwxyz')
s = sorted(set(input()))
for i in range(26):
    if s[i] != lis[i]:
        print(lis[i])
        sys.exit()
print("None")
Problem p03681 (python)

Fixed submission:
import sys
n,m = map(int,input().split())

if abs(n-m) >= 2:
    print(0)
    sys.exit()

if abs(n-m) == 1:
    x = max(n,m)
    for i in range(1,min(n,m)+1):
        x = x*i**2 % (10**9 + 7)

else:
    x = 2
    for i in range(1,n+1):
        x = x*i**2 % (10**9 + 7)
print(x)

Buggy submission (verdict: Runtime Error):
import sys
n,m = map(int,input().split())

if abs(n-m) >= 2:
    print(0)
    sys.exit()

if abs(n-m) == 1:
    x = max(a,b)
    for i in range(1,min(n,m)+1):
        x = x*i**2 % (10**9 + 7)

else:
    x = 2
    for i in range(1,n+1):
        x = x*i**2 % (10**9 + 7)
print(x)
Problem p03455 (python)

Fixed submission:
a,b=map(int,input().split())
x=(a*b)%2
if x==0:
	print("Even")
else:
  	print("Odd")

Buggy submission (verdict: Runtime Error):
a,b=list(map(int,input().split())
x=(a*b)%2
if x==0:
	print("Even")
else:
  	print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
x=a*b
y=x%2
if y==0:
	print("Even")
else:
  	print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
x=(a*b)%2
if x==0:
	print("Even")
else:
  	print("Odd")

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
x=(a*b)%2
if x==0:
    print("Even")
else:
    print("Odd")
Problem p02923 (python)

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

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
    b.append(a)
  else:
    a = 0
        
print(max(b))

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

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
    b.append(a)
  else:
    a = 0
    b.append(a)
    
print(max(b))
Problem p03469 (python)

Fixed submission:
a = input().split('/')
print('2018/' + a[1] + '/' + a[2])

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

for x in range(N+1):
  for y in range(N+1):
    z = N - x - y
    if z < 0:
      continue
    if 10000 * x + 5000 * y + 1000 * z == Y:
      print(x,y,z)
      exit()

print(-1,-1,-1)
Problem p03493 (python)

Fixed submission:
print(input().count('1'))

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

while all(i % 2 == 0 for i in a):
    a = [i // 2 for i in a]
    ans += 1
print(ans)
Problem p02747 (python)

Fixed submission:
a=input()
list_1=list(a)
length=len(list_1)
count=0
if length%2==1:
  print("No")
else:
  for k in range(0,length,2):
    if list_1[k]=='h' and list_1[k+1]=='i':
      count+=2
      if count==length:
        print("Yes")
        break
    else:
      continue
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
a=input()
list_1=list(a)
length=len(list_1)
count=0
for k in range(0,length,2):
  if list_1[k]=='h' and list_1[k+1]=='i':
    count+=2
    if count==length:
      print("Yes")
      break
    else:
      continue
  else:
    print("No")
Problem p02786 (python)

Fixed submission:
a=int(input())
count=0
s=0
while True:
  if a>1:
    a//=int(2)
    count+=1
    s+=2**count
  else:
    s+=1
    print(s)
    break

Buggy submission (verdict: Runtime Error):
a=int,input()
count=0
s=1
while True:
  if a!=1:
    a=a//2
    count+=1
    s+=2**count
  else:
    s+=2**count
Problem p03962 (python)

Fixed submission:
a, b, c= map(int, input().split())
if a==b and b==c:
  print(1)
elif a==b or b==c or a==c:
  print(2)
else:
  print(3)

Buggy submission (verdict: Runtime Error):
a, b, c= map(int, input().split())
if a=b=c:
  print(1)
elif a=b:
  print(2)
elif b=c:
  print(2)
else:
  print(3)
Problem p04043 (python)

Fixed submission:
a, b, c=map(int,input().split())
if a==7 and b==5 and c==5:
  print("YES")
elif a==5 and b==7 and c==5:
  print("YES")
elif a==5 and b==5 and c==7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c=int(input(),split())
if a==7 and b==5 and c==5:
  print("YES")
elif a==5 and b==7 and c==5:
  print("YES")
elif a==5 and b==5 and c==7:
  print("YES")
else:
  print("NO")
Problem p03068 (python)

Fixed submission:

N=int(input())
S=input()
K=int(input())
letter=""

for i in S:
    if i is S[K-1]:
        letter +=i
    else:
        letter +="*"
print(letter)

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
K=int(input())
letter=""

for i in S:
    if i is S[K]:
        letter +=i
    else:
        letter +="*"
print(letter)