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

Fixed submission:
MOD = 10**9+7
n, k = map(int, input().split())
a = list(map(int, input().split()))

cnt1 = 0
for i in range(len(a)-1):
    for j in range(i, len(a)):
        if a[i] > a[j]:
            cnt1 += 1

a2 = a * 2
cnt2 = 0
for i in range(len(a)):
    for j in range(len(a), len(a2)):
        if a2[i] > a2[j]:
            cnt2 += 1

print((cnt1 * k + cnt2 * k * (k-1) // 2) % MOD)

Buggy submission (verdict: Runtime Error):
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0]*-~n

    def sum(self, i):
        s = 0
        while i:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


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

k = k % (10 ** 9 + 7)
bit = Bit(n * k)
cnt = 0
for i, t in enumerate(a * k):
    bit.add(t, 1)
    cnt += i+1-bit.sum(t)


print((cnt % (10 ** 9 + 7)))

Buggy submission (verdict: Runtime Error):
class Bit:
    def __init__(self, n):
        self.size = n
        self.tree = [0]*-~n

    def sum(self, i):
        s = 0
        while i:
            s += self.tree[i]
            i -= i & -i
        return s

    def add(self, i, x):
        while i <= self.size:
            self.tree[i] += x
            i += i & -i


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

bit = Bit(n)
cnt = 0
for i, t in enumerate(a):
    bit.add(t, 1)
    cnt += i+1-bit.sum(t)
    cnt = cnt % (10 ** 9 + 7)


print(cnt * sum(range(1, k+1)) % (10 ** 9 + 7))
Problem p02936 (python)

Fixed submission:
n, q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n-1)]
px = [list(map(int, input().split())) for _ in range(q)]

l = [[] for i in range(n+1)]
for a, b in ab:
    l[a].append(b)
    l[b].append(a)

value = [0 for i in range(n+1)]
for p, x in px:
    value[p] += x

s = [1]
flag = [False]*(n+1)
while s:
    v = s.pop()
    flag[v] = True
    for e in l[v]:
        if flag[e]:
            continue
        value[e] += value[v]
        s.append(e)

print(*value[1:])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n-1)]
px = [list(map(int, input().split())) for _ in range(q)]

l = [[] for i in range(n)]
for a, b in ab:
    a, b = a - 1, b - 1
    l[a].append(b)
    l[b].append(a)

value = [0 for i in range(n)]
for p, x in px:
    value[p] += x

s = [0]
flag = [False]*(n)
while s:
    v = s.pop()
    flag[v] = True
    for e in l[v]:
        if flag[e]:
            continue
        value[e] += value[v]
        s.append(e)

print(*value)

Buggy submission (verdict: Runtime Error):
    import sys
    sys.setrecursionlimit(10**6)
     
    n, q = map(int, input().split())
    g = [[] for _ in range(n)]
    for i in range(n-1):
      a, b = map(int, input().split())
      a, b = a-1, b-1
      g[a].append(b)
      #g[b].append(a)
     
    ans = [0]*n  
    for j in range(q):
      p, x = map(int, input().split())
      ans[p-1] += x
      
    from collections import deque
    s = deque()
    s.append(0)
     
    while s:
      v = s.pop()
      for v_ in g[v]:
        ans[v_] += ans[v]
        s.append(v_)
     
    print(' '.join(map(str, ans)))
Problem p02971 (python)

Fixed submission:
n = int(input())
a = [int(input()) for x in range(n)]

copied_arr = a.copy()
max1 = max(a)
copied_arr.remove(max1)
max2 = max(copied_arr)

for x in a:
    if x == max1:
        print(max2)
    else:
        print(max1)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(input()) for x in range(n)]

copied_arr = a.copy()
max1 = max(a)
copied_arr.remove(max1)
max2 = max(copied_arr)

for x in a:
    if x == max1:
        print(max2)
    else:
        print(max1)
Problem p03673 (python)

Fixed submission:
from collections import deque

n = int(input())
a = list(map(int, input().split()))

d = deque()
for i in range(n):
    if i % 2 != 0:
        d.append(a[i])
    else:
        d.appendleft(a[i])

if n % 2 == 0:
    print(*list(reversed(d)))
else:
    print(*d)

Buggy submission (verdict: Runtime Error):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

n = i_i()
a = i_l()

print(*a[::-2],*a[n%2::2])

Buggy submission (verdict: Runtime Error):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

n = i_i()
a = i_l()
print(*a[::-2],*a[n%2::2])

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

if len(a) % 2 == 0:
    print(*list(reversed(a[1::2])), *a[0::2])
else:
    print(*list(reversed(a[0::2])), *a[1::2])

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

if len(a) % 2 == 0:
    print(*reversed(a[1::2]), *a[0::2])
else:
    print(*reversed(a[0::2]), *a[1::2])

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

if len(a) % 2 == 0:
    print(*reversed(a[1::2]), *a[0::2])
else:
    print(*reversed(a[0::2]), *a[1::2])
Problem p03739 (python)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]


def check(a, t):
    ans = 0
    x = 0
    for i in a:
        x += i
        if t == True and x < 1:
            ans += 1 - x
            x = 1
        elif t == False and x > -1:
            ans += x + 1
            x = -1
        t = not t
    return ans


print(min(check(a, True), check(a, False)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]


def check(a, t):
    ans = 0
    x = 0
    for i in a:
        x += i
        if t == True and x < 1:
            ans += 1 - x
            x = 1
        elif t == False and x > -1:
            ans += x + 1
            x = -1
        t = not t
    return ans


print(min(chk(a, True), chk(a, False)))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [int(x) for x in input().split()]


def check(a, t):
    ans = 0
    x = 0
    for i in a:
        x += i
        if t == True and x < 1:
            ans += 1 - x
            x = 1
        elif t == False and x > -1:
            ans += x + 1
            x = -1
        t = not t
    return ans


print(min(chk(a, True), chk(a, False)))
Problem p03845 (python)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
m = int(input())

for _ in range(m):
    new_t = t.copy()
    p, x = map(int, input().split())
    new_t[p-1] = x
    print(sum(new_t))

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

for _ in range(m):
    new_t = t.copy()
    p, x = map(int, input().split())
    new_t[p-1] = x
    print(sum(new_t))
Problem p03944 (python)

Fixed submission:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    w, h, n = map(int, input().split())
    px = py = 0
    for _ in range(n):
        x, y, a = map(int, input().split())
        if a == 1:
            px = max(px, x)
        elif a == 2:
            w = min(w, x)
        elif a == 3:
            py = max(py, y)
        elif a == 4:
            h = min(h, y)

    print(max(0, w-px) * max(0, h-py))


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    w, h, n = map(int, input().split())
    px = py = 0
    points = [[px, py], [w, h]]
    for _ in range(n):
        x, y, a = map(int, input().split())
        if a == 1:
            points[0][0] = max(px, x)
        elif a == 2:
            points[1][0] = min(w, x)
        elif a == 3:
            points[0][1] = max(py, y)
        elif a == 4:
            points[1][1] = min(h, y)

    print(max(0, points[1][0]-points[0][0])) * max(0, points[1][1]-points[0][1])


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

Fixed submission:
r=int(input())

print(2*r*3.141592)

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

print(2*r*3.141592)
Problem p02719 (python)

Fixed submission:
n,k = map(int,input().split())
print(min(n%k,k-n%k))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
print(min(n%k,k-n%k)
Problem p02755 (python)

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

for i in range(1240):
  if int(i*0.08) == a and int(i*0.1) == b:
    c.append(i)
c.append(-1)

print(c[0])

Buggy submission (verdict: Runtime Error):
import math

a,b = map(int,input().split())

if math.floor(a*12.5) == math.floor(b*10):
  print(math.floor(b*10)
else:
  print("-1")
Problem p02761 (python)

Fixed submission:
a,b=map(int,input().split())
ans=-1
arr = [list(map(int,input().split())) for i in range(b)]

for i in range(1001):
  j=str(i)
  if len(j)==a and all(j[s-1]==str(t) for s,t in arr):
    ans = i
    break
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=-1
arr = [list(map(int,input().split)) for i in range(b)]

for i in range(1001):
  j=str(i)
  if len(j)==a and all(j[s-1]==str(t) for s,t in arr):
    ans = i
    break
print(ans)
Problem p02791 (python)

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

min=10000000000
ans=0
       
for i in p:
  if i <= min:
    ans+=1
    min=i
print(ans)

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

min=10000000000
ans=0
       
for i in p:
  if i <= min:
    ans+=1
    min=i
print(ans)

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

min=10000000000
ans=0
       
for i in p:
  if i <= min:
    ans+=1
    min=i
print(ans)
Problem p02802 (python)

Fixed submission:
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0])-1] == 0:
      pen[int(ps[i][0])-1]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]*n
rig=[0]*n

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0]-1)] == 0:
      pen[int(ps[i][0]-1)]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
ps=[list(input().split()) for i in range(m)]
pen=[0]
rig=[0]

for i in range(m):
  if ps[i][1] == "AC":
    rig[int(ps[i][0])-1]=1
  else:
    if rig[int(ps[i][0]-1)] == 0:
      pen[int(ps[i][0]-1)]+=1

cnt1,cnt2=0,0
for i in range(n):
  if rig[i]==1:
    cnt1+=rig[i]
    cnt2+=pen[i]
    
print(str(cnt1)+" "+str(cnt2))
Problem p02909 (python)

Fixed submission:
N = str(input())
ans=""
if N =="Sunny":
    ans="Cloudy"
elif N=="Cloudy":
    ans="Rainy"
elif N=="Rainy":
    ans="Sunny"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N =="Sunny":
    ans="Cloudy"
elif N=="Cloudy":
    ans="Rainy"
elif N=="Rainy":
    ans="Sunny"
print(ans)
Problem p02921 (python)

Fixed submission:
pre = input()
gen = input()
ans=0
for i,k in zip(pre, gen):
    if i==k:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = N*(N-1)//2
print(int(ans))
Problem p02947 (python)

Fixed submission:
N=int(input())
A=[]
D={}
cnt=0
for i in range(N):
    A.append(str(sorted(input())))

for sortstr in A:
    if sortstr in D:
        cnt+=D[sortstr]
        D[sortstr]+=1
    else:
        D[sortstr]=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
D={}
cnt=0
for i in range(N):
    A.append(sorted(input()))

for sortstr in A:
    if sortstr in D:
        cnt+=D[sortstr]
        D[sortstr]+=1
    else:
        D[sortstr]=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=[]
D={}
count=0
for i in range(N):
    S=''.join(sorted(input()))
    A.append(S)

for s in A:
    if s in D:
        count+=1
    else:
        D+=s
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
L = [list(map(str, input().split())) for i in range(N)]

from collections import Counter
def verify_anagrams(first_word, second_word):
    def get_counter(s):
        return Counter(s.replace(' ', ''))
    if get_counter(first_word) == get_counter(second_word):
        return True
    else:
        return False

cnt=0
for i in range(N):
    for k in range(N):
        if k+1>len(L):
            continue
        if verify_anagrams(L[i],L[k+1]):
            cnt+=1

print(num)
Problem p02953 (python)

Fixed submission:
N=int(input())
H=list(map(int, input().split()))
maxv=H[0]
ans="Yes"
for i in range(1, N):
  if maxv-H[i]>=2:
    ans="No"
    break
  maxv=max(maxv, H[i])
print(ans)

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

for i in L:
  for k in L[1:]:
    if i<=k || i-1<=k:
      ans="yes"
    else:
      ans="no"
      
print(ans)

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

for i in L:
  for k in L[1:]:
    if i<=k || i-1<=k:
      ans=yes
    else:
      ans=no
      
print(ans)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a*b%2=0:
    print("Even")
else:
    print("odd")
Problem p03493 (python)

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

Buggy submission (verdict: Runtime Error):
list=[int(i) for i in input().split()]
a=0
for i in list:
    if i==1:
        a=a+1
    elif:
        a=a+0
print(a)
Problem p02747 (python)

Fixed submission:
test_input = str(input())
v = [(test_input[i*2]+test_input[i*2+1]) for i in range(int(len(test_input)/2))]
if len(test_input)%2 !=0:
    print("No")
elif set(v) == set(["hi"]):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
a, b, m = map(int,str(input()).split())
a_cost_map = map(int,str(input()).split())
a_cost = list(a_cost_map)
b_cost_map = map(int,str(input()).split())
b_cost = list(b_cost_map)

coupons_map = [str(input()).split() for i in range(m)]
coupons_map_all =  [[int(coupons_map[i][t]) for t in range(len(coupons_map[i]))] for i in range(len(coupons_map))]

minimum = min(a_cost) + min(b_cost)
for coupon in coupons_map_all:
    coupon_use = (a_cost[coupon[0]-1] +  b_cost[coupon[1]-1] - coupon[2]) 
    print(coupon_use)
    if minimum > coupon_use:
        minimum = coupon_use
print(minimum)
Problem p02756 (python)

Fixed submission:
s=input()
q=int(input())
head=''
foot=''

a=0
for i in range(q):
  t=input()
  if t=='1':
    a=a^1
  else:
    t, f, c = map(str, t.split())
    f=int(f)
    if (f^a)&1==0:
      foot+=c
    else:
      head=c+head
s=head+s+foot
if a==1:
  s=s[::-1]
print(s)

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

s=input()
q=int(input())
for i in range(q):
  t=input()
  if t=='1':
    s=s[::-1]
  else:
    t, f, c = map(str, t.split())
    if f =='1':
      s=c+s
    else:
      s=s+c
print(s)
Problem p02923 (python)

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

a = 0
move = []

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

print(max(move))

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

a = 0
move = []

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

print(max(move))

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

a = 0
move = []

for i in range(n-1):
  if h[i] >= h[i+1]:
    a += 1
  else:
    move += a
    a = 0

print(max(move))
Problem p02936 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)

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

n, q = map(int, input().split())
v = [[] for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].append(b)
  v[b].append(a)

for _ in range(q):
  p, x = map(int, input().split())
  c[p] += x

def addcount(p, prev):
  for i in v[p]:
    if i != prev:
      c[i] += c[p]
      addcount(i, p)
  return None
addcount(1, 0)
  
print(*c[1:])

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)

n, q = map(int, input().split())
v = [set() for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].add(b)
  v[b].add(a)

for _ in range(q):
  p, x = map(int, input().split())
  c[p] += x

def addcount(p, prev):
  v[p].remove(prev)
  for i in v[p]:
    c[i] += c[p]
    addcount(i, p)
  return None
addcount(1, 0)
  
print(' '.join(str(i) for i in c[1:]))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
v = [set() for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].add(b)
  v[b].add(a)

for _ in range(q):
  p, x = map(int, input().split())
  c[p] += x

def addcount(p, prev):
  for i in v[p]:
    if i != prev:
      c[i] += c[p]
      addcount(i, p)
  return None
addcount(1, 0)
  
print(' '.join(str(i) for i in c[1:]))

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
v = [set() for _ in range(n+1)]
c = [0]*(n+1)

for _ in range(n-1):
  a, b = map(int, input().split())
  v[a].add(b)
  v[b].add(a)

def clearpre(x):
  for i in v[x]:
    v[i].remove(x)
    clearpre(i)
clearpre(1)

def f(p, x):
  c[p] += x
  for i in v[p]:
    f(i, x)

for _ in range(q):
  p, x = map(int, input().split())
  f(p, x)
print(' '.join(str(i) for i in c[1:]))
Problem p03000 (python)

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

i = 0
while d <= x and i <= n:
  if i < n:
    d += l[i]
  i += 1
print(i)

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

i = 0
while d <= x:
  d += l[i]
  i += 1
print(i)
Problem p03102 (python)

Fixed submission:
n, m, c=map(int, input().split())
b=list(map(int, input().split()))
ac=0
for _ in range(n):
  ans=c
  a=list(map(int, input().split()))
  for i in range(m):
    ans+=a[i]*b[i]
  if ans>0:
    ac += 1
print(ac)

Buggy submission (verdict: Runtime Error):
n, m, c=map(int, input().split())
b=list(map(int, input().split()))
ac=0
for _ in range(n):
  ans=c
  a=list(map(int, input().split()))
  for i in range(n):
    ans+=a[i]*b[i]
  if ans>0:
    ac += 1
print(ac)
Problem p03282 (python)

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

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

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
i=0
while s[i]=='1':
  i+=1
if k<=i or i==len(s):
  print(1)
else:
  print(s[i])

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

Fixed submission:
n=input()
l=len(n)
if n==n[0]+'9'*(l-1):
  print(int(n[0])+9*(l-1))
else:
  print(9*(l-1)+int(n[0])-1)

Buggy submission (verdict: Runtime Error):
n=input()
l=len(n)
if n==n[0]+'9'*(l-1):
  print(n[0]+9*(l-1))
else:
  print(9*(l-1)+int(n[0])-1)
Problem p03448 (python)

Fixed submission:
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//500)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    if x-500*i-100*j <= 50*c:
      ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
x=int(input())
ans=0

for i in range(min(a, x//a)+1):
  for j in range(min(b, (x-500*i)//100)+1):
    p=x-500*i-100*j
    if p<=50*c:
      ans+=1
print(ans)
Problem p02713 (python)

Fixed submission:
def gcd(a,b):
	while(b):
		a,b = b,a%b
	return a
k = int(input())
ans=0
for a in range(1,k+1):
	for b in range(1,k+1):
		for c in range(1,k+1):
			ans+=gcd(a,gcd(b,c))

print(ans)

Buggy submission (verdict: Runtime Error):
def gcd(a,b):
	while(y):
		x,y = y,x%y
	return x
k = int(input())
ans=0
for a in range(1,k+1):
	for b in range(1,k+1):
		for c in range(1,k+1):
			ans+=gcd(a,gcd(b,c))

print(ans)
Problem p02993 (python)

Fixed submission:
n = int(input())
 
a = int(n/1000)
b = int(n/100) -a*10
c = int(n/10)-a*100 - b*10
d = n -a*1000-b*100-c*10
 
if a == b  or b ==c or c == d :
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
if a =b or a=c or a=d or b =c or c = d or b= d:
  print("Good")
else:
  print("Bad")

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

if a = b or a = c or a = d or b = c or b = d or c =d:
  print('Good')
else:
  print('Bad
Problem p03378 (python)

Fixed submission:
a,b,c = map(int,input().split())
n_list = list(map(int,input().split()))
ans_1 = 0
ans_2 = 0

for i in n_list:
  if i >=c and i <=a:
    ans_1+=1
    
for i in n_list:
  if i >=0 and i <=c:
    ans_2+=1

print(min(ans_1,ans_2))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
n_list = [map(int,input().split())]
ans = 0
for i in n_list:
  if i >=c and i <=a:
    ans+=1
    
print(ans)
Problem p03408 (python)

Fixed submission:
b_list = [input() for i in range(int(input()))]
r_list = [input() for i in range(int(input()))]

ans = 0 
for i in list(set(b_list)):
  if ans <= b_list.count(i) - r_list.count(i):
    ans = b_list.count(i) - r_list.count(i)
    
print(int(ans))

Buggy submission (verdict: Runtime Error):
b_list = [int(input() for i in range(int(input())))]
r_list = [int(input() for i in range(int(input())))]

ans = 0 
for i in list(set(b_list)):
  s = b_list.count(i) - r_list.count(i)
  if ans <= s:
    ans = s
    
print(ans)

Buggy submission (verdict: Runtime Error):
b_list = [int(input() for i in range(int(input())))]
r_list = [int(input() for i in range(int(input())))]

ans = 0 
for i in list(set(b_list)):
  if ans <= b_list.count(i) - r_list.count(i):
    ans = b_list.count(i) - r_list.count(i)
    
print(ans)
Problem p03471 (python)

Fixed submission:
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    break
print(*answer)

Buggy submission (verdict: Runtime Error):
例
N,Y=map(int,input().split())
answer=-1,-1,-1
for x in range(N+1):
    for y in range(N-x+1):
        z=N-x-y
        if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y:
            answer=x,y,z
            break
    else:
        continue
    
print(*answer)
Problem p02717 (python)

Fixed submission:
a,b,c= input().split()
print(c+" "+a+" "+b)

Buggy submission (verdict: Runtime Error):
a,b,c=input()
print(c+" "+a+""+b)
Problem p02719 (python)

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

if k==1:
    print(0)
elif n>k:
    print(k-(n%k))
else:
    val=k-n
    if n<val:
        print(n)
    else:
        print(val)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k and k>1:
    val=n-k
    print(n%val)
elif n>k and k==1:
	print(0)
else:
    val=k-n
    print(k%val)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k:
    n=n-k
    print(n%val)
else:
    print(n)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
if n>k:
    val=n-k
    print(n%val)
else:
    val=k-n
    print(k%val)