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

Fixed submission:
# C
N, M = map(int, input().split())
L = 1000000007

res = 1

if (M - N) >= 2 or (N - M) >= 2:
    res = 0
else:
    for k in range(M):
        res *= (k+1)
        res = res % L
    for k in range(N):
        res *= (k+1)
        res = res % L
    if M == N:
        res *= 2
        res = res % L
print(res)

Buggy submission (verdict: Runtime Error):
# D
import numpy as np
N = int(input())
X = np.zeros(N, dtype=int)
Y = np.zeros(N, dtype=int)

for i in range(N):
    x, y = map(int, input().split())
    X[i] = x
    Y[i] = y

# edges
X_s = np.argsort(X)
Y_s = np.argsort(Y)

edge_list = []
edge_weight = []
for i in range(N-1):
    edge_list.append([X_s[i], X_s[i+1]])
    edge_weight.append(min(abs(X[X_s[i+1]] - X[X_s[i]]), abs(Y[X_s[i+1]] - Y[X_s[i]])))
    edge_list.append([Y_s[i], Y_s[i+1]])
    edge_weight.append(min(abs(X[Y_s[i+1]] - X[Y_s[i]]), abs(Y[Y_s[i+1]] - Y[Y_s[i]])))
    
# sort edges
sel = np.argsort(np.array(edge_weight))

res = 0
flg = np.zeros(N)

for s in sel:
    m, n = edge_list[s]
    if flg[m]*flg[n] > 0:
        pass
    else:
        res += edge_weight[s]
        flg[m] = 1
        flg[n] = 1
print(res)
Problem p03708 (python)

Fixed submission:
# D
res = 0

A = int(input())
B = int(input())

def pow2_floor_log2(x):
    res = 1
    while res*2 <= x:
        res *= 2
    return res

if A == B:
    res += 1
    
while A < B:
    # find log2A and log2B
    C = pow2_floor_log2(B)
    if A < C:
        # A to C
        res += C - A
        if B > C:
            B_ = C + pow2_floor_log2(B - C)*2 - 1
        else:
            B_ = C
        if C + A <= B_:
            res += C
            break
        else:
            res += (C - A) + (B_ - C + 1)
            break
    else:
        A -= C
        B -= C

print(res)

Buggy submission (verdict: Runtime Error):
# D
res = 0

A = int(input())
B = int(input())

def pow2_floor_log2(x):
    res = 1
    while res*2 <= x:
        res *= 2
    return res


while True:
    # find log2A and log2B
    C = pow2_floor_log2(B)
    if A < C:
        # A to C
        res += C - A
        if B > C:
            B_ = C + pow2_floor_log2(B - C)*2 - 1
        if C + A <= B_:
            res += C
            break
        else:
            res += (C - A) + (B_ - C + 1)
            break
    else:
        A -= C
        B -= C

print(res)

Buggy submission (verdict: Runtime Error):
# D
import math
res = 0

A = int(input())
B = int(input())


while True:
    # find log2A and log2B
    C = 2**math.floor(math.log2(B))
    if A < C:
        # A to C
        res += C - A
        if B > C:
            B_ = C + 2**math.floor(math.log2(B - C) + 1) - 1
        if C + A <= B_:
            res += C
            break
        else:
            res += (C - A) + (B_ - C + 1)
            break
    else:
        A -= C
        B -= C

print(res)
Problem p03746 (python)

Fixed submission:
# B
import numpy as np
from collections import deque
# input
N, M = map(int, input().split())
G = dict()
for n in range(1, N+1):
    G[n] = []
    
visited = [0]*(N+1)
for m in range(M):
    A, B = map(int, input().split())
    G[A].append(B)
    G[B].append(A)
    if m == 0:
        pt = [A, B]
        visited[A] = 1
        visited[B] = 1

# from left
s = pt[0]
add_left = list()

while True:
    left_ext = [l for l in G[s] if visited[l] == 0]
    if len(left_ext) != 0:
        s = left_ext[0]
        visited[s] = 1
        add_left.append(s)
    else:
        break

# from right
s = pt[1]
add_right = list()

while True:
    right_ext = [l for l in G[s] if visited[l] == 0]
    if len(right_ext) != 0:
        s = right_ext[0]
        visited[s] = 1
        add_right.append(s)
    else:
        break
pt = list(reversed(add_left)) + pt + add_right
print(len(pt))
print(" ".join([str(a) for a in pt]))

Buggy submission (verdict: Runtime Error):
# B
from collections import deque
# input
N, M = map(int, input().split())
G = dict()
for n in range(1, N+1):
    G[n] = []

for _ in range(M):
    A, B = map(int, input().split())
    G[A].append(B)
    G[B].append(A)
    
# find minimum degree
s = np.argmin(np.array([len(G[k]) for k in range(1, N+1)])) + 1

targets = dict()
for a in G[s]:
    targets[a] = 1


# BFS
t = G[s][0]
pt = [s, t]
del targets[t]
while len(targets) > 0:
    ques = deque()
    visited = [0]*(N+1)    
    for a in pt:
        visited[a] = 1
    ques.append([t, pt])
    end = 0
    while len(ques) > 0 and end == 0:
        q = ques.popleft()
        s = q[0]
        pt = q[1]
        for t in G[s]:
            if visited[t] == 1:
                pass
            elif t in targets.keys():
                pt.append(t)
                end = 1
                del targets[t]
                break
            else:
                visited[t] = 1
                ques.append([t, pt+[t]])
            
print(len(pt))
print(" ".join([str(a) for a in pt]))
Problem p03766 (python)

Fixed submission:
n = int(input())

if n == 1:
    print(1)
else:
    res_v = [0]*(n + 1)
    res_v_cumsum = [0]*(n + 1)
    res_v[0] = 0
    res_v[1] = 1
    res_v[2] = 1
    res_v_cumsum[0] = 0
    res_v_cumsum[1] = 1
    res_v_cumsum[2] = 2

    M = 1000000007

    for k in range(3, n):
        res_v[k] = (1 + res_v_cumsum[k-1] - res_v[k-2]) % M
        res_v_cumsum[k] = (res_v_cumsum[k-1] + res_v[k]) % M
    #print(res_v)
    print((((res_v_cumsum[n-2] * (((n-1) * (n-1)) % M)) % M) + ((res_v_cumsum[n-1] * (n-1)) % M) + n + (n-1)*(n-1)%M) % M)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())

if n == 1:
    print(1)
else:
    res_v = np.zeros(n + 1, dtype='int64')
    res_v_cumsum = np.zeros(n + 1, dtype='int64')
    res_v[0] = 0
    res_v[1] = 1
    res_v[2] = 1
    res_v_cumsum[0] = 0
    res_v_cumsum[1] = 1
    res_v_cumsum[2] = 2

    M = 1000000007

    for k in range(3, n):
        res_v[k] = (1 + res_v_cumsum[k-1] - res_v[k-2]) % M
        res_v_cumsum[k] = (res_v_cumsum[k-1] + res_v[k]) % M

    print((((res_v_cumsum[n-2] * (((n-1) * (n-1)) % M)) % M) + ((res_v_cumsum[n-1] * (n-1)) % M) + n + (n-1)*(n-1)%M) % M)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())

res_v = np.zeros(n + 1, dtype='int64')
res_v_cumsum = np.zeros(n + 1, dtype='int64')
res_v[0] = 0
res_v[1] = 1
res_v[2] = 1
res_v_cumsum[0] = 0
res_v_cumsum[1] = 1
res_v_cumsum[2] = 2

M = 1000000007

for k in range(3, n):
    res_v[k] = (1 + res_v_cumsum[k-1] - res_v[k-2]) % M
    res_v_cumsum[k] = (res_v_cumsum[k-1] + res_v[k]) % M

print((((res_v_cumsum[n-2] * (((n-1) * (n-1)) % M)) % M) + ((res_v_cumsum[n-1] * (n-1)) % M) + n + (n-1)*(n-1)%M) % M)

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

res_v = np.zeros(n + 1, dtype='int64')
res_v_cumsum = np.zeros(n + 1, dtype='int64')
res_v[0] = 0
res_v[1] = 1
res_v[2] = 1
res_v_cumsum[0] = 0
res_v_cumsum[1] = 1
res_v_cumsum[2] = 2

M = 1000000007

for k in range(3, n):
    res_v[k] = (1 + res_v_cumsum[k-1] - res_v[k-2]) % M
    res_v_cumsum[k] = (res_v_cumsum[k-1] + res_v[k]) % M

print((((res_v_cumsum[n-2] * (((n-1) * (n-1)) % M)) % M) + ((res_v_cumsum[n-1] * (n-1)) % M) + n + (n-1)*(n-1)%M) % M)
Problem p03813 (python)

Fixed submission:
x = int(input())
if x < 1200:
    print('ABC')
else:
    print('ARC')

Buggy submission (verdict: Runtime Error):
x = int(raw_input())
if x < 1200:
    print('ABC')
else:
    print('ARC')
Problem p03856 (python)

Fixed submission:
S = raw_input()

def pick_greedy(S):
    if S[0:5] == 'dream':
        if S[5:7] == 'er':
            if S[7] == 'a':
                ret = 'dream'
            else:
                ret = 'dreamer'
        else:
            ret = 'dream'
    elif S[0:5] == 'erase':
        if S[5] == 'r':
            ret = 'eraser'
        else:
            ret = 'erase'
    else:
        ret = 'no'
    return ret

sol = 'YES'

while len(S) > 0:
    try:
        r = pick_greedy(S)
        if r == 'no':
            sol = 'NO'
            break
        else:
            if len(S) < len(r):
                sol = 'NO'
                break
            else:
                S = S[len(r):]
    except:
        sol = 'YES'
        break
        
print sol

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

def pick_greedy(S):
    if S[0:5] == 'dream':
        if S[5:7] == 'er':
            if S[7] == 'a':
                ret = 'dream'
            else:
                ret = 'dreamer'
        else:
            ret = 'dream'
    elif S[0:5] == 'erase':
        if S[5] == 'r':
            ret = 'eraser'
        else:
            ret = 'erase'
    else:
        ret = 'no'
    return ret

sol = 'YES'

while len(S) > 0:
    r = pick_greedy(S)
    if r == 'no':
        sol = 'NO'
        break
    else:
        if len(S) < len(r):
            sol = 'NO'
            break
        else:
            S = S[len(r):]
        
print sol

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

def pick_greedy(S):
    if S[0:5] == 'dream':
        if S[5:7] == 'er':
            if S[7] == 'a':
                ret = 'dream'
            else:
                ret = 'dreamer'
        else:
            ret = 'dream'
    elif S[0:5] == 'erase':
        if S[5] == 'r':
            ret = 'eraser'
        else:
            ret = 'erase'
    else:
        ret = 'no'
    return ret

sol = 'YES'

while len(S) > 0:
    r = pick_greedy(S)
    if r == 'no':
        sol = 'NO'
        break
    else:
        S = S[len(r):]
        
print sol
Problem p03972 (python)

Fixed submission:
W, H = map(int, raw_input().split())

p_list = list()
q_list = list()

for i in range(W):
    p_list.append(int(raw_input()))
    
for j in range(H):
    q_list.append(int(raw_input()))

p_list.sort()
q_list.sort()

cp = H+1
cq = W+1

res = 0
pid = 0
qid = 0

while True:
    if pid == W:
        if qid == H:
            break
        else:
            choice = 'q'
    elif qid == H:
        choice = 'p'
    elif p_list[pid] < q_list[qid]:
        choice = 'p'
    else:
        choice = 'q'
    if choice == 'p':
        cq -= 1
        res += cp*p_list[pid]
        pid += 1
    else:
        cp -= 1
        res += cq*q_list[qid]
        qid += 1

print res

Buggy submission (verdict: Runtime Error):
W, H = map(int, raw_input().split())

p_list = list()
q_list = list()

for i in range(W):
    p_list.append(int(raw_input()))
    
for j in range(H):
    q_list.append(int(raw_input()))

p_list.sort()
q_list.sort()

cp = H+1
cq = W+1

res = 0
pid = 0
qid = 0

while True:
    if pid == H:
        if qid == W:
            break
        else:
            choice = 'q'
    elif qid == W:
        choice = 'p'
    elif p_list[pid] < q_list[qid]:
        choice = 'p'
    else:
        choice = 'q'
    if choice == 'p':
        cq -= 1
        res += cp*p_list[pid]
        pid += 1
    else:
        cp -= 1
        res += cq*q_list[qid]
        qid += 1

print res
Problem p03993 (python)

Fixed submission:
N = int(raw_input())
x_vec = map(int, raw_input().split())
ret = 0
for i in range(len(x_vec)):
    if x_vec[x_vec[i] - 1] == i + 1:
        ret += 1 
print ret / 2

Buggy submission (verdict: Runtime Error):
x_vec = map(int, raw_input().split())
ret = 0
for i in range(len(x_vec)):
    if x_vec[x_vec[i]] == i:
        ret += 1 
print ret / 2
Problem p02582 (python)

Fixed submission:
import re
s = input()
array = re.split(r'S+', s)
print(max([len(e) for e in array]))

Buggy submission (verdict: Runtime Error):
x, k, d = list(map(lambda x: int(x), input().split()))

min_pos = x % d
min_neg = min_pos - d

num_to_min_pos = x // d
if k <= num_to_min_pos:
    print(x - d * k)
    
else:
    if (k - num_to_min_pos) % 2 == 0:
        print(min_pos)
    else:
        print(abs(min_neg))
Problem p02584 (python)

Fixed submission:
x, k, d = list(map(lambda x: int(x), input().split()))


x = abs(x)
min_pos = x % d
min_neg = min_pos - d

num_to_min_pos = x // d
if k <= num_to_min_pos:
    print(x - d * k)
    
else:
    if (k - num_to_min_pos) % 2 == 0:
        print(min_pos)
    else:
        print(abs(min_neg))

Buggy submission (verdict: Runtime Error):
x, k, d = list(map(lambda x: int(x), input().split()))

min_pos = x % d
min_neg = min_pos - d

num_to_min_pos = x // d
if k <= num_to_min_pos:
    print(x - d * k)
    
else:
    if (k - num_to_min_pos) % 2 == 0:
        print(min_pos)
    else:
        print(abs(min_neg)
Problem p02600 (python)

Fixed submission:
print(10 - int(input())//200)

Buggy submission (verdict: Runtime Error):
#3

n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))
list_score = []

for i in range(n):
    if i < k - 1:
        continue
#     print(i-k, i+1)
    list_score.append(sum(list_a[i-k+1:i+1]))
# print(list_score)

score_before = list_score[0]
for score in list_score[1:]:
    if score_before < score:
        print('Yes')
        score_before = score
        continue
    print('No')
    score_before = score

Buggy submission (verdict: Runtime Error):
def main():
  a,b,c = map(lambda x: int(x), input().split())
  k = int(input())
 
  for _ in range(k):
      if b <= a:
          b = 2 * b
          continue
      if c <= b:
          c = 2 * c
          continue
      print('Yes')
      return
 
  if (a < b) & (b < c):
      print('Yes')
      return
  print('No')
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
 
def main():
  a,b,c = map(lambda x: int(x), input().split())
  k = int(input())
 
  for _ in range(k):
      if b <= a:
          b = 2 * b
          continue
      if c <= b:
          c = 2 * c
          continue
      print('Yes')
      return
 
  if (a < b) & (b < c):
      print('Yes')
      return
  print('No')
 
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys

def main():
  a,b,c = map(lambda x: int(x), input().split())
  k = int(input())

  for _ in range(k):
      if b <= a:
          b = 2 * b
          continue
      if c <= b:
          c = 2 * c
          continue
      print('Yes')
      sys.exit()

  if (a < b) & (b < c):
      print('Yes')
      sys.exit()
  print('No')

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import sys
a,b,c = map(lambda x: int(x), input().split())
k = int(input())

for _ in range(k):
    if b <= a:
        b = 2 * b
        continue
    if c <= b:
        c = 2 * c
        continue
    print('Yes')
    quit()
    
if (a < b) & (b < c):
    print('Yes')
    quit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys
a,b,c = map(lambda x: int(x), input().split())
k = int(input())

for _ in range(k):
    if b <= a:
        b = 2 * b
        continue
    if c <= b:
        c = 2 * c
        continue
    print('Yes')
    sys.exit()
    
if (a < b) & (b < c):
    print('Yes')
    sys.exit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys
a,b,c = map(lambda x: int(x), input().split())
k = int(input())

for _ in range(k):
    if b <= a:
        b = 2 * b
        continue
    if c <= b:
        c = 2 * c
        continue
    print('Yes')
    sys.exit()
    
if (a < b) & (b < c):
    print('Yes')
    sys.exit()
print('No')

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

for _ in range(k):
    if b <= a:
        b = 2 * b
        continue
    if c <= b:
        c = 2 * c
        continue
    print('Yes')
    sys.exit()
    
if (a < b) & (b < c):
    print('Yes')
    sys.exit()
print('No')
Problem p02601 (python)

Fixed submission:
import sys
 
def main():
  a,b,c = map(lambda x: int(x), input().split())
  k = int(input())
 
  for _ in range(k):
      if b <= a:
          b = 2 * b
          continue
      if c <= b:
          c = 2 * c
          continue
      print('Yes')
      return
 
  if (a < b) & (b < c):
      print('Yes')
      return
  print('No')
 
if __name__ == '__main__':
    main()

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

for _ in range(k):
    if b < a:
        b = 2 * b
        continue
    if c < b:
        c = 2 * c
        continue
    print('Yes')
    sys.exit()
print('No')
Problem p02602 (python)

Fixed submission:
n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))

band_score = 1
    
for i, score in enumerate(list_a[k:]):
    if list_a[i] < score:
        print('Yes')
        continue
    print('No')

Buggy submission (verdict: Runtime Error):
n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))


scores = list_a[0:k]
score_first_time = list_a
score = 1
for each in scores:
    score *= each
    
for i, next_score in enumerate(list_a[k:]):
    score_before = score
    score = score_before * next_score / list_a[i]
    if score > score_
    before:
        print('Yes')
        continue
    print('No')

Buggy submission (verdict: Runtime Error):
n, k = map(lambda x: int(x), input().split())
list_a =  list(map(lambda x: int(x), input().split()))


scores = list_a[0:k]
score_first_time = list_a
score = 1
for each in scores:
    score *= each
    
for i, next_score in enumerate(list_a[k:]):
    score_before = score
    score = score_before * next_score / list_a[i]
    if score > score_
    before:
        print('Yes')
        continue
    print('No')
Problem p02603 (python)

Fixed submission:
import sys

n = int(input())
a_list = list(map(lambda x: int(x), input().split()))
possesion = 1000
num_stock = 0

# print(a_list)
for i in range(len(a_list) - 1):
    a_today = a_list[i]
    for a in a_list[i+1:]:
        a_next = a
        if a != a_today:
            break
    # これからずっと値段が変わらない場合は全部売ってあと放置
    if a_next == a_today:
        possesion += num_stock * a_list[-1]
        print(possesion)
        sys.exit()
    
    if a_today < a_next:
        # 買えるだけ買う
        possesion_yesterday = possesion
        possesion = possesion % a_today
        num_stock += possesion_yesterday // a_today
    if a_today > a_next:
        # うれるだけうる
        possesion += num_stock * a_today
        num_stock = 0
#     print(a_today, a_next, possesion, num_stock)

# 最終日は買えるだけ買う
possesion += num_stock * a_list[-1]
print(possesion)

Buggy submission (verdict: Runtime Error):
n = int(input())
a_list = list(map(lambda x: int(x), input().split()))
possesion = 1000
num_stock = 0

for i in range(len(a_list) - 1):
    a_today = a_list[i]
    for a in a_list[i+1:]:
        if a != a_today:
            a_next = a
            break
    
    if a_today < a_next:
        # 買えるだけ買う
        possesion_yesterday = possesion
        possesion = possesion % a_today
        num_stock += possesion_yesterday // a_today
    if a_today > a_next:
        # うれるだけうる
        possesion += num_stock * a_today
        num_stock = 0

# 最終日は買えるだけ買う
possesion += num_stock * a_list[-1]
print(possesion)
Problem p02645 (python)

Fixed submission:
name = input('')
print(name[:3])

Buggy submission (verdict: Runtime Error):
def main():
  name = input()
  print(name)
	
  
  
  
if __name__ == '__main__'
	main()

Buggy submission (verdict: Runtime Error):
def main():
  name = input()
  print name
	
  
  
  
if __name__ == '__main__'
	main()
Problem p03206 (python)

Fixed submission:
#!/usr/bin/env python3

import sys

input = iter(sys.stdin.read().splitlines()).__next__


sys.setrecursionlimit(10000)

D = int(input())

res = ' '.join(['Christmas'] + ['Eve'] * (25-D))

print(res)

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python

from sys import stdin, stderr

DPL = [0] * 56
DPP = [0] * 56

def F(n, x):
   if x == 0:
      return 0

   if x == 1:
      return 1 if n == 0 else 0

   if x == DPL[n]:
      return DPP[n]

   if x == 1 + DPL[n-1] + 1:
      return DPP[n-1] + 1
   elif x > 1 + DPL[n-1] + 1:
      return DPP[n-1] + 1 + F(n-1, x - (1 + DPL[n-1] + 1))
   else:
      return F(n-1, x-1)

def main():
   N, X = map(int, stdin.readline().split())

   DPL[0] = 1
   DPP[0] = 1
   for n in xrange(1, N+1):
      DPL[n] = 2*DPL[n-1] + 3
      DPP[n] = 2*DPP[n-1] + 1

   res = F(N, X)
   print(res)

   return 0

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

Fixed submission:
a, b = (int(i) for i in input().split()) 
print((a-1)*(b-1))

Buggy submission (verdict: Runtime Error):
a, b = (int(i) for i in input().split()) 
print((c-1)*(d-1))

Buggy submission (verdict: Runtime Error):
a, b = (int(i) for i in input().split()) 
print(c*d)

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

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

Fixed submission:
def count(n):
  ans = 0
  for i in range(1,n+1):
    if n % i == 0:
      ans += 1
  return ans

ans = 0
N = int(input())
for i in range(1,N + 1):
  if i % 2 == 0:
  	continue
  if count(i) == 8:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
def count(n):
  ans = 0
  for i in range(1,n+1):
    if n % i == 0:
      ans += 1
  return ans

ans = 0
N = (int(i) for i in input().split())
for i in range(1,N+1):
  if count(i) == 8:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
def count(n):
  ans = 0
  for i in range(1,n+1):
    if n % i == 0:
      ans += 1
  return ans

ans = 0
a = (int(i) for i in input().split())
for i in range(1,n+1):
  if count(i) == 8:
    ans += 1
print(ans)
Problem p02613 (python)

Fixed submission:
N = int(input())
S = [input() for i in range(N)]

ac = S.count('AC')
wa = S.count('WA')
tle = S.count('TLE')
re = S.count('RE')

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

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]

ac = S.count('AC')
wa = S.count('WA')
tle = S.count('TLE')
re = S.count('RE')

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

Buggy submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]

ac = S.count('AC')
wa = S.count('WA')
tle = S.count('TLE')
re = S.count('RE')

print('AC', x, ac)
print('WA', x, wa)
print('TLE', x, tle)
print('RE', x, re)
Problem p02641 (python)

Fixed submission:
import numpy as np

X, N= map(int,input().split())
P = list(map(int, input().split()))
P = list(set(P))

if N == 0:
    print(X)
else:
    A = [i for i in range(1,210)]

    for i in P:
        A.remove(i)

    a = (np.array(A) - X)**2
    j = np.argmin(a)
    if (A[j] - X)**2 >= X**2:
        print(0)
    else:
        print(A[j])

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

X, N= map(int,input().split())
P = list(map(int, input().split()))
P = list(set(P))

if N == 0:
    print(X)
else:
    A = [i for i in range(1,101)]

    for i in P:
        A.remove(i)

    a = (np.array(A) - X)**2
    j = np.argmin(a)
    if (A[j] - X)**2 >= X**2:
        print(0)
    else:
        print(A[j])

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

X, N= map(int,input().split())
P = list(map(int, input().split()))

if N == 0:
    print(X)
else:
    A = [i for i in range(1,101)]

    for i in P:
        A.remove(i)

    a = (np.array(A) - X)**2
    j = np.argmin(a)
    if (A[j] - X)**2 >= X**2:
        print(0)
    else:
        print(A[j])

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

X, N= map(int,input().split())
P = list(map(int, input().split()))

if N == 0:
    print(X)
else:
    A = [i for i in range(1,101)]

    for i in P:
        A.remove(i)

    a = (np.array(A) - X)**2
    j = np.argmin(a)
    print(A[j])

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

if N == 0:
    print(X)
else:
    A = [i for i in range(1,100)]

    for i in P:
        A.remove(i)

    a = (np.array(A) - X)**2
    j = np.argmin(a)
    print(A[j])
Problem p02658 (python)

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
inf=10**18
res = 1
for val in a:
    res = res*val
    if res > inf:
        res = -1
        break
if 0 in a:
    res = 0
print(res)

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

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

A = np.array(a)
a_mul = Decimal(int(np.prod(A)))

if a_mul > Decimal(10**18):
    print(-1
else:
    print(int(a_mul))
    
print(a_mul)