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

Fixed submission:
s = input()
t = set(s)
if len(t) == 2 and s.count(list(t)[0]) == 2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = set(s)
if len(t) == 2 and s.count(list(t[0])) == 2:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = set(s)
if len(t) == 2 and s.count(t[0]) == 2:
  print("Yes")
else:
  print("No")
Problem p03272 (python)

Fixed submission:
a,b = map(int,input().split())
print(a-b+1)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
return a - b + 1
Problem p02623 (python)

Fixed submission:
n, m, k = map(int, input().split())
a = [0] + list(map(int, input().split()))
b = [0] + list(map(int, input().split()))
for i in range(1, n + 1):
    a[i] += a[i - 1]
for i in range(1, m + 1):
    b[i] += b[i - 1]

ans = 0
for i in range(len(a)):
    rest = k - a[i]
    if rest < 0:
        break
    left, right = -1, len(b)
    while right - left > 1:
        mid = (left + right) // 2
        if rest - b[mid] >= 0:
            left = mid
        else:
            right = mid
    # print(f"{rest}を越えない最大のBiは{b[left]}")
    ans = max(ans, i + left)
print(ans)

Buggy submission (verdict: Runtime Error):
package main
import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main(){
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()
	N, M, K := nextInt(), nextInt(), nextInt()
	A := append([]int{0}, nextInts(N)...)
	B := append([]int{0}, nextInts(M)...)
	for i:=1; i<=N; i++{
		A[i] += A[i-1]
	}
	for i:=1; i<=M; i++{
		B[i] += B[i-1]
	}
	ans := 0
	for i:=0; i<=N; i++{
		rest := K-A[i]
		if rest < 0{
			break
		}
		// golangでupper_boundどうやるんだ？？？？？？・
		/// bidx := max(0, sort.Search(len(B), func(j int)bool{return rest<=B[j]}))
		// bidx := sort.Search(len(B), func(j int)bool{return rest<=B[j]})-1
		// bidx := sort.SearchInts(B, rest)
		// わからんので仕方なく手書き
		left, right := -1, len(B)
		for right - left > 1{
			mid := (left+right)/2
			if rest-B[mid]>=0{
				left = mid
			}else{
				right = mid
			}
		}
		bidx := left
		ans = max(ans, i+bidx)
	}
	fmt.Fprintln(out, ans)
}

func min(a, b int) int {
	if a<b{
		return a
	}
	return b
}

func max(a, b int) int {
	if a<b{
		return b
	}
	return a
}
func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func nextInts(n int) []int{
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}
Problem p02762 (python)

Fixed submission:
 # 同じ木に属する(==そこまでたどりつけるかどうか）の判定にunionfind
# 同じ木に属しているノードはあとで数えることができる（そうだね）
# 除外するやつが出てくる。直の友達+ブロック関係にあるやつ（と自分）
# 同じ木に属しているノードの総数 - (直の友達+ブロック関係+自分自身)が答え
from sys import setrecursionlimit
setrecursionlimit(10**8)
n, m, k = map(int, input().split())
par = [i for i in range(n)]
ans = [0 for _ in range(n)]


def root(x):
    if x == par[x]:
        return x
    y = root(par[x])
    par[x] = y
    return y


def union(x, y):
    if x > y:
        x, y = y, x
    rx, ry = root(x), root(y)
    if rx != ry:
        par[ry] = rx


friends = [[] for _ in range(n)]
blocks = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    union(a - 1, b - 1)
    friends[a - 1].append(b - 1)
    friends[b - 1].append(a - 1)
for _ in range(k):
    c, d = map(int, input().split())
    blocks[c - 1].append(d - 1)
    blocks[d - 1].append(c - 1)

# 木に属しているやつを数えるぜ
group_count = [0 for _ in range(n)]
for i in range(n):
    group_count[root(i)] += 1
# 答えを作るぜ
for i in range(n):
    # 初期化（じゃないけど）
    ans[i] += group_count[root(i)]
    # 直の友達を除く
    ans[i] -= len(friends[i])
    # ブロックしてるやつを除く
    for b in blocks[i]:
        ra, rb = root(i), root(b)
        if ra == rb:
            ans[i] -= 1
    # 自分自身を除く
    ans[i] -= 1
print(" ".join(list(map(str, ans))))

Buggy submission (verdict: Runtime Error):
# 同じ木に属する(==そこまでたどりつけるかどうか）の判定にunionfind
# 同じ木に属しているノードはあとで数えることができる（そうだね）
# 除外するやつが出てくる。直の友達+ブロック関係にあるやつ（と自分）
# 同じ木に属しているノードの総数 - (直の友達+ブロック関係+自分自身)が答え
n, m, k = map(int, input().split())
par = [i for i in range(n)]
ans = [0 for _ in range(n)]


def root(x):
    if x == par[x]:
        return x
    y = root(par[x])
    par[x] = y
    return y


def union(x, y):
    if x > y:
        x, y = y, x
    rx, ry = root(x), root(y)
    if rx != ry:
        par[ry] = rx


friends = [[] for _ in range(n)]
blocks = [[] for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    union(a - 1, b - 1)
    friends[a - 1].append(b - 1)
    friends[b - 1].append(a - 1)
for _ in range(k):
    c, d = map(int, input().split())
    blocks[c - 1].append(d - 1)
    blocks[d - 1].append(c - 1)

# 木に属しているやつを数えるぜ
group_count = [0 for _ in range(n)]
for i in range(n):
    group_count[root(i)] += 1
# 答えを作るぜ
for i in range(n):
    # 初期化（じゃないけど）
    ans[i] += group_count[root(i)]
    # 直の友達を除く
    ans[i] -= len(friends[i])
    # ブロックしてるやつを除く
    for b in blocks[i]:
        ra, rb = root(i), root(b)
        if ra == rb:
            ans[i] -= 1
    # 自分自身を除く
    ans[i] -= 1
print(" ".join(list(map(str, ans))))
Problem p02831 (python)

Fixed submission:
# 最小公倍数
import fractions

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


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


print(lcm(a, b))

Buggy submission (verdict: Runtime Error):
# 最小公倍数
import math

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


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


print(lcm(a, b))
Problem p03634 (python)

Fixed submission:
# disjoint setかと思いきやDFS
# したらTLEになったので根本的にやり方が間違ってるということ
# よくよく考えたらdfsなのでそこにたどり着いたときが最短距離だわ ムダに探索してた


import sys

sys.setrecursionlimit(10000000)

n = int(input())
graph = [[] for _ in range(n)]

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

q, k = map(int, input().split())
k = k - 1
# kからスタートしてぜんぶたどる
ans_list = [0 for _ in range(n)]


def dfs(node, weight):
    for data in graph[node]:
        if not used[data[0]]:
            used[data[0]] = True
            dfs(data[0], weight + data[1])
    ans_list[node] = weight


used = [False for _ in range(n)]
used[k] = True
dfs(k, 0)

for _ in range(q):
    a, b = map(lambda x: int(x) - 1, input().split())
    print(ans_list[a] + ans_list[b])

Buggy submission (verdict: Runtime Error):
# disjoint setかと思いきやDFS
n = int(input())
graph = [[] for _ in range(n)]

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

q, k = map(int, input().split())
k = k - 1
# kからスタートしてぜんぶたどる
ans_list = [0 for _ in range(n)]


def dfs(node, used, weight):
    for data in graph[node]:
        if data[0] not in used:
            next_used = used[:]
            next_used.append(data[0])
            dfs(data[0], next_used, weight + data[1])
    ans_list[node] = weight


dfs(k, [k], 0)

for _ in range(q):
    a, b = map(lambda x: int(x) - 1, input().split())
    print(ans_list[a] + ans_list[b])

Buggy submission (verdict: Runtime Error):
# disjoint setかと思いきやDFS
n = int(input())
graph = [[] for _ in range(n)]

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

q, k = map(int, input().split())
k = k - 1
# kからスタートしてぜんぶたどる
ans_list = [0 for _ in range(n)]


def dfs(node, used, weight):
    for data in graph[node]:
        if data[0] not in used:
            next_used = used[:]
            next_used.append(data[0])
            dfs(data[0], next_used, weight + data[1])
    ans_list[node] = weight


dfs(k, [k], 0)

for _ in range(q):
    a, b = map(lambda x: int(x) - 1, input().split())
    print(ans_list[a] + ans_list[b])
Problem p02580 (python)

Fixed submission:
from collections import Counter
import sys

H,W,M,*hw = map(int,open(0).read().split())

h = hw[::2]
w = hw[1::2]

hw_set = set((hi,wi) for hi,wi in zip(h,w))


raw_count = Counter(h).most_common()
col_count = Counter(w).most_common()


raw_max = raw_count[0][1]
col_max = col_count[0][1]

ans = 0
for hi, rcount in raw_count:
    if rcount<raw_max:break
    for wi, ccount in col_count:
        if ccount<col_max: break
        
        if (hi,wi) in hw_set:
            ans = raw_max + col_max - 1
        else:
            print(raw_max + col_max)
            sys.exit()

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
import sys

H,W,M,*hw = map(int,open(0).read().split())

h = hw[::2]
w = hw[1::2]

bomb = [[0]*W for _ in range(H)]
for hi,wi in zip(h,w):
    bomb[hi-1][wi-1] = 1


raw_count = Counter(h)
col_count = Counter(w)

raw_max = raw_count.most_common()[0][1]
col_max = col_count.most_common()[0][1]

ans = 0
for hi, rcount in raw_count.most_common():
    if rcount<raw_max:break
    for wi, ccount in col_count.most_common():
        if ccount<col_max: break
        
        if bomb[hi-1][wi-1]==1:
            ans = raw_max + col_max - 1
        else:
            print(raw_max + col_max)
            sys.exit()

print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter
import sys

H,W,M,*hw = map(int,open(0).read().split())

h = hw[::2]
w = hw[1::2]

bomb = [[0]*W for _ in range(H)]
for hi,wi in zip(h,w):
    bomb[hi-1][wi-1] = 1


raw_count = Counter(h)
col_count = Counter(w)

raw_max = raw_count.most_common()[0][1]
col_max = col_count.most_common()[0][1]

ans = 0
for hi, rcount in raw_count.most_common():
    if rcount<raw_max:break
    for wi, ccount in col_count.most_common():
        if ccount<col_max: break
        
        if bomb[hi-1,wi-1]==1:
            ans = raw_max + col_max - 1
        else:
            print(raw_max + col_max)
            sys.exit()

print(ans)
Problem p02781 (python)

Fixed submission:
def calc(n,k):
    while n[0] == '0' and len(n)>1:
        n=n[1:]
    
    digit = len(n)
    if digit < k:
        return 0
    
    comb = [1]*(k+1)
    for i in range(1,k+1):
        comb[i] = comb[i-1] * (digit-i) //i
    if k==1:
        return 9*comb[1] + int(n[0])
    elif k==2:
        return (9**2)*comb[2] + (int(n[0])-1) * 9*comb[1] + calc(n[1:],1)
    elif k==3:
        return (9**3)*comb[3] + (int(n[0])-1) * (9**2) * comb[2] + calc(n[1:],2)

n=input()
k=int(input())
print(calc(n,k))

Buggy submission (verdict: Runtime Error):
def calc(n,k):
    while n[0] == '0' :n=n[1:]
    
    digit = len(n)
    if digit < k:
        return 0
    
    comb = [1]*(k+1)
    for i in range(1,k+1):
        comb[i] = comb[i-1] * (digit-i) //i
    if k==1:
        return 9*comb[1] + int(n[0])
    elif k==2:
        return (9**2)*comb[2] + (int(n[0])-1) * 9*comb[1] + calc(n[1:],1)
    elif k==3:
        return (9**3)*comb[3] + (int(n[0])-1) * (9**2) * comb[2] + calc(n[1:],2)

n=input()
k=int(input())
print(calc(n,k))

Buggy submission (verdict: Runtime Error):
def calc(n,k):
    digit = len(n)
    comb = [1]*(k+1)
    for i in range(1,k+1):
        comb[i] = comb[i-1] * (digit-i) //i
    if k==1:
        return 9*comb[1] + int(n[0])
    elif k==2:
        return (9**2)*comb[2] + (int(n[0])-1) * 9*(digit-1) + calc(n[1:],1)
    elif k==3:
        return (9**3)*comb[3] + (int(n[0])-1) * (9**2) * comb[2] + calc(n[1:],2)

n=input()
k=int(input())
print(calc(n,k))
Problem p02990 (python)

Fixed submission:
import math
def c_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,k=map(int,input().split())
for i in range(1,k+1):
    if i <= n-k+1:
        print(((c_count(n-k+1,i)%(10**9+7)) * (c_count(k-1,i-1)%(10**9+7)))%(10**9+7))
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
import math
def c_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,k=map(int,input().split())
for i in range(1,k+1):
    print((c_count(n-k+1,i)%(10**9+7)) * (c_count(k-1,i-1)%(10**9+7)))
Problem p03013 (python)

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

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if a_id < m:
            if i+1 == a[a_id]:
                a_id += 1 if a_id < m-1 else 0
                cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)

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

if n+1 < 2*m:
    print(0)
else:
    a = [int(input()) for _ in range(m)]

    pre2 = 0
    pre1 = 0
    cur = 1
    a_id = 0

    for i in range(n):
        pre2 = pre1
        pre1 = cur 
        cur = pre1 + pre2
        if i+1 == a[a_id]:
            a_id += 1 if a_id < m-1 else 0
            cur = 0
        if cur == 0 and pre1 == 0:
            break
    print(cur%1000000007)

Buggy submission (verdict: Runtime Error):
n,m=list(map(int,input().split()))
a = [int(input()) for _ in range(m)]

pre2 = 0
pre1 = 0
cur = 1
a_id = 0

for i in range(n):
    pre2 = pre1
    pre1 = cur 
    cur = pre1 + pre2
    if i+1 == a[a_id]:
        a_id += 1 if a_id < m-1 else 0
        cur = 0
    if cur == 0 and pre1 == 0:
        break
print(cur%1000000007)
Problem p03209 (python)

Fixed submission:
def count(n,x):
    if x<=n:
        return 0
    elif x>=2**(n+2)-3-n:
        return 2**(n+1)-1
    elif 2**(n+2)-3 > 2*x:
        return count(n-1,x-1)
    else:
        return 2**n + count(n-1,x-2**(n+1)+1)

n,x=map(int,input().split())
print(count(n,x))

Buggy submission (verdict: Runtime Error):
def count(n,x):
    if x<=n:
        return 0
    elif x>=2**(n+2)-2-n:
        return 2**(n+1)-1
    elif 2**(n+2)-3 > 2*x:
        return count(n-1,x-1)
    else:
        return 2**n + count(n-1,x-2**(n+1)+1)

n,x=map(int,input().split())
print(count(n,x))

Buggy submission (verdict: Runtime Error):
def count(n,x):
    print(n,x)
    if x<=n:
        return 0
    elif x>=2**(n+2)-2-n:
        return 2**(n+1)-1
    elif 2**(n+2)-3 > 2*x:
        return count(n-1,x-1)
    else:
        return 2**n + count(n-1,x-2**(n+1)+1)

n,x=map(int,input().split())
print(count(n,x))

Buggy submission (verdict: Runtime Error):
def count(n,x):
    if x<=n:
        return 0
    elif 2**(n+2)-3 > 2*x:
        return count(n-1,x-1)
    else:
        return 2**n + count(n-1,x-2**(n+1)+1)

n,x=map(int,input().split())
print(count(n,x))
Problem p03634 (python)

Fixed submission:
from collections import deque

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

q,k = map(int,input().split())

dist = [float('inf')] * n
visited = [0] * n

dist[k-1] = 0
visited[k-1] = 1
vq = deque([k-1])

while vq:
    
    vs = vq.popleft()
    
    for ve,vc in edge[vs]:
        if visited[ve] == 1: continue
        
        dist[ve] = dist[vs] + vc
        visited[ve] = 1
        vq.append(ve)


for _ in range(q):
    x,y = map(int,input().split())
    print(dist[x-1] + dist[y-1])

Buggy submission (verdict: Runtime Error):
from scipy.sparse.csgraph import dijkstra
import numpy as np

n = int(input())
L = np.zeros((n,n),int)
for _ in range(n-1):
    a,b,c = map(int,input().split())
    L[a-1,b-1] = c

q,k = map(int,input().split())

dist = dijkstra(L,directed = False, indices= k-1).astype(int)

for _ in range(q):
    x,y = map(int,input().split())
    print(dist[x-1] + dist[y-1])
Problem p02753 (python)

Fixed submission:
a = input()
if a == "AAA" or a == "BBB":
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
a = input()
if a = "AAA" or a = "BBB":
  print("No")
else:
  print("Yes")
Problem p02793 (python)

Fixed submission:
import sys
from fractions import gcd
input = sys.stdin.readline

def lcm(x, y):
    return (x * y) // gcd(x, y)
def main():
    n = int(sys.stdin.readline())
    a = list(map(int,input().split()))
    
    l = a[0]
    for i in range(n):
        l = lcm(l, a[i])
    sum = 0
    for i in range(n):
        sum += l // a[i]
    print(sum % 1000000007)
main()

Buggy submission (verdict: Runtime Error):
from fractions import gcd

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

def lcm(x, y):
    return (x * y) // gcd(x, y)
l = a[0]
for i in range(n):
    if i == 0:
        continue
    l = lcm(l, a[i])
sum = 0
for i in range(n):
    sum += l / a[i]
    sum %= 1000000007
print(sum)

Buggy submission (verdict: Runtime Error):
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
l = a[0]
for i in range(n):
    if i == 0:
        continue
    l = lcm(l, a[i])
sum = 0
for i in range(n):
    sum += l / a[i]
    sum %= 1000000007
print(sum)
Problem p02790 (python)

Fixed submission:
a, b = map(int, input().split())
print(max(int(str(a)*b), int(str(b)*a)))

Buggy submission (verdict: Runtime Error):
a, b = map(int, input.split())
print(max(int(str(a)*b), int(str(b)*a)))
Problem p03253 (python)

Fixed submission:
mod = 10 ** 9 + 7
N, M = [int(_) for _ in input().split()]

MAX_N = 10 ** 5 + 100

factorize_result = {}
def factorization(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            factorize_result[i] = 1
            n = n // i
            while n % i == 0:
                factorize_result[i] += 1
                n = n // i
    if n > 1:
        factorize_result[n] = 1


factorial = [1] * MAX_N
def calc_factorial():
    for i in range(1, MAX_N):
        factorial[i] = i * factorial[i - 1] % mod


def comb(n, k):
    a = factorial[n] % mod
    b = (factorial[k] * factorial[n - k]) % mod
    b_ = pow(b, mod - 2, mod)
    return (a * b_) % mod


# 素因数分解
factorization(M)

# 階乗を用意
calc_factorial()

ans = 1
for k, v in factorize_result.items():
    ans *= comb(N + v - 1, v) % mod

print(ans % mod)

Buggy submission (verdict: Runtime Error):
mod = 10 ** 9 + 7
N, M = [int(_) for _ in input().split()]

factorize_result = {}
def factorization(n):
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            factorize_result[i] = 1
            n = n // i
            while n % i == 0:
                factorize_result[i] += 1
                n = n // i
    if n > 1:
        factorize_result[n] = 1


factorial = [1] * (2 * N)
def calc_factorial():
    for i in range(1, 2 * N):
        factorial[i] = i * factorial[i - 1] % mod


def comb(n, k):
    a = factorial[n] % mod
    b = (factorial[k] * factorial[n - k]) % mod
    b_ = pow(b, mod - 2, mod)
    return (a * b_) % mod


# 素因数分解
factorization(M)

# 階乗を用意
calc_factorial()

ans = 1
for k, v in factorize_result.items():
    ans *= comb(N + v - 1, v) % mod

print(ans % mod)
Problem p03075 (python)

Fixed submission:
a = [0]*5
for i in range(5):
  a[i] = int(input())
k = int(input())
if (max(a)-min(a))>k:
  print(':(')
else:
  print('Yay!')

Buggy submission (verdict: Runtime Error):
a = [0]*5
for i in range(5):
  a[i] = input()
k = input()
if (max(a)-min(a))>k:
  print(':(')
else:
  print('Yay!')
Problem p02682 (python)

Fixed submission:
A, B, C, K = map(int, input().split())
if K <= A:
    print(K)
elif K <= A + B:
    print(A)
else:
    print(A - (K - A - B))

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

if 0 in A:
    print(0)
    exit()
          
n = 1
for i in range(N):
    n *= A[i]
    if n > 10**18:
        print(-1)
        exit()

print(n)
Problem p02693 (python)

Fixed submission:
K = int(input())
A, B = list(map(int, input().split()))

for i in range(A, B+1):
    if i % K == 0:
        print('OK')
        exit()

print('NG')

Buggy submission (verdict: Runtime Error):

A, B = list(map(int, input().split()))

for i in range(A, B+1):
    if i % K == 0:
        print('OK')
        exit()

print('NG')
Problem p02879 (python)

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

print(a*b if (1 <= a <= 9 and 1 <= b <= 9) else '-1')

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

print(a*b if 1 <= a <= 9 and 1 <= b <= 9 else '-1')
Problem p03073 (python)

Fixed submission:
raw = input()
s = bin(int(raw, 2))
n = len(raw)
m = bin(int(''.join([str(i%2) for i in range(n)]),2))
 
a = bin((int(s,2))^int(m,2)).count("1")
b = n-a
 
print(a if a < b else b)

Buggy submission (verdict: Runtime Error):
raw = input()
s = bin(int(raw, 2))
n = len(raw)
m1 = bin(int("1010101010101"[:n],2))
m2 = bin(int("0101010101010"[:n],2))

if s == m1 or s == m2:
    print("0")
    exit(1)

a = bin((int(s,2))^int(m1,2)).count("1")
b = bin((int(s,2))^int(m2,2)).count("1")

print(a if a < b else b)
Problem p02701 (python)

Fixed submission:
n = int(input())
lis = [input() for i in range(n)]
print(len(set(lis)))

Buggy submission (verdict: Runtime Error):
n = int(input)
lis = [input() for i in range(n)]
print(len(set(lis)))
Problem p02777 (python)

Fixed submission:
s, t = input().split()
a, b = list(map(int, input().split()))
u = input()
if u == s:
    print("{} {}".format(a-1, b))
else:
    print("{} {}".format(a, b-1))

Buggy submission (verdict: Runtime Error):
s, t = input().split()
a, b = list(map(int, input, split()))
u = input()
if u == s:
    print("{} {}".format(a-1, b))
else:
    print("{} {}".format(a, b-1))
Problem p02847 (python)

Fixed submission:
youbi = ['SUN','MON','TUE','WED','THU','FRI','SAT']
y = input()

for i in range(7):
  if y == youbi[i]:
    print(7-i)

Buggy submission (verdict: Runtime Error):
youbi = ['SUN','MON','TUE','WED','THU','FRI','SAT']
y = input()

for i in range(1, 7):
  if y = youbi[i]:
    print(7-i)
Problem p02860 (python)

Fixed submission:
n = int(input())
s = input()
if n % 2 == 0 and s[:n//2] == s[n//2:] :
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 == 0 and s[:n//2] == s[s//2:] :
  print('Yes')
else:
  print('No')
Problem p03011 (python)

Fixed submission:
a,b,c = list(map(int, input().split() ))
print (min(a+b, b+c, c+a))

Buggy submission (verdict: Runtime Error):
a,b,c = list(map(input.split() ))
print (min(a+b, b+c, c+a))