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

Fixed submission:
import re
  
  
def solve(s, t):
    s = s.replace('?', '.')
    ls, lt = len(s), len(t)
    if ls < lt:
        return 'UNRESTORABLE'
    ans = []
    for i in range(ls - lt + 1):
        m = re.match(s[i:i + lt], t)
        if m is None:
            continue
        ans.append((s[:i] + t + s[i + lt:]).replace('.', 'a'))
    if not ans:
        return 'UNRESTORABLE'
    return min(ans)
  
  
s = input().strip()
t = input().strip()
  
print(solve(s, t))

Buggy submission (verdict: Runtime Error):
import re
s = input()
s = s.replace('?', '.')
t = input()
if len(t) > len(s):
  print("UNRESTORABLE")
else:
  r = []
  for i in range(len(s)-len(t)+1):
    m = re.match(s[i:i+len(t)], t)
    if m is None:
      continue
    r.append((s[:i]+t+s[i+len(t):]).replace(".","a"))
  if not r:
    print('UNRESTORABLE')
    quit()
      
print(min(r))

Buggy submission (verdict: Runtime Error):
import re
s = input()
s = s.replace('?', '.')
t = input()
r = []
if len(t) > len(s):
  print("UNRESTORABLE")
else:
  for i in range(len(s)-len(t)+1):
    m = re.match(s[i:i+len(t)], t)
    if m is None:
      continue
    r.append((s[:i]+t+s[i+len(t):]).replace(".","a"))
  if not r:
    print('UNRESTORABLE')
    quit()
      
print(sorted(r)[0])
Problem p03607 (python)

Fixed submission:
from collections import Counter
n = int(input())
l = [int(input()) for _ in range(n)]
c = Counter(l)
ans = 0
for key, value in c.items():
  if value % 2 != 0:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
l = [False]*(10*9)
for i in range(n):
  a = int(input())
  if l[a-1] == False:
    l[a-1] = True
  else:
    l[a-1] =  False
print(l.count(True))
Problem p03679 (python)

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

if a>=b:
  print("delicious")
else:
  if b-a<=x:
    print("safe")
  if a+x+1 <= b:
    print("dangerous")

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

if a>=b:
  print("delicious")
else:
  if x=<b:
    print("safe")
  if a+x+1 <= b:
    print("dangerous")

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

if a-b > 0:
  print("delicious")

if b > x
  print("safe")

if b > x+1:
  print("dangerous")
Problem p03721 (python)

Fixed submission:
N, K = map(int, input().split())
l = sorted([tuple(map(int, input().split()))for _ in range(N)], key=lambda x:x[0])
c = 0
for i in l:
  c += i[1]
  if c >= K:
    print(i[0])
    break

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
s = ""
for _ in range(N):
  a,b = map(int, input().split())
  s += (str(a)+" ")*b
print(sorted(s.split())[K-1])
Problem p03844 (python)

Fixed submission:
i = input().split()
if i[1] == "+":
  print(int(i[0])+int(i[2]))
else:
  print(int(i[0])-int(i[2]))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input(),split())
if str(b) == "+":
  print(a+b)
else:
  print(a-b)
Problem p03845 (python)

Fixed submission:
import copy
N = int(input())
Ts = list(map(int, input().split()))
M = int(input())
for i in range(M):
  P, x = map(int, input().split())
  Ts_2 = copy.copy(Ts) #コピーを行う
  Ts_2[P-1] = x
  print(sum(Ts_2))

Buggy submission (verdict: Runtime Error):
N = int(input())
Ts = list(map(int, input().split()))
M = int(input())
for i in range(M):
  p, x = map(int, input().split())
  print(sum(Ts)-T[p-1]+x)
Problem p03860 (python)

Fixed submission:
a, b, c = map(str, input().split())
B = b[0]
print("A{}C".format(B))

Buggy submission (verdict: Runtime Error):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)
Problem p03962 (python)

Fixed submission:
l = list(map(int, input().split()))
print(len(list(set(l))))

Buggy submission (verdict: Runtime Error):
l = list(map(int, input().split()))
print(len(list(set(l)))
Problem p04033 (python)

Fixed submission:
a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0 and num%2==0:
  print("Positive")
elif b < 0 and num%2!=0:
  print("Negative")
elif a <= 0 and b >= 0:
  print("Zero")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0:
  if num%2 != 0:
    print("Positive")
  else:
  	print("Negative")
elif a < 0 and b > 0:
  if len(abs(a))%2 == 0:
  	print("Positive")
  else:
    print("Negative")
else:
  print("Zero")

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())
num = (b-a)+1
if min(a,b) > 0 or:
  print("Positive")
elif max(a,b) < 0 and num%2!=0:
  print("Positive")
elif max(a,b) < 0 and num%2==0:
  print("Negative")
else:
  print("Zero")

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if min(a,b) > 0:
  print("Positive")
elif max(a,b) < 0:
  print("Negative")
else:
  print("Zero")

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if min(a,b) > 0:
  print("Positive")
elif max(a,b) < 0:
  print("Negative")
else:
  print("Zero")
Problem p04043 (python)

Fixed submission:
A = list(map(int, input().split()))
c_7 = 0
c_5 = 0
for i in A:
  if i == 7:
    c_7 += 1
  if i == 5:
    c_5 += 1
if c_7 == 1 and c_5 == 2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = []
for _ in range(n):
  s.append(input())
s = sorted(s)
print(*s, sep="")

Buggy submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = []
for _ in range(n):
  s.append(input())
s = sorted(s)
r = ""
for i in s:
  r += i
print(r)
Problem p02613 (python)

Fixed submission:
N=int(input())
S=[]
for i in range(0, N):
    val = input()
    S.append(val)
ac=S.count('AC')
wa=S.count('WA')
tle=S.count('TLE')
re=S.count('RE')

print("AC x ", end='') 
print(ac)
print("WA x ", end='') 
print(wa)
print("TLE x ", end='') 
print(tle)
print("RE x ", end='') 
print(re)

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

for i in range(0, N):
  val = input()
  if val:
    S.append(val)
AC=S.count('AC')
WA=S.count('WA')
TLE=S.count('TLE')
RE=S.count('RE')

print("AC x ", end='') 
print(AC)
print("WA x ", end='') 
print(WA)
print("TLE x ", end='') 
print(TLE)
print("RE x ", end='') 
print(RE)
Problem p02690 (python)

Fixed submission:

def factorize(n):
    ## 素因数分解
    # arr = factorize(20)
    # arr == [[2, 2], [5, 1]]
    
    result = []
    tmp = n
    for k in range(2, int(n ** 0.5) + 1):
        cnt = 0
        while tmp % k == 0:
            cnt += 1
            tmp //= k
        if cnt > 0:
            result.append([k, cnt])
    if tmp != 1:
        result.append([tmp, 1])
    return result

def divisorize(n):
    ## 約数
    # arr = factorize(20)
    # arr == [2, 4, 5, 10, 20]
    f = factorize(n)
    divisors = [1]
    for k in range(len(f)):
        num_divisors = len(divisors)
        for i in range(1, f[k][1] + 1):
            for j in range(num_divisors):
                divisors.append(divisors[j] * f[k][0] ** i)
    return sorted(divisors)

x = int(input())
a = 0
d = divisorize(x)
flg = False
while True:
    for dd in d:
        b = a - dd
#         print(a, dd, b)
        try:
            if a ** 5 - b ** 5 == x:
                flg = True
                break
        except:
            pass
    if flg:
        break
    a += 1
print(a, b)

Buggy submission (verdict: Runtime Error):
x = int(input())
amax = int(x ** (1/ 5)) + 1
for a in range(amax + 1):
    b5 = a ** 5 - x
    if b5 < 0:
        c = (-b5) ** (1/5)
        if int(c) == c:
            ans = (a, -int(c))
            break
    else:
        c = (b5) ** (1/5)
        if int(c) == c:
            ans = (a, int(c))
            break

print(ans[0], ans[1])
Problem p02714 (python)

Fixed submission:
# %%time
from collections import Counter, deque
n = int(input())
s = input()


# n = 4000
# np.random.seed(1)
# s = np.random.randint(0, 3, n)
# s = (s)

c = Counter(s)
c = list(c.values())
if len(c) == 3:
    ans = c[0] * c[1] * c[2]
else:
    ans = 0
# print(ans)
if ans > 0:
    for k in range(n):
        for a in range(1, (n - k)//2 + 1):
            if k + 2 * a >= n:
                continue
            x, y,  = s[k], s[k + a]
            
            if x != y:
                z = s[k + 2 * a]
                if y != z:
                    if z != x:
                        ans -= 1

print(ans)

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

from collections import Counter
c = Counter(s)
c = list(c.values())
ans = c[0] * c[1] * c[2]
# print(ans)
for k in range(n):
    for a in range(1, n//2 + 1):
        if k + 2 * a >= n:
            continue
        if (s[k] != s[k+a]) and (s[k+a] != s[k + 2 * a]) and (s[k] != s[k + 2*a]):
            ans -= 1

print(ans)
Problem p02732 (python)

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

from collections import Counter

c = Counter(a)

def comb(x):
    return x * (x - 1) // 2

base = 0
for aa in c.keys():
    x = c[aa]
    base += comb(x)

for aa in a:
    ans = base - comb(c[aa]) + comb(c[aa] - 1)
    print(ans)

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

from collections import Counter

c = Counter(a)

from scipy.special import comb

s = set(c.values())

dic = {}
for ss in s:
    if ss not in dic.keys():
        dic[ss] = comb(ss, 2)
for ss in s:
    ss -= 1
    if ss not in dic.keys():
        dic[ss] = comb(ss, 2)

base = 0
for k in c.keys():
    base += dic[c[k]]

for k in range(len(a)):
    print(int(base - dic[c[a[k]]] + dic[c[a[k]] - 1]))
Problem p02743 (python)

Fixed submission:
from decimal import *
getcontext().prec = 20      # デフォルト28桁のところを20桁にする
def sq(n):
    m = Decimal(n).sqrt()
    return m

import math
a, b, c = list(map(int, input().split()))
# def sq(a):
#     aa = math.sqrt(a)
#     return aa
if (sq(a) + sq(b)) < sq(c):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math
a, b, c = list(map(int, input().split()))
# xのn乗根を得る
def nroot(a, n, x=1.0, eps=1e-7):
    while abs(a - x**n) > eps:
#         print(abs(a - x**n))
        x = ( (n-1)*x + a/(x**(n-1)) ) / n
    return x
def sq(a):
    aa = np.sqrt(a)
    return nroot(a, 2, aa)
if (sq(a) + sq(b)) < sq(c):
    print("Yes")
else:
    print("No")
Problem p02802 (python)

Fixed submission:
n, m = list(map(int, input().split()))
ac_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(n):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))

Buggy submission (verdict: Runtime Error):
n, m = list(map(int, input().split()))
ac_list = [0] * n
wa_list = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        ac_list[p] = 1
    if s == "WA":
        if ac_list[p] == 0:
            wa_list[p] += 1
for k in range(m):
    if ac_list[k] == 0:
        wa_list[k] = 0
print(sum(ac_list), sum(wa_list))
Problem p02994 (python)

Fixed submission:
import numpy as np
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])

Buggy submission (verdict: Runtime Error):
N, L =  list(map(int, input().split()))
r = np.arange(L, N + L)
print(np.sum(r) - r[np.argmin(np.abs(r))])
Problem p02995 (python)

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

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

def lcm(a,b):
    return a*b//gcd(a,b)
x = b//c - (a - 1)//c

y = b//d - (a - 1)//d

cd = lcm(c, d)

z = b//cd - (a - 1)//cd

ans = b - a + 1 - x - y + z
print(ans)

Buggy submission (verdict: Runtime Error):
import math

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

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

x = b//c - (a - 1)//c 

y = b//d - (a - 1)//d

cd = lcm(c, d)

z = b//cd - (a - 1)//cd

ans = b - a + 1 - x - y + z
print(ans)
Problem p02997 (python)

Fixed submission:
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

N, K = list(map(int, input().split()))
k_max = int(cmb(N - 1, 2))

if N == 2:
    if K == 0:
        print(1)
        print(1, 2)
    else:
        print(-1)
elif k_max < K:
    print(-1)
else:
    E = [[v, N] for v in range(1, N)]

    add_need = k_max - K
    if add_need >= 1:
        count = 0
        for i in range(1, N):
            for k in range(i + 1, N):
                E.append([i, k])
                count += 1
        #         print(count)
                if count == add_need:
                    break
            if count == add_need:
                break

    print(len(E))
    for e in E:
        print(e[0], e[1])

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

N, K = list(map(int, input().split()))


k_max = int(comb(N - 1, 2))

if k_max < K:
    print(-1)
else:
    E = [[v, N] for v in range(1, N)]

    add_need = k_max - K

    count = 0
    for i in range(1, N):
        for k in range(i + 1, N):
            E.append([i, k])
            count += 1
    #         print(count)
            if count == add_need:
                break
        if count == add_need:
            break

    print(len(E))
    for e in E:
        print(e[0], e[1])
Problem p03147 (python)

Fixed submission:
import numpy as np
n = int(input())
h = list(map(int, input().split()))

h = np.array(h)


def calc(h, s):
#     print(h, s)
    a = np.min(h)
    s += a
    h = h - a
    ind = np.where(h == 0)[0][0]
    h1 = h[:ind]
    h2 = h[ind+1:]
    if len(h1) != 0:
        s = calc(h1, s)
    if len(h2) != 0:
        s = calc(h2, s)
    return s

print(calc(h, 0))

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

h = np.array(h)

h_zero = np.hstack([np.zeros(1), h, np.zeros(1)])

d = np.diff(h_zero)

a= (d[:-1] * d[1:]) < 0

h_a = h[a == True]

s = 0
for k in range(len(h_a)):
    
    if k%2 == 0:
        
            
        if k == 0:
            s += h_a[k] - h_a[k+1]
        elif k == len(h_a)-1:
            s += h_a[k] - h_a[k-1] 
        else:
            s += h_a[k] - np.max([h_a[k-1], h_a[k+1]])
    else:
        s += h_a[k]
#     print(k, s)
print(s)

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

h = np.array(h)

h_zero = np.hstack([np.zeros(1), h, np.zeros(1)])

d = np.diff(h_zero)

a= (d[:-1] * d[1:]) < 0

h_a = h[a == True]

s = 0
for k in range(len(h_a)):
    
    if k%2 == 0:
        
            
        if k == 0:
            s += h_a[k] - h_a[k+1]
        elif k == len(h_a)-1:
            s += h_a[k] - h_a[k-1] 
        else:
            s += h_a[k] - np.max([h_a[k-1], h_a[k+1]])
    else:
        s += h_a[k]
#     print(k, s)
print(s)
Problem p03215 (python)

Fixed submission:
import numpy as np
N, K = list(map(int,input().split()))
a = list(map(int,input().split()))

a = np.array(a)

s = 0
e = 0

arr = []
aa = np.append(0,np.cumsum(a))
for s in range(len(aa)):
    for e in range(s+1, len(aa)):
        arr.append(aa[e] - aa[s])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(aa)[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)

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

a = np.array(a)

s = 0
e = 0

arr = []
for s in range(N):
    for e in range(s+1, N+1):
        arr.append(a[s:e])

max_len = len(bin(np.sum(a))[2:])

su = 0
b = [bin(np.sum(aa))[2:] for aa in arr]
b = ['0' * (max_len - len(bb)) + bb for bb in b]
while True:
    c = [bb for bb in b if bb[0] == '1']
    if len(c) >= K:
        su += 2 ** (len(c[0]) - 1)
        b = [cc[1:] for cc in c]
    else:
        b = [bb[1:] for bb in b]
    if len(b[0]) == 0:
        break
print(su)
Problem p03231 (python)

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

n,m = list(map(int, input().split()))
s = input()
t = input()

sdic = {}
for k in range(0, len(s)):
    sdic[k*m] = s[k]
tdic = {}
for k in range(0, len(t)):
    tdic[k*n] = t[k]
ok = 1
for skey in sdic.keys():
    try:
        if tdic[skey] != sdic[skey]:
            ok = -1
    except:
        pass
    
if ok == 1:
    print(int(m * n / gcd(m,n)))
else:
    print('-1')

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

n,m = list(map(int, input().split()))
s = input()
t = input()

s1 = ''
for ss in s:
    s1 += ss
    s1 += 'A'*(m-1)

t1 = ''
for tt in t:
    t1 += tt
    t1 += 'A'*(n-1)

ok = 1
for k in range(len(s1)):
    if s1[k] != 'A' and t1[k] != 'A':
        if s1[k] != t1[k]:
            ok = -1
        if ok == -1:
            break
if ok == 1:
    print(int(m * n / gcd(m,n)))
else:
    print('-1')

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

s1 = ''
for ss in s:
    s1 += ss
    s1 += 'A'*(m-1)

t1 = ''
for tt in t:
    t1 += tt
    t1 += 'A'*(n-1)

ok = 1
for k in range(len(s1)):
    if s1[k] != 'A' and t1[k] != 'A':
        if s1[k] != t1[k]:
            ok = -1
        if ok == -1:
            break
if ok == 1:
    print(int(m * n / math.gcd(m,n)))
else:
    print('-1')
Problem p03241 (python)

Fixed submission:
import numpy as np
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
def yaku(n):
    fct = factorize(n)
    y = divisorize(fct)
    ys = []
    for yy in y:
        ys.append(num(yy))
    ys.sort()
    return ys

n,m = list(map(int,input().split()))
if n == 1 and m == 1:
    print(1)
else:
    y = yaku(m)
    print(np.max(np.array(y)[np.array(y) <= m/n]))

Buggy submission (verdict: Runtime Error):
import numpy as np
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
def yaku(n):
    fct = factorize(n)
    y = divisorize(fct)
    ys = []
    for yy in y:
        ys.append(num(yy))
    ys.sort()
    return ys

n,m = list(map(int,input().split()))
y = yaku(m)
print(np.max(np.array(y)[np.array(y) <= m/n]))

Buggy submission (verdict: Runtime Error):
import numpy as np
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]

def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a
def yaku(n):
    fct = factorize(n)
    y = divisorize(fct)
    ys = []
    for yy in y:
        ys.append(num(yy))
    ys.sort()
    return ys

n,m = list(map(int,input().split()))
y = yaku(m)
np.max(np.array(y)[np.array(y) <= m/n])
Problem p03251 (python)

Fixed submission:
import numpy as np


n,m,X,Y = list(map(int,input().split()))
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')

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

x.append(X)
y.append(Y)

if np.max(x) < np.min(y):
    print('No War')
else:
    print('War')
Problem p03280 (python)

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

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print(a * b - a - b + 1)
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

x = 0
ans1 = []
for x in range(len(s)):
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])

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

x = 0
ans1 = []
while True:
    if s[x] == '1':
        ans1.append(x+1)
        x += 1
    else:
        break

if k in ans1:
    print('1')
else:
    print(s[x])
Problem p03284 (python)

Fixed submission:
n,k = list(map(int,input().split()))
if n%k == 0:
    print(0)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
n,k = list(map(int,input().split()))
if n%k == 0:
    pirnt(0)
else:
    print(1)
Problem p02600 (python)

Fixed submission:
X = int(input())

if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)

Buggy submission (verdict: Runtime Error):
X = input()

if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)

Buggy submission (verdict: Runtime Error):
if 400 <= X <= 599:
    print(8)
if 600 <= X <= 799:
    print(7)
if 800 <= X <= 999:
    print(6)
if 1000 <= X <= 1199:
    print(5)
if 1200 <= X <= 1399:
    print(4)
if 1400 <= X <= 1599:
    print(3)
if 1600 <= X <= 1799:
    print(2)
if 1800 <= X <= 1999:
    print(1)
Problem p02601 (python)

Fixed submission:
n = [int(i) for i in input().split()]
K = int(input())

for _ in range(K):
    if n[0] >= n[1]:
        n[1] = n[1] * 2
    else:
        n[2] = 2*n[2]
        

if n[2] > n[1] > n[0]:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
A,B,C = int(input()),int(input()),int(input())
K = int(input())
for _ in range(K):
    if A >= B:
        B = 2*B
    else:
        C = 2*C
        

if C > B > A:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
K = int(input())

for _ in range(K):
    if A >= B:
        B = 2*B
    else:
        C = 2*C
        
if C > B > A:
    print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
K = int(input())

for _ in range(K):
    if A >= B:
        B = 2*B
    else:
        C = 2*C
        

if C > B > A:
    print('Yes')
else:
  print('No')