Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, M_a: int, M_b: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    M = (max(a+b)+1)*N
    DP = [[INF]*(M) for _ in range(M)]
    for aa, bb, cc in zip(a, b, c):
        DP_next = [DP[i][:] for i in range(M)]
        DP_next[aa][bb] = min(cc, DP_next[aa][bb])
        for i in range(1, M):
            for j in range(1, M):
                if i+aa < M and j + bb < M and DP[i][j] > 0:
                    DP_next[i+aa][j+bb] = min(DP[i][j]+cc, DP_next[i+aa][j+bb])
        DP = DP_next

    m = INF
    for i in range(1, M//M_a):
        anum = M_a*i
        bnum = M_b*i
        if anum >= M or bnum >= M:
            break
        if DP[anum][bnum] != 0:
            if m > DP[anum][bnum]:
                m = DP[anum][bnum]
    if m == INF:
        print(-1)
    else:
        print(m)
    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
    M_a = int(next(tokens))  # type: int
    M_b = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M_a, M_b, a, b, c)


if __name__ == '__main__':
    main()


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


def solve(N: int, M_a: int, M_b: int, a: "List[int]", b: "List[int]", c: "List[int]"):
    M = (max(a+b)+1)*N
    DP = [[INF]*(M) for _ in range(M)]
    for aa, bb, cc in zip(a, b, c):
        DP_next = [DP[i][:] for i in range(M)]
        DP_next[aa][bb] = min(cc, DP_next[aa][bb])
        for i in range(1, M):
            if M <= i + aa:
                break
            for j in range(1, M):
                if M <= j+bb:
                    break
                DP_next[i+aa][j+bb] = min(DP[i][j]+cc, DP_next[i+aa][j+bb])
        DP = DP_next

    m = INF
    for i in range(1, M//M_a):
        anum = M_a*i
        bnum = M_b*i
        if anum >= M or bnum >= M:
            break
        m = min(DP[anum][bnum], m)
    if m == INF:
        print(-1)
    else:
        print(m)
    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
    M_a = int(next(tokens))  # type: int
    M_b = int(next(tokens))  # type: int
    a = [int()] * (N)  # type: "List[int]"
    b = [int()] * (N)  # type: "List[int]"
    c = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        a[i] = int(next(tokens))
        b[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(N, M_a, M_b, a, b, c)


if __name__ == '__main__':
    main()
Buggy python 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()


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 python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(N: int, T: "List[int]", A: "List[int]"):

    a0, a1 = T[0], A[0]
    for t, a in zip(T, A):
        while a0*a != a1*t:
            if a0/a1 - t/a > 0:
                a1 += 1
            else:
                a0 += 1
        # print(a0, a1)
    print(a0+a1)
    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
    T = [int()] * (N)  # type: "List[int]"
    A = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        T[i] = int(next(tokens))
        A[i] = int(next(tokens))
    solve(N, T, A)


if __name__ == '__main__':
    main()


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


def main():
    # i回目 Ti : Ai
    N = int(input())
    T, A = [], []
    for i in range(N):
        t, a = map(int, input().split())
        T.append(t)
        A.append(a)

    num = [0, 0]
    for i, (t, a) in enumerate(zip(T, A)):
        # print(i, t, a, num)
        while True:
            if num[0] <= t and num[1] <= a:
                break
            if num[0] <= t:
                # print("B", t, a, num)
                c = -(-num[1]//a)
                a *= c
                t *= c
                continue
            if num[1] <= a:
                # print("C", t, a, num)
                c = -(-num[0]//t)
                199, 17
                a *= c
                t *= c
                continue
            c = max(-(-num[0]//t), -(-num[1]//a))
            # print("D", t, a, num, c)
            a *= c
            t *= c
            continue
        num[0] = t
        num[1] = a
        # print(a, t)
    print(num[0]+num[1])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n,d = map(int,input().split())
ans = 0
for i in range(n):
    if x*x+y*y <= d*d: ans+=1
print(ans)

Fixed submission:
n,d = map(int,input().split())
ans = 0
for i in range(n):
    x,y = map(int,input().split())
    if x*x+y*y <= d*d: ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = [0]*(max(a)+1)
ans = 0
for i in a:
    for j in range(i,max(a)+1,i):
        b[j]+=1
for i in a:
    if b[i]==1: ans+=1
print(ans)

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 python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = [0]*(max(a)+1)
ans = 0
for i in a:
    for j in range(i,max(a)+1,i):
        b[j]+=1
for i in a:
    if b[i]==1: ans+=1
print(ans)

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 python 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)

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 python 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)

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 python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
s = 1
for i in range(n):
    s*=a[i]
if s>10**18: print(-1)
else: print(s)



Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
if(a[0]==0): print(0)
else:
    s = 1
    for i in range(n):
        s*=a[i]
        if s>10**18:
            print(-1)
            break
    else: print(s)
Buggy python submission (verdict: Runtime Error):
#include <stdio.h>
int main(void){
    long k,n,i,max=-1,a[200000];
    scanf("%ld%ld",&k,&n);
    for(i=0;i<n;i++) scanf("%ld",&a[i]);
    for(i=0;i<n-1;i++){
        int tmp=a[i+1]-a[i];
        if(tmp>max) max=tmp;
    }
    printf("%ld",k-max);
    return 0;
}

Fixed submission:
k,n = map(int,input().split())
a = list(map(int,input().split()))
m = a[0]+k-a[n-1]
for i in range(n-1):
    m = max(m,a[i+1]-a[i])
print(k-m)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

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

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

Fixed submission:
# coding: utf-8
# Your code here!

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

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

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!

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

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

Fixed submission:
# coding: utf-8
# Your code here!

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

a,b = map(int,input().split())
print(lcm(a, b))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a+b+c<=21:
  print("win")
else:
  prnt("bust")
  

Fixed submission:
a,b,c = map(int,input().split())
if a+b+c<=21:
  print("win")
else:
  print("bust")
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
for i in s:
    print((i-'A'+n)%26+'A')

Fixed submission:
n = int(input())
s = input()
for i in s:
    print(chr((ord(i)-ord('A')+n)%26+ord('A')),end="")
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]+=i+1
print(*b)

Fixed submission:
import math

n=int(input())
print(math.ceil(n/2)/n)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(1,n+1):
  for j in range(n):
    if i==a[j]:
      b.append(j+1)
      break
print(*b)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]+=i+1
print(*b)
Buggy python submission (verdict: Runtime Error):
a=int(input())
s=input()
if a>=3200: print(s)
else print("red")

Fixed submission:
n = int(input())
s = input()
if n>=3200:
    print(s)
else:
    print("red")
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
l,r = [],[]
for i in range(m):
    x,y = map(int,input().split())
    l.append(x)
    r.append(y)
cnt = 0
for i in range(1,n+1):
    for j in range(m):
        if l[j]>i or r[j]<i:
            break
    else:
        cnt+=1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
l,r = [],[]
for i in range(m):
    x,y = map(int,input().split())
    l.append(x)
    r.append(y)
print(max(0,min(r)-max(l)+1))
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t = False
a = list(map(int,input().split()))
a.sort()
b = []
for i in range(m):
    b.append(list(map(int,input().split())))
b = sorted(b, key=lambda x: x[1],reverse=True)
cnt = 0
for i in range(m):
    for j in range(b[i][0]):
        if b[i][1]<a[cnt]:
            t = True
            break
        a[cnt] = b[i][1]
        cnt+=1
    if t==True:
        break
print(sum(a))
    

Fixed submission:
n,m = map(int,input().split())
t = False
a = list(map(int,input().split()))
a.sort()
b = []
for i in range(m):
    b.append(list(map(int,input().split())))
b = sorted(b, key=lambda x: x[1],reverse=True)
cnt = 0
for i in range(m):
    for j in range(b[i][0]):
        if cnt > n-1 or b[i][1]<a[cnt]:
            t = True
            break
        a[cnt] = b[i][1]
        cnt+=1
    if t==True:
        break
print(sum(a))
Buggy python submission (verdict: Time Limit Exceeded):
import fractions
import itertools
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

n = int(input())
tup = tuple(map(int,input().split()))
max = 0
for i in tuple(itertools.combinations(tup,n-1)):
    l = gcd(*i)
    if max<l:
        max = l
        num = i
print(max)

Fixed submission:
from fractions import gcd

n = int(input())
a = list(map(int,input().split()))
left = [0]*n
right = [0]*n
for i in range(1,n):
    left[i] = gcd(left[i-1],a[i-1])
    right[-1-i] = gcd(right[-i],a[-i])
gcds = []
for i in range(n):
    gcds.append(gcd(left[i],right[i]))
print(max(gcds))
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = list(input())
a = [0]*n
l=1
while l<n:
    if s[l-1]=="A" and s[l]=="C":
        a[l-1]=1
        l+=2
    else:
        a[l-1]=0
        l+=1
for i in range(q):
    x,y=map(int,input().split())
    print(sum(a[x-1:y-1]))

Fixed submission:
n,q = map(int,input().split())
s = list(input())
a = [0]*n
c = 0
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        c+=1
    a[i]=c
for i in range(q):
    l,r = map(int,input().split())
    print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
for i in range(q):
    x,y = map(int,input().split())
    print(s[x-1:y].count("AC"))

Fixed submission:
n,q = map(int,input().split())
s = list(input())
a = [0]*n
c = 0
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        c+=1
    a[i]=c
for i in range(q):
    l,r = map(int,input().split())
    print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
for i in range(q):
    x,y=map(int,input().split())
    ans = 0
    for l in range(x,y):
        if s[l-1]=="A" and s[l]=="C": ans+=1
    print(ans)

Fixed submission:
n,q = map(int,input().split())
s = list(input())
a = [0]*n
c = 0
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        c+=1
    a[i]=c
for i in range(q):
    l,r = map(int,input().split())
    print(a[r-1]-a[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
for i in range(q):
    x,y = map(int,input().split())
    a = s[x-1:y]
    print(a.count("AC"))

Fixed submission:
n,q = map(int,input().split())
s = list(input())
a = [0]*n
c = 0
for i in range(1,n):
    if s[i-1]=="A" and s[i]=="C":
        c+=1
    a[i]=c
for i in range(q):
    l,r = map(int,input().split())
    print(a[r-1]-a[l-1])
Buggy python 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])

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 python 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])

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 python submission (verdict: Time Limit Exceeded):
s = list(input())
i,cnt = 1,0
while i!=len(s) and len(s)!=0:
    if s[i-1] != s[i]:
        del s[i]
        del s[i-1]
        i = 1
        cnt += 1
    else:
        i += 1
print(cnt*2)

Fixed submission:
s = list(input())
n_1 = s.count('1')
n_0 = s.count('0')
print(min(n_0,n_1)*2)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
enemy = list(set(map(int,input().split())))
if len(enemy)==1:
    print(enemy[0])
else:
    enemy.sort()
    min_n = 10**10
    for i in range(len(enemy)-1):
        min_n = min(min_n,math.gcd(enemy[i],enemy[i+1]))
    print(min_n)

Fixed submission:
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

n = int(input())
enemy = list(set(map(int,input().split())))
if len(enemy)==1:
    print(enemy[0])
else:
    enemy.sort()
    min_n = 10**10
    for i in range(len(enemy)-1):
        min_n = min(min_n,gcd(enemy[i],enemy[i+1]))
    print(min_n)

Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
enemy = list(set(map(int,input().split())))
if len(enemy)==1:
    print(enemy[0])
else:
    enemy.sort()
    min_n = 10**10
    for i in range(n-1):
        min_n = min(min_n,math.gcd(enemy[i],enemy[i+1]))
    print(min_n)

Fixed submission:
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

n = int(input())
enemy = list(set(map(int,input().split())))
if len(enemy)==1:
    print(enemy[0])
else:
    enemy.sort()
    min_n = 10**10
    for i in range(len(enemy)-1):
        min_n = min(min_n,gcd(enemy[i],enemy[i+1]))
    print(min_n)
Buggy python submission (verdict: Runtime Error):
aaaaaaaaaaaaaaab
aaaaaaaaaaaaaaab

Fixed submission:
n=input()
m=input()
n*=2
if m in n:
    print("Yes")
else:
    print("No")
Buggy python 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;
}

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 python 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)

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 python submission (verdict: Runtime Error):
import math

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

Fixed submission:
import math

n = int(input())
print(math.factorial(n) % (10**9+7))
Buggy python 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");
}


Fixed submission:
a = list(map(int,input().split()))
if sum(a)%17==0 and a.count(5)==2:
    print("YES")
else:
    print("NO")
Buggy python 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");
}

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 python submission (verdict: Runtime Error):
s = string(input())
if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")

Fixed submission:
s = input()

if s == "Sunny":
  print("Cloudy")
elif s == "Cloudy":
  print("Rainy")
else:
  print("Sunny")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ans = 0
for i in range(3):
  if s[i] == t[i]:
    ans++
print(ans)

Fixed submission:
s = input()
t = input()
ans = 0
for i in range(3):
  if s[i] == t[i]:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
s = input()
if a < 3200:
  print("red")
else:
  print(s)

Fixed submission:
a = int(input())
s = input()
if a < 3200:
  print("red")
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
text = input()
if text == "RRS":
    print(2)
elif text == "SSS":
    print(0)
else text == "RSR":
    print(1)

Fixed submission:
a = input()

if a == "RSR":
    print(1)
else :
    print(a.count("R"))
Buggy python submission (verdict: Runtime Error):
# 169a
# A*Bを整数として出力せよ

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

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

# ③結果出力
print(answer)

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

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

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

# ③結果出力
print(answer)
Buggy python submission (verdict: Runtime Error):
n = int(input())

if n < 1000:
    input('ABC')
else:
    input('ABD')

Fixed submission:
n = int(input())

if n < 1000:
    print("ABC")
else:
    print("ABD")

Buggy python submission (verdict: Runtime Error):
n = int(input())

if n < 1000:
    input("ABC")
else:
    input("ABD")


Fixed submission:
n = int(input())

if n < 1000:
    print("ABC")
else:
    print("ABD")

Buggy python submission (verdict: Runtime Error):
n = int(input())

if 1 <= n <= 999:
   input("ABC")
else:
    input("ABD")

Fixed submission:
n = int(input())

if n < 1000:
    print("ABC")
else:
    print("ABD")
Buggy python 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")


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 python submission (verdict: Runtime Error):
n = (a * b) % 2
if n == 0:
    print("Even")
else:
    print("Odd")

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

print(a ^ b ^ c)


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

if a == b:
    print(c)
elif b == c:
    print(a)
else:
    print(b)
Buggy python 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))


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 python submission (verdict: Runtime Error):
if c in "aiueo":
    print("vowel")
else:
    print("consonant")

Fixed submission:
c = input()

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