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

Fixed submission:
import sys
input = sys.stdin.buffer.readline

n,m = map(int,input().split())

#Union Find

#xの根を求める
def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]
#xとyの属する集合の併合
def unite(x,y):
    x = find(x)
    y = find(y)
    
    if x == y:
        return False
    else:
        #sizeの大きいほうがx
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True

#xとyが同じ集合に属するかの判定
def same(x,y):
    return find(x) == find(y)

#xが属する集合の個数
def size(x):
    return -par[find(x)]



#初期化
#根なら-size,子なら親の頂点
par = [-1]*n


for _ in range(m):
    a,b = map(int,input().split())
    unite(a-1,b-1)

res = 0
for e in par:
    if e < 0:
        res = max(res,-e)
print(res)

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


n,m = map(int,input().split())
edge = [[] for _ in range(n)]

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

#True:訪問済み False:未訪問
flag = [False]*n

def dfs(now):
    if flag[now]:
        return 0
    
    flag[now] = True

    size = 0
    for nxt in edge[now]:
        if not flag[nxt]:
            size += dfs(nxt)

    return size + 1

res = 0

for i in range(n):
    if flag[i]:
        continue
    res = max(res,dfs(i))

print(res)

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


n,m = map(int,input().split())
edge = [[] for _ in range(n)]

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

#True:訪問済み False:未訪問
flag = [False]*n

def dfs(now):
    if flag[now]:
        return 0
    
    flag[now] = True

    size = 0
    for nxt in edge[now]:
        if not flag[nxt]:
            size += dfs(nxt)

    return size + 1

res = 0

for i in range(n):
    if flag[i]:
        continue
    res = max(res,dfs(i))

print(res)
Problem p02606 (python)

Fixed submission:
l,r,d = map(int,input().split())

ans = 0

for i in range(l,r+1):
    if i%d == 0:
        ans += 1
print(ans)

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

cnt = [0]*n

for x in range(1,101):
    for y in range(1,101):
        for z in range(1,101):
            if x**2 + y**2 + z**2 + x*y + x*z + y*z - 1 < n:
                cnt[x**2 + y**2 + z**2 + x*y + x*z + y*z - 1] += 1
print(*cnt,sep='\n')
Problem p02621 (python)

Fixed submission:
import sys
input = sys.stdin.readline

a = int(input())
print(a + a*a + a*a*a)

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

print(a + a*a + a*a*a)
Problem p02632 (python)

Fixed submission:
import sys
input = sys.stdin.buffer.readline

mod = 10**9+7
MAX_N = 10**7 + 10

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod


def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod

k = int(input())
s = list(input())

n = len(s)-1

res = 0

for i in range(n,n+k+1):
    res = (res + (mod_comb_k(i-1,n-1,mod)*pow(25,i-n,mod)%mod)*pow(26,n+k-i,mod))%mod

print(res)

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

mod = 10**9+7
MAX_N = 10**6 + 10

fact = [1]
fact_inv = [0]*(MAX_N+4)
for i in range(MAX_N+3):
    fact.append(fact[-1]*(i+1)%mod)

fact_inv[-1] = pow(fact[-1],mod-2,mod)
for i in range(MAX_N+2,-1,-1):
    fact_inv[i] = fact_inv[i+1]*(i+1)%mod


def mod_comb_k(n,k,mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] %mod

k = int(input())
s = list(input())

n = len(s)-1

res = 0

for i in range(n,n+k+1):
    res = (res + (mod_comb_k(i-1,n-1,mod)*pow(25,i-n,mod)%mod)*pow(26,n+k-i,mod))%mod

print(res)
Problem p02698 (python)

Fixed submission:
import sys,bisect
input = sys.stdin.readline

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

ans = [1]*n

edge = [[] for i in range(n)]
for i in range(n-1):
    u,v = map(int,input().split())
    edge[u-1].append(v-1)
    edge[v-1].append(u-1)

root = 0
chi = [[] for i in range(n)]
par = [-1]*n
used = [False]*n
tank = [0]

while tank:
    q = tank.pop()
    used[q] = True
    for e in edge[q]:
        if not used[e]:
            chi[q].append(e)
            tank.append(e)
            par[e] = q

tank = [root]

idx = dict()
val = dict()
dp = [10**10]*n

eulerNum = -1

while tank:
    q = tank.pop()
    if q >= 0:
        #first time
        num = a[q]
        kk = bisect.bisect_left(dp,num)
        
        val[q] = dp[kk]
        idx[q] = kk
        dp[kk] = num
        ans[q] = bisect.bisect_left(dp,10**10)

        eulerNum += 1
        tank.append(~q)
        for ch in chi[q]:
            tank.append(ch)
    else:
        if ~q != root:
            if dp[idx[~q]] == a[~q]:
                dp[idx[~q]] = val[~q]
                eulerNum += 1

print(*ans,sep = "\n")

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

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

ans = [1]*n

edge = [[] for i in range(n)]
for i in range(n-1):
    u,v = map(int,input().split())
    edge[u-1].append(v-1)
    edge[v-1].append(u-1)

root = 0
chi = [[] for i in range(n)]
par = [-1]*n
used = [False]*n
tank = [0]

while tank:
    q = tank.pop()
    used[q] = True
    for e in edge[q]:
        if not used[e]:
            chi[q].append(e)
            tank.append(e)
            par[e] = q

tank = [root]

idx = dict()
val = dict()
dp = [10**6]*n

eulerNum = -1

while tank:
    q = tank.pop()
    if q >= 0:
        #first time
        num = a[q]
        kk = bisect.bisect_left(dp,num)
        val[q] = dp[kk]
        idx[q] = kk
        dp[kk] = num
        ans[q] = kk+1

        eulerNum += 1
        tank.append(~q)
        for ch in chi[q]:
            tank.append(ch)
    else:
        if ~q != root:
            dp[idx[~q]] = val[~q]
            eulerNum += 1

print(*ans,sep = "\n")
Problem p02700 (python)

Fixed submission:
import sys
input = sys.stdin.buffer.readline

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

flag = 1
while True:
    if flag > 0:
        c -= b
        if c <= 0:
            break
    else:
        a -= d
        if a <= 0:
            break
    flag = flag * (-1)

if flag > 0:
    print("Yes")
else:
    print("No")

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

n = int(input())
a = set()

for i in range(n):
    a.add(input())

print(len(a))
Problem p02745 (python)

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

la = len(a)
lb = len(b)
lc = len(c)

def match(x,y):
    if x == y or x == "?" or y == "?":
        return True
    return False
    
ab = [True]*15000
ac = [True]*15000
bc = [True]*15000

for i in range(4000-lb,4000+la):
    for j in range(lb):
        if 4000 <= i+j < 4000+la:
            if not match(a[i+j-4000],b[j]):
                ab[i] = False

for i in range(4000-lc,4000+la):
    for j in range(lc):
        if 4000 <= i+j < 4000+la:
            if not match(a[i+j-4000],c[j]):
                ac[i] = False

for i in range(4000-lc,4000+lb):
    for j in range(lc):
        if 4000 <= i+j < 4000+lb:
            if not match(b[i+j-4000],c[j]):
                bc[i] = False

res = la+lb+lc

for i in range(4000-lb-lc,4000+la+lc+1):
    for j in range(0,4000+la+lb+1):
        if ab[i] and ac[j]:
            if (j-i+4000 >= 15000) or bc[j-i+4000]:
                res = min(res, max(4000+la,i+lb,j+lc)-min(4000,i,j))

print(res)

Buggy submission (verdict: Runtime Error):
import copy
#Z[i]:length of the longest list starting from S[i] which is also a prefix of S
#O(|S|)
def Z_algorithm(s,L):
    N = len(s)
    Z_alg = [0]*N

    Z_alg[0] = N
    i = L
    j = 0
    while i < N:
        while i+j < N and (s[j] == s[i+j] or s[j] == "?" or s[i+j] == "?"):
            j += 1
        Z_alg[i] = j
        if j == 0:
            i += 1
            continue
        k = 1
        while i+k < N and k + Z_alg[k]<j:
            Z_alg[i+k] = Z_alg[k]
            k += 1
        i += k
        j -= k
    return Z_alg

a = list(input())
b = list(input())
c = list(input())

def unite(x,y):
    X,Y = len(x),len(y)
    z = Z_algorithm(y+x,Y)

    tmp = -1
    for i in range(Y,X+Y):
        if z[i]+i == X+Y or z[i] == Y:
            tmp = i
            break


    if tmp == -1:
        return x+y
    else:
        if z[tmp] == Y:
            res = x
            for i in range(tmp-Y,tmp):
                if res[i+Y-tmp] == "?":
                    res[i] = y[i-(tmp-Y)]
            return res
        else:
            res = x
            for i in range(tmp-Y,X):
                if res[i] == "?":
                    res[i] = y[i-(tmp-Y)]
            for i in range(X-tmp+Y,Y):
                res.append(y[i])
            return res

print(min(
len(unite(unite(a,b),c)),
len(unite(unite(a,c),b)),
len(unite(unite(b,a),c)),
len(unite(unite(b,c),a)),
len(unite(unite(c,a),b)),
len(unite(unite(c,b),a))))
Problem p02787 (python)

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

dg = 10**5

ba = []
for _ in [0]*n:
    a,b = map(int,input().split())
    if a >= h:
        a = h
    ba.append(b*dg+a)
ba.sort()

d = [10**9]*(h+1)

d[0] = 0

for i in range(1,h+1):
    for e in ba:
        a,b = e%dg,e//dg
        if i<=a:
            if d[i] > b:
                d[i] = b
        else:
            if d[i] > d[i-a]+b:
                d[i] = d[i-a]+b

print(d[-1])

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

dg = 10**5

ba = []
for _ in [0]*n:
    a,b = map(int,input().split())
    ba.append(b*dg+a)
ba.sort()

d = [0]*(h+1)

a,b = ba[0]%dg,ba[0]//dg
d[0] = 0
for i in range(1,h+1):
    if i%a == 0:
        d[i] = (i//a)*b
    else:
        d[i] = (i//a+1)*b


for i in range(1,n):
    a,b = ba[i]%dg,ba[i]//dg
    if d[a] >= b:
        for j in range(a,h+1):
            if d[j] > d[j-a]+b:
                d[j] = d[j-a]+b

print(d[-1])
Problem p02900 (python)

Fixed submission:
import random
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    is_prime = [True] * (n + 100)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime

def is_prime(n):
    if n == 1:
        return True
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


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

g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

#isp = primes(g)
#print(isp)

for e in d:
    if is_prime(e):
        res += 1

print(res)

Buggy submission (verdict: Runtime Error):
import random
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)


#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    is_prime = [True] * (n + 100)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime


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


g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

isp = primes(g)
#print(isp)

for e in d:
    if isp[e]:
        res += 1

print(res)

Buggy submission (verdict: Runtime Error):
#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

#a*x+b*y=gcd(a,b)の一つの解
def extgcd_2(a,b):    
    g = gcd(a,b)
    a = a//g
    b = b//g
    return extgcd(a,b)

#a,bの最小公倍数
def lcm(a, b):
	return a * b // gcd (a, b)

#nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass

#n以下の素数列挙(O(n log(n))
def primes(n):
    ass = []
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = True
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False

    return is_prime


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

g = gcd(a,b)
d = divisor(g)
d.sort()

res = 0

isp = primes(g)

for e in d:
    if isp[e]:
        res += 1
print(res)
Problem p02902 (python)

Fixed submission:
import sys
input = sys.stdin.readline

n,m = map(int,input().split())

edge = [[] for _ in [0]*n]
back = [[] for _ in [0]*n]

for _ in [0]*m:
    a,b = map(int,input().split())
    edge[a-1].append(b-1)
    back[b-1].append(a-1)


res = [None]*(n+1)

for end in range(n):
    for start in edge[end]:
        cost = [-1]*n
        cost[start] = 0
        new = [start]
        tank = []
        judge = True

        while len(new) > 0 and judge:
            tank = []
            for fr in new:
                for go in edge[fr]:
                    if cost[go] < 0:
                        cost[go] = cost[fr] + 1
                        tank.append(go)
                        if go == end:
                            judge = False
            new = tank

        
        if cost[end] >= 0 and cost[end] < len(res):
            p = end
            res = [p+1]
            while p != start:
                for e in back[p]:
                    if cost[p] == cost[e]+1:
                        p = e
                        res.append(p+1)
                        break
if res[0] == None:
    print(-1)
else:                      
    print(len(res))
    for e in res:
        print(e)

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
def main():
    n,m = map(int,input().split())
    edge = [[] for _ in [0]*n]
    for _ in range(m):
        a,b = map(int,input().split())
        edge[a-1].append(b-1)


    new = [0]*n
    for i in range(n):
        new[i] = i
    res = []
    tank = []
    res2 = -1

    while len(new) > 0:
        tank = []
        for i in range(len(new)):
            el = new[i]

            for go in edge[el[-1]]:
                if not go in el:
                    if el[0] in edge[go]:
                        print(len(el)+1)
                        for e in el:
                            print(e+1)
                        print(go+1)

                        exit()
                    tank.append(el+[go])
        new = tank
        
    print(-1)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
edge = [[] for _ in [0]*n]
for _ in range(m):
    a,b = map(int,input().split())
    edge[a-1].append(b-1)


new = [[i] for i in range(n)]

while len(new) > 0:
    tank = []
    for i in range(len(new)):
        el = new[i]
        if el != None:
            for go in edge[el[-1]]:
                if not go in new:
                    if el[0] in edge[go]:
                        res = el
                        res2 = go
                        break
                    tank.append(el.append(go))
    new = tank

print(len(res)+1)
for e in el:
    print(res)
print(go)
Problem p02913 (python)

Fixed submission:
n = int(input())
s = list(input())

res = 0

for k in range(1,n):
    d = [0]*n
    for i in range(n-k):
        if i+k <= n-1 and s[i] == s[i+k]:
            d[i] = min(k,d[i-1]+1)
            res = max(res,d[i])
print(res)

Buggy submission (verdict: Runtime Error):
import random

n = int(input())
s = list(input())

#s[i:j]のハッシュ値:(hash1[j]-hash1[i]*power1[j-i]%mod1)%mod1,hash_key2 = (hash2[j]-hash2[i]*power2[j-i]%mod2)%mod2
#長さnの文字列s
base1 = 1007
mod1 = 1000000007
base2 = 2009
mod2 = 1000000009

"""
modTank1 = [8570647,8570659,8570671,8570677,8570687,8570701,8570719,8570761,8570797,8571799]
mod1 = modTank1[random.randint(0,10)]
modTank2 = [7777709,7777727,7777753,7777769,7777801,7777811,7777813,7777843,7777849,7777853]
mod2 = modTank2[random.randint(0,10)]
"""

modTank1 = [8570647,8570659,8570671,8570677,8570687,8570701,8570719,8570761,8570797,8571799]
mod1 = modTank1[random.randint(0,10)]

hash1 = [0]*(n+1)
power1 = [1]*(n+1)


for i,e in enumerate(s):
    hash1[i+1] = (hash1[i]*base1 + ord(e))%mod1
    power1[i+1] = (power1[i]*base1)%mod1

res = 0
for i in range(n):
    for j in range(i+1,n):
        ng = min(j-i+1,n-j+1)
        ok = 0
        while ng-ok > 1:
            mid = (ok+ng)//2
            if (hash1[i+mid]-hash1[i]*power1[mid]%mod1)%mod1 != (hash1[j+mid]-hash1[j]*power1[mid]%mod1)%mod1:
                ng = mid
            else:
                ok = mid
        res = max(res,mid)
print(res)

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

s.sort()

p = 0
for e in s:
    p = p^e

res = 0

q = 0
for e in s:
    q = q^e
    res = max(res,(p^q)+q)


q = 0
for i in range(n):
    q = q^s[n-1-i]
    res = max(res,(p^q)+q)
print(res)

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

s.sort()

p = 0
for e in s:
    p = p^e

res = 0

q = 0
for e in s:
    q = q^e
    res = max(res,(p^q)+q)


q = 0
for i in range(n):
    q = q^s[n-1-i]
    res = max(res,(p^q)+q)
print(res)
Problem p02928 (python)

Fixed submission:
import bisect

n,k = map(int,input().split())
a = list(map(int,input().split()))
mod = 10**9+7

ass = 0
for i in range(n):
    for j in range(i):
        if a[i] < a[j]:
            ass += 1

res = 0
b = sorted(a)
for e in b:
    kw = bisect.bisect_right(b,e)
    res += n-kw

print((k*ass%mod+( (k*(k-1)//2)%mod )*res%mod)%mod)

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

# i が与えられたとき a1~aiまでの和を計算する( O(log n) )
def bitsum(bit,i):
    s = 0
    while i > 0:
        s += bit[i]
        i -= i&(-i)
    return s
    
# i と x が与えられたとき ai += x とする ( O(log n) )
def bitadd(bit,i,x):
    while i <= n:
        bit[i] += x
        i += i&(-i)
    return bit
    
#################################
import math

#bitの構築
n_ = int(math.log2(n)) + 1
bit = [0] * (2**n_)
bit.append(0)

################################
ass = 0
for j in range(n):
    ass += j-bitsum(bit,a[j])
    #bitsum(bit,a[j]): j-1番目までの中でa[j]以下のもの
    bit = bitadd(bit,a[j],1)

res = 0
b = sorted(a)

for e in b:
    kw = bisect.bisect_right(b,e)
    res += n-kw

mod = 10**9+7

print((k*ass%mod+res*k*(k-1)//2%mod)%mod)

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

# i が与えられたとき a1~aiまでの和を計算する( O(log n) )
def bitsum(bit,i):
    s = 0
    while i > 0:
        s += bit[i]
        i -= i&(-i)
    return s
    
# i と x が与えられたとき ai += x とする ( O(log n) )
def bitadd(bit,i,x):
    while i <= n:
        bit[i] += x
        i += i&(-i)
    return bit
    
#################################
import math

#bitの構築
n_ = int(math.log2(n)) + 1
bit = [0] * (2**n_)
bit.append(0)

################################
ass = 0
for j in range(n):
    ass += j-bitsum(bit,a[j])
    #bitsum(bit,a[j]): j-1番目までの中でa[j]以下のもの
    bit = bitadd(bit,a[j],1)

res = 0
b = sorted(a)

for e in b:
    kw = bisect.bisect_right(b,e)
    res += n-kw

mod = 10**9+7

print((k*ass%mod+res*k*(k-1)//2%mod)%mod)
Problem p02945 (python)

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

print(max(a+b,a-b,a*b))

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

print(max(a+b,a-b,a*b))

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

print(max(a+b,a-b,a＊b))
Problem p02983 (python)

Fixed submission:
mod = 2019
l,r = map(int,input().split())

cnt = 0
tank = []
for i in range(l,r+1):
    tank.append(i%mod)
    cnt += 1
    if cnt >= 2020:
        break

res = 2019

n = len(tank)
for i in range(n):
    for j in range(i+1,n):
        res = min(res,tank[i]*tank[j]%mod)
print(res)

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

s = sum(a)
p = 0
for i in range(n):
    if i%2 == 1:
        p += a[i]*2

q = s-p
for i in range(n):
    print(q)
    q = a[i]*2-q
Problem p02999 (python)

Fixed submission:
x,a = map(int,input().split())
if x<a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
x,a = map(int(input()).split())
if x<a:
  print(0)
else:
  print(10)
Problem p03001 (python)

Fixed submission:
w,h,x,y = map(int,input().split())

if w/2.0 == float(x) and h/2.0 == float(y):
    print(w*h/2.0,1)
else:
    print(w*h/2.0,0)

Buggy submission (verdict: Runtime Error):
w,h,x,y = map(input().split())

if w/2.0 == float(x) and h/2.0 == float(y):
    print(w*h/2.0,1)
else:
    print(w*h/2.0,0)
Problem p03046 (python)

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

if m == 0:
    if k == 0:
        print(0,0)
    else:
        print(-1)
    exit()
if m == 1:
    if k == 0:
        print(0,0,1,1)
    else:
        print(-1)
    exit()
if k >= 2**m:
    print(-1)
    exit()
if k == 0:
    for i in range(2**m):
        print(i,i,end = ' ')
    exit()
res = []
used = [True]*(2**m)

tank = []

for i in range(2**m):
    if used[i]:
        tank.append((i,i^k))
        used[i] = used[i^k] = False
for i in range(len(tank)):
    if i % 2 == 1:
        continue
    a = tank[i][0]
    b = tank[i][1]
    c = tank[i+1][0]
    d = tank[i+1][1]
    res += [c,a,b,c,d,b,a,d]

for e in res:
    print(e,end=' ')

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

if m == 0:
    if k == 0:
        print(0,0)
    else:
        print(-1)
    exit()
if m == 1:
    if k == 0:
        print(0,0,1,1)
    else:
        print(-1)
    exit()
if k >= 2**m:
    print(-1)

res = []
used = [True]*(pow(2**m))

tank = []

for i in range(2**m):
    if used[i]:
        tank.append((i,i^k))
        used[i] = used[i^k] = False
for i in range(len(tank)):
    if i % 2 == 1:
        continue
    a = tank[i][0]
    b = tank[i][1]
    c = tank[i+1][0]
    d = tank[i+1][1]
    res += [c,a,b,c,d,b,a,d]

for e in res:
    print(e,end=' ')