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

Fixed submission:
Q = int(input())
query = [list(map(int, input().split())) for _ in range(Q)]

def is_prime(n):
  if n <= 1:
    return False
  if n == 2:
    return True
  i = 2
  while i * i <= n:
    if n % i == 0:
      return False
    i += 1
  return True

prime = []
ans = [0]*100001
sum_a = [0]*100001
for n in range(1, 100000+1):
  if is_prime(n) and is_prime((n+1)//2):
    if n != 2:
      prime.append(n)
      ans[n] = 1
  sum_a[n] = sum_a[n-1] + ans[n]

for l, r in query:
  print(sum_a[r] - sum_a[l-1])

Buggy submission (verdict: Runtime Error):
Q = int(input())
query = [list(map(int, input().split())) for _ in range(Q)]

def is_prime(n):
  if n <= 1:
    return False
  if n == 2:
    return True
  i = 2
  while i * i <= n:
    if n % i == 0:
      return False
    i += 1
  return True

prime = []
ans = [0]*10001
sum_a = [0]*10001
for n in range(1, 10000+1):
  if is_prime(n) and is_prime((n+1)//2):
    if n != 2:
      prime.append(n)
      ans[n] = 1
  sum_a[n] = sum_a[n-1] + ans[n]

for l, r in query:
  print(sum_a[r] - sum_a[l-1])

Buggy submission (verdict: Runtime Error):
Q = int(input())
query = [list(map(int, input().split())) for _ in range(Q)]

def is_prime(n):
  if n <= 1:
    return False
  if n == 2:
    return True
  i = 2
  while i * i <= n:
    if n % i == 0:
      return False
    i += 1
  return True

prime = []
ans = [0]*10001
sum_a = [0]*10001
for n in range(3, 10000):
  if is_prime(n) and is_prime((n+1)//2):
    prime.append(n)
    ans[n] = 1
  sum_a[n] = sum_a[n-1] + ans[n]

for l, r in query:
  print(sum_a[r] - sum_a[l-1])
Problem p03543 (python)

Fixed submission:
s = input()
ans = "No"
if s[0] == s[1] == s[2]:
  ans = "Yes"
elif s[1] == s[2] == s[3]:
  ans = "Yes"
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
ans = "No"
if s[0] == S[1] == s[2]:
  ans = "Yes"
elif s[1] == s[2] == s[3]:
  ans = "Yes"
print(ans)
Problem p03546 (python)

Fixed submission:
from scipy.sparse.csgraph import floyd_warshall
from itertools import permutations

H, W = map(int, input().split())
C = [[0]*10 for _ in range(10)]
A = [[0]*W for _ in range(H)]

for i in range(10):
  C[i] = list(map(int, input().split()))

C = floyd_warshall(C)  

cost = 0
for i in range(H):
  A[i] = list(map(int, input().split()))
  for a in A[i]:
    if a != -1:
      cost += C[a][1]

print(int(cost))

Buggy submission (verdict: Runtime Error):
# ABC79 D - Wall
from scipy.sparse.csgraph import floyd_warshall
from itertools import permutations

H, W = map(int, input().split())
C = [list(map(int, input().split())) for _ in range(10)]
A = [list(map(int, input().split()))　for _ in range(H)]

C = floyd_warshall(C)  

cost = 0
for i in range(H):
    for a in A[i]:
        if a != -1:
            cost += C[a][1]

print(int(cost))
Problem p03555 (python)

Fixed submission:
A = input()
B = input()
if A[0] == B[2] and A[1] == B[1] and A[2] == B[0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
B = list(map(int,input().split()))
if A[0] == B[2] and A[1] == B[1] and A[2] == B[0]:
  print("YES")
else:
  print("NO")
Problem p03563 (python)

Fixed submission:
R = int(input())
G = int(input())
print(2*G - R)

Buggy submission (verdict: Runtime Error):
R, G = map(int, input().split())
print(2*G - R)
Problem p03612 (python)

Fixed submission:
N = int(input())
P = list(map(int,input().split()))
cnt = 0
for i in range(1, N):
  if P[i-1] == i:
    tmp = P[i-1]
    P[i-1] = P[i]
    P[i] = tmp
    cnt += 1
if P[N-1] == N:
  tmp = P[N-1]
  P[N-1] = P[N-2]
  P[N-2] = tmp
  cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
P = list(map(int,input().split()))
cnt = 0
for i in range(1, N+1):
  if P[i-1] == i:
    tmp = P[i-1]
    P[i-1] = P[i]
    P[i] = tmp
    cnt += 1
print(cnt)
Problem p03624 (python)

Fixed submission:
S = input()
for i in range(ord("a"), ord("z")+1):
  if chr(i) not in S:
    print(chr(i))
    exit()
print("None")

Buggy submission (verdict: Runtime Error):
S = input()
for i in range(ord(a), ord(z)+1):
  if chr(i) not in S:
    print(chr(i))
    exit()
Problem p03632 (python)

Fixed submission:
A, B, C, D = map(int, input().split())
print(max(min(B,D) - max(A,C), 0))

Buggy submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
print(max(min(B,D) - max(A,C) 0))
Problem p03645 (python)

Fixed submission:
N, M = map(int, input().split())
edges = [[] for i in range(N)]

for i in range(M):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  edges[a].append(b)

for i in edges[0]:
  if N-1 in edges[i]:
    print("POSSIBLE")
    exit()
print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(M):
  a, b = map(lambda x: int(x)-1, input().split())
  G[a].append(b)

for v in G[0]:
  if nv in G[v]:
    print("POSSIBLE")
    exit()
print("IMPOSSIBLE")
Problem p03671 (python)

Fixed submission:
a, b, c = map(int, input().split())
print((a + b + c) - max(a, b, c))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(sum(a, b, c) - max(a, b, c))
Problem p03679 (python)

Fixed submission:
X, A, B = map(int, input().split())
if B - A <= 0:
  print("delicious")
elif 0 < B - A <= X:
  print("safe")
else:
  print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if B - A <= 0:
  print("delicious")
elif:
  0 < B - A and B - A <= X:
  print("safe")
else:
  print("dangerous")

Buggy submission (verdict: Runtime Error):
X, A, B = map(int, input().split())
if B - A <= 0:
  print("delicious")
elif:
  0 < B - A < X:
  print("safe")
else:
  print("dangerous")
Problem p03680 (python)

Fixed submission:
N = int(input())
A = [int(input()) for _ in range(N)]

nb = 1
for i in range(N):
  nb = A[nb-1]
  if nb == 2:
    print(i+1)
    exit()
print(-1)

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

nb = 0
for i in range(N):
  nb = A[nb]
  if nb == 2:
    print(i+1)
    exit()
Problem p03698 (python)

Fixed submission:
from collections import defaultdict
S = input()
d = defaultdict(int)
for i in range(len(S)):
  d[S[i]] += 1
for val in d.values():
  if val != 1:
    print("no")
    exit()
print("yes")

Buggy submission (verdict: Runtime Error):
S = input()
A = [0]*len(S)
for i in range(len(S)):
  A[S[i]] += 1
if max(A) == 1:
  print("yes")
else:
  print("no")
Problem p03721 (python)

Fixed submission:
from collections import defaultdict
N, K = map(int, input().split())
d = defaultdict(int)
for _ in range(N):
  a, b = map(int, input().split())
  d[a] += b
d = sorted(d.items(), key=lambda x:x[0])
s = 0
for i in range(len(d)):
  s += d[i][1]
  if K <= s:
    print(d[i][0])
    exit()

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
A, B = [0]*N, [0]*N
s = ""
for i in range(N):
  A[i], B[i] = input().split()
  s += A[i] * int(B[i])
print(s[K-1])
Problem p03729 (python)

Fixed submission:
A, B, C = input().split()
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A[-1] == B[0] and B[-1] == C[0]:
  print("YES")
else:
  print("NO")
Problem p03737 (python)

Fixed submission:
a,b,c=input().split()
print((a[0]+b[0]+c[0]).upper())

Buggy submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
print((a[0]+b[0]+c[0]).upper())
Problem p03763 (python)

Fixed submission:
from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)

Buggy submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
S = [input() for _ in range(N)
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)
Problem p03777 (python)

Fixed submission:
a, b = input().split()
if a == "H":
  print(b)
else:
  print("H") if b == "D" else print("D")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a == "H":
  print(b)
else:
  print("H") if b == "D" else print("D")
Problem p03860 (python)

Fixed submission:
A, B, C = input().split()
print("A"+B[0]+"C")

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
print("A"+B+"C")
Problem p04012 (python)

Fixed submission:
S = input()
st = list(set(S))
for i in range(len(st)):
  if S.count(st[i]) % 2 != 0:
    print("No")
    exit()
print("Yes")

Buggy submission (verdict: Runtime Error):
S = input()
st = set(S)
for i in range(len(st)):
  if S.count(st[i]) % 2 != 0:
    print("No")
    exit()
print("Yes")
Problem p04029 (python)

Fixed submission:
print(sum([i for i in range(1, int(input())+1)]))

Buggy submission (verdict: Runtime Error):
print(sum[i for i in range(1, int(input())+1)]

Buggy submission (verdict: Runtime Error):
print(sum[for i in range(1, int(input())+1)]
Problem p02573 (python)

Fixed submission:
N, M = map(int, input().split())
ad_list = {}
for i in range(M):
  a, b = map(int, input().split())
  if a in ad_list:
    ad_list[a].add(b)
  else:
    ad_list[a] = {b}
  if b in ad_list:
    ad_list[b].add(a)
  else:
    ad_list[b] = {a}

#BFS
ans = 0
done = [True for i in range(N+1)]

import queue
q = queue.Queue()

for i in range(1, N+1):
  if done[i]:
    done[i] = False
    tmp = 1
    if i in ad_list:
      q.put(i)
      while not q.empty():
        x = q.get()
        for y in ad_list[x]:
          if done[y]:
            tmp += 1
            done[y] = False
            q.put(y)
    ans = max(ans, tmp)

print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ad_list = {}
for i in range(M):
  a, b = map(int, input().split())
  if a in ad_list:
    ad_list[a].add(b)
  else:
    ad_list[a] = {b}
  if b in ad_list:
    ad_list[b].add(a)
  else:
    ad_list[b] = {a}

#BFS
ans = 0
done = [True for i in range(N+1)]

def dfs(x):
  global done
  global tmp
  for y in ad_list[x]:
    if done[y]:
      done[y] = False
      tmp += 1
      dfs(y)
      
for i in range(1, N+1):
  if done[i]:
    done[i] = False
    tmp = 1
    if i in ad_list:
        dfs(i)
    ans = max(ans, tmp)

print(ans)
Problem p02642 (python)

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

F = [0 for i in range(A[-1]+1)]
for i in A:
  F[i] = 1

c_set = set()
for i in A:
  if F[i] == 0:
    continue
  c_set.add(i)
  for j in range(i, A[-1]+1, i):
    F[j] = 0

ans = len(c_set)
d = 0
d_set = set()
for i in range(N):
  if i == 0 and N > 1:
    if A[i] == A[i+1]:
      d_set.add(A[i])
  elif i < N - 1 and A[i-1] != A[i] and A[i] == A[i+1]:
    d_set.add(A[i])

print( len(c_set - d_set) )

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

F = [0 for i in range(A[-1]+1)]
for i in A:
  F[i] = 1

c_set = set()
for i in A:
  if F[i] == 0:
    continue
  c_set.add(i)
  for j in range(i, A[-1]+1, i):
    F[j] = 0

ans = len(c_set)
d = 0
d_set = set()
for i in range(N):
  if i == 0:
    if A[i] == A[i+1]:
      d_set.add(A[i])
  elif i < N - 1 and A[i-1] != A[i] and A[i] == A[i+1]:
    d_set.add(A[i])

print( len(c_set - d_set) )
Problem p02663 (python)

Fixed submission:
H, M, h, m, K = map(int, input().split())

print( max(0, 60*(h-H) + m - M - K) )

Buggy submission (verdict: Runtime Error):
H, M, h, m, K = map(int, input().slpit())

print( max(0, 60*(h-H) + m - M - K) )
Problem p02683 (python)

Fixed submission:
big_int = 10 ** 9

N, M, X = map(int, input().split())

L = [0 for i in range(N)]
for i in range(N):
  L[i] = tuple(map(int, input().split()))

def foo(i):
  t = i
  T = [0 for j in range(M+1)]
  for j in range(N):
    for k in range(M+1):
      T[k] += L[j][k] * (t%2)
    t //= 2
  for k in range(1,M+1):
    if T[k] < X:
      return big_int
  return T[0]
  
ans = big_int

for i in range(2**N):
  ans = min(ans, foo(i))
  
if ans == big_int:
  print(-1)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
big_int = 10 ** 9

N, M, X = map(int, input().split())

L = []
for i in range(N):
  L.insert( tuple(map(int, input().split())) )

def foo(i):
  T = [0 for j in range(M+1)]
  for j in range(N):
    for k in range(M+1):
      T[k] += L[j][k] * (i%2)
      i //= 2
  for k in range(1,M+1):
    if T[k] < X:
      return big_int
  return T[0]
  
ans = big_int

for i in range(2**N):
  ans = min(ans, foo(i))
  
if ans == big_int:
  print(-1)
else:
  print(ans)
Problem p02684 (python)

Fixed submission:
N, K = map(int, input().split())
A = tuple( map(int, input().split()) )

L = [0 for i in range(N+1)]
L[1] = 1
x = 1
t = 1
while K>0:
  t += 1
  K -= 1
  x = A[x-1]
  if L[x] != 0:
    p = t - L[x]
    K %= p
    break
  else:
    L[x] = t
    
while K>0:
  x = A[x-1]
  K -= 1
print(x)

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

L = [0 for i in range(N+1)]
L[1] = 1
x = 1
t = 1
while K>0:
  t += 1
  K -= 1
  x = A[x]
  if L[x] != 0:
    p = t - L[x]
    K %= p
    break
  else:
    L[x] = t
    
while K>0:
  x = A[x]
  K -= 1
print(x)
Problem p02691 (python)

Fixed submission:
N = int(input())

A = tuple( map(int, input().split()) )

dict_ = {}

ans = 0
for i in range(N):
  k = (i+1) - A[i]
  if k in dict_:
    ans += dict_[k]
  ad = (i+1) + A[i]
  if ad in dict_:
    dict_[ad] = dict_[ad] + 1
  else:
    dict_[ad] = 1

print(ans)

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

A = tuple( map(int, input().split()) )

dict_ = {}

ans = 0
for i in range(N):
  k = (i+1) - A[i]
  if k in dict_:
    ans += dict[k]
  ad = (i+1) + A[i]
  if ad in dict_:
    dict_[ad] = dict_[ad] + 1
  dict_[ad] = 1

print(ans)
Problem p02696 (python)

Fixed submission:
A, B, N = map(int, input().split())

# floor( Ar / B ) : r = 0..min(B-1,N%B)

if N < B:
  r = N
else:
  r = B-1

print( A*r // B )

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

# floor( Ar / B ) : r = 0..min(B-1,N%B)

r = N if N < B else r = B-1

print( A*r // B )
Problem p02700 (python)

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

t = 0

while True:
  if t == 0:
    C = C - B
    t = 1
    if C <= 0:
      print('Yes')
      break
  else:
    A = A - D
    t = 0
    if A <= 0:
      print('No')
      break

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

t = 0

while True:
  if t = 0:
    C = C - B
    t = 1
    if C <= 0:
      print('Yes')
      break
  else:
    A = A - D
    t = 0
    if A <= 0:
      print('No')
      break
Problem p02706 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
s = sum(A)
 
print( max(N - s, -1) )

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
s = sum(A)
 
print( max(N - A, -1) )

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

s = sum(A)

print( max(N - A, -1) )
Problem p02732 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
#L = [0 for i in range(N)]
dict = {}

for i in A:
  if i in dict:
    dict[i] = dict[i] + 1
  else:
    dict[i] = 1

#print(dict)
total = 0;
for i in dict:
#  print("i:" + str(i) + " " + str(dict[i]))
  total += dict[i]*(dict[i]-1) // 2

#print("T:" + str(total))

for i in A:
  print(total - dict[i] + 1)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input.split()))
L = [0 for i in range(N)]

total = 0

for i in range(N):
  r = 0
  for j in range(N):
    if i != j and A[i] == A[j]:
      r += 1
  L[i] = r
  total += r

total = total // 2

for i in L:
  print(total - L[i])
Problem p02741 (python)

Fixed submission:
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())

print(L[K-1])

Buggy submission (verdict: Runtime Error):
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

K = int(input())

print(L[K])
Problem p02756 (python)

Fixed submission:
S = input()
N = int(input())

pre = ""
suf = ""
f = 1
for i in range(N):
  Q = input()
  if Q[0] == "1":
    f *= -1
  elif Q[2] == "1":
    if f > 0:
      pre = Q[4] + pre
    else:
      suf = suf + Q[4]
  else:
    if f < 0:
      pre = Q[4] + pre
    else:
      suf = suf + Q[4]

ans = pre + S + suf
if f > 0:
  print(ans)
else:
  print(ans[::-1])

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

pre = ""
suf = ""
f = 1
for i in range(N):
  Q = input()
  if Q[0] == "1":
    f *= -1
  elif Q[2] == "1":
    if f > 0:
      pre = Q[4] + pre
    else:
      suf = sef + Q[4]
  else:
    if f < 0:
      pre = Q[4] + pre
    else:
      suf = sef + Q[4]

ans = pre + S + suf
if f > 0:
  print(ans)
else:
  print(ans[::-1])
Problem p02761 (python)

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

if N == 1:
  ans = ["*"]
elif N == 2:
  ans = ["*","*"]
else: #N==3
  ans = ["*","*","*"]
  
ng = False
for i in range(M):
  s, c = input().split()
  s = int(s)-1
  if ans[s] != '*' and ans[s] != c:
    ng = True
    break
  elif s==0 and c=="0" and N>1:
    ng = True
    break
  else:
    ans[s] = c

if N == 1 and ans[0] == "*":
  ans[0] = "0"
if N == 2:
  if ans[0] == "*":
    ans[0] = "1"
  if ans[1] == "*":
    ans[1] = "0"
if N == 3:
  if ans[0] == "*":
    ans[0] = "1"
  if ans[1] == "*":
    ans[1] = "0"
  if ans[2] == "*":
    ans[2] = "0"

if ng:
  print(-1)
else:
  print("".join(ans))

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

if N == 1:
  ans = "*"
elif N == 2:
  ans = "**"
else: #N==3
  ans = "***"

  
ng = False
for i in range(M):
  s, c = input().split()
  s = int(s)
  if ans[s] != '*' or ans[s] != c:
    ng = True
    break
  else:
    ans[s] = c

if N == 1 and ans == "*":
  ans = "0"
if N == 2:
  if ans[0] == "*":
    ans[0] = "1"
  if ans[1] == "*":
    ans[1] = "0"
if N == 3:
  if ans[0] == "*":
    ans[0] = "1"
  if ans[1] == "*":
    ans[1] = "0"
  if ans[2] == "*":
    ans[2] = "0"

if ng:
  print(-1)
else:
  print(int(ans))
Problem p02772 (python)

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

s = "APPROVED"
for i in AL:
  if i%2 == 0 and i%3 != 0 and i%5 != 0:
    s = "DENIED"
print(s)

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

s = "APPROVED"
for i in AL:
  if i%2 == 0 and i%3 != 0 and i%5 != 0:
    s = DENIED
print(s)
Problem p02886 (python)

Fixed submission:
N = int(input())
X = list(map(int, input().split()))
ans = 0
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().spit()))
for i in range(N):
  for j in range(i+1, N):
    ans += X[i] * X[j]
    
print(ans)
Problem p02910 (python)

Fixed submission:
S = input()
O = ['R','U','D']
E = ['L','U','D']
ng = False
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] not in O:
      ng = True
      break
  else:
    if S[i] not in E:
      ng = True
      break
print('No') if ng else print('Yes')

Buggy submission (verdict: Runtime Error):
S = input()
O = ['R','U','D']
E = ['L','U','D']
ng = False
for i in range(len(S)):
  if i % 2 == 0:
    if S[i] not in O:
      ng = True
      break
  else:
    if S[i] not in E:
      ng = True
      break
print('No') if ng print('Yes')
Problem p02921 (python)

Fixed submission:
S = input()
T = input()
count = 0
for i in range(3):
  if S[i] == T[i]:
    count += 1
print(count)

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
count = 0
for i in range(len(3)):
  if S[i] == T[i]:
    count += 1
print(count)
Problem p02945 (python)

Fixed submission:
A, B = map(int, input().split())
print( max(A+B, A-B, A*B))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print( max(A+B A-B, A*B))
Problem p02988 (python)

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

ans = 0

for i in range(N-2):
  if P[i] > P[i+1] and P[i+1] > P[i+2] or P[i] < P[i+1] and P[i+1] < P[i+2]:
    ans += 1

print(ans)

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

ans = 0

for i in range(N-2):
  if P[i] > P[i+1] and P[i+1] > P[i+2] or P[i] < P[i+1] and P[i+1] < P[i+2] or :
    ans += 1

print(ans)
Problem p02994 (python)

Fixed submission:
N, L = map(int, input().split())
#L, L+N-1 => sum: (2L+N-1)*N // 2
A = (2 * L + N - 1)*N // 2
if L*(L+N-1) <= 0:
  print( A )
elif L+N-1 < 0:
  print( A - (L+N-1) )
else:
  print( A - L )

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
#L, L+N-1 => sum: (2L+N-1)*N // 2
A = (2L+N-1)*N // 2
if L*(L+N-1) <= 0:
  print( A )
elif L+N-1 < 0:
  print( A - (L+N-1) )
else:
  print( A - L )
Problem p03086 (python)

Fixed submission:
S = input()
s = {"A", "C", "G", "T"}
ans = 0
tmp = 0
for i in S:
  if i in s:
    tmp += 1
    ans = max(ans, tmp)
  else:
    tmp = 0
print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
s = {"A", "C", "G", "T"}
ans = 0
for i in S:
  if i in s:
    tmp += 1
    ans = max(ans, tmp)
  else:
    tmp = 0
print(ans)
Problem p03126 (python)

Fixed submission:
N, M = map(int, input().split())
t = [0 for i in range(M+1)]
for i in range(N):
  A = list(map(int, input().split()))
  for j in range(1, A[0]+1):
    t[ A[j] ] += 1
ans = 0
for i in t:
  if i == N:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
t = [0 for i in range(M+1)]
for i in range(N):
  A = map(int, input().split())
  for j in range(1, A[0]+1):
    t[ A[j] ] += 1
ans = 0
for i in t:
  if i == N:
    ans += 1
print(ans)
Problem p03239 (python)

Fixed submission:
N, T = map(int, input().split())
ans = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans) if ans < 1001 else print("TLE")

Buggy submission (verdict: Runtime Error):
N, T = map(int, input().split())
c = 1001
for i in range(N):
  c, t = map(int, input().split())
  if t <= T:
    ans = min(ans, c)
print(ans) if c < 1001 else print("TLE")
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()

def f(s, t):
  set_s = set()
  set_t = set()
  for i in s:
    set_s.add(i)
  for i in t:
    set_t.add(i)
  return len( set_s & set_t )

ans = 0
for i in range(1,N):
  s = S[i:]
  t = S[:i]
  ans = max(ans, f(s ,t))
print(ans)

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

def f(s, t):
  set_s = set()
  set_t = set()
  for i in s:
    set_s.add(i)
  for i in t:
    set_t.add(i)
  return len( set_s & set_t )

for i in range(1,N):
  s = S[i:]
  t = S[:i]
  ans = max(ans, f(s ,t))
print(ans)
Problem p03385 (python)

Fixed submission:
s = input()
L = [s[0], s[1], s[2]]
L.sort()
S = "".join(L)
print("Yes") if S == "abc" else print("No")

Buggy submission (verdict: Runtime Error):
s = input()
L = [s[0], s[1], s[2]].sort().join()
print("Yes") if L == "abc" else print("No")

Buggy submission (verdict: Runtime Error):
s = input().sort()
print("Yes") if s == "abc" else print("No")

Buggy submission (verdict: Runtime Error):
s = input().sort()
print("Yes") if s = "abc" else print("No")
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

print( min(A,B) + min(C,D))

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

print( min(A,B) + min(C,D))
Problem p03815 (python)

Fixed submission:
x = int(input())

N = x // 11
M = x % 11

if M == 0:
  ans = 0
elif M <= 6:
  ans = 1
else:
  ans = 2

print(2*N + ans)

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

N = x // 11
M = x % 11

ans = 0
if M <= 5:
  ans = 1
else ans = 2

print(2*N + ans)

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

N = x // 11
M = x % 11

ans = 0
if M <= 5:
  ans = 1
else ans = 2

print(2N + ans)