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

Fixed submission:
from collections import Counter
n = int(input())
Slist = [Counter(list(input())) for _ in range(n)]
ans = []
for i in range(ord("a"), ord("a") + 26):
    searching_alpha = chr(i)
    min_num = 10**9
    for S in Slist:
        min_num = min(min_num, S[searching_alpha])
    ans.append(searching_alpha * min_num)
print("".join(ans))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict, Counter
def f():
    return 10**9
d = defaultdict(f)
n = int(input())
for _ in range(N):
    S = Counter(input())
    for k, v in S.items():
        d[k] = min(d[k], v)
ans = ""
for k, v in d.items():
    ans += k * v
print(ans)
Problem p04012 (python)

Fixed submission:
w = list(input())
counter = 0
for _ in w:
    if w.count(_)%2 == 0:
        counter += 1
    else:
        print("No")
        break
    if counter == len(w):
        print("Yes")

Buggy submission (verdict: Runtime Error):
//https://atcoder.jp/contests/abc044/tasks/abc044_b
//044-BをC++でといてみる
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;

int main(void){
    string w; cin >> w;
    map<char,int> mp;
    int i;
    for (i = 0; i < w.size(); i++){
        mp[w[i]] += 1;
    }

    for (pair<char,int> x :mp){
        if (x.second%2 != 0){
            cout << "No" << endl; return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}
Problem p04030 (python)

Fixed submission:
s = list(input())
ans = []
for char in s:
    if char == "B":
        if ans:
            ans.pop(-1)
        else:
            pass
    else:
        ans.append(char)

print("".join(ans))

Buggy submission (verdict: Runtime Error):
s = input()
ans = []
for c in s:
    if c == "0":
        ans.append("0")
    if c == "1":
        ans.append("1")
    if c == "B":
        ans.pop(-1)
print("".join(ans))
Problem p04047 (python)

Fixed submission:
N = int(input())
Llist = sorted(list(map(int, input().split())))[::-1]
ans = 0
for i in range(0, 2*N, 2):
    ans += min(Llist[i], Llist[i+1])
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
Llist = sorted(list(map(int, input().split())))[::-1]
ans = 0
for i in range(0, 2*N):
    ans += min(Llist[i], Llist[i+1])
print(ans)
Problem p03632 (python)

Fixed submission:
a=list(map(int,input().split()))
n=min(a[1],a[3])-max(a[0],a[2])
print(n if n>0 else 0)

Buggy submission (verdict: Runtime Error):
a[]=list(map(int,input().split()))
n=min(a[1],a[3])-max(a[0],a[2])
print(n if n>0 else 0)
Problem p03633 (python)

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

n=int(input())
p=1
for i in range(n):
  m=int(input())
  p=p*m//gcd(p,m)
print(int(p))

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a % b)   

n=int(input())
p=1
for i in range(n):
  m=int(input())
  p=p*m/gcd(p,m)
print(p)
Problem p02768 (python)

Fixed submission:
M = pow(10, 9) + 7

def pow_mod(a, n, m): # (a^n) % m
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % m
        a = (a * a) % m
        n = n // 2
    return res

def combi_mod(p, q, m):
    numerator, denominator = 1, 1
    for i in range(1, q+1):
        numerator *= (p - i + 1)
        numerator %= m
        denominator *= i
        denominator %= m
    return numerator * pow_mod(denominator, m-2, m) % m

n, a, b = list(map(int, input().split()))
res = pow_mod(2, n, M) - 1
res -=combi_mod(n, a, M)
if res < 0:
    res += M
res -= combi_mod(n, b, M)
if res < 0:
    res += M
print(res)

Buggy submission (verdict: Runtime Error):
def pow_mod(a, n, m): # (a^n) % m
    res = 1
    while n > 0:
        if n % 2 == 1:
            res = (res * a) % m
        a = (a * a) % m
        n = n // 2
    return res

def combi_mod(p, q, m):
    numerator, denominator = 1, 1
    for i in range(1, q+1):
        numerator *= (p - i + 1)
        numerator %= m
        denominator *= i
        denominator %= m
    return numerator * pow_mod(denominator, m-2, m) % m

n, a, b = list(map(int, input().split()))
res = pow_mod(2, n, M) - 1
res -=combi_mod(n, a, M)
if res < 0:
    res += M
res -= combi_mod(n, b, M)
if res < 0:
    res += M
print(res)
Problem p02995 (python)

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

A, B, C, D = list(map(int, input().split()))
lcm = int(C * D / gcd(C, D))

num_lesser_than_A_non_dividable_by_C = (A - 1) - (A - 1) // C
num_lesser_than_A_non_dividable_by_D = (A - 1) - (A - 1) // D
num_lesser_than_A_non_dividable_by_C_or_D = (A - 1) - (A - 1) // lcm
num_lesser_than_A_dividable_by_C_nor_D = num_lesser_than_A_non_dividable_by_C + num_lesser_than_A_non_dividable_by_D - num_lesser_than_A_non_dividable_by_C_or_D
num_not_larger_than_than_B_non_dividable_by_C = B - B // C
num_not_larger_than_than_B_non_dividable_by_D = B - B // D
num_not_larger_than_than_B_non_dividable_by_C_or_D = B - B // lcm
num_not_larger_than_than_B_dividable_by_C_nor_D = num_not_larger_than_than_B_non_dividable_by_C + num_not_larger_than_than_B_non_dividable_by_D - num_not_larger_than_than_B_non_dividable_by_C_or_D
print(num_not_larger_than_than_B_dividable_by_C_nor_D - num_lesser_than_A_dividable_by_C_nor_D)

Buggy submission (verdict: Runtime Error):
import math

A, B, C, D = list(map(int, input().split()))
lcm = int(C * D /math.gcd(C, D))

num_lesser_than_A_non_dividable_by_C = (A - 1) - (A - 1) // C
num_lesser_than_A_non_dividable_by_D = (A - 1) - (A - 1) // D
num_lesser_than_A_non_dividable_by_C_or_D = (A - 1) - (A - 1) // lcm
num_lesser_than_A_dividable_by_C_nor_D = num_lesser_than_A_non_dividable_by_C + num_lesser_than_A_non_dividable_by_D - num_lesser_than_A_non_dividable_by_C_or_D
num_not_larger_than_than_B_non_dividable_by_C = B - B // C
num_not_larger_than_than_B_non_dividable_by_D = B - B // D
num_not_larger_than_than_B_non_dividable_by_C_or_D = B - B // lcm
num_not_larger_than_than_B_dividable_by_C_nor_D = num_not_larger_than_than_B_non_dividable_by_C + num_not_larger_than_than_B_non_dividable_by_D - num_not_larger_than_than_B_non_dividable_by_C_or_D
print(num_not_larger_than_than_B_dividable_by_C_nor_D - num_lesser_than_A_dividable_by_C_nor_D)
Problem p03160 (python)

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

dp = [0] * N

dp[0] = 0
dp[1] = abs(H[1] - H[0])
for i in range(2, N):
    dp[i] = min([
        dp[i-1] + abs(H[i] - H[i-1]),
        dp[i-2] + abs(H[i] - H[i-2]),
    ])
    
print(dp[-1])

Buggy submission (verdict: Runtime Error):
dp = [0] * N

dp[0] = 0
dp[1] = abs(H[1] - H[0])
for i in range(2, N):
    dp[i] = min([
        dp[i-1] + abs(H[i] - H[i-1]),
        dp[i-2] + abs(H[i] - H[i-2]),
    ])
    
print(dp[-1])
Problem p03243 (python)

Fixed submission:
n = int(input())
prospects = [111*i for i in range(1, 10)]

for p in prospects:
    if p < n:
        continue
    if p >= n:
        print(p)
        break

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

for p in prospects:
    if p < n:
        continue
    if p >= n:
        print(p)
        break
Problem p03260 (python)

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

if m % 2 == 1:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):

def gcd(a, b):
    if a < 0:
        a = -a
    if b < 0:
        b = -b
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 

def reduce(function, iterable, initializer=None):
    it = iter(iterable)
    if initializer is None:
        value = next(it)
    else:
        value = initializer
    for element in it:
        value = function(value, element)
    return value

def gcd_list(ls):
    return reduce(gcd, ls)

N, X = list(map(int, input().split()))
xs = list(map(int, input().split()))
ys = [x - X for x in xs]

print(gcd_list(ys))
Problem p02681 (python)

Fixed submission:
s= input()
t = input()
flag = True

for i in range(len(s)):
  if s[i] != t[i]:
    flag = False
    
print(['No', 'Yes'][flag])

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

def main():
    n, k = map(int, input().split())
    nlis = list(map(int, input().split()))

    tmp = 1
    tl = []
    tl_a = tl.append

    if k < n:
        for i in range(k):
            tmp = nlis[tmp - 1]
        print(tmp)
    else:
        for i in range(n):
            if not nlis[tmp - 1] in tl:
                tl_a(nlis[tmp - 1])
                tmp = nlis[tmp - 1]
            else:
                tl = tl[tl.index(nlis[tmp - 1]):]
                print(tl[((k - i) % len(tl)) - 1])
                break

if __name__ == "__main__":
    main()

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

def main():
    n, k = map(int, input().split())
    nlis = list(map(int, input().split()))

    tmp = 1
    tl = []
    tl_a = tl.append

    if k < n:
        for i in range(k):
            tmp = nlis[tmp - 1]
        print(tmp)
    else:
        for i in range(n):
            if not nlis[tmp - 1] in tl:
                tl_a(nlis[tmp - 1])
                tmp = nlis[tmp - 1]
            else:
                tl = tl[tl.index(nlis[tmp - 1]):]
                print(tl[((k - i) % len(tl)) - 1])
                break

if __name__ == "__main__":
    main()
Problem p02690 (python)

Fixed submission:
import math
X = int(input())
res = False
for A in range(1,1000):
    for B in range(-1000, A):
        if math.pow(A, 5) - math.pow(B, 5) == X:
            res = True
            break

    if res:
        break

print(A, B)

Buggy submission (verdict: Runtime Error):
import math
X = int(input())
res = False
for A in range(1,1000):
    for B in range(-1000, A):
        if math.pow(A, 5) - math.pow(B, 5) == X:
            res = Trueå
            break

    if res:
        break

print(A, B)
Problem p02814 (python)

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

def main():
    _, m = map(int, input().split())
    a = list(map(int, input().split()))

    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
        if i == 1:
            if (int(x / a[0]) % 2 == 0) or (int(x / a[i]) % 2 == 0):
                print(0)
                return
        else:
            if (int(x / a[i]) % 2 == 0):
                print(0)
                return

    print(int((int(m * 2 / x) + 1) / 2))

if __name__ == '__main__':
    main()

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

def lcm(a):
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

def main():
    _, m = map(int, input().split())
    a = list(map(int, input().split()))

    mlcm = lcm(a)

    for i in a:
        if (int(mlcm / i) % 2 == 0):
            print(0)
            return

    print(int((int(m * 2 / mlcm) + 1) / 2))

if __name__ == '__main__':
    main()

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd (a, b)

mlcm = 1
for i in a:
    mlcm = lcm(mlcm, i)

for i in a:
    if (int(mlcm / i) % 2 == 0):
        print(0)
        exit(0)

print(int((int(m * 2 / mlcm) + 1) / 2))
Problem p03035 (python)

Fixed submission:
a, b = map(int, input().split())
 
if a <= 5:
  print(0)
elif a <= 12:
  print(int(b / 2))
else:
  print(b)

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

if a =< 5:
  print(0)
elif a <= 12:
  print(int(b / 2))
else:
  print(b)
Problem p03059 (python)

Fixed submission:
A, B, T = map(int, input().split())
print(int(T / A) * B)

Buggy submission (verdict: Runtime Error):
from fractions import gcd
n = int(input())
li = list(map(int, input().split()))
lil = [0]*n
lir = [0]*n
for k in range(n):
  if k == 0:
    lil[k] = li[0]
    lir[k] = li[-1]
  else:
    lil[k] = gcd(lil[k-1], li[k])
    lir[k] = gcd(lir[k-1], li[-k-1])
    
lir = lir[::-1]
tmp = max(gcd(lil[j-1], lir[j+1]) for j in range(1, n-1))
print(max(tmp, lir[1], lil[-2]))
Problem p03102 (python)

Fixed submission:
import numpy as np
 
n, m, c = map(int, input().split())
 
b = list(map(int, input().split()))
num = 0
 
for i in range(n):
  A = list(map(int, input().split()))
  npb = np.array(b)
  npA = np.array(A)
  if np.dot(npA.T, npb) + c > 0:
    num += 1
    
print(num)

Buggy submission (verdict: Runtime Error):
import numpy as np
 
n, m, c = map(int, input().split())
 
mp = np.zeros((w, h))
b = list(map(int, input().split()))
num = 0
 
for i in range(n):
  A = list(map(int, input().split()))
  npb = np.array(b)
  npA = np.array(A)
  if np.dot(npA.T, npb) + c > 0:
    num += 1
    
print(num)

Buggy submission (verdict: Runtime Error):
import numpy as np

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

mp = np.zeros((w, h))
b = list(map(int, input().split()))
num = 0

for i in range(n):
  A = list(map(int, input().split()))
  npb = np.array(b)
  npA = np.array(A)
  if np.dot(npA.T, npb) + c > 0:
    num++
    
print(num)
Problem p03110 (python)

Fixed submission:
N = int(input())
res = 0
for i in range(N):
  x, y = input().split()
  if y == 'JPY':
    res += int(x)
  else:
    res += float(x) * 380000
    
print(res)

Buggy submission (verdict: Runtime Error):
N = int(input())
res = 0
for i in range(N):
  x, y = input().split()
  if y == 'JPY':
    res += int(x)
  else:
    res += int(x) * 380000
    
print(res)
Problem p03433 (python)

Fixed submission:
a = int(input())
b = int(input())
print(['No', 'Yes'][(a % 500) <= b])

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

print(['No', 'Yes'][(b % 500) <= a]
Problem p02845 (python)

Fixed submission:
MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))
C = [0] * 100001
C[0] = 3
答 = 1
for x in A:
  答 *= C[x]
  答 %= MOD
  C[x] -= 1
  C[x+1] += 1
print(答)

Buggy submission (verdict: Runtime Error):
MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))
C = [0] * 100000
C[0] = 3
答 = 1
for x in A:
  答 *= C[x]
  答 %= MOD
  C[x] -= 1
  C[x+1] += 1
print(答)
Problem p02696 (python)

Fixed submission:
import math
a, b, n = map(int, input().split())
if n < b:
    print(math.floor((a * n) / b))
else:
    print(math.floor(a * (b - 1) / b) - a * math.floor((b - 1) / b))

Buggy submission (verdict: Runtime Error):
import math
a, b, n = map(int, input().split())
if n < b:
    print(math.floor((a * n) / b))
else:
    print(math.floor((a * n) / (b - 1)))
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
print(c, a, b)
Problem p02732 (python)

Fixed submission:
import collections
import math

def combinations_count(n, r):
    if n < 2:
        return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n = int(input())
a_list = list(map(int, input().split()))
a_col = collections.Counter(a_list)
c_dic = {}
sm = sum([c * (c - 1) for c in a_col.values()]) // 2
for a in a_list:
    if a in c_dic:
        print(c_dic[a])
    else:
        ans = sm - combinations_count(a_col[a], 2) + combinations_count(a_col[a] - 1, 2)
        print(ans)
        c_dic[a] = ans

Buggy submission (verdict: Runtime Error):
import collections
from scipy.special import comb

n = int(input())
a_list = list(map(int, input().split()))
a_col = collections.Counter(a_list)
c_dic = {}
sm = sum([c * (c - 1) for c in a_col.values()]) // 2

for a in a_list:
    if a in c_dic:
        print(c_dic[a])
    else:
        ans = sm - comb(a_col[a], 2) + comb(a_col[a] - 1, 2)
        print(ans)
        c_dic[a] = ans
Problem p02767 (python)

Fixed submission:
n = int(input())
x_list = list(map(int, input().split()))
ans_list = [sum([(x - p) ** 2 for x in x_list]) for p in range(min(x_list), max(x_list) + 1)]
print(sorted(ans_list)[0])

Buggy submission (verdict: Runtime Error):
n = int(input())
x_list = list(map(int, input().split()))
ans_list = [sum([(x - p) ** 2 for x in x_list]) for p in range(min(x_list), max(x_list)) + 1]
print(sorted(ans_list)[0])
Problem p02786 (python)

Fixed submission:
i = 0
h = int(input())
while 2 ** i <= h:
    i += 1
print(2 ** i - 1)

Buggy submission (verdict: Runtime Error):
h = int(input())
while 2 ** i <= h:
    i += 1
print(2 ** i - 1)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
print("{} {}".format(a - k, b) if a >= k else "{} {}".format(0, max(0, b - (k - a))))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
print(f"{a - k} {b}" if a >= k else f"{0} {b - (k - a)}")

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
print(f"{a - k} {b}" if a >= k else f"0 {b - (k - a)}")
Problem p02887 (python)

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

ans_list = [s[0]]
now_color = s[0]
for i in range(1, n):
    if now_color != s[i]:
        ans_list.append(s[i])
        now_color = s[i]
    # print("s[{}]:{} now_color:{} ans_list:{}".format(i, s[i], now_color, ans_list))

print(len(ans_list))

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

i = 1
nowcolor = s[0]
while(True):
    if nowcolor == s[i]:
        del s[i]
    else:
        nowcolor = s[i]
        i += 1
    if len(s) == i:
        break
print(len(s))
Problem p02953 (python)

Fixed submission:
def main():
    n = int(input())
    h_list = list(map(int, input().split()))
    for i in range(n - 1)[::-1]:
        if h_list[i] == h_list[i + 1] + 1:
            h_list[i] = h_list[i] - 1
        elif h_list[i] > h_list[i + 1] + 1:
            print("No")
            return
    print("Yes")

main()

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

ans = "Yes"
for i in range(n-1):
    if h[i] - h[i + 1] >= 2:
        ans = "No"
        break;
    elif h[i] - h[i + 1] == 1:
        h[i] -= 1

for i in range(n-1):
    if h[i] > h[i + 1]:
        ans = "No" 

print(ans))
Problem p03087 (python)

Fixed submission:
n, q = map(int, input().split())
s_list = list(input())
l_r_list = [list(map(int, input().split())) for _ in range(q)]
c_sum = [0]
su = 0
for i in range(n - 1):
    if s_list[i] == "A" and s_list[i + 1] == "C":
        su += 1
    c_sum.append(su)
for l, r in l_r_list:
    print(c_sum[r - 1] - c_sum[l - 1])

Buggy submission (verdict: Runtime Error):
n, q = map(int, input().split())
s_list = list(input())
l_r_list = [list(map(int, input().split())) for _ in range(q)]
c_sum= [0]
su = 0
for i in range(n):
    if s_list[i] == "A" and s_list[i + 1] == "C":
        su += 1
    c_sum.append(su)
for l, r in l_r_list:
    print(c_sum[r - 1] - c_sum[l - 1])
Problem p03455 (python)

Fixed submission:
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 判定
# 2で割った余りが0の時、Evenと出力
if (a * b)% 2 == 0:
  print('Even')
# 余りが0でないとき、Oddと出力
else:
  print('Odd')

Buggy submission (verdict: Runtime Error):
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 判定
# 2で割った余りが0の時、Evenと出力
if (a * B)% 2 == 0:
  print('Even')
# 余りが0でないとき、Oddと出力
else:
  print('Odd)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split)
if (a * b) % 2 == 0:
  return('Even')
  else:
    return('Odd')
Problem p03110 (python)

Fixed submission:
n=int(input())
c=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":
        c+=float(a)
    else:
        c+=float(a)*380000
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
c=0
for i in range(n):
    a,b=input().split()
    if b=="JPY":
        c+=float(b)
    else:
        c+=float(b)*3800
print(c)
Problem p03220 (python)

Fixed submission:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
num=0
dist=abs(a-(t-h[0]*0.006))
for i in range(1,n):
    if dist>abs(a-(t-h[i]*0.006)):
        num=i
        dist=abs(a-(t-h[i]*0.006))
print(num+1)

Buggy submission (verdict: Runtime Error):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().solit()))
num=0
dist=abs(t-h[0]*0.006)
for i in range(1,n):
    if dist>abs((t-h[i]*0.006)):
        num=i
print(num+1)
Problem p02945 (python)

Fixed submission:
A, B = [int(i) for i in input().split(" ")] 
print(max([A+B, A-B, A*B]))

Buggy submission (verdict: Runtime Error):
a, b = input().split(" ")
print(max([a+b, a-b, a*b]))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(max([a+b, a-b, a*b]))
Problem p02993 (python)

Fixed submission:
li = list(input())
flag = False
for i in range(len(li)):
  if i == 0:
    continue
  flag = li[i-1] == li[i]
  if flag:
    break
print("Bad" if flag else "Good")

Buggy submission (verdict: Runtime Error):
li = list(input())
flag = False
for i in range(li):
  if i == 0:
    continue
  flag = li[i-1] == li[i]
  if flag:
    break
print("Bad" if flag else "Good")
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
times = H / A
if int(times) == times:
    print(int(times))
else:
    print(int(times) + 1)

Buggy submission (verdict: Runtime Error):
N, K= map(int, input().split())
Nli = [int(x) for x in input().split()]
Nli.sort()
if N > K:print(sum(Nli[0:N-K]))
else: print(0)
Problem p03644 (python)

Fixed submission:
A = int(input())
i = 0
while (2 ** i) <= A:
    if 2 ** i == A:
        print(A)
        break
    elif (2 ** i) < A:
        i += 1
        continue
else: print(2 ** (i - 1))

Buggy submission (verdict: Runtime Error):
A = int(input())
i = 0
while (2 ** i) <= A:
    if (2 ** i) = A:
        print(A)
        break
    else:
        i += 1
print(2 ** (i - 1))
Problem p03693 (python)

Fixed submission:
r, g, b = input().split()
rgb = int(r + g + b)
result = rgb % 4

if result == 0:
    print("YES")
else :
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
c = int((a + b) / 2)
print(c) if c == (a + b) else print(c + 1)
Problem p03037 (python)

Fixed submission:
t = input().split()
n = int(t[0])
m = int(t[1])

low = 0
high = n
for i in range(0, m):
  tmp = input().split()
  if int(tmp[0]) > low:
    low = int(tmp[0])
  if int(tmp[1]) < high:
    high = int(tmp[1])

if (high-low)<0:
  num = 0
else:
  num = high-low+1
print(num)

Buggy submission (verdict: Runtime Error):
t = input().split()
n = int(t[0])
m = int(t[1])

low = 0
high = n
for i in range(0, m):
  tmp = input().split()
  if int(tmp[0]) > low:
    low = int(tmp[0])
  if int(tmp[1]) < high:
    high = int(tmp[1])

if high =< low:
  num = 0
else:
  num = high-low+1
print(num)
Problem p03059 (python)

Fixed submission:
data = input().split()
A = int(data[0])
B = int(data[1])
T = int(data[2]) + 0.5
biscuit = 0
time = A
while time < T:
  biscuit += B
  time += A

print(biscuit)

Buggy submission (verdict: Runtime Error):
num =int(input())
value = list(map(int, input().split()))
value.sort()
point = 0
for i in range (0, value[0]):
  cnt = 0
  for j in range(0, num):
    if value[j]%(value[0]-i)!=0:
      cnt += 1
      point = j
  if cnt == 1 or cnt == 0:
    break
print(value[0] - i)

Buggy submission (verdict: Runtime Error):
num =int(input())
value = list(map(int, input().split()))
value.sort()
point = 0
for i in range (0, value[0]):
  cnt = 0
  for j in range(0, num):
    if value[j]%(value[0]-i)!=0:
      cnt += 1
      point = j
  if cnt == 1 or cnt == 0:
    break
print(value[0] - i)