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

Fixed submission:
a,b = map(int,input().split())
if a==0:
    print(b)
    exit()
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans)

Buggy submission (verdict: Runtime Error):
a,b = map(int,input().split())
ab = bin(a-1)[2:]
bb = bin(b)[2:]
# print(ab)
# print(bb)
sa = []
sb = []
if int(bb[-1]):
    sb = [1]
else:
    for i in bb:
        sb += [int(i)]
if a>0:
    if int(ab[-1]):
        sa = [1]
    else:
        for i in ab:
            # print(2)
            sa += [int(i)]
sa[-1] = (a//2)%2
sb[-1] = ((b+1)//2)%2
# print(sa)
# print(sb)
# print(ab)
ta = "".join([str(i) for i in sa])
tb = "".join([str(i) for i in sb])
ta = int(ta,2)
tb = int(tb,2)
# print(ta)
# print(tb)
ans = ta^tb
# print(ta)
# print(tb)
print(ans)
Problem p03127 (python)

Fixed submission:
import fractions
n = int(input())
a = list(map(int,input().split()))
ans = a[0]
for i in range(1,n):
    ans = min(ans,fractions.gcd(ans,a[i]))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int,input().split()))
# def lcm(a,b):
#     return(a*b//math.gcd(a,b))
ans = a[0]
for i in range(1,n):
    ans = min(ans,math.gcd(ans,a[i]))
    
print(ans)
Problem p03135 (python)

Fixed submission:
t,x = map(int,input().split())
print(t/x)

Buggy submission (verdict: Runtime Error):
t,x = map(int(input()))
print(t/x)
Problem p02689 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5 + 5)
N, M = map(int, input().split())
H = [0] + list(map(int, input().split()))
Graph = [[] for _ in range(N+1)]
is_good = [False] + [True] * N
seen = [True] + [False] * N

def dfs(cur):
    global Graph, seen, H
    seen[cur] = True
    for nex in Graph[cur]:
        if H[nex] >= H[cur]:
            is_good[cur] = False
        if seen[nex]:
            continue
        dfs(nex)


for _ in range(M):
    a, b = map(int, input().split())
    Graph[a].append(b)
    Graph[b].append(a)

for i in range(1, N+1):
    if not seen[i]:
        dfs(i)

print(is_good.count(True))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
H = [0] + list(map(int, input().split()))
Graph = [[] for _ in range(N+1)]
is_good = [False] + [True] * N
seen = [True] + [False] * N

def dfs(cur):
    global Graph, seen, H
    seen[cur] = True
    for nex in Graph[cur]:
        if H[nex] >= H[cur]:
            is_good[cur] = False
        if seen[nex]:
            continue
        dfs(nex)


for _ in range(M):
    a, b = map(int, input().split())
    Graph[a].append(b)
    Graph[b].append(a)

for i in range(1, N+1):
    if not seen[i]:
        dfs(i)

print(is_good.count(True))
Problem p03013 (python)

Fixed submission:
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
one_or_two = [0] + [1] + [2] + [-1] * n
for i in range(3, n + 3):
    one_or_two[i] = (one_or_two[i-1] + one_or_two[i-2]) % mod
if m == 0:
    print(one_or_two[n])
    exit()
ans = 1
if a[0] > 1:
    ans *= one_or_two[a[0]-1]
for i in range(1, m):
    if a[i] - a[i-1] == 2:
        continue
    if a[i] - a[i-1] == 1:
        ans = 0
        break
    ans *= one_or_two[a[i] - a[i-1] - 2]
    ans %= mod
if n - a[-1] > 1:
    ans *= one_or_two[n - a[-1] - 1]
print(ans % mod)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
one_or_two = [0] + [1] + [2] + [-1] * n
for i in range(3, n + 3):
    one_or_two[i] = (one_or_two[i-1] + one_or_two[i-2]) % mod
ans = 1
if a[0] > 1:
    ans *= one_or_two[a[0]-1]
for i in range(1, m):
    if a[i] - a[i-1] == 2:
        continue
    if a[i] - a[i-1] == 1:
        ans = 0
        break
    ans *= one_or_two[a[i] - a[i-1] - 2]
    ans %= mod
if n - a[-1] > 1:
    ans *= one_or_two[n - a[m-1] - 1]
print(ans % mod)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]
mod = int(1e9 + 7)
one_or_two = [0] + [1] + [2] + [-1] * n
for i in range(3, n + 3):
    one_or_two[i] = (one_or_two[i-1] + one_or_two[i-2]) % mod
ans = 1
if a[0] > 1:
    ans *= one_or_two[a[0]-1]
for i in range(1, m):
    if a[i] - a[i-1] == 2:
        continue
    ans *= one_or_two[a[i] - a[i-1] - 2]
    ans %= mod
if n - a[-1] > 1:
    ans *= one_or_two[n - a[m-1] - 1]
print(ans % mod)
Problem p02723 (python)

Fixed submission:
s = str(input())
if (s[2]==s[3])  and (s[4]==s[5]):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = str(input())
if s[3]==s[4]  and s[5]==s[6]:
  print("Yes")
else:
  print("No")
Problem p02912 (python)

Fixed submission:
from heapq import heappush, heappop,heapify
n,m = map(int,input().split())
def minusint(x):
  return -int(x)
a = list(map(minusint,input().split()))
heapify(a)
for _ in range(m):
  ai = heappop(a)*(-1)
  heappush(a,-(ai//2))
print(-sum(a))

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
sm = sum(a)
a.sort(reverse=True)
a = a[0:min(n,m)]
discount = 0
for i in range(m):
  newa = a[0]//2
  discount += a[0] - newa
  l = len(a)
  if l == 1:
    continue
  ain = a[1:min(l,m-i-1)]
  lin = len(ain)
  if newa > ain[0]:
    a = [newa] + ain
    continue
  j = 0
  k = lin-1
  while j < k:
    mid = (j+k)//2
    if newa <= ain[mid]:
      k = mid
    else:
      j = mid
  a = ain[0:j+1] + [newa] + ain[j+1:]
Problem p02959 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(n):
  if a[i] >= b[i]:
    c += b[i]
  elif a[i]+a[i+1] >= b[i]:
    c += b[i]
    a[i+1] -= b[i]-a[i]
    continue
  else:
    c += a[i]+a[i+1]
    a[i+1]=0
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
for i in range(n):
  if b[i] >= a[i]:
    c += a[i]
  elif b[i]+b[i+1] >= a[i]:
    c += a[i]
    b[i+1] -= a[i]-b[i]
  else:
    c += b[i]+b[i+1]
    b[i+1] = 0
print(c)
Problem p02970 (python)

Fixed submission:
import math
n,d = map(int,input().split())
print(math.ceil(n/(2*d+1)))

Buggy submission (verdict: Runtime Error):
import math
n = int(input())
d = int(input())
print(math.ceil(n/(2*d+1)))
Problem p03013 (python)

Fixed submission:
n,m = map(int,input().split())
way = [1 for _ in range(n+1)]
for i in range(m):
  ai = int(input())
  way[ai] = 0
for i in range(2,n+1):
  if way[i] != 0:
    way[i] = (way[i-1]+way[i-2])%1000000007
print(way[n])

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
way = [1 for _ in range(n+1)]
b1 = 1
b2 = 1
count = 1
ai = int(input())
if ai == 1:
  b2 = 0
  ai = int(input())
  count += 1
for i in range(2,n+1):
  if i == ai:
    b1 = b2
    b2 = 0
    if count < m:
      ai = int(input())
      count+=1
  else:
    tmp = b2
    b2 = (b1 + tmp)%1000000007
    b1 = tmp
print(b2)
Problem p03286 (python)

Fixed submission:
n = int(input())
a = []
if n ==0:
  print(0)
else:
  while n != 0:
    if n%2 ==0:
      n = n/(-2)
      a.append("0")
    else:
      n = (n-1)/(-2)
      a.append("1")
    
  b = ""
  for i in range(len(a)):
    b += a[len(a)-i-1]

  print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
if n ==0:
  print(0)
else:
  while n != 0:
  if n%2 ==0:
    n = n/(-2)
    a.append("0")
  else:
    n = (n-1)/(-2)
    a.append("1")
    
b = ""
for i in range(len(a)):
  b += a[len(a)-i-1]

print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
while n > 0:
  if n%2 ==0:
    n = n/(-2)
    a.append("0")
  else:
    n = (n-1)(-2)
    a.append("1")
    
b = ""
for i in range(len(a)):
  b += a[len(a)-i-1]
  
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
while n > 0:
  if n%2 ==0:
    n = n/(-2)
    a.append("0")
  else:
    n = (n-1)(-2)
    a.append("1")
    
b = ""
for i in range(len(a)):
  b += a[len(a)-i-1]
  
print("b")
Problem p03775 (python)

Fixed submission:
n = int(input())
mx = 1
for i in range(2,int(n**(1/2))+1):
  if n%i == 0:
    mx = i
print(len(str(n//mx)))

Buggy submission (verdict: Runtime Error):
n = int(input())
mx = 1
for i in range(2,n**(1/2)+1):
  if n%i == 0:
    mx = i
print(len(str(n//mx)))
Problem p02596 (python)

Fixed submission:
import sys
K=int(input())
L=9*K
if L%7==0:
  L = L//7
n = 1
for i in range(1,K+1):
  n = n * 10 % L
  if n == 1:
    print(i)
    sys.exit()
print(-1)

Buggy submission (verdict: Runtime Error):
K = int(input())
ans = -1

if K % 7 == 0:
  for i in range(1,K+1):
    if 10 ** i % (9 * K / 7) == 1:
      ans = i
      break
else:
  for i in range(1,K+1):
    if 10 ** i % (9 * K) == 1:
      ans = i
      break
  
print(ans)
Problem p02622 (python)

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

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

Fixed submission:
from decimal import Decimal
A,B = input().split()
print(int(Decimal(A)*Decimal(B)))

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
print((A*(B*100))//100)
Problem p02771 (python)

Fixed submission:
S = list(map(int,input().split()))
print("Yes" if len(set(S))==2 else "No")

Buggy submission (verdict: Runtime Error):
S = list(map(int,input().split())
print("Yes" if len(set(S))==2 else "No")
Problem p02987 (python)

Fixed submission:
A = input()
B = [i for i in A]
B.sort()
if B.count(B[0]) == 2:
  if B.count(B[-1]) == 2:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A = input().split()
print(count(A[0]))
Problem p03072 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
A = H[0]
result = 0
for i in range(len(H)):
  if A <= H[i]:
    result += 1
    A = H[i]
  else:
    None
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
result = 1
for i in range(1,len(H)):
  if H[i] < H[i+1]:
    result += 1
  else:
    break
print(result)
Problem p03075 (python)

Fixed submission:
A = [int(input()) for i in range(5)]
if A[-1]-A[0] <= int(input()):
    print("Yay!")
else:
    print(":(")

Buggy submission (verdict: Runtime Error):
a,b,c,d,e = map(int,input().split())
if e-a <= int(input()):
    print("Yay!")
else:
    print(":(")
Problem p02629 (python)

Fixed submission:
N = int(input())

s = 1
while N > 26 ** s:
    N -= 26 ** s
    s += 1

ans = ""
N -= 1
for i in range(s)[::-1]:
    a = N // (26 ** i)
    N -= (26 ** i) * a
    ans += chr(ord("a") + a)
    
print(ans)

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

s = 1
while N > 26 ** s:
    N -= 26 ** s
    s += 1

ans = ""
N -= 1
for i in range(s):
    ans += chr(ord("a") + ord(N % 26))
    N = N // 26

print(ans[::-1])
Problem p02661 (python)

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

ba = []
for i, j in ab:
    ba.append([j, i])

ab.sort()
ba.sort(reverse = True)

if N % 2 == 1:
    n = (N+1) // 2 - 1
    ans = ba[n][0] - ab[n][0] + 1
    
else:
    n = N // 2 - 1
    ans = (ba[n][0] + ba[n+1][0]) - (ab[n][0] + ab[n+1][0]) + 1

print(ans)

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

x = [list(map(int, input().split())) for _ in range(N)]

y = []
for i,j in x:
    y.append([j, i])

x.sort()
y.sort(reverse = True)

mini = 10 ** 10
maxi = 0
if N % 2 == 1:
    idx = (N+1) // 2 - 1
    for i,j in x[idx:]:
        mini = min(mini,j)
    for i,j in y[idx:]:
        maxi = max(maxi, j)
    if maxi <= mini:
        ans = y[idx][0] - x[idx][0] + 1 
    else:
        ams = y[idx][0] - maxi +mini - x[idx][0] + 2 
        
else:
    idx = N // 2
    for i,j in x[idx:]:
        mini = min(mini,j)
    for i,j in y[idx:]:
        maxi = max(maxi, j)
    if maxi + y[idx-1][1] <= mini + x[idx-1][1]:
        ans = y[idx][0]+y[idx-1][0] - x[idx][0]-x[idx-1][0] + 1
    else:
        ans = y[idx][0]+y[idx-1][0] - maxi - y[idx-1][1] +mini + x[idx-1][1] - x[idx][0]-x[idx-1][0]

print(ans)

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

x = [list(map(int, input().split())) for _ in range(N)]

y = []
for i,j in x:
    y.append([j, i])

x.sort()
y.sort(reverse = True)

mini = 10 ** 10
maxi = 0
if N % 2 == 1:
    idx = (N+1) // 2 - 1
    for i,j in x[idx:]:
        mini = min(mini,j)
    for i,j in y[idx:]:
        maxi = max(maxi, j)
    if maxi <= mini:
        ans = y[idx][0] - x[idx][0] + 1 
    else:
        ams = y[idx][0] - maxi +mini - x[idx][0] + 2 
        
else:
    idx = N // 2
    for i,j in x[idx:]:
        mini = min(mini,j)
    for i,j in y[idx:]:
        maxi = max(maxi, j)
    if maxi + y[idx-1][1] <= mini + x[idx-1][1]:
        ans = y[idx][0]+y[idx-1][0] - x[idx][0]-x[idx-1][0] + 1
    else:
        ans = y[idx][0]+y[idx-1][0] - maxi - y[idx-1][1] +mini + x[idx-1][1] - x[idx][0]-x[idx-1][0]

print(ans)
Problem p03045 (python)

Fixed submission:
N, M = map(int, input().split())
ans = [-1] * N

def find(x):
    global ans
    if ans[x] == -1:
        return x
    else:
        ans[x] = find(ans[x])
        return ans[x]
    
for _ in range(M):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    xx = find(x)
    yy = find(y)
    if ans[x] == ans[y] == -1:
        ans[y] = x
    elif xx == yy:
        continue
    else:
        ans[yy] = xx

n = 0
for i in ans:
    if i == -1:
        n += 1

print(n)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
ans = [-1] * N

def find(x):
    global ans
    if ans[x] == -1:
        return x
    else:
        return find(ans[x])
    
for _ in range(M):
    x, y, z = map(int, input().split())
    x -= 1
    y -= 1
    xx = find(x)
    yy = find(y)
    if ans[x] == ans[y] == -1:
        ans[y] = x
    elif xx == yy:
        continue
    else:
        ans[yy] = xx

n = 0
for i in ans:
    if i == -1:
        n += 1

print(n)
Problem p03221 (python)

Fixed submission:
import numpy as np
from itertools import accumulate

N, M = map(int, input().split())
P = []
p = [0] * (N+1)
for i in range(M):
    p1, y1 = map(str, input().split())
    p[int(p1)] += 1
    P.append(int(p1+y1.rjust(10,"0")))
    
ans = np.argsort(P)
ans = np.argsort(ans)
p = list(accumulate(p))

for i in range(M):
    a = P[i] // 10 ** 10 
    print(str(a).rjust(6,"0") + str(ans[i] - p[a-1] + 1).rjust(6,"0"))

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

N, M = map(int, input().split())
P = []
p = [0] * (N+1)
for i in range(M):
    p1, y1 = map(str, input().split())
    p[int(p1)] += 1
    P.append(int(p1+y1.rjust(10,"0")))
    
ans = np.argsort(P)
ans = np.argsort(ans)
p = list(accumulate(p))

for i in range(M):
    a = P[i] // 10 ** 6 
    print(str(a).rjust(6,"0") + str(ans[i] - p[a-1] + 1).rjust(6,"0"))

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

N, M = map(int, input().split())
P = []
p = [0] * (N+1)
for i in range(M):
    p1, y1 = map(str, input().split())
    p[int(p1)] += 1
    P.append(int(p1+y1.rjust(6,"0")))
    
ans = np.argsort(P)
ans = np.argsort(ans)
p = list(accumulate(p))

for i in range(M):
    a = P[i] // 10 ** 6 
    print(int(str(a).rjust(6,"0") + str(ans[i] - p[a-1] + 1).rjust(6,"0")))

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

N, M = map(int, input().split())
P = []
p = [0] * (N+1)
for i in range(M):
    p1, y1 = map(str, input().split())
    p[int(p1)] += 1
    P.append(int(p1+y1.rjust(6,"0")))
    
ans = np.argsort(P)
ans = np.argsort(ans)
p = list(accumulate(p))

for i in range(M):
    a = int(P[i]) // 10 ** 6 
    print(str(a).rjust(6,"0") + str(ans[i] - p[a-1] + 1).rjust(6,"0"))

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

N, M = map(int, input().split())
P = []
p = [0] * (N+1)
for i in range(M):
    p1, y1 = map(str, input().split())
    p[int(p1)] += 1
    P.append(p1+y1.rjust(6,"0"))
    
ans = np.argsort(P)
ans = np.argsort(ans)
p = list(accumulate(p))

for i in range(M):
    a = int(P[i]) // 10 ** 6 
    print(str(a).rjust(6,"0") + str(ans[i] - p[a-1] + 1).rjust(6,"0"))
Problem p03986 (python)

Fixed submission:
X = input()

ans = 0
cnt = 0
for i in range(len(X)):
    if cnt == 0 and X[i] == "T":
        ans += 1
    else:
        if X[i] == "T":
            cnt += 1
        else:
            cnt -= 1

print(ans*2)

Buggy submission (verdict: Runtime Error):
from itertools import groupby
x = [[i,len(list(j))] for i,j in groupby(input())]

ans = []
if x[0][0] == "T":
    ans.append(x[0][1])
if x[-1][0] == "S":
    ans.append(x[-1][1])
    
print(max(ans)*2)
Problem p03127 (python)

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

ans = a[0]
for x in a:
  ans = fractions.gcd(ans, x)
print(ans)

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

ans = a[0]
for x in a:
  ans = math.gcd(ans, x)
print(ans)
Problem p03745 (python)

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

i = 0
ans = 0
for a in A:
  right, right2 = i, i
  while right+1 < N and A[right] <= A[right+1]: right += 1
  while right2+1 < N and A[right2] >= A[right2+1]: right2 += 1
  i = max(right, right2) + 1
  ans += 1
  if i >= N: break
print(ans)

Buggy submission (verdict: Runtime Error):
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL_DEBUG
  #include "LOCAL_DEBUG.hpp"
#endif
#define int long long
const int INF = 1LL << 60;

signed main(){

  int n; cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }

  int ans = 0;
  for(int i = 0; i < n; i++){
    int right1 = i, right2 = i;
    while(right1+1 < n && a[right1] <= a[right1+1]) right1++;
    while(right2+1 < n && a[right2] >= a[right2+1]) right2++;
    i = max(right1, right2);
    ans++;
  }
  cout << ans << endl;

  return 0;
}
Problem p03774 (python)

Fixed submission:
n, m = map(int, input().split())
a, b, c, d = [], [], [], []
for i in range(n) :
  ai, bi = map(int, input().split())
  a.append(ai), b.append(bi)
for i in range(m) :
  ci, di = map(int, input().split())
  c.append(ci), d.append(di)

for i in range(n) :
  cost, ans = 10**18, 0
  for j in range(m) :
    if cost > abs(a[i] - c[j]) + abs(b[i] - d[j]) :
      cost = abs(a[i] - c[j]) + abs(b[i] - d[j])
      ans = j+1
  print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n)]
cd = [list(map(int, input().split())) for i in range(n)]

for a, b in ab:
  cost, idx = 10**18, 0
  for i, (c, d) in enumerate(cd):
    if cost > abs(a - c) + abs(b - d):
      cost = abs(a - c) + abs(b - d)
      idx = i + 1
  print(idx)
Problem p02627 (python)

Fixed submission:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)
sorted(S) #Sを辞書順にソート
exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
N=input()
if N=="A" or N=="B" or N=="C" or N=="D" or N=="E" or N=="F" or N=="G" or N=="H" or N=="I" or N=="J" or N=="K" or N=="L" or N=="M" or N=="N" or N=="O" or N=="P" or N=="Q" or N=="R" or N=="S" or N=="T" or N=="U"or N=="V"or N=="W"or N=="X" or N=="Y" or N=="Z":
    print("A")
else: print("a")

Buggy submission (verdict: Runtime Error):
N=int(input())
number=list(map(int,input().split()))
Q=int(input())
for i in range(Q):
    B,C=map(int,input().split())
    if B in number:
        for i in range(N):
            if number[i]==B:
                number[i]=C
    print(sum(number))
Problem p02659 (python)

Fixed submission:
import math
A,B = input().split()
A = int(A)
B = round(float(B)*100)
ans = A*B
print(ans//100)

Buggy submission (verdict: Runtime Error):
import math
A,B = input().split()
A = int(A)
B = int(round(B*100))
ans = A*B
print(math.floor(ans/100))

Buggy submission (verdict: Runtime Error):
import math
A,B = input().split()
A = int(A)
B = round(B*100)
ans = A*B
print(math.floor(ans/100))
Problem p02682 (python)

Fixed submission:
A,B,C,K=map(int,input().split())
if K<=A:
    print(K)
    exit(0)
else:
    if K<=A+B:
        print(A)
        exit(0)
    else:
        print(A-(K-A-B))

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
numberA=[1]*A
numberB=[0]*B
numberC=[-1]*C
number=numberA+numberB+numberC
numberX=number[0:K]
print(sum(numberX))

Buggy submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
numberA=[1]*A
numberB=[0]*B
numberC=[-1]*C
number=numberA+numberB+numberC
numberX=number[0:K]
print(sum(numberX))
Problem p02701 (python)

Fixed submission:
import collections
N = int(input())
item = []
for i in range(N):
    item.append(input())
item_count=collections.Counter(item)
print(len(item_count))

Buggy submission (verdict: Runtime Error):
N = int(input())
number=[]
for i in range(N):
    number.append(input())
print(len(Counter(number)))

Buggy submission (verdict: Runtime Error):
N = int(input())
number=[]
for i in range(N):
    number.append(input())
print(len(Counter(number)))