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

Fixed submission:
import itertools
a,b=map(int,input().split())
A=[]
for _ in range(a-1):
  A.append(_+2)
List=[list(map(int,input().split())) for i in range(b)]
count=0
for i in itertools.permutations(A):
  ju=True
  if [1,i[0]] in List or [i[0],1] in List:
    ju=True
  else:
    ju=False
  for j in range(a-2):
    if not([i[j],i[j+1]] in List) and not([i[j+1],i[j]] in List):
      ju=False
  if ju:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
import math
import sys
from collections import deque
import copy
import itertools
from itertools import permutations
def mi() : return map(int,input().split())
def i() : return int(input())
from scipy.special import perm #print(perm(4,2,exact=True))=4P2=3
a,b=mi()
ans=0
l=[[] for _ in range(a)]
for i in range(b):
  u,v=mi()
  l[u-1].append(v-1)
  l[v-1].append(u-1)
S=[]
for i in range(1,a):
  S.append(i)
lst=list(itertools.permutations(S))
for i in lst:
  x=0
  t=True
  for w in range(len(i)):
    if not i[w] in l[x]:
      t=False
      break
    x=i[w]
  if t:
    ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
import math
import sys
from collections import deque
import copy
import itertools
from itertools import permutations
def mi() : return map(int,input().split())
def i() : return int(input())
from scipy.special import perm #print(perm(4,2,exact=True))=4P2=3
a,b=mi()
ans=0
l=[[] for _ in range(a)]
for i in range(b):
  u,v=mi()
  l[u-1].append(v-1)
  l[v-1].append(u-1)
S=[]
for i in range(1,a):
  S.append(i)
lst=list(permutations(S))
for i in lst:
  x=0
  t=True
  for w in range(len(i)):
    if not i[w] in l[x]:
      t=False
      break
    x=i[w]
  if t:
    ans+=1
print(ans)
Problem p03834 (python)

Fixed submission:
a,b,c = input().split(',')
print(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c = input()split(',')
print(a,b,c)

Buggy submission (verdict: Runtime Error):
a,b,c = input().split(,)
print(a,b,c)
Problem p03705 (python)

Fixed submission:
n, a, b = [int(x) for x in raw_input().split()]
print max((b - a + 1) * (n - 2) - (n - 3), 0)
		#^^THIS IS LENGTH OF [a, ..., a, a+1, ..., b]
							  #^^THIS IS THE PART WHICH IS UNAVAILABLE

Buggy submission (verdict: Runtime Error):
def main():
	n, a, b = [int(x) for x in raw_input().split()]
	if a == b:
		print 1
		return
	if n == 1:
		print 0
		return
	from itertools import combinations
	s = set()
	for t in combinations(sorted(range(a, b + 1) * 2), n - 2):
		ans = a + b
		for e in t:
			ans += e
		s.add(ans)
	print len(s)
	print s
	return
	
main()
Problem p02688 (python)

Fixed submission:
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(map(int, input().split()))
 
print(len(set(range(1, N+1)) - tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
 	tmp[j-1] |= 1 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
 	tmp[j-1] |= 1 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
 	tmp[j] |= 1 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in set(map(int, input().split())):
 	tmp[j] |= 1 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in set(map(int, input().split()))
 	tmp[j] |= 1 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
    tmp[j] |= 1
 
print(sum(tmp))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(N):
  input()
  tmp |= set(map(int, input().split()))
 
print(len(set(range(1, N+1)) - tmp))

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

tmp = {}

for i in range(N):
  input()
  tmp |= set(map(int, input().split()))

print(len(set(range(1, N+1)) - tmp))
Problem p03073 (python)

Fixed submission:
S = input()
li = []
for s in S:
    li.append(int(s))

count = 0
first = li[0]
for i in range(len(li)):
    if i % 2 == 0:
        if li[i] != first:
            count += 1
    else:
        if li[i] == first:
            count += 1

count2 = 1
for i in range(len(li)):
    if i % 2 == 0:
        if li[i] == first:
            count2 += 1
    else:
        if li[i] != first:
            count2 += 1

print(min(count, count2))

Buggy submission (verdict: Runtime Error):
S = input()
li = []
for s in S:
    li.append(int(s))

count = 0
first = li[0]i
for i in range(len(li)):
    if i % 2 == 0:
        if li[i] != first:
            count += 1
    else:
        if li[i] == first:
            count += 1

count2 = 1
for i in range(len(li)):
    if i % 2 == 0:
        if li[i] == first:
            count2 += 1
    else:
        if li[i] != first:
            count += 1

print(min(count,count2))
Problem p02629 (python)

Fixed submission:
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = int(math.ceil(math.log((25*N/26)+1,26)))
n = int(N-(26*(26**(k-1)-1)/25))
for i in range(k):
  if i<k-1:
    if n%(26**(k-1-i))!=0:
      kre = int(n//(26**(k-1-i)))
    else:
      kre = int(n/(26**(k-1-i))-1)
    print(Alp[kre], end='')
    n -= int((26**(k-1-i))*kre)
  else:
    print(Alp[n-1], end='')

Buggy submission (verdict: Runtime Error):
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = int(math.ceil(math.log((25*N/26)+1,26)))
n = int(N-(26*(26**(k-1)-1)/25))
for i in range(k):
  if i<k-1:
    kre = int(n//(26**(k-1-i)))
    print(Alp[kre], end='')
    n -= int((26**(k-1-i))*kre)
  else:
    print(Alp[n-1], end='')

Buggy submission (verdict: Runtime Error):
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = math.ceil(math.log((25*N/26)+1,26))
n = N-(26*(26**(k-1)-1)/25)
for i in range(k):
  if i<k-1:
    kre = int(n//(26**(k-1-i)))
    print(Alp[kre], end='')
    n -= (26**(k-1-i))*kre
  else:
    print(Alp[int(n-1)], end='')

Buggy submission (verdict: Runtime Error):
import math
Alp = [chr(ord('a') + i) for i in range(26)]
N = int(input())
k = math.ceil(math.log((25*N/26)+1,26))
n = N-(26*(26**(k-1)-1)/25)
for i in range(k):
  if i<k-1:
    kre = int(n//(26**(k-1-i)))
    print(Alp[kre], end='')
    n -= (26**(k-1-i))*kre
  else:
    print(Alp[int(n-1)])
Problem p02711 (python)

Fixed submission:
n = input()
A = list(n)
if '7' in A: print('Yes')
else: print('No')

Buggy submission (verdict: Runtime Error):
A = list(int(input))
if 7 in A: print('Yes')
else: print('No')
Problem p02773 (python)

Fixed submission:
from collections import Counter
N = int(input())
L = [str(input()) for i in range(N)]
Lc = Counter(L).most_common()
Llist = []             
L_max = Lc[0][1]       
i = 0
while True:
  Llist.append(Lc[i][0])
  if i<len(Lc)-1 and Lc[i+1][1]==L_max:
    i+=1
  else:
    break
print("\n".join(sorted(Llist)))

Buggy submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
L = [str(input()) for i in range(N)]
Lc = Counter(L).most_common()
Llist = []             
L_max = Lc[0][1]       
i = 0
while True:
  Llist.append(Lc[i][0])
  if Lc[i+1][1]==L_max:
    i+=1
  else:
    break
print("\n".join(sorted(Llist)))
Problem p02771 (python)

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

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

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

if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b = int(input())


if a<10 and b<10:
    print(a*b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b = int(input())

c = a*b

if a<10 or b<10:
    print(c = -1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = int(input())


if a<10 or b<10:
    print(-1)
else:
    print(a*b)

Buggy submission (verdict: Runtime Error):
a,b = int(input())


if a<=9 or b<=9:
    print(a*b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b = int(input())


if a<9 or b<9:
    print(a*b)
else:
    print(-1)

Buggy submission (verdict: Runtime Error):
a,b = int(input())


if a>9 or b>9:
    print(a*b)
else:
    print(-1)

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


c = A * B


if c > 10:
    print(-1)
else:
    print(c)

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

A = 10
B = 9

if A * B :
    print(-1)
else:
    print(A,B)
Problem p02835 (python)

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

if int(a+b+c) >= 22:
	print("bust")
else:
	print("win")

Buggy submission (verdict: Runtime Error):
sum = int(input()) + int(input()) + int(input())

if sum >= 22:
	print("bust")
else:
	print("win")
Problem p03307 (python)

Fixed submission:
n=int(input())

if n%2==0:
    print(n)
else:
    print(n*2)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
l=list(map(int, input().split()))
for i in range(n):
    l[i]-=(i+1)
avg=sum(l)/n
fb=math.floor(avg)
cb=math.ceil(avg)
sadf=sadc=0
for i in l:
    sadf+=abs(i-fb)
    sadc+=abs(i-cb)

sad=min(sadf, sadc)
print(sad)
Problem p02990 (python)

Fixed submission:
import math

def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, k = map(int, input().split())
r = n - k
mod = 10 ** 9 + 7
for i in range(1, k + 1):
    if i > r + 1:
        print(0)
    else:
        if i == 1 or i == k:
            print(nCr(r + 1, i) % mod)
        else:
            print(nCr(r + 1, i) * (nCr(k - 1, i - 1)) % mod)

Buggy submission (verdict: Runtime Error):
import math

def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, k = map(int, input().split())
r = n - k
mod = 10 ** 9 + 7
for i in range(1, k + 1):
    if i == 1 or i == k:
        print(nCr(r + 1, i) % mod)
    else:
        print(nCr(r + 1, i) * (k - 1) % mod)
Problem p03013 (python)

Fixed submission:
from functools import lru_cache
import sys

sys.setrecursionlimit(1000000)

mod = 10 ** 9 + 7

@lru_cache(maxsize=1000000)
def saiki(i):
    if ok[i]:
        if i == 0:
            return 1
        if i == 1:
            return 1
        return saiki(i - 1) % mod + saiki(i - 2) % mod
    else:
        return 0


n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
ok = [True] * (n + 1)
for i in a:
    ok[i] = False
print(saiki(n) % mod)

Buggy submission (verdict: Runtime Error):
import math

def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
b = []
for i in range(m):
    if i == 0:
        b.append(a[i] - 1)
    else:
        b.append(a[i] - a[i - 1] - 2)
b.append(n - a[-1] - 1)
if -1 in b:
    print(0)
    exit()
c = set(b)
d = {}
for i in c:
    k = 0
    s = 1
    while i - k > k:
        s += nCr(i - k, k)
        k += 1
    d[i] = s
ans = 1
for i in b:
    ans *= d[i] % (10 ** 9 + 7)
print(ans % (10 ** 9 + 7))
Problem p03107 (python)

Fixed submission:
s = input()
count_1 = 0
count_0 = 0
ans = 0
for i in range(len(s)):
    if s[i] == "1":
        if count_0:
            ans += 2
            count_0 -= 1
        else:
            count_1 += 1
    else:
        if count_1:
            ans += 2
            count_1 -= 1
        else:
            count_0 += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
r = s.count(”0”)
print(min(r, len(s) - r) * 2)
Problem p03705 (python)

Fixed submission:
n, a, b = map(int, input().split())
print(max(b - a + 1 + (b - a) * (n - 3), 0))

Buggy submission (verdict: Runtime Error):
import itertools

n, a, b = map(int, input().split())
if n < 2 and a != b:
    print(0)
elif n == 1:
    print(1)
else:
    c = set()
    for i in itertools.combinations_with_replacement(range(a, b + 1), n - 2):
        c.add(sum(i))
    print(len(c))
Problem p02759 (python)

Fixed submission:
from math import ceil

N = int(input());

print(ceil(N / 2))

Buggy submission (verdict: Runtime Error):
class UnionFind:
  def __init__(self, size):
    self.parents = [x for x in range(size)]
    self.sizes = [1] * size
  
  def unite(self, a, b):
    if self.find(a) == self.find(b):
      return
    
    if self.size_of(a) > self.size_of(b):
      self.sizes[self.find(a)] += self.size_of(b)
      self.parents[self.find(b)] = self.find(a)
    else:
      self.sizes[self.find(b)] += self.size_of(a)
      self.parents[self.find(a)] = self.find(b)
  
  def is_same(self, a, b):
    return self.find(a) == self.find(b)
  
  def size_of(self, a):
    return self.sizes[self.find(a)]
  
  def find(self, a):
    if a == self.parents[a]:
      return a
    else:
      self.parents[a] = self.find(self.parents[a])
      return self.parents[a]


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

u = UnionFind(N)

# 自分自身・友達・ブロック関係のいずれかの場合はフラグ立つ
relations = [1 << i for i in range(N)]

for _ in range(M):
  a, b = map(int, input().split())
  a, b = a - 1, b - 1
  relations[a] |= 1 << b
  relations[b] |= 1 << a
  u.unite(a, b)
  
for _ in range(K):
  c, d = map(int, input().split())
  c, d = c - 1, d - 1
  
  # 同じ連結成分に含まれないブロック関係は無視してok
  if u.is_same(c, d):
    relations[c] |= 1 << d
    relations[d] |= 1 << c

candidates = []

for i in range(N):
  candidates.append(u.size_of(i) - bin(relations[i]).count('1'))
    
print(' '.join(str(x) for x in candidates))
Problem p03805 (python)

Fixed submission:
from itertools import permutations, tee

N, M = map(int, input().split())
edges = set()

for _ in range(M):
    edges.add(tuple(map(int, input().split())))


def each_cons(iterable):
    a, b = tee(iterable)
    next(b, None)
    return zip(a, b)


def is_available(edge):
    return edge in edges or edge[::-1] in edges


cases = permutations(range(2, N + 1), N - 1)

count = 0

for numbers in cases:
    if all(map(is_available, each_cons((1,) + numbers))):
        count += 1


print(count)

Buggy submission (verdict: Runtime Error):
from itertools import permutations, tee

N, M = map(int, input().split())
edges = set()
for _ in range(N):
   a, b = map(int, input().split())
   edges.add((a, b))   

def each_cons(iterable):
  a, b = tee(iterable)
  next(b, None)
  return zip(a, b)

cases = list(permutations(range(2, N + 1), N - 1))

count = 0

def is_available(edge):
  return edge in edges or edge[::-1] in edges

for numbers in cases:
  if all(map(is_available, each_cons((1,) + numbers))):
    count += 1
         
print(count)
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal

a,b=map(str,input().split())

#パソコンは数値は2進数で表現しますが、2進数では小数点を正確に表現することができないため
#10進数表記に変える
#小数点を文字列型で定義する
a=Decimal(a)
b=Decimal(b)

print(math.floor(a*b))

Buggy submission (verdict: Runtime Error):
import math
from decimal import Decimal

a,b=map(float,input().split())

a=int(a)
x=math.floor(b)
y=decimal(b-x)

print(a*x+math.floor(a*y))

Buggy submission (verdict: Runtime Error):
import math
from decimal import decimal

a,b=map(input().split())

#パソコンは数値は2進数で表現しますが、2進数では小数点を正確に表現することができないため
#10進数表記に変える
#小数点を文字列型で定義する
a=decimal(a)
b=decimal(b)

print(math.floor(a*b))
Problem p02688 (python)

Fixed submission:
n,k = map(int,input().split())
a=[0 for i in range(n)]
for i in range(k):
    di = int(input())
    ai = list(map(int,input().split()))
    for j in range(len(ai)):
        a[ai[j]-1] = 1

print(a.count(0))

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


f= False
for d  in range (a,b+1):
    if d % k == 0:
        f=True
        break


if f :
    print('OK')
else :
    print('NG')
Problem p02712 (python)

Fixed submission:
n=int(input())
a=[0 for i in range(n+1)]
for i in range(n+1): #0,1,2,3,…n-1,n+1-1:nが3でも5でも割り切れない場合range(n)ではダメ
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[0 for i in range(n)]
for i in range(n+1): #0,1,2,3,…n-1,n+1-1:nが3でも5でも割り切れない場合range(n)ではダメ
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[0 for i in range(n)]
for i in range(m): #0,1,
    if i%3!=0 and i%5!=0:
        a[i]=int(i+1)

print(sum(a))
Problem p02725 (python)

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

l = [ A[i+1]-A[i] for i in range(N-1)]
l.append( K-A[-1] + A[0] )

l.remove(max(l))
print(sum(l))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
L = [list(map(int,input().split())) for i in range(M)]
dict = {}
 
if M == 0 :
    if N == 1 :
        print(0)
    else :
        print(10**(N-1))
    exit()
 
for x in L :
    dict.setdefault(x[0],[])
    dict[x[0]].append(x[1])
dict.setdefault(1,[1])
 
for k,v in dict.items():
    dict[k] = set(v)
 
ansList = ["0"]*N
for i in range(N) :
    if i+1 in dict :
        ansList[i] = str(list(dict[i+1])[0])
 
isZeroHead = 2 <= N and ansList[0] == "0"
isOverlapping = any([ 2 <= len(v) for v in dict.values()])  
ans = -1 if isZeroHead or isOverlapping else int("".join(ansList))
 
# print(dict)
# print("isZeroHead :",isZeroHead)
# print("isOverlapping :",isOverlapping)
print(ans)
Problem p03042 (python)

Fixed submission:
X=input()
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

if YM == 1 and MY == 1 :
    print("AMBIGUOUS")
elif YM == 1 and MY == 0 :
    print("YYMM")
elif YM == 0 and MY == 1 :
    print("MMYY")
else :
    print("NA")

Buggy submission (verdict: Runtime Error):
YM=0
MY=0
F=int(X[0] + X[1])
B=int(X[2] + X[3])
if 0<F<=12 :
    MY += 1
else:
    pass

if 0<B<=12 :
    YM += 1
else:
    pass

if YM == 1 and MY == 1 :
    print("AMBIGUOUS")
elif YM == 1 and MY == 0 :
    print("YYMM")
elif YM == 0 and MY == 1 :
    print("MMYY")
else :
    print("NA")
Problem p02912 (python)

Fixed submission:
import numpy as np
import math
import heapq

N, M = map(int, input().split())
A = list(map(lambda x: [-int(x),int(x)], input().split()))
heapq.heapify(A)

for i in range(M):
    x = heapq.heappop(A)
    x[1] //= 2
    x[0] = -x[1]
    heapq.heappush(A, x)

ans = 0
for i in range(N):
    ans += A[i][1]
print(ans)

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)
A_ix = A.argsort()[::-1]

for i in range(M):
    if(A[A_ix[0]] > A[A_ix[1]]):
        A[A_ix[0]]  =  math.floor(A[A_ix[0]] / 2)
    else:
        A_ix = A.argsort()[::-1]
        A[A_ix[0]]  =  math.floor(A[A_ix[0]] / 2)

print(A.sum())

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

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = np.array(A)
A_ix = A.argsort()[::-1]
j = 0

for i in range(M):
    if(A[A_ix[j]] > A[A_ix[j+1]]):
        A[A_ix[j]]  =  math.floor(A[A_ix[j]] / 2)
    else:
        A_ix = A.argsort()[::-1]
        A[A_ix[j]]  =  math.floor(A[A_ix[j]] / 2)

print(A.sum())
Problem p02990 (python)

Fixed submission:
n, k = list(map(int, input().split()))
lim = 10**9 + 7
C = [[1], [1,1]]

for i in range(2, n+10):
    C.append([1] + [(C[i-1][j-1] + C[i-1][j])%lim for j in range(1, i)] + [1])

for i in range(1, k+1):
    if n-k+1 < i  or k < i:
        #赤ボールが操作回数よりも少ない時、青ボールが操作回数よりも少ない時
        print(0)
    else:
        #青ボールを入れる箇所の組み合わせ×各箇所に入れる青ボール個数の組み合わせ
        print((C[n-k+1][i]*C[k-1][i-1])%lim)

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
using namespace std;

uint64_t gcd(uint64_t a, uint64_t b)
{
    uint64_t r;
    while ((r = a % b) != 0) {
        a = b;
        b = r;
    }

    return b;
}

uint64_t binomial(uint64_t n, uint64_t r)
{
    r = (r > n / 2) ? n - r : r;
    uint64_t result = 1;

    for (uint64_t i = 1; i <= r; i++, n--) {
        int d = gcd(result, i);

        result /= d;
        result *= n / (i / d);
    }

    return result;
}

int main(){
    int N, K;
    cin >> N >> K;
    int ans;
    
    for(int i=1; i<=K; i++){
        ans = binomial(N-K+1, i) * binomial(K-1, i-1);
        ans = ans % int(1E9 + 7);
        cout << ans << endl;
    }
}
Problem p02935 (python)

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

ans =v[0]

for i in range(n-1):
        ans = (ans + v[i+1])/2
print(ans)

Buggy submission (verdict: Runtime Error):
import re

n = int(input())
v = sorted(list(map(int, input().split())))

ans = (v[0]+v[1])/2

if n == 2:
    ans = ans

elif n > 2 and n % 2 == 0:
    for i in range(n/2):
        ans = (ans + v[i+2])/2

else:
    for i in range(n-2):
        ans = (ans + v[i+2])/2

if re.search('.0', str(ans)):
    ans = str(ans).replace('.0', '')
    print(ans)

else:
    print(ans)

Buggy submission (verdict: Runtime Error):
import re

n = int(input())
v = sorted(list(map(int, input().split())))

ans = (v[0]+v[1])/2

if n == 2:
    ans = str(ans)

elif n > 2 and n % 2 == 0:
    for i in range(n/2):
        ans = str((ans + v[i+2])/2)

else:
    for i in range(n-2):
        ans = str((ans + v[i+2])/2)

if re.search('.0', ans):
   ans = ans.replace('.0', '')
   print(ans)

else:
    print(ans)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if(s.length() != 6):
  print("No")

if(s[2] == s[3] && s[4] == s[5]):
  print("Yes")
else:
  print("No")
Problem p02627 (python)

Fixed submission:
c = input()

print('a' if c.islower() else 'A')

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

print('a' if c.islower() else 'A)
Problem p02659 (python)

Fixed submission:
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# from bisect import bisect_left
# from heapq import heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

from decimal import Decimal, getcontext
getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np    # numpy.lcm()
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk
# import networkx as nx
# G = Graph()
import math
# slist = "abcdefghijklmnopqrstuvwxyz"
A,B = input().split()
# A = int(A)
# B = float(B)*10000

# B = round(B,-2)
# ans = A*B//10000

A = Decimal(A)
B = Decimal(B)

ans = A*B

# print(A,B,ans)
print(int(ans))
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))

Buggy submission (verdict: Runtime Error):
# from math import factorial,sqrt,ceil #,gcd
# from itertools import permutations,combinations,combinations_with_replacement
# from collections import deque,Counter
# from bisect import bisect_left
# from heapq import heappush,heappop
# from numba import njit
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from fractions import gcd

# from decimal import Decimal, getcontext
# getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np    # numpy.lcm()
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb,perm #permはnPk
# import networkx as nx
# G = Graph()

# slist = "abcdefghijklmnopqrstuvwxyz"
A,B = input().split()
A = int(A)
B = int(B.replace("."))

ans = (A*B)//100

print(ans)
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))