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

Fixed submission:
n,k = (int(x) for x in input().split())
a = tuple([int(x) for x in input().split()])
 
c = [0] + [-1]*(n)
l = [1]
now = 1
dupl = -1

for i in range(k):
  now = a[now - 1]
  c[now - 1] += 1
   
  if c[now - 1] == 1:
    dupl = now
    break
  else:
    l.append(now)
    
if dupl == -1:
  print(now)
  exit()
       
notloop = l.index(dupl)
length = len(l)-notloop
print(l[(k-notloop)%length+notloop])

Buggy submission (verdict: Runtime Error):
def check(pair,m,x):
  l = len(pair)
  sum = 0
  
  for i in range(1,m):
    p = 0
    for j in range(l):
      p += pair[j][i]
    
    if(p < x):
      return -1
    
  for e in pair:
    sum += e[0]
  return sum
      
n,m,x = (int(x) for x in input().split())
a = []
for i in range(n):
  a.append(tuple([int(x) for x in input().split()]))
  
min = -1
  
for i in range(2 ** n):
  pair = []
  for j in range(n):
    if((i >> j) & 1):
      pair.append(a[j])
      
  sum = check(pair,m,x)
  if sum != -1:
    if min == -1:
      min = sum
    elif min > sum:
      min = sum
    
print(min)

Buggy submission (verdict: Runtime Error):
def is_dupl(a):
  if 1 in a:
    return True
  else:
    return len(a) != len(set(a))

n,k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]

l = [1]
now = 1
next = a[0]
count = 0
dupl = -1

if not is_dupl(a):
  print(a[-1])

else:
  for i in range(k):
    now = next
    next = a[now-1]
  
    if now in l:
      dupl = now
      break
    else:
      l.append(now)
    
  count = l.index(dupl)
  length = len(l)-count
  print(l[(k-count)%length+count])

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]

l = [1]
now = 1
next = a[0]
count = 0
dupl = a[-1]

for i in range(k):
  now = next
  next = a[now-1]
  
  if now in l:
    dupl = now
    break
  else:
    l.append(now)
    
count = l.index(dupl)
length = len(l)-count
print(l[(k-count)%length+count])

Buggy submission (verdict: Runtime Error):
n,k = (int(x) for x in input().split())
a = [int(x) for x in input().split()]

l = [1]
now = 1
next = a[0]
count = 0
dupl = -1

for i in range(k):
  now = next
  next = a[now-1]
  
  if now in l:
    dupl = now
    break
  else:
    l.append(now)
    
count = l.index(dupl)
length = len(l)-count
print(l[(k-count)%length+count])
Problem p02694 (python)

Fixed submission:
x = int(input())

money = 100
year = 0

while(money<x):
  year += 1
  money += money // 100
  
print(year)

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

money = 100
year = 0

while(True):
  year += 1
  money += int(money*0.01)
  if money == x:
    print(year)
    break
Problem p03380 (python)

Fixed submission:
n = int(input())
numbers =list(map(int,input().split()))
sornum =sorted(numbers, reverse=True)

ans =0
d_min = sornum[0]

for i in range(n-1):
   d =abs(sornum[0]/2-sornum[i+1])
   if d<d_min:
      d_min =d
      ans = sornum[i+1]

print('{} {}'.format(sornum[0], ans))

Buggy submission (verdict: Runtime Error):
from scipy.special import comb

n = int(input())
numbers =list(map(int,input().split()))
sornum =sorted(numbers, reverse=True)

large =0
inum = 0
jmum = 0
for i in range(n-1):
   for j in range(n-i):
      a = comb(sornum[i],sornum[i+j])
      if a>=large:
         large = a
         inum = sornum[i]
         jnum =sornum[i+j]


print(inum,jnum)
Problem p02887 (python)

Fixed submission:
import sys

n = int(input())
s = list(input())

if n == 1:
    print(1)
    sys.exit()

a = []

for i in range(n-1):
    if s[i] != s[i+1]:
        a.append(s[i])

if len(a) == 0:
    print(1)
else:
    if a[-1] != s[-1]:
        a.append(s[-1])

    print(len(a))

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

a = []

for i in range(n-1):
    if s[i] != s[i+1]:
        a.append(s[i])

if s[-2] != s[-1]:
    a.append(s[-1])

if len(a) == 0:
    print(1)
else:
    print(len(a))
Problem p02947 (python)

Fixed submission:
n = int(input())

s = []

for i in range(n):
    s.append(''.join(sorted(input())))

t = {}
for i in range(n):
    if s[i] in t:
        t[s[i]] += 1
    else:
        t[s[i]] = 1

print(sum(t[k]*(t[k]-1)//2 for k in t)) # t[k] Combi 2のlistのsumが答えになる

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {'0': 0}

for i in range(n):
    tp = ''.join(sorted(input()))
    if tp in d:
        d[tp] = sum(list(range(d[tp] + 2)))
    else:
        d.update({tp: 0})

print(sum(d.values()))
Problem p02582 (python)

Fixed submission:
s = input()
if s == 'RRR' :
    print(3)
if s == 'SRR' :
    print(2)
if s == 'RSR' :
    print(1)
if s == 'RRS' :
    print(2)
if s == 'SSR' :
    print(1)
if s == 'RSS' :
    print(1)
if s == 'SRS' :
    print(1)
if s == 'SSS' :
    print(0)

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

if x >= 0 :
    a = abs(x//d)
    if a <= k :
        if (k - a) % 2 == 0 :
            print(abs(x-a*d))
        else :
            print(abs(x-(a+1)*d))
    else :
        print(abs(x-k*d))
else :
    if x%d == 0 :
        a = abs(x//d)
    else :
        a = abs(x//d+1)
            if a <= k :
                if (k - a) % 2 == 0 :
                    print(abs(x+a*d))
                else :
                    print(abs(x+(a+1)*d))
            else :
                print(abs(x+k*d))
Problem p02584 (python)

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

if x >= 0 :
    a = abs(x//d)
    if a <= k :
        if (k - a) % 2 == 0 :
            print(abs(x-a*d))
        else :
            print(abs(x-(a+1)*d))
    else :
        print(abs(x-k*d))
else :
    if x%d == 0 :
        a = abs(x//d)
    else :
        a = abs(x//d+1)

    if a <= k :
        if (k - a) % 2 == 0 :
            print(abs(x+a*d))
        else :
            print(abs(x+(a+1)*d))
    else :
            print(abs(x+k*d))

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

if x >= 0 :
    a = abs(x//d)
    if a <= k :
        if (k - a) % 2 == 0 :
            print(abs(x-a*d))
        else :
            print(abs(x-(a+1)*d))
    else :
        print(abs(x-k*d))
else :
    if x%d == 0 :
        a = abs(x//d)
    else :
        a = abs(x//d+1)
            if a <= k :
                if (k - a) % 2 == 0 :
                    print(abs(x+a*d))
                else :
                    print(abs(x+(a+1)*d))
            else :
                print(abs(x+k*d))
Problem p02628 (python)

Fixed submission:
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
price = 0
for i in range(k) :
    price += l[i]
print(price)

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
print(l[0] + l[1] + l[2])
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
ans = 1
l = list(map(int,input().split()))
for i in range(n) :
    ans *= l[i]
if ans > 10**18 :
    print('-1')
else :
    print(ans)
Problem p02553 (python)

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

ans = max(a*c,a*d,b*c,b*d)

print(ans)

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

num_listx = []
num_listy = []

for num in range(a,b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(c,d + 1):
  if nums >= c:
    num_listy.append(nums)
find_max = []
for i in range(len(num_listx)):
  find_max.append(num_listx[i] * num_listy[i])
print(max(find_max))

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

num_listx = []
num_listy = []

for num in range(a,b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(c,d + 1):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

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

num_listx = []
num_listy = []

for num in range(b + 1):
  if num >= a:
    num_listx.append(num)
for nums in range(d + 1):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
find_max = []
for i in range(len(num_listx)):
  find_max.append(num_listx[i] * num_listy[i])
print(max(find_max))

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a and <= b:
    num_listx.append(num)
for nums in range(d):
  if nums >= c and <= d:
    num_listy.append(nums)
x = max(num_listx)
y = max(num_listy)
print(x*y)

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a:
    num_listx.append(num)
for nums in range(d):
  if nums >= c:
    num_listy.append(nums)
    
print(max(num_listx) * max(num_listy))

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

num_listx = []
num_listy = []

for num in range(b):
  if num >= a and <= b:
    num_listx.append(num)
for nums in range(d):
  if nums >= c and <= d:
    num_listy.append(nums)
    
print(max(num_listx) * max(num_listy))
Problem p02582 (python)

Fixed submission:
D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)

Buggy submission (verdict: Runtime Error):
D = list(input().strip().split())
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ans_list.append(ans)
  ans_list.sort()
print(ans_list[-1])
elif D.count("R") < 1:
  print(0)

Buggy submission (verdict: Runtime Error):
D = list(input().strip().split())
cons = 0
if D.count("R") >= 1:
  for i in range(3):
    if D[i] != 'R':
      cons = cons
      continue
    elif D[i] == 'R':
      cons += 1
      if D[i] == D[i + 1]:
        cons += 1
      else:
        cons = cons
      if i < 1:
        if D[i + 1] == D[i + 2]:
        cons += 1
      else:
        print(cons)
        break
elif D.count("R") < 1:
  print(0)

Buggy submission (verdict: Runtime Error):
D = list(input().strip().split())
cons = 0
if D.count("R") >= 1:
  for i in range(len(D)):
    if D[i] != 'R':
      cons == cons
      continue
    elif D[i] == 'R':
      cons += 1
      if D[i] == D[i + 1]:
        cons += 1
      else:
        cons = cons
      if i < 2:
        if D[i + 1] == D[i + 2]:
        cons += 1
      else:
        print(cons)
        break
elif D.count("R") < 1:
  print(0)
Problem p02717 (python)

Fixed submission:
X,Y,Z = map(str, input().split())


print(Z + ' ' + X + ' ' +Y )

Buggy submission (verdict: Runtime Error):
K = int(input())
ans = []
i = 1

while len(ans) < K :
  l = len(str(i)) - 1
  que = 'yes'
  for k in range(l):
    a = str(i)
    if abs( int(a[k])- int(a[k+1]) ) >= 2:
      que = 'no'
      break

  if que == 'yes':
    ans = ans + [i]


  i +=1

print(i)
Problem p02786 (python)

Fixed submission:
H = int(input())
def atk(n):
  if n==1: return 1
  return 1 + 2*(atk(n//2))

print(atk(H))

Buggy submission (verdict: Runtime Error):
H = int(input())
import pdb; pdb.set_trace()
def atk(n):
  if n==1: return 1
  return 1 + 2*(atk(n//2))

print(atk(H))
Problem p02553 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
ans=max([(b*d),(a*c),(a*d),(b*c)])
print(ans)

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
ans=max[(b*d),(a*c),(a*d),(b*c)]
print(ans)
Problem p02612 (python)

Fixed submission:
import math
n=int(input())
print(math.ceil(n/1000)*1000-n)

Buggy submission (verdict: Runtime Error):
n=int(input())
print((n//1000)+1)*1000-n)
Problem p02641 (python)

Fixed submission:
import collections
x,n=map(int,input().split())
if n!=0:
    l=list(map(int,input().split()))
    v=collections.Counter(l)
if n==0:
    print(x)
else:
    for i in  range(101):
        if x not in v:
            ans=x
            break
            
        if x-i not in v:
            ans=x-i
            break
        if x+i not in v:
            ans=x+i
            break
    print(ans)

Buggy submission (verdict: Runtime Error):
import collections
x,n=map(int,input().split())
l=list(map(int,input().split()))
v=collections.Counter(l)
if n==0:
    print(x)
else:
    for i in  range(101):
        if x not in v:
            ans=x
            break
            
        if x+1 not in v:
            ans=x+1
            break
        if x-1 not in v:
            ans=x-1
            break
    print(ans)
Problem p02706 (python)

Fixed submission:
n,m=map(int,input().split())
l=list(map(int,input().split()))
k=sum(l)
if k>n:
    print(-1)
else:
    print(n-k)

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
l=list(map(int,input()))
k=sum(l)
if k>n:
    print(-1)
else:
    print(n-k)
Problem p02791 (python)

Fixed submission:
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
ans=0
for i in range(n):
    if i==0:
        st.append(a[i])
        ans+=1
    else:
        if st[-1]>=a[i]:
            ans+=1
            st.append(a[i])
print(ans)

Buggy submission (verdict: Runtime Error):
# cook your dish here
n=int(input())
a=list(map(int,input().split()))
st=[]
for i in range(n):
    if i==0:
        st.append(a[i])
    else:
        if st[-1]>=a[i]:
            ans+=1
        else:
            st.append(a[i])
Problem p02921 (python)

Fixed submission:
s=str(input())
l=str(input())
count=0
if s[0]==l[0]:
    count+=1
if s[1]==l[1]:
    count+=1
if s[2]==l[2]:
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
s=str(input())
l=str(input())
count=0
if s[0]=l[0]:
    count+=1
if s[1]=l[1]:
    count+=1
if s[2]=l[2]:
    count+=1
print(count)
Problem p03085 (python)

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="C":
  print("G")
elif b=="T":
  print("A")
elif b=="G":
  print("C")

Buggy submission (verdict: Runtime Error):
b=input()
if b=="A":
  print("T")
elif b=="C":
  print("G")
elif b=="T":
  print("A")
 elif b=="G":
  print("C")
Problem p03086 (python)

Fixed submission:
s=input()
s1="ATGC"
l=[]
count=0
for i in range(len(s)):
  if s[i] not in s1:
    l.append(count)
    count=0
  else:
    count=count+1
  if i==len(s)-1 and s[i] in s1:
    l.append(count)
    
print(max(l))

Buggy submission (verdict: Runtime Error):
s=input()
s1="ATGC"
l=[]
count=0
for i in range(len(s)):
  if s[i] not in s1:
    l.append(count)
    count=0
  else:
    count=count+1
print(max(l))
Problem p02612 (python)

Fixed submission:
n=int(input())
if n%1000==0:
  print(0)
else:
  k=n%1000
  l=1000-k
  print(l)

Buggy submission (verdict: Runtime Error):
n=int(input())
k=1000
for i in range(1,10001):
  if n>k:
    k=k*i
  else:
    prinr(k-n)
    break
Problem p02628 (python)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:K]))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l1=list(map(int.input().split()))
l1.sort()
price = 0
count= 0
for i in range(n-1):
  if count=k:
      break
  else:    
     if l1[i]!=l1[i+1]:
          price+=l1[i]
          count+=1
print(price)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
l1=list(map(int.input().split()))
l1.sort()
price = 0
for i in range(n-1):
  if l1[i]!=l1[i+1]:
    price+=l1[i]
print(price)
Problem p02639 (python)

Fixed submission:
l1=list(map(int,input().split()))
for i in range(len(l1)):
  if l1[i]==0:
    print(i+1)
    break

Buggy submission (verdict: Runtime Error):
L1=list(map(int,input().split()))
for i in range(len(l1)):
  if l1[i]==0:
    print(i+1)
    break
Problem p02657 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b=map(int,inpnut().split())
print(a*b)
Problem p02573 (python)

Fixed submission:
n, m = [int(x) for x in input().split()]

if m != 0:
  g = [set() for _ in range(n)]
  valid = [-1] * n
  set_list = []
  for _ in range(m):
    a, b = [int(x) for x in input().split()]
    g[a-1].add(b-1)
    g[b-1].add(a-1)

  j = -1
  for i in range(n):
    if valid[i] == -1:
      set_list.append(set())
      j += 1
      stack = [i]
      while len(stack)!=0:
        v = stack.pop()
        set_list[j].add(v)
        valid[v] = 1
        for i in g[v]:
          if valid[i] == -1:
            stack.append(i)
            set_list[j].add(i)
            valid[i] = 1
  ans = 1
  for i in range(len(set_list)):
    ans = max(len(set_list[i]),ans)

  print(ans)

else:
  print(1)

Buggy submission (verdict: Runtime Error):
a = list(map(int,input().split()))
n = a[0]
m = a[1]
ab = [map(int, input().split()) for _ in range(m)]
a, b = [list(i) for i in zip(*ab)]

set_list = [{a[0],b[0]}]
for i in range(1,m):
  flag = 0
  for j in range(len(set_list)):
    if a[i] in set_list[j] or b[i] in set_list[j]:
      set_list[j].add(a[i])
      set_list[j].add(b[i])
      flag = 1
      break
  if flag == 0:
    set_list.append({a[i],b[i]})

#print(set_list)

ans = 0
for i in range(len(set_list)):
  ans = max(ans, len(set_list[i]))
  
print(ans)
Problem p02783 (python)

Fixed submission:
input = input().split(' ')
h = int(input[0])
a = int(input[1])

if h % a == 0:
  print(int(h/a))
else:
  print(h//a + 1)

Buggy submission (verdict: Runtime Error):
input1 = input().split(' ')
input2 = input().split(' ')
n = int(input1[0])
k = int(input1[1])
h = input2

for _ in range(k):
  if len(h) == 0:
    break
  h.pop(h.index(max(h)))

h = list(map(int, input2))
print(sum(h))
Problem p02576 (python)

Fixed submission:
N, X, T = map(int, input().split())
t = int(N / X) if N % X == 0 else int(N // X + 1)
print(f'{t * T}')

Buggy submission (verdict: Runtime Error):
from itertools import product

def add_magic_move(enable_to_move_list):
  ret = list(enable_to_move_list)
  for h, w in enable_to_move_list:
    for target_h, target_w in product([h-1, h, h+1], [w-1, w, w+1]):
      if -1 < target_h < H and -1 < target_w < W and (target_h, target_w) not in enable_to_move_list:
        s[target_h][target_w] = '.'
        ret += [(target_h, target_w)]
  return ret
    

def get_enable_to_move_list(h, w, enable_to_move_list):
  if (h, w) in enable_to_move_list:
    return enable_to_move_list
  enable_to_move_list += [(h, w)]
  targets = ((h+1, w), (h-1, w), (h, w+1), (h, w-1))
  for h, w in targets:
    if -1 < h < H and -1 < w < W and s[h][w] == '.':
      enable_to_move_list = get_enable_to_move_list(h, w, enable_to_move_list)
  return enable_to_move_list

H, W = map(int, input().split())
s_h, s_w = [i-1 for i in map(int, input().split())]
d_h, d_w = [i-1 for i in map(int, input().split())]
s = [list(input()) for i in range(H)]

enable_to_move_list = get_enable_to_move_list(s_h, s_w, [])
i = 0
while True:
  if (d_h, d_w) in enable_to_move_list:
    break
  tmp = add_magic_move(enable_to_move_list)
  i += 1
  for h, w in list(set(tmp) - set(enable_to_move_list)):
  	enable_to_move_list = get_enable_to_move_list(h, w, enable_to_move_list)
  if not set(tmp) ^ set(enable_to_move_list):
    i = -1
    break

print(i)
Problem p02554 (python)

Fixed submission:
n = int(input())
a, b, c = 1, 1, 1
for i in range(n):
  a, b, c = a * 10, b * 9, c * 8
  a, b, c = a % (10**9+7), b % (10**9+7), c % (10**9+7)
print(0 if n==1 else (a - b*2 + c) % (10**9+7))

Buggy submission (verdict: Runtime Error):
n = int(input())
a, b, c = 1, 1, 1
for i in range(n):
  a, b, c = a * 10, b * 9, c * 8
  a, b, c = a % (10**9+7), b % (10**9+7), , c % (10**9+7)
print(0 if n==1 else (a - b*2 + c) % (10**9+7))
Problem p02573 (python)

Fixed submission:
class union:
  def __init__(self, box):
    self.r = []
    for i in range(box):
      self.r.append(-1)
    
  def root(self, x):
    if self.r[x] < 0:
      return x
    self.r[x] = self.root(self.r[x])
    return self.r[x]

  def add(self, a):
    a[0] -= 1
    a[1] -= 1
    a[0] = self.root(a[0])
    a[1] = self.root(a[1])
    if a[0] == a[1]:
      return False
    if self.r[a[0]] > self.r[a[1]]:
      a[0], a[1] = a[1], a[0]
    self.r[a[0]] += self.r[a[1]]
    self.r[a[1]] = a[0]
    return True
  
  def size(self, x):
    return -self.r[x]

n, m = map(int, input().split())
uf = union(n)
ans = 0
for i in range(m):
  uf.add(list(map(int, input().split())))

for i in range(n):
  ans = max(ans, uf.size(i))
print(ans)

Buggy submission (verdict: Runtime Error):
class union:
  def __init__(self, box):
    self.r = []
    for i in range(box):
      self.r.append(-1)
    
  def root(self, x):
    if self.r[x] < 0:
      return x
    return self.r[x] = root(self.r[x])

  def add(self, a, b):
    a = root(a)
    b = root(b)
    if a == b:
      return False
    if self.r[a] > self.r[b]:
      a, b = b, a
    self.r[a] += self.r[b]
    self.r[b] = a
    return True
  
  def size(self, x):
    return self.r[x]

n, m = map(int, input().split())
uf = union(m)
ans = 0
for i in range(m):
  uf.add(map(int, input().split()))

for i in range(n):
  ans = max(ans, uf.size(i))
print(ans)
Problem p02576 (python)

Fixed submission:
n, x, t = map(int, input().split())
print((n // x + (0 if n % x == 0 else 1)) * t)

Buggy submission (verdict: Runtime Error):
n, x, t = map(int, input().split())
print((n // x + (n % x == 0) ? 0 : 1) * t)

Buggy submission (verdict: Runtime Error):
n, x, t = map(int, input())
print((n // x + 1) * t)