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

Fixed submission:
import collections


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False
    if n > 1:
        _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n = int(input())
sieve = eratosthenes(n)
primes = [i for i in range(n + 1) if sieve[i]]
counter = collections.Counter()
for i in range(2, n + 1):
    for p in primes:
        while i % p == 0:
            counter[p] += 1
            i //= p
        if i == 1:
            break

counter2 = collections.Counter()
for i in [2, 4, 14, 24, 74]:
    for p in primes:
        if counter[p] >= i:
            counter2[i] += 1

c0 = counter2[74]
c1 = counter2[24] * (counter2[2] - 1)
c2 = counter2[14] * (counter2[4] - 1)
c3 = (counter2[4] * (counter2[4] - 1) * (counter2[2] - 2)) // 2
print(c0 + c1 + c2 + c3)

Buggy submission (verdict: Runtime Error):
import collections


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n = int(input())
sieve = eratosthenes(n)
primes = [i for i in range(n + 1) if sieve[i]]
counter = collections.Counter()
for i in range(2, n + 1):
    for p in primes:
        while i % p == 0:
            counter[p] += 1
            i //= p
        if i == 1:
            break

counter2 = collections.Counter()
for i in [2, 4, 14, 24, 74]:
    for p in primes:
        if counter[p] >= i:
            counter2[i] += 1

c0 = counter2[74]
c1 = counter2[24] * (counter2[2] - 1)
c2 = counter2[14] * (counter2[4] - 1)
c3 = (counter2[4] * (counter2[4] - 1) * (counter2[2] - 2)) // 2
print(c0 + c1 + c2 + c3)
Problem p03241 (python)

Fixed submission:
import collections
import itertools
import math


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n, m = map(int, input().split())
m2 = math.ceil(math.sqrt(m)) + 1
sieve = eratosthenes(m2)
counter = collections.Counter()

mm = m
for k in range(2, m2):
    if sieve[k] and m % k == 0:
        while mm % k == 0:
            mm //= k
            counter[k] += 1
if mm > 1:
    counter[mm] += 1

es = [range(k + 1) for k in counter.values()]
res = 1
for ks in itertools.product(*es):
    x = 1
    for p, k in zip(counter.keys(), ks):
        x *= p**k
    if x <= m // n:
        res = max(res, x)
print(res)

Buggy submission (verdict: Runtime Error):
import math

n, m = map(int, input().split())
mm = m // n
res = []
for k in range(1, int(math.sqrt(m))):
    if m % k == 0:
        if k > mm:
            break
        if m // k <= mm:
            k = m // k
        res.append(k)
print(max(res))

Buggy submission (verdict: Runtime Error):
import collections
import itertools
import math


def eratosthenes(n):
    sieve = [True for _ in range(n + 1)]
    sieve[0] = False
    sieve[1] = False

    def _update(p):
        if sieve[p]:
            for i in range(p * 2, n + 1, p):
                sieve[i] = False

    _update(2)
    p = 3
    while p * p <= n:
        _update(p)
        p += 2
    return sieve


n, m = map(int, input().split())
m2 = math.ceil(math.sqrt(m))
sieve = eratosthenes(m2)
counter = collections.Counter()

mm = m
for k in range(2, m2):
    if sieve[k] and m % k == 0:
        while mm % k == 0:
            mm //= k
            counter[k] += 1
if mm > 1:
    counter[mm] += 1

es = [range(k + 1) for k in counter.values()]
res = 1
for ks in itertools.product(*es):
    x = 1
    for p, k in zip(counter.keys(), ks):
        x *= p**k
    if x <= m // n:
        res = max(res, x)
print(res)
Problem p03282 (python)

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

count = 0
for i in range(len(s)):
    c = s[i]
    if c != '1':
        if k <= count:
            print('1')
        else:
            print(c)
        break
    else:
        count += 1
else:
    print('1')

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

count = 0
for i in range(k):
    c = s[i]
    if c != '1':
        print(c)
    else:
        count += 1
else:
    print('1')
Problem p03436 (python)

Fixed submission:
import sys

sys.setrecursionlimit(10**6)

h, w = map(int, input().split())
ls = [input().rstrip() for _ in range(h)]
ds = [[float('inf') for _ in range(w)] for _ in range(h)]
ds[0][0] = 1

dxdy = [(-1, 0), (1, 0), (0, -1), (0, 1)]


def dfs(x, y):
    for i in range(4):
        dx, dy = dxdy[i]
        nx = x + dx
        ny = y + dy
        if 0 <= nx < w and 0 <= ny < h and ls[ny][nx] == '.':
            if ds[ny][nx] > ds[y][x] + 1:
                ds[ny][nx] = ds[y][x] + 1
                dfs(nx, ny)


dfs(0, 0)
d = ds[h - 1][w - 1]
if d < float('inf'):
    s = sum([l.count('.') for l in ls])
    print(s - d)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
ls = [input().rstrip() for _ in range(h)]
ds = [[float('inf') for _ in range(w)] for _ in range(h)]
ds[0][0] = 1

dxdy = [(-1, 0), (1, 0), (0, -1), (0, 1)]


def bfs(x, y):
    for i in range(4):
        dx, dy = dxdy[i]
        nx = x + dx
        ny = y + dy
        if 0 <= nx < w and 0 <= ny < h and ls[ny][nx] == '.':
            if ds[ny][nx] > ds[y][x] + 1:
                ds[ny][nx] = ds[y][x] + 1
                bfs(nx, ny)


bfs(0, 0)
d = ds[h - 1][w - 1]
if d < float('inf'):
    s = sum([l.count('.') for l in ls])
    print(s - d)
else:
    print(-1)
Problem p03474 (python)

Fixed submission:
a, b = map(int, input().split())
s = input()
ok = True
for i in range(a):
    if s[i] == '-':
        ok = False
ok = ok and s[a] == '-'
for i in range(b):
    if s[a + 1 + i] == '-':
        ok = False
if ok:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
s = input()
ok = True
for i in range(a):
    if s[i] == '-':
        ok = False
ok = ok and s[a] == '-'
for i in range(b):
    if s[a + 2 + i] == '-':
        ok = False
if ok:
    print('Yes')
else:
    print('No')
Problem p03599 (python)

Fixed submission:
a, b, c, d, e, f = map(int, input().split())
res = (100 * a, 0)
for aa in range(0, f + 1, 100 * a):
    for bb in range(0, f + 1, 100 * b):
        w = aa + bb
        if w == 0 or w >= f:
            continue
        r = f - w
        for cc in range(0, r + 1, c):
            for dd in range(0, r + 1, d):
                s = cc + dd
                t = w + s
                if t > f or 100 * s > e * w:
                    continue
                if s * res[0] > res[1] * t:
                    res = (t, s)
print(*res)

Buggy submission (verdict: Runtime Error):
a, b, c, d, e, f = map(int, input().split())
res = None
m = 0
for aa in range(0, f, 100 * a):
    for bb in range(0, f, 100 * b):
        w = aa + bb
        if w == 0 or aa + bb > f:
            continue
        r = f - w
        for cc in range(0, r, c):
            for dd in range(0, r, d):
                s = cc + dd
                if s + w > f or 100 * s > e * w:
                    continue
                mm = s / w
                if mm > m:
                    res = (w + s, s)
                    m = mm
print(*res)
Problem p03999 (python)

Fixed submission:
s = input().rstrip()
n = len(s)
res = 0
for i in range(2**(n - 1)):
    bs = bin(i)[2:].rjust(n - 1, '0')
    ss = s[0]
    for b, c in zip(bs, s[1:]):
        if b == '1':
            ss += '+'
        ss += c
    res += eval(ss)
print(res)

Buggy submission (verdict: Runtime Error):
s = input().rstrip()
n = len(s)
res = 0
for i in range(2**(n - 1)):
    bs = bin(i)[2:].rjust(n - 1, '0')
    ss = s[0]
    for j, b in enumerate(bs, 1):
        if b == '1':
            ss += '+'
        ss += s[j]
    res += eval(ss)
print(res)
Problem p02783 (python)

Fixed submission:
a, b = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる

result=0

if a % b !=0:
    result += 1 

result += a // b 
print(result)

#####################

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる

result=0

if a % b <>0:
    result += 1 

result += a // b 
print(result)

#################
Problem p02784 (python)

Fixed submission:
h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = list(map(int, input().split()))  

a = sum(l)

if h > a:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = []
for i in range(n):
    l.append(input()) 

a = sum(l)

if h > a:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
h, n = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる
l = []
for i in range(n):
    l.append(input()) 

a = sum(l)

if h >= a:
    print('Yes')
else:
    print('No')
Problem p02882 (python)

Fixed submission:
import math
from math import atan, cos, tan

a, b, x = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる

result =0

if x>=a**2 * b/2:
    result = math.degrees(atan((2*(b - x/a**2)/a)))
else:
    result = math.degrees(atan(a*b**2/2/x))

print(result)

Buggy submission (verdict: Runtime Error):
import math
from math import atan, cos, tan

a, b, x = map(int, input().split()  ) #split()で分解したものを別々の変数に入れる

result =0

if x>=a**2 * b/2:
    result = math.degrees(math.pi /2 - atan(a/ (2*(b - x/a**2))))
else:
    result = math.degrees(math.pi /2 - atan(2*x/(a*b)/b))

print(result)
Problem p02888 (python)

Fixed submission:
import bisect
from bisect import bisect_left

n = int(input()) #n行の入力をリストに入れる
l = []
l = list(map(int, input().split( )))

l.sort()
result =0
for i in range(n-2):
    a =l[i]
    for j in range(i+1,n-1):
        b=l[j]
        k = bisect_left(l,a+b)
        result += k-j-1

print(result)

Buggy submission (verdict: Runtime Error):
import bisect
from bisect import bisect_left

n = int(input()) #n行の入力をリストに入れる
l = []
for i in range(n):
    l.append(input()) 

l.sort()
result =0
for i in range(n):
    a =l[i]
    for j in range(i+1,n-1):
        b=l[j]
        k = bisect_left(l,a+b)
        result += k-j-1

print(result)
Problem p03200 (python)

Fixed submission:
S=input()
counter=0
result = 0

for i in range(len(S)):
    if S[i]=='B':
        counter+=1
    else:
        result +=counter

print(result)

Buggy submission (verdict: Runtime Error):
temp=input()
S=list(temp)
counter1=0
counter2=0
counter3=0 
i=len(S)-1

while True:
    if S[i-1]=='B' and S[i]=='W':
        S[i-1]='W'
        S[i]='B'
        counter1 +=1
    i -=1
    if i ==0:
        if counter1==counter2:
            break
        counter2=counter1
        for j in range(len(S)):
            if S[j]=='W':
                counter3 =j
            j -=1
        i= counter3

print(counter1)
Problem p03227 (python)

Fixed submission:
A = input()
chars = list(A)

result ="0"
if len(A)==2:
    result = A
else:
    result= chars[2]+chars[1]+chars[0]

print(result)

Buggy submission (verdict: Runtime Error):
A,B,K = input().split()
A=int(A)
B=int(B)
K=int(K)

if K==1:
    if A % 2 ==1:
        A =A-1
    A =A/2
    B=B+A

if K==2:
    if A % 2 ==1:
        A =A-1
    A =A/2
    B=B+A
    if B % 2==1:
        B=B-1
    B=B/2
    A=A+B

if K>=3:
    for i in range(1,K,2):
        if A % 2 ==1:
            A =A-1
        A =A/2
        B=B+A
        if B % 2==1:
            B=B-1
        B=B/2
        A=A+B

    if K%2==1:
        if A % 2 ==1:
            A =A-1
        A =A/2
        B=B+A


print (int(A),int(B))
Problem p03231 (python)

Fixed submission:
N,M=map(int,input().split())
S=input()
T=input()

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

def lcm(a, b):
	return int(a * b // gcd (a, b))
answer =lcm(N,M)

G =gcd(N,M)

for k in range(G):
    if S[int(k*N/G)] !=  T[int(k*M/G)]:
        answer =-1

print(answer)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
S=input()
T=input()

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

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


G = int(lcm(N,M))

answer = G

temp_S =['0']*G
temp_T =['0']*G

for i in range(N):
    temp_S[i*int(G/N)] = S[i]

for j in range(M):
    temp_T[j*int(G/M)] = T[j]

for k in range(G):
    if temp_S[k] != temp_T[k] and temp_S[k] != '0' and temp_T[k] != '0':
        answer =-1

print(answer)
Problem p03220 (python)

Fixed submission:
import numpy as np
N = int(input())
T,A = map(int, input().split())
Hs = input().split()
for i in range(N):
  Hs[i] = int(Hs[i])
Hs = np.array(Hs)

Ts = T - Hs*0.006

Ts_A = np.abs(Ts - A)

print(np.argmin(Ts_A)+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int, input().split())
Hs = input().split()
for i in range(N):
  Hs[i] = int(Hs[i])
Hs = np.array(Hs)

Ts = T - Hs*0.006

Ts_A = np.abs(Ts - A)

print(np.argmin(Ts_A))
Problem p03408 (python)

Fixed submission:
import numpy as np

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())

s = np.array(s)
t = np.array(t)
s_uni = np.unique(s)

ans = 0
for i,ch_s in enumerate(s_uni):
  ans_tmp = (s==ch_s).sum()
  ans_tmp -= (t==ch_s).sum()
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))

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

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())

s = np.array(s)
t = np.array(t)

s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
  ans_tmp = s[1][i]
  for j,ch_t in enumerate(t[0]):
    if ch_s == ch_t:
      ans_tmp -= t[1][j]
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))

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

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())
    
s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
#for i,ch_s in enumerate(s[0]):
#  ans_tmp = s[1][i]
#  for j,ch_t in enumerate(t[0]):
#    if ch_s == ch_t:
#      ans_tmp -= t[1][j]
#  if ans_tmp > ans:
#    ans = ans_tmp
print(int(ans))

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

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())
    
s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
  ans_tmp = s[1][i]
  for j,ch_t in enumerate(t[0]):
    if ch_s == ch_t:
      ans_tmp -= t[1][j]
  if ans_tmp > ans:
    ans = ans_tmp
print(int(ans))

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

N = int(input())
s = []
for i in range(N):
  s.append(input())
    
M = int(input())
t = []
for i in range(M):
  t.append(input())
    
s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
  ans_tmp = s[1][i]
  for j,ch_t in enumerate(t[0]):
    if ch_s == ch_t:
      ans_tmp -= t[1][j]
    if ans_tmp > ans:
      ans = ans_tmp
print(int(ans))

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

N = int(input())
s = []
for i in range(N):
    s.append(input())
    
M = int(input())
t = []
for i in range(M):
    t.append(input())
    
s = np.unique(s, return_counts=True)
t = np.unique(t, return_counts=True)

ans = 0
for i,ch_s in enumerate(s[0]):
    ans_tmp = s[1][i]
    for j,ch_t in enumerate(t[0]):
        if ch_s == ch_t:
            ans_tmp -= t[1][j]
    if ans_tmp > ans:
        ans = ans_tmp
print(int(ans))
Problem p03486 (python)

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

length = min(len(s),len(t))

sorted_s = sorted(s)
sorted_t = sorted(t)[::-1]

flag = True
for i in range(length):
  if sorted_s[i] == sorted_t[i]:
    pass
  elif sorted_s[i] < sorted_t[i]:
    print('Yes')
    flag = False
    break
  else:
    print('No')
    flag = False
    break

if flag:
  if len(s) < len(t):
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

length = min(len(s),len(t))

sorted_s = sorted(s)
soreted_t = sorted(t)[::-1]

flag = True
for i in range(length):
  if sorted_s[i] == sorted_t[i]:
    pass
  elif sorted_s[i] < sorted_t[i]:
    print('Yes')
    flag = False
    break
  else:
    print('No')
    flag = False
    break

if flag:
  if len(s) < len(t):
    print('Yse')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

length = min(len(s),len(t))

sorted_s = sorted(s)
soreted_t = sorted(t)[::-1]

for i in range(length):
  if sorted_s[i] == sorted_t[i]:
    pass
  elif sorted_s[i] < sorted_t[i]:
    print('Yes')
    break
  else:
    print('No')
    break

if len(s) < len(t):
  print('Yse')
else:
  print('No')
Problem p03495 (python)

Fixed submission:
import numpy as np
import collections

N,K = map(int, input().split())
As = input().split()
for i in range(N):
  As[i] = int(As[i])
As = np.array(As)

As_c = collections.Counter(As)

ans = 0
counter = 0
for a in sorted(As_c.values()):
  if counter < len(As_c) - K:
    ans += a 
    counter += 1
  else:
    break
print(int(ans))

Buggy submission (verdict: Runtime Error):
import numpy as np
N,K = map(int, input().split())
As = input().split()
for i in range(N):
  As[i] = int(As[i])
As = np.array(As)

As_uni = np.unique(As)

if len(As_uni) <= K:
  ans = 0
else:
  for i,a in enumerate(As_uni):
    As_uni[i] = (As==a).sum()
  As_uni = np.sort(As_uni)
  ans = As_uni[:K2-K].sum()
  
print(int(ans))
Problem p03599 (python)

Fixed submission:
A,B,C,D,E,F = map(int, input().split())

val_max = 0
for a in range(0,1+F//(100*A)):
  for b in range(0,1+(F - 100*A*a)//(100*B)):
    if (a==0)&(b==0):
      continue
    for c in range(0,1+(F - 100*A*a - 100*B*b)//C):
      for d in range(0,1+(F - 100*A*a - 100*B*b - C*c)//D):
        if C*c+D*d <= E*(A*a+B*b):
          val = (C*c + D*d)/(100*A*a + 100*B*b + C*c + D*d)
          if val >= val_max:
            val_max = val
            ans1 = 100*A*a + 100*B*b + C*c + D*d
            ans2 = C*c + D*d
print(int(ans1),int(ans2))

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int, input().split())

val_max = 0
for a in range(0,1+F//(100*A)):
  for b in range(0,1+(F-100*A*a)//(100*B)):
    if (a==0)&(b==0):
      continue
    for c in range(0,1+(F-100*A*a-100*B*b)//C):
      for d in range(0,1+(F-100*A*a-100*B*b-C*c)//D):
        if C*c+D*d <= E*(A*a+B*b):
          val = (C*c+D*d)/(100*A*a+100*B*b+C*c+D*d)
          if val > val_max:
            val_max = val
            ans1 = 100*A*a+100*B*b+C*c+D*d
            ans2 = C*c+D*d
print(ans1,ans2)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int, input().split())

val_max = 0
for a in range(0,1+F//(100*A)):
  for b in range(0,1+(F-100*A*a)//(100*B)):
    for c in range(0,1+(F-100*A*a-100*B*b)//C):
      for d in range(0,1+(F-100*A*a-100*B*b-C*c)//D):
        if C*c+D*d <= E*(A*a+B*b):
          val = (C*c+D*d)/(100*A*a+100*B*b+C*c+D*d)
          if val > val_max:
            val_max = val
            ans1 = 100*A*a+100*B*b+C*c+D*d
            ans2 = C*c+D*d
print(ans1,ans2)

Buggy submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int, input().split())

val_max = 0
for a in range(1,1+F//(100*A)):
  for b in range(0,1+(F-100*A*a)//(100*B)):
    for c in range(0,1+(F-100*A*a-100*B*b)//C):
      for d in range(0,1+(F-100*A*a-100*B*b-C*c)//D):
        if C*c+D*d <= E*(A*a+B*b):
          val = (C*c+D*d)/(100*A*a+100*B*b+C*c+D*d)
          if val > val_max:
            val_max = val
            ans1 = 100*A*a+100*B*b+C*c+D*d
            ans2 = C*c+D*d
print(ans1,ans2)
Problem p03624 (python)

Fixed submission:
import numpy as np

S = input()

S = np.unique(sorted(S))

ans = 'None'
for ch in 'abcdefghijklmnopqrstuvwxyz':
  if ch in S:
    pass
  else:
    ans = ch
    break
print(ans)

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

S = np.unique(sorted(S))

ans = 'None'
for ch in 'abcdefghijklmnopqrstuvwxyz':
  if ch in S:
    pass
  else:
    ans = ch
    break
print(ans)
Problem p03658 (python)

Fixed submission:
import numpy as np

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

ls = input().split()
ls_arr = np.zeros(N)
for i in range(N):
  ls_arr[i] = int(ls[i])

ls_arr = np.sort(ls_arr)[::-1]

ans = int(ls_arr[:K].sum())

print(ans)

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

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

ls = input().split()
ls_arr = np.array(N)
for i in range(N):
  ls_arr[i] = int(ls[i])

ls_arr = np.sort(ls_arr)[::-1]

ans = int(ls_arr[:K].sum())

print(ans)
Problem p03944 (python)

Fixed submission:
import numpy as np

W,H,N = map(int, input().split())

x_s,y_s,a_s = [],[],[]
for i in range(N):
  x,y,a = map(int, input().split())
  x_s.append(x)
  y_s.append(y)
  a_s.append(a)
    
x_s = np.array(x_s)
y_s = np.array(y_s)
a_s = np.array(a_s)

if (a_s==1).sum()>=1:
  x_min = x_s[a_s==1].max()
else:
  x_min = 0
  
if (a_s==2).sum()>=1:
  x_max = x_s[a_s==2].min()
else:
  x_max = W
  
if (a_s==3).sum()>=1:
  y_min = y_s[a_s==3].max()
else:
  y_min = 0
  
if (a_s==4).sum()>=1:
  y_max = y_s[a_s==4].min()
else:
  y_max = H
  
if (x_min>=x_max)|(y_min>=y_max):
  ans = 0
else:
  ans = (x_max-x_min)*(y_max-y_min)
  
print(int(ans))

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

W,H,N = map(int, input().split())

x_s,y_s,a_s = [],[],[]
for i in range(N):
	x,y,a = map(int, input().split())
    x_s.append(x)
    y_s.append(y)
    a_s.append(a)
    
x_s = np.array(x_s)
y_s = np.array(y_s)
a_s = np.array(a_s)

if (a_s==1).sum()>=1:
  x_min = x_s[a_s==1].max()
else:
  x_min = 0
  
if (a_s==2).sum()>=1:
  x_max = x_s[a_s==2].min()
else:
  x_max = W
  
if (a_s==3).sum()>=1:
  y_min = y_s[a_s==3].max()
else:
  y_min = 0
  
if (a_s==4).sum()>=1:
  y_max = y_s[a_s==4].min()
else:
  y_max = H
  
if (x_min>=x_max)|(y_min>=y_max):
  ans = 0
else:
  ans = (x_max-x_min)*(y_max-y_min)
  
print(int(ans))

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

W,H,N = map(int, input().split())

x_s,y_s,a_s = [],[],[]
for i in range(N):
	x,y,a = map(int, input().split())
    x_s.append(x)
    y_s.append(y)
    a_s.append(a)
    
x_s = np.array(x_s)
y_s = np.array(y_s)
a_s = np.array(a_s)

x_min = x_s[a_s==1].max()
x_max = x_s[a_s==2].min()
y_min = y_s[a_s==3].max()
y_max = y_s[a_s==4].min()

if (x_min>=x_max)|(y_min>=y_max):
  ans = 0
else:
  ans = (x_max-x_min)*(y_max-y_min)
  
print(int(ans))
Problem p02801 (python)

Fixed submission:
a = input()
print(chr(ord(a)+1))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
cleared = []
ac_counter = 0
wa_counter = 0
for i in range(m):
    p, s = input().split()
    p = int(p)
    if not p in cleared:
        if s == 'AC':
            ac_counter += 1
            cleared.append(p)
        else:
            wa_counter += 1
print('{} {}'.format(ac_counter, wa_counter))

Buggy submission (verdict: Runtime Error):
a = input()
print(chr(ord(a)+1)