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

Fixed submission:
#!/usr/bin/env python3
import sys
import itertools
import collections
from queue import Queue
import functools
import math
INF = 10**9


def solve(N: int, K: int, x: "List[int]"):
    x_neg = ([-xx for xx in x if xx < 0]+[0])[::-1]
    x_pos = [0] + [xx for xx in x if xx >= 0]

    # 左先を考える
    left = [x_neg[i]*2 + x_pos[K-i] for i in range(len(x_neg))
            if 0 <= K-i and K-i < len(x_pos)]
    if len(left) > 0:
        ansleft = min(left)
    else:
        ansleft = INF

    # 右先
    right = [x_pos[i]*2 + x_neg[K-i] for i in range(len(x_pos))
             if 0 <= K-i and K-i < len(x_neg)]
    if len(right) > 0:
        ansright = min(right)
    else:
        ansright = INF
    # print(left)
    # print(right)
    print(min(ansright, ansleft))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, x)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import itertools
import collections
from queue import Queue
import functools
import math
INF = 10**9


def solve(N: int, K: int, x: "List[int]"):
    x_neg = ([-xx for xx in x if xx < 0]+[0])[::-1]
    x_pos = [0] + [xx for xx in x if xx >= 0]

    # 左先を考える
    # print(x_neg)
    # print(x_pos)
    left = [x_neg[i]*2 + x_pos[K-i] for i in range(len(x_neg))
            if K-i < len(x_pos)]
    if len(left) > 0:
        ansleft = min(left)
    else:
        ansleft = INF

    # 右先
    right = [x_pos[i]*2 + x_neg[K-i] for i in range(len(x_pos))
             if K-i < len(x_neg)]
    if len(right) > 0:
        ansright = min(right)
    else:
        ansright = INF
    # print(left)
    # print(right)
    print(min(ansright, ansleft))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, x)


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

Fixed submission:
#!/usr/bin/env python3
import sys
INF = float("inf")
import numpy as np
from collections import Counter
from itertools import permutations


def solve(N: int, C: int, D: "List[List[int]]", c: "List[List[int]]"):
    D = np.array(D)
    onedim = [[], [], []]
    for i in range(N):          # O(N^2)
        for j in range(N):
            onedim[(i+j) % 3].append(c[i][j])
    # print(onedim)
    counters = [Counter(onedim[i]) for i in range(3)]  # O(3*N*N)
    arr = np.empty((C, C))
    for i in range(3):          # O(C*C)
        for j in range(C):
            arr[i][j] = counters[i][j+1]
    # print("arr", arr)
    # print("D", D)
    hint = arr.dot(D)         # O(C*C*3)
    # print("arr@D\n", hint)
    print(int(min([hint[0][a] + hint[1][b]+hint[2][c]
                   for a, b, c in permutations(range(C), 3)])))
    # O(C*(C-1)*(C-2))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = [[int(next(tokens)) for _ in range(C)]
         for _ in range(C)]  # type: "List[List[int]]"
    c = [[int(next(tokens)) for _ in range(N)]
         for _ in range(N)]  # type: "List[List[int]]"
    solve(N, C, D, c)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
INF = float("inf")
import numpy as np
from collections import Counter
from itertools import permutations


def solve(N: int, C: int, D: "List[List[int]]", c: "List[List[int]]"):
    D = np.array(D)
    onedim = [[], [], []]
    for i in range(N):          # O(N^2)
        for j in range(N):
            onedim[(i+j) % 3].append(c[i][j])
    # print(onedim)
    counters = [Counter(onedim[i]) for i in range(C)]  # O(C*N*N)
    arr = np.empty((C, C))
    for i in range(C):          # O(C*C)
        for j in range(C):
            arr[i][j] = counters[j][i+1]
    # print("arr", arr)
    # print("D", D)
    hint = D.T.dot(arr)         # O(C*C*3)
    # print("D.T@arr\n", hint)
    print(int(min([hint[0][a] + hint[1][b]+hint[2][c]
                   for a, b, c in permutations(range(C), 3)])))
    # O(C*(C-1)*(C-2))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = [[int(next(tokens)) for _ in range(C)]
         for _ in range(C)]  # type: "List[List[int]]"
    c = [[int(next(tokens)) for _ in range(N)]
         for _ in range(N)]  # type: "List[List[int]]"
    solve(N, C, D, c)


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

Fixed submission:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(s: str, K: int):
    N = len(s)
    for i in range(ord('a'), ord('z')+1):
        c = chr(i)
        l = -1
        subs = []
        while c in s[l+1:]:
            l = s.index(c, l+1)
            for r in range(l+1, min(N+1, l+1+K)):
                subs.append(s[l:r])
        subs = sorted(list(set(subs)))
        if len(subs) > K-1:
            break
        else:
            K -= len(subs)
            continue
    print(subs[K-1])
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    K = int(next(tokens))  # type: int
    solve(s, K)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(s: str, K: int):
    N = len(s)
    for i in range(ord('a'), ord('z')+1):
        c = chr(i)
        l = -1
        subs = []
        while c in s[l+1:]:
            l = s.index(c, l+1)
            for r in range(l+1, N+1):
                subs.append(s[l:r])
        subs = sorted(list(set(subs)))
        if len(subs) > K:
            break
        else:
            K -= len(subs)
            continue
    print(subs[K-1])
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    K = int(next(tokens))  # type: int
    solve(s, K)


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

Fixed submission:
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(A: int, B: int):
    h = 100
    w = 99
    print(h, w)

    grid = [["."]*w for row in range(h)]

    for i in range(h//2, h):
        grid[i] = ["#"]*w

    def ij_k(k):
        row = (w-1)//2
        i = (k//row)*2+1
        j = (k % row)*2+1
        return i, j

    for k in range(B-1):
        i, j = ij_k(k)
        grid[i][j] = "#"

    for k in range(A-1):
        i, j = ij_k(k)
        grid[i+h//2][j] = "."

    for i in range(h):
        r = "".join(grid[i])
        print(r)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def solve(A: int, B: int):
    h = 100
    w = 100
    print(h, w)

    grid = [["." if row < 50 else "#" for _ in range(w)] for row in range(h)]

    for i in range(B-1):
        grid[2*(i//50)][(i % 50)*2] = "#"

    for k in range(A-1):
        grid[2*(i//50)+51][(i % 50)*2] = "."

    for i in range(h):
        r = "".join(grid[i])
        print(r)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


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

Fixed submission:
#!/usr/bin/env python3
import sys
INF = float("inf")
from collections import defaultdict


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(s: str, x: int, y: int):
    N = len(s)
    s = [len(FF) for FF in s.split("T")]
    sX = s[0::2]                # 空となるケースに注意
    sY = s[1::2]                # 空となるケースに注意
    # print(sX, sY)

    # sXを足すか引くかして、xにたどり着くことができるか
    DPx = defaultdict(bool)
    DPx[sX[0]] = True
    for c in sX[1:]:
        DPnext = defaultdict(bool)
        for key in DPx:
            DPnext[key-c] = True
            DPnext[key+c] = True
        DPx = DPnext

    DPy = defaultdict(bool)
    DPy[0] = True
    for c in sY:
        DPnext = defaultdict(bool)
        for key in DPy:
            DPnext[key-c] = True
            DPnext[key+c] = True
        DPy = DPnext

    if DPx[x] and DPy[y]:
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(s, x, y)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


def solve(s: str, x: int, y: int):
    s = [len(FF) for FF in s.split("T")]
    sX = s[0::2]                # 空となるケースに注意
    sY = s[1::2]                # 空となるケースに注意
    # print(sX, sY)

    # sXを足すか引くかして、xにたどり着くことができるか
    N = len(s)
    DPx = [False]*(2*N+1)  # [-len(s):len(s)]
    DPx[0] = True
    for c in sX:
        DPnext = [False]*(2*N+1)
        for i in range(-N, N+1):
            DPnext[i] = DPx[i-c]
            if i+c < N+1:
                DPnext[i] = DPnext[i] or DPx[i+c]
        DPx = DPnext
        # print(DPx)

    DPy = [False]*(2*N+1)
    DPy[0] = True
    for c in sY:
        DPnext = [False]*(2*N+1)
        for i in range(-N, N+1):
            DPnext[i] = DPy[i-c]
            if i+c < N+1:
                DPnext[i] = DPnext[i] or DPy[i+c]
        DPy = DPnext
    # print(DPy)

    if DPx[x] and DPy[y]:
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    x = int(next(tokens))  # type: int
    y = int(next(tokens))  # type: int
    solve(s, x, y)


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

Fixed submission:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, p: "List[int]"):
    counter = 0
    i = 0
    while i < N:
        if i+1 == p[i]:
            if i+1 < N and i+2 == p[i+1]:
                counter += 1
                i += 2
                continue
            else:
                counter += 1
                i += 1
                continue
        else:
            i += 1
            continue
    print(counter)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, p)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, p: "List[int]"):
    counter = 0
    i = 0
    while i < N:
        if i+1 == p[i]:
            if i+2 == p[i+1]:
                counter += 1
                i += 2
                continue
            else:
                counter += 1
                i += 1
                continue
        else:
            i += 1
            continue
    print(counter)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, p)


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

Fixed submission:
#!/usr/bin/env python3
import sys
INF = float("inf")

sys.setrecursionlimit(10**5)


def yes():
    print("YES")  # type: str


def no():
    print("NO")  # type: str


template = ["dream", "dreamer", "erase", "eraser"]


def dfs(s, i):
    if i == len(s):
        return True
    for t in template:
        if s[i:].startswith(t):
            if dfs(s, i+len(t)):
                return True
    return False


def solve(S: str):
    if dfs(S, 0):
        yes()
    else:
        no()

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
INF = float("inf")


def yes():
    print("YES")  # type: str


def no():
    print("NO")  # type: str


template = ["dream", "dreamer", "erase", "eraser"]


def dfs(s):
    if len(s) == 0:
        return True
    for t in template:
        if s.startswith(t):
            if dfs(s[len(t):]):
                return True
    return False


def solve(S: str):
    if dfs(S):
        yes()
    else:
        no()

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


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

Fixed submission:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
from collections import defaultdict
INF = float("inf")


def yes():
    print("YES")  # type: str


def no():
    print("NO")  # type: str


class UnionFind(object):

    def __init__(self, N):
        self.tree = list(range(N))

    def root(self, i):
        if self.tree[i] == i:
            return i
        else:
            self.tree[i] = self.root(self.tree[i])
            return self.tree[i]

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

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            self.tree[x] = y


def main():

    N, M = map(int, input().split())
    L = [0]*N
    lang_leader = defaultdict(int)
    for i in range(N):
        K, *L[i] = list(map(int, input().split()))
    # 前Nは人
    uf = UnionFind(N+1)
    for i in range(N):
        for l in L[i]:
            if lang_leader[l] == 0:
                lang_leader[l] = i+1
            else:
                uf.unite(i, lang_leader[l]-1)

    # print(uf.tree)
    # 人はすべて同じグループであるか
    flag = True
    for i in range(N):
        if not uf.same(0, i):
            flag = False
            break
    if flag:
        yes()
    else:
        no()

    pass


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def yes():
    print("YES")  # type: str


def no():
    print("NO")  # type: str


class Graph(object):

    def __init__(self, N):
        self.N = N
        self.E = defaultdict(list)

    def add_edge(self, f, t, w=1):
        self.E[f].append((t, w))
        self.E[t].append((f, w))


class UnionFind(object):

    def __init__(self, N):
        self.tree = list(range(N))

    def root(self, i):
        if self.tree[i] == i:
            return i
        else:
            self.tree[i] = self.root(self.tree[i])
            return self.tree[i]

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

    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x != y:
            self.tree[x] = y


def main():

    N, M = map(int, input().split())
    L = [0]*N
    for i in range(N):
        L[i] = list(map(int, input().split()))

    # 前Nは人、後ろMは言語
    uf = UnionFind(N+M)

    for i in range(N):
        for l in L[i]:
            # 人iは言語L[i]と同じグループ
            uf.unite(i, N+l)

    # 人はすべて同じグループであるか
    flag = True
    for i in range(N):
        if not uf.same(0, i):
            flag = False
            break
    if flag:
        yes()
    else:
        no()

    pass


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

Fixed submission:
n = int(input())
a = sorted(list(map(int,input().split())))
am = a[-1]+1
b = [0]*am
for i in a:
    b[i]+=1
    if b[i]==1:
        for j in range(i*2,am,i):
            b[j]=2
print(b.count(1))

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = [0]*100000
ans = 0
a = list(map(int,input().split()))
a.sort()

for i in range(n):
    j = a[i]
    while j<100000:
        if cnt[j]<2:
            cnt[j]+=1
            j+=a[i]
        else:
            break
for i in range(n):
    if cnt[a[i]]<2: ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
cnt = [0]*100001
ans = 0
a = list(map(int,input().split()))
a.sort()

for i in range(n):
    j = a[i]
    while j<100001:
        if cnt[j]<2:
            cnt[j]+=1
            j+=a[i]
        else:
            break
for i in range(n):
    if cnt[a[i]]<2: ans+=1
print(ans)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()
for i in s:
    print(chr((ord(i)-ord('A')+n)%26+ord('A')),end="")

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
for i in s:
    print((i-'A'+n)%26+'A')
Problem p03106 (python)

Fixed submission:
a,b,k = map(int,input().split())
ans = [1]
for i in range(2,min(a,b)+1):
    if a%i==0 and b%i==0:
        ans.append(i)
ans.sort(reverse = True)
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
ans = [1]
for i in range(2,min(a,b)):
    if a%i==0 and b%i==0:
        ans.append(i)
ans.sort(reverse = True)
print(ans[k-1])

Buggy submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
ans = [1]
for i in range(2,max(a,b)):
    if a%i==0 and b%i==0:
        ans.append(i)
ans.sort(reverse = True)
print(ans[k-1])
Problem p03293 (python)

Fixed submission:
n=input()
m=input()
n*=2
if m in n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab
Problem p03325 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
g = 0
for i in a:
    while i%2==0:
        g+=1
        i/=2
print(g)

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
int main(void){
    int n,i;
    scanf("%d",&n);
    long long a[n],ans=0;
    for(i=0;i<n;i++){
        scanf("%lld",&a[i]);
    }
    for(i=0;i<n;i++){
        while(a[i]%2==0){
            a[i]+=a[i]/2;
            ans++;
        }
    }
    printf("%lld",ans);
    return 0;
}
Problem p03387 (python)

Fixed submission:
a = list(map(int,input().split()))
a.sort()
if (a[2]-a[1])%2==0 and (a[2]-a[0])%2==0:
    print((a[2]-a[1])//2+(a[2]-a[0])//2)
elif (a[2]-a[1])%2==1 and (a[2]-a[0])%2==1:
    print((a[2]-a[1])//2+(a[2]-a[0])//2+1)
else:
    print((a[2]-a[1])//2+(a[2]-a[0])//2+2)

Buggy submission (verdict: Runtime Error):
n = int(input())
x = list(map(int,input().split()))
y = sorted(x)
m1,m2 = y[n//2-1],y[n//2]
for i in x:
    if i<=m1: print(m2)
    else: print(m1)
Problem p03796 (python)

Fixed submission:
import math

n = int(input())
print(math.factorial(n) % (10**9+7))

Buggy submission (verdict: Runtime Error):
import math

n = int(input())
actorial(n) % (10**9+7))
Problem p04043 (python)

Fixed submission:
a = list(map(int,input().split()))
if sum(a)%17==0 and a.count(5)==2:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
int main(void){
    // Your code here!
    int a,b,c;
    int i,cnt=0;
    scanf("%d%d%d",&a,&b,&c);
    if(a==5) cnt+=1;
    if(b==5) cnt+=1;
    if(c==5) cnt+=1;
    if(a+b+c==17 && cnt==2)
        printf("YES\n");
    else
        printf("NO\n");
}
Problem p04044 (python)

Fixed submission:
n,l = map(int,input().split())
a = []
for i in range(n):
    a.append(input())
a.sort()
for i in a:
    print(i,end="")
print()

Buggy submission (verdict: Runtime Error):
#include <stdio.h>
#include <string.h>
int main(void){
    // Your code here!
    char s[110][110],tmp[110];
    int l,n,i,j;
    scanf("%d%d",&n,&l);
    for(i=0;i<n;i++){
        scanf("%s",s[i]);
    }
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            if(strcmp(s[i],s[j])>=1){
                strcpy(tmp,s[i]);
                strcpy(s[i],s[j]);
                strcpy(s[j],tmp);
            }
        }
    }
    for(i=0;i<n;i++){
        printf("%s",s[i]);
    }
    printf("\n");
}
Problem p02909 (python)

Fixed submission:
s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Buggy submission (verdict: Runtime Error):
s = string(input())
if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Problem p02921 (python)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(3):
  if s[i] == t[i]:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
for i in range(3):
  if s[i] == t[i]:
    ans++
print(ans)
Problem p02582 (python)

Fixed submission:
a = input()

if a == "RSR":
    print(1)
else :
    print(a.count("R"))

Buggy submission (verdict: Runtime Error):
text = input()
if text == "RRS":
    print(2)
elif text == "SSS":
    print(0)
else text == "RSR":
    print(1)
Problem p02657 (python)

Fixed submission:
# 169a
# A*Bを整数として出力せよ

# ①入力をプログラムでとらえるように受け取る
a, b = map(int, input().split())
# print(a, b)

# ②受け取った入力値を適切に出力
answer = a * b

# ③結果出力
print(answer)

Buggy submission (verdict: Runtime Error):
# 169a
# A*Bを整数として出力せよ

# ①入力をプログラムでとらえるように受け取る
a, b = map(int, input(),split())
# print(a, b)

# ②受け取った入力値を適切に出力
answer = a * b

# ③結果出力
print(answer)
Problem p03351 (python)

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

AB = abs(a - b)
BC = abs(b - c)
AC = abs(a - c)

if AC <= d:
    print("Yes")
elif AB <= d and BC <= d:
    print("Yes")
else:
    print("No")

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

AB = abs(a - b)
BC = abs(b - c)
AC = abs(a - c)

if AC <= d or ( AB <= d and BC <= d:):
    print("Yes")
else:
    print("No")
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
n = (a * b) % 2
if n == 0:
    print("Even")
else:
    print("Odd")
Problem p03573 (python)

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

if a == b:
    print(c)
elif b == c:
    print(a)
else:
    print(b)

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

print(a ^ b ^ c)
Problem p03610 (python)

Fixed submission:
s = input()

s_odd = []
for i in range(0, len(s)):
    if i % 2 == 0:
        s_odd.append(s[i])

print("".join(s_odd))

Buggy submission (verdict: Runtime Error):
s = input()
snum = len(s)
harf_snum = snum // 2

s_odd = []
for i in range(harf_snum + 1):
    s_odd.append(s[i * 2])
print("".join(s_odd))
Problem p03852 (python)

Fixed submission:
c = input()

if c == "a" or c == "e" or c == "i" or c == "o" or c == "u":
    print("vowel")
else:
    print("consonant")

Buggy submission (verdict: Runtime Error):
if c in "aiueo":
    print("vowel")
else:
    print("consonant")