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

Fixed submission:
import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.ceil(s1/H)
  h10=math.ceil(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=abs(S[0]-S[2])

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.ceil(s1/h1)
  h11=math.ceil(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))


S=[0]*3
s=H*W/3
w0=math.floor(s/H)
h0=math.floor(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.floor(s1/H)
  h10=math.floor(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=min(ans,abs(S[0]-S[2]))

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.floor(s1/h1)
  h11=math.floor(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))

print(ans)

Buggy submission (verdict: Runtime Error):
import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*import math
H,W=map(int,input().split())
if H%3==0 or W%3==0:
  print(0)
  exit(0)
S=[0]*3
s=H*W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-W/3
w0=math.ceil(s/H)
h0=math.ceil(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.ceil(s1/H)
  h10=math.ceil(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=abs(S[0]-S[2])

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.ceil(s1/h1)
  h11=math.ceil(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))


S=[0]*3
s=H*W/3
w0=math.floor(s/H)
h0=math.floor(s/W)

S[0]=w0*H
w1=W-w0
if w1%2==0 or H%2==0:
  S[1]=(H*w1)//2
  S[2]=(H*w1)//2
else:
  s1=H*w1/2
  w10=math.floor(s1/H)
  h10=math.floor(s1/w1)
  S[2]=max((w1-w10)*H,(H-h10)*w1)
ans=min(ans,abs(S[0]-S[2]))

S[0]=W*h0
h1=H-h0
if h1%2==0 or W%2==0:
  S[1]=(W*h1)//2
  S[2]=(W*h1)//2
else:
  s1=h1*W/2
  w11=math.floor(s1/h1)
  h11=math.floor(s1/W)
  S[2]=max((W-w11)*h1,(h1-h11)*W)
ans=min(ans,abs(S[0]-S[2]))

print(ans)
Problem p03720 (python)

Fixed submission:
import collections
N,M=map(int,input().split())
table=collections.defaultdict(int)
for i in range(M):
  a,b=map(int,input().split())
  table[a]+=1
  table[b]+=1
for i in range(1,N+1):
  print(table[i])

Buggy submission (verdict: Runtime Error):
import collections
N,m=map(int,input().split())
table=collections.defaultdict(int)
for i in range(M):
  a,b=map(int,input().split())
  table[a]+=1
  table[b]+=1
for i in range(N):
  print(table[i])
Problem p03730 (python)

Fixed submission:
A,B,C=map(int,input().split())
for i in range(1,B):
  if A*i %B==C:
    print("YES")
    exit(0)
print("NO")

Buggy submission (verdict: Runtime Error):
A,B,C=map(int,input().split())

if C%(((B//A +1)*A)%B) == 0:
  print("YES")
else:
  print("NO")
Problem p03731 (python)

Fixed submission:
N,T=map(int,input().split())
t=list(map(int,input().split()))
diff = [t[i]-t[i-1] for i in range(1,N)]
ans=T*N
for i in range(N-1):
  ans-=max((T - diff[i]),0)
print(ans)

Buggy submission (verdict: Runtime Error):
N,T=map(int,input().split())
t=list(map(int,input().split()))
diff = [t[i]-t[i-1] fossil i in range(1,N)]
ans=T*N
for i in range(N-1):
  ans-=min((T - diff[i]),0)
print(ans)
Problem p03733 (python)

Fixed submission:
N,T = map(int, input().split())
prev = 0
ans = 0
tt = list(map(int, input().split()))
for t in tt:
  if prev+T <= t:
    ans += T
  else:
    ans += (t - prev)
  prev = t

print(ans + T)

Buggy submission (verdict: Runtime Error):
N,T = map(int, input().split())
prev = 0
ans = 0
for i in range(N):
  t = int(input())
  if prev+T <= t:
    ans += T
  else:
    ans += (t - prev)
    prev = t

print(ans + T)
Problem p03734 (python)

Fixed submission:
import collections
N, W = map(int, input().split())
wv = collections.defaultdict(list)
w = 0
for i in range(N):
    a, b = map(int, input().split())
    wv[a].append(b)
    if i == 0:
        w = a
s = [[0]*(len(wv[w+i])+1) for i in range(4)]

for i in range(4):
    wv[w + i].sort(reverse=True)
    for j, x in enumerate(wv[w + i]):
        s[i][j+1] = s[i][j] + x
ans = 0
L = len(wv[w+3])
for i in range(min(len(wv[w]), N)+1):
    tmp1 = s[0][i]
    weight1 = w * i
    if weight1 > W:
        break
    for j in range(min(len(wv[w+1])+1, N+1 - i)):

        tmp2 = tmp1 + s[1][j]
        weight2 = weight1 + (w+1)*j
        if weight2 > W:
            break
        for k in range(min(len(wv[w+2])+1, N+1 - i - j)):
            tmp3 = tmp2 + s[2][k]
            weight3 = weight2 + (w+2)*k
            if weight3 > W:
                break
            d = W - weight3

            ans = max(ans, tmp3 + s[3][min(L, d//(w+3))])
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N, W = map(int, input().split())
wv = collections.defaultdict(list)
w = 0
for i in range(N):
    a, b = map(int, input().split())
    wv[a].append(b)
    if i == 0:
        w = a
s = [[0]*(len(wv[w+i])+1) for i in range(4)]

for i in range(4):
    wv[w + i].sort(reverse=True)
    for j, x in enumerate(wv[w + i]):
        s[i][j+1] = s[i][j] + x
ans = 0
L = len(wv[3])
for i in range(min(len(wv[w]), N)+1):
    tmp1 = s[0][i]
    weight1 = w * i
    if weight1 > W:
        break
    for j in range(min(len(wv[w+1])+1, N+1 - i)):

        tmp2 = tmp1 + s[1][j]
        weight2 = weight1 + (w+1)*j
        if weight2 > W:
            break
        for k in range(min(len(wv[w+2])+1, N+1 - i - j)):
            tmp3 = tmp2 + s[2][k]
            weight3 = weight2 + (w+2)*k
            if weight3 > W:
                break
            d = W - weight3

            ans = max(ans, tmp3 + s[3][min(L, d//(w+3))])
print(ans)
Problem p03737 (python)

Fixed submission:
s1,s2,s3=input().split()
ans="".join([s1[0],s2[0],s3[0]])
print(ans.upper())

Buggy submission (verdict: Runtime Error):
s1,s2,s3=input.split()
ans="".join([s1[0],s2[0],s3[0]])
print(ans.upper())
Problem p03739 (python)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ans=0
tmp=0
for i in range(n):
  tmp+=a[i]
  if i%2==0:
    if tmp<=0:
      ans+=abs(tmp)+1
      tmp=1
  else:
    if tmp>=0:
      ans+=abs(tmp)+1
      tmp=-1

tmp=0
tmp2=0
for i in range(n):
  tmp+=a[i]
  if i %2==0:
    if tmp>=0:
      tmp2+=abs(tmp)+1
      tmp=-1
  else:
    if tmp<=0:
      tmp2+=abs(tmp)+1
      tmp=1
print(min(ans,tmp2))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=0
tmp=0
for i in range(N):
  tmp+=a[i]
  if i%2==0:
    if tmp<=0:
      ans+=abs(tmp)+1
      tmp=1
  else:
    if tmp>=0:
      ans+=abs(tmp)+1
      tmp=-1

tmp=0
tmp2=0
for i in range(N):
  tmp+=a[i]
  if i %2==0:
    if tmp>=0:
      tmp2+=abs(tmp)+1
      tmp=-1
  else:
    if tmp<=0:
      tmp2+=abs(tmp)+1
      tmp=1
print(min(ans,tmp))
Problem p03778 (python)

Fixed submission:
W,a,b=map(int,input().split())
print(max(max(0,b-W-a),max(0,a-W-b)))

Buggy submission (verdict: Runtime Error):
W,a,b=map(int,input().split())
print(min(max(W+a - b,0),max(a-W-b)))
Problem p03807 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
count=0
for i in range(N):
  if A[i]%2==1:
    count+=1

ans=["YES","NO"]

print(ans[count%2])

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(),int.input().split())
count=0
for i in range(N):
  if A[i]%2==1:
    count+=1

ans=["YES","NO"]

print(ans[count%2])
Problem p03911 (python)

Fixed submission:
class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return
N,M=map(int,input().split())
G=unionFind(M)
s=set()
for i in range(N):
  tmp=tuple(map(int,input().split()))
  s.add(tmp[1]-1)
  for x in tmp[2:]:
    G.unite(tmp[1],x)

parent=set()
for i in s:
  parent.add(G.root(i))

if len(parent)==1:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
class unionFind:
    parent = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            return
N,M=map(int,input().split())
G=unionFind(M)
s=set()
for i in range(N):
  tmp=tuple(map(int,input().split()))
  s|=set(tmp[1:])
  for x in tmp[2:]:
    G.unite(tmp[1],x)

parent=set()
for i in s:
  parent.add(G.root(i-1))

if len(parent)==1:
  print("YES")
else:
  print("NO")
Problem p03912 (python)

Fixed submission:
import collections
N, M = map(int, input().split())
X = list(map(int, input().split()))

table = collections.defaultdict(list)
for x in X:
    table[x % M].append(x)
Count = [None]*M
for i in range(M):
    Count[i] = collections.Counter(table[i]).values()
ans = 0
for i in range(M // 2 + 1):
    tmp = min(len(table[i]), len(table[(M-i) % M]))
    if i != (M-i) % M:
        ans += tmp
    else:
        ans += tmp // 2

    k = 0
    l = 0
    for x in Count[i]:
        k += x % 2
        l += x // 2
    if tmp <= k:
        ans += l
    else:
        ans += ((k + l*2) - tmp) // 2

    if i != (M-i) % M:
        k = 0
        l = 0
        for x in Count[(M-i) % M]:
            k += x % 2
            l += x // 2
        if tmp <= k:
            ans += l
        else:
            ans += ((k + l*2) - tmp) // 2

print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N, M = map(int, input().split())
X = list(map(int, input().split()))

table = collections.defaultdict(list)
for x in X:
    table[x % M].append(x)
Count = [None]*N
for i in range(M):
    table[i].sort(key=lambda x: table[x].count(x), reverse=True)
    Count[i] = collections.Counter(table[i]).values()
ans = 0
for i in range(M // 2 + 1):
    tmp = min(len(table[i]), len(table[(M-i) % M]))
    if i != (M-i) % M:
        ans += tmp
    else:
        ans += tmp // 2

    k = 0
    l = 0
    for x in Count[i]:
        k += x % 2
        l += x // 2
    if tmp <= k:
        ans += l
    else:
        ans += ((k + l*2) - tmp) // 2

    if i != (M-i) % M:
        k = 0
        l = 0
        for x in Count[(M-i) % M]:
            k += x % 2
            l += x // 2
        if tmp <= k:
            ans += l
        else:
            ans += ((k + l*2) - tmp) // 2
    # print(table[i])
    # print(table[(M-i) % M])
    # print(ans)
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
N, M = map(int, input().split())
X = list(map(int, input().split()))

table = collections.defaultdict(list)
for x in X:
    table[x % M].append(x)
Count = [None]*N
for i in range(M):
    table[i].sort(key=lambda x: table[x].count(x), reverse=True)
    Count[i] = collections.Counter(table[i]).values()
ans = 0
for i in range(M // 2):
    tmp = min(len(table[i]), len(table[(M-i) % M]))
    ans += tmp
    k = 0
    l = 0
    for x in Count[i]:
        k += x % 2
        l += x // 2
    if tmp <= k:
        ans += l
    else:
        ans += ((k + l*2) - tmp) // 2

    if i != (M-i) % M:
        k = 0
        l = 0
        for x in Count[(M-i) % M]:
            k += x % 2
            l += x // 2
        if tmp <= k:
            ans += l
        else:
            ans += ((k + l*2) - tmp) // 2
print(ans)
Problem p03937 (python)

Fixed submission:
H,W=map(int,input().split())
prev=0
for i in range(H):
  s=input()
  id = s.index("#")
  if id >= prev:
    flag=False
    prev = W-1 - s[::-1].index("#")
    for j in range(id,W):
      if flag and s[j]=="#":
        print("Impossible")
        exit(0)
      if s[j]==".":
        flag=True
  else:
    print("Impossible")
    exit(0)
print("Possible")

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
prev=0
for i in range(H):
  s=input()
  id = s.index("#")
  if id >= prev:
    flag=False
    prev = id
    for j in range(prev,W):
      if flag ans s[j]=="#":
        print("Impossible")
        exit(0)
      if s[j]==".":
        flag=True
print("Possible")

Buggy submission (verdict: Runtime Error):
H,W=map(int,input().split())
prev=0
for i in range(H):
  s=input()
  id = s.index("#")
  if id >= prev:
    flag=False
    for j in range(id,W):
      if flag ans s[j]=="#":
        print("Impossible")
        exit(0)
      if s[j]==".":
        flag=True
print("Possible")
Problem p03952 (python)

Fixed submission:
N, x = map(int, input().split())
if N == 2:
    if x != N:
        print("No")
        exit(0)
else:
    if abs(N - x) > N - 2:
        print("No")
        exit(0)
print("Yes")

if N == 2:
    for i in range(3):
        print(i+1)
else:
    left = []
    right = []
    if x < 2 * N - 2:
        ans = [x+2, x-1, x, x+1]
        s = [i for i in range(1, 2*N) if i < x - 1 or i > x+2]
        for i in range((2*N - 5) // 2):
            print(s.pop())
        for i in range(4):
            print(ans[i])
        for i in range(((2*N - 5) // 2) + 1):
            print(s.pop())

    else:
        ans = [x-2, x+1, x, x-1]
        s = [i for i in range(1, 2*N) if i < x - 2 or i > x+1]
        for i in range((2*N - 5) // 2):
            print(s.pop())
        for i in range(4):
            print(ans[i])
        for i in range(((2*N - 5) // 2) + 1):
            print(s.pop())

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
if N == 2:
    if x != N:
        print("No")
    else:
        exit(1)

else:
    if abs(N - x) > N - 2:
        print("No")
    else:
        exit(1)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
if N <= 3:
    if x != N:
        print("No")
    else:
        exit(1)

else:
    if abs(N - x) > 1:
        print("No")
    else:
        exit(1)

Buggy submission (verdict: Runtime Error):
N, x = map(int, input().split())
if N <= 3:
    if x != N:
        print("No")
    else:
        exit(1)

else:
    if abs(N - x) > N - 3:
        print("No")
    else:
        exit(1)
Problem p03958 (python)

Fixed submission:
K,T = map(int,input().split())
a = list(map(int,input().split()))

a = sorted(a,reverse = True)
ans = a.pop(0) - sum(a) - 1
if ans >= 0:
    print(ans)
else:
    print(0)

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

a = sorted(a,reverse = True)
ans = a.pop(0) - sum(a) - 1
if a >= 0:
    print(ans)
else:
    print(0)
Problem p03998 (python)

Fixed submission:
s=[list(input()) for i in range(3)]
for i in range(3):
  s[i]=list(reversed(s[i]))
flag=True
next=0
ans=0
mem_s=["a","b","c"]
ans_s=["A","B","C"]
while(flag):
  if len(s[next]) >0:
    tmp=s[next].pop()
    next=mem_s.index(tmp)
  else:
    ans=next
    flag=False
print(ans_s[ans])

Buggy submission (verdict: Runtime Error):
s=[reversed(list(input())) for i in range(3)]
flag=True
next=0
ans=0
ans_s=["a","b","c"]
while(flag):
  if len(s[next]) >0:
    tmp=s[next].pop()
    next=ans_s.index(tmp)
  else:
    ans=next
    flag=False
print(ans_s[ans])

Buggy submission (verdict: Runtime Error):
s=[reversed(list(input())) for i in range(3)]
flag=True
next=0
ans=0
ans_s=["a","b","c"]
while(flag):
  if len(s[next]) >0:
    next=s[next].pop()
  else:
    ans=next
    flag=False
print(ans_s[ans])
Problem p02969 (python)

Fixed submission:
r = int(input())

print( 3 * r * r)

Buggy submission (verdict: Runtime Error):
import math
 
N, D = list(map(int, input().strip().split(" ")))

if D == 0:
    print(N)
elif N == 0:
    print("0")
else:
	print( int(math.ceil(N / (2 * D))))

Buggy submission (verdict: Runtime Error):
import math

N, D = list(map(int, input().strip().split(" ")))

print( int(math.ceil(N // (2 * D)))
Problem p02717 (python)

Fixed submission:
x,y,z=input().split()
print(z,x,y)

Buggy submission (verdict: Runtime Error):
x,y,z=map(input().split())
print(z,y,x)
Problem p02684 (python)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
s = 0
for _ in range(k):
    if ans[t] == 1:
        n = len(L) - L.index(t)
        temp = (k-c)%n
        t = L[L.index(t):][temp]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
s = 0
for _ in range(k):
    if ans[t] == 1:
        temp = t + k%c
        temp %= n
        t = L[temp]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
for _ in range(k):
    if ans[t] == 1:
        t += k%c
        t %= n
        t = L[t]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
for _ in range(k):
    if ans[t] == 1:
        t += k%c
        t %= n-1
        t = L[t]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
for _ in range(k):
    if ans[t] == 1:
        t += k%c
        t %= n-1
        t = L[t]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1
print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
for _ in range(k):
    if ans[t] == 1:
        t += k%c
        t = L[t]
        break
    else:
        ans[t] = 1
        L.append(t)
        t = A[t]-1
        c += 1

print(t+1)

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

A = list(map(int,input().split()))
t = 0
c = 0
ans = [0] * n
L = []
for _ in range(k):
    if ans[t] == 1:
        t += k%c
        t = L[t]
        break
    else:
        ans[t] = 1
        L.append(t)
        print(L)
        t = A[t]-1
        c += 1

print(t+1)
Problem p02786 (python)

Fixed submission:
from math import floor,log2
h = int(input())
d = floor(log2(h))
c = 1
for i in range(0,d):
  c += 2 ** (d-i)

print(c)

Buggy submission (verdict: Runtime Error):
from math import floor:
h = int(input())

c = 0

def attack(h):
  if h == 1:
    c += 1
    return c
  else:
    return attack(floor(2/h)) + attack(floor(2/h))
  
print(attack(h))
Problem p02789 (python)

Fixed submission:
m,n = map(int,input().split())
if(m == n):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
m,n = map(int,input().split())
if(m == n):
  print(Yes)
else:
  print(No)
Problem p02806 (python)

Fixed submission:
N = int(input())
ST = list()
for _ in range(N):
  ST.append(list(input().split()))

X = input()
time = 0
play = 0
for i in range(N):
  if play==0:
    if play==0 and ST[i][0] == X:
      play = 1
    continue
  time += int(ST[i][1])
  
print(time)

Buggy submission (verdict: Runtime Error):
15
ypnxn 279
kgjgwx 464
qquhuwq 327
rxing 549
pmuduhznoaqu 832
dagktgdarveusju 595
wunfagppcoi 200
dhavrncwfw 720
jpcmigg 658
wrczqxycivdqn 639
mcmkkbnjfeod 992
htqvkgkbhtytsz 130
twflegsjz 467
dswxxrxuzzfhkp 989
szfwtzfpnscgue 958
pmuduhznoaqu
Problem p03246 (python)

Fixed submission:
N = int(input())
V = list(map(int,input().split()))

O = [0] * 10 ** 6
E = [0] * 10 ** 6

for v in range(len(V)):
  if v % 2 == 0:
    E[V[v]] += 1
  else:
    O[V[v]] += 1
    
o_max = max(O)
e_max = max(E)

o = [i for i,x in enumerate(O) if x == o_max]
e = [i for i,x in enumerate(E) if x == e_max]

ans = 0
if len(o) == 1 and len(e) == 1 and e[0] == o[0]:
  a=max(sorted(O)[-2],sorted(E)[-2])
  if a == 0:
    print(int(N/2))
  else:
    print(int(int(N/2 - o_max) + int(N/2 - a)))
else:
  print(int(int(N/2 - o_max) + int(N/2 - e_max)))

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

O = [0] * 10 ** 5
E = [0] * 10 ** 5

for v in range(len(V)):
  if v % 2 == 0:
    E[V[v]] += 1
  else:
    O[V[v]] += 1
    
o_max = max(O)
e_max = max(E)

o = [i for i,x in enumerate(O) if x == o_max and x % 2 == 1]
e = [i for i,x in enumerate(E) if x == e_max and x % 2 == 0]

ans = 0
if len(o) == 1 and len(e) == 1 and e[0] == o[0]:
  a=max(sorted(O)[-2],sorted(E)[-2])
  if a == 0:
    print(int(N/2))
  else:
    print(int(int(N/2 - o_max) + int(N/2 - e_max)))
print(int(int(N/2 - o_max) + int(N/2 - e_max)))
Problem p02690 (python)

Fixed submission:
import sys
x = int(input())
for i in range(1000):
    for j in range(1000):
        if i**5+j**5 == x:
            print(i, -j)
            sys.exit()
        if i**5-j**5 == x:
            print(i, j)
            sys.exit()

Buggy submission (verdict: Runtime Error):
import sys
for i in range(1000):
    for j in range(1000):
        if i**5+j**5 == x:
            print(i, -j)
            sys.exit()
        if i**5-j**5 == x:
            print(i, j)
            sys.exit()