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

Fixed submission:
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])

if height !=1 and wei !=1: 
  if height %2 ==0:
    if wei %2 ==0:
      print(int(wei/2)*height)
    else:
      print(int(wei/2)*height+int(height/2))
  else:
    if wei %2 ==0:
      print(int(height/2)* wei + int(wei/2))
    else:
      print(wei* int(height/2) + int(wei/2)+1)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

Buggy submission (verdict: Runtime Error):
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
提出情報

Buggy submission (verdict: Runtime Error):
line = input()
data = line.split()
 
height = int(data[0])
wei = int(data[1])
 
if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
 
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*wei)
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)

Buggy submission (verdict: Runtime Error):
line = input()
data = line.split()

height = int(data[0])
wei = int(data[1])

if height %2 ==0:
  if wei %2 ==0:
    print(int(height/2)*wei)
  else:
    print(int(height/2)*(int(wei/2)+1)+int(wei/2+1)-1))
else:
  if wei %2 ==0:
    print(int(height/2)* wei + int(wei/2))
  else:
    print(wei* int(height/2) + int(wei/2)+1)
Problem p02749 (python)

Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
m = map(int,read().split())
AB = zip(m,m)
 
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
 
dist = [-1] * (N+1)
stack = [1]
dist[1] = 0
while stack:
    v = stack.pop()
    for w in graph[v]:
        if dist[w] == -1:
            dist[w] = dist[v] + 1
            stack.append(w)
 
ev = [i for i,x in enumerate(dist) if x % 2 == 0 and i > 0]
od = [i for i,x in enumerate(dist) if x % 2 == 1 and i > 0]
 
def make_perm(N, ev, od, x0, x1, x2, y0, y1, y2):
    assert len(ev) == x0 + x1 + x2
    assert len(od) == y0 + y1 + y2
    P = [0] * (N+1)
    for i in ev:
        if x0:
            P[i] = (x0 + y0) * 3
            x0 -= 1
            continue
        if x1:
            P[i] = (x1 + y1) * 3 - 2
            x1 -= 1
            continue
        if x2:
            P[i] = (x2 + y2) * 3 - 1
            x2 -= 1
            continue
    for i in od:
        if y0:
            P[i] = (x0 + y0) * 3
            y0 -= 1
            continue
        if y1:
            P[i] = (x1 + y1) * 3 - 2
            y1 -= 1
            continue
        if y2:
            P[i] = (x2 + y2) * 3 - 1
            y2 -= 1
            continue
    return P[1:]
 
def solve(N, ev, od):
    x0 = N // 3
    x1 = (N+2) // 3
    x2 = (N+1) // 3
    perm = [0] * (N+1)
    LE = len(ev)
    LO = len(od)
    if LE <= x0:
        return make_perm(N, ev, od, LE, 0, 0, x0-LE, x1, x2)
    if LO <= x0:
        return make_perm(N, ev, od, x0-LO, x1, x2, LO, 0, 0)
    if LE == x1:
        return make_perm(N, ev, od, 0, x1, 0, x0, 0, x2)
    if LO == x1:
        return make_perm(N, ev, od, x0, 0, x2, 0, x1, 0)
    # どちらも x1 よりたくさんある
    return make_perm(N, ev, od, LE-x1, x1, 0, LO-x2, 0, x2)
 
P = solve(N, ev, od)
print(' '.join(map(str, P)))

Buggy submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
from functools import cmp_to_key
import itertools
 
N, T = map(int, readline().split())
m = map(int, read().split())
AB0 = []
AB1 = []
for a,b in zip(m,m):
    if a == 0:
        AB0.append(b)
    else:
        AB1.append((a,b))
 
def sort_func(ab0, ab1):
    a0, b0 = ab0
    a1, b1 = ab1
    return a1*(1+b0) - a0*(1+b1)
 
AB0.sort()
AB1.sort(key=cmp_to_key(sort_func))
AB0, AB1
 
def compute_0():
    INF = T + 1
    dp = [INF] * 40
    dp[0] = 0
    for a,b in AB1:
        for n in range(39, -1, -1):
            if dp[n] > T:
                continue
            x = (dp[n] + 1) * (a + 1) + b
            if x < dp[n+1]:
                dp[n+1] = x
    return dp
 
def compute_1():
    return [0] + list(itertools.accumulate(x + 1 for x in AB0))
 
dp0 = compute_0()
dp1 = compute_1()
 
R = len(dp1) - 1
answer = 0
for i,x in enumerate(dp0):
    if x > T:
        break
    while x + dp1[R] > T:
        R -= 1
    value = i + R
    if answer < value:
        answer = value
 
print(answer)
Problem p02995 (python)

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)

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

import numpy as np

from_1_a = (A-1)//C +(A-1)//D - (A-1)//np.lcm(C,D)
from_1_b = B//C + B//D - B//np.lcm(C,D)

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1


print(among - baisu_c_or_d)

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

import numpy as np

from_1_a = (A-1)//C +(A-1)//D - (A-1)//np.lcm(C,D)
from_1_b = B//C + B//D - B//np.lcm(C,D)

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1


print(among - baisu_c_or_d)

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

import numpy as np

from_1_a = int((A-1)/C) +int((A-1)/D) - int((A-1)/np.lcm(C,D))
from_1_b = int(B/C) +int(B/D) - int(B/np.lcm(C,D))

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1

print(among - baisu_c_or_d)

Buggy submission (verdict: Runtime Error):
line = input().split()
A =int(line[0])
B =int(line[1])
C =int(line[2])
D =int(line[3])

import numpy as np

from_1_a = int((A-1)/C) +int((A-1)/D) - int((A-1)/np.lcm(C,D))
from_1_b = int(B/C) +int(B/D) - int(B/np.lcm(C,D))

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1

print(among - baisu_c_or_d)

Buggy submission (verdict: Runtime Error):
line = input().split()
A =int(line[0])
B =int(line[1])
C =int(line[2])
D =int(line[3])

import numpy as np

from_1_a = int((A-1)/C) +int((A-1)/D) - int((A-1)/np.lcm(C,D))
from_1_b = int(B/C) +int(B/D) - int(B/np.lcm(C,D))

baisu_c_or_d = from_1_b -from_1_a
among = B -A  +1

print(among - baisu_c_or_d)
Problem p03523 (python)

Fixed submission:
data =input()
data = list(data)
deter =""
cnt2 =0
cnt =[0]*5
cnt3 =0
for t in range(len(data)):
  if data[t] =="I":
    cnt[0] +=1
  if data[t] =="K":
    cnt[1] +=1
  if data[t] =="H":
    cnt[2] +=1
  if data[t] =="B":
    cnt[3] +=1
  if data[t] =="R":
    cnt[4] +=1
  
if cnt[0] ==1 and cnt[1] ==1 and cnt[2] ==1 and cnt[3] ==1 and cnt[4] ==1:
  cnt2 +=1 

if len(data) >9 or cnt2 ==0 :
  print("NO")
  cnt3 +=1
if len(data) >=5 and len(data)<=9  and cnt2 ==1:
  if data[0] !="A":
    data.insert(0,"A")
  if data[4] !="A":
    data.insert(4,"A")
  if data[6] !="A":
    data.insert(6,"A")
  if len(data) ==8:
    data.append("A")
  else:
    if data[8] !="A":
      data.insert(8,"A")
 
  for s in range(len(data)):
    deter +=data[s]
  
  if deter =="AKIHABARA":
    print("YES")
  else:
    print("NO")

 
if len(data) <=4 and cnt3==0:
  print("NO")

Buggy submission (verdict: Runtime Error):
data =input()
data = list(data)
deter =""


if len(data) >9 :
  print("NO")
if len(data) >=5 and len(data)<=9:
  if data[0] !="A":
    data.insert(0,"A")
  if data[4] !="A":
    data.insert(4,"A")
  if data[6] !="A":
    data.insert(6,"A")
  if len(data) ==8:
    data.append("A")
  else:
    if data[8] !="A":
      data.insert(8,"A")
 
  for s in range(len(data)):
    deter +=data[s]
   
  if deter =="AKIHABARA":
    print("YES")
  else:
    print("NO")

 
if len(data) <=4:
  print("NO")

Buggy submission (verdict: Runtime Error):
data =input()
data = list(data)
deter =""


if len(data) >9 :
  print("NO")
if len(data) >=5 and len(data)<=9:
  if data[0] !="A":
    data.insert(0,"A")
  if data[4] !="A":
    data.insert(4,"A")
  if data[6] !="A":
    data.insert(6,"A")
  if len(data) ==8:
    data.append("A")
  else:
    if data[8] !="A":
      data.insert(8,"A")
 
  for s in range(len(data)):
    deter +=data[s]
   
  if deter =="AKIHABARA":
    print("YES")

 
if len(data) <=4:
  print("NO")
Problem p02612 (python)

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

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

s=[]
for i in range(n):
    a=input()
    s.append(a)
    
for j in ['AC', 'WA', 'TLE', 'RE']:
    print('{0} × {1}'.format(j,s.count(j)))

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

judge_list=[]
for i in range(n):
    a=input()
    judge_list.append(a)

print("AC ×",judge_list.count("AC"))
print("WA ×",judge_list.count("WA"))
print("TLE ×",judge_list.count("TLE"))
print("RE ×",judge_list.count("RE"))
Problem p02658 (python)

Fixed submission:
N=int(input())
s=input().split()
result=1
if '0' in s:
  print(0)
else:
  for i in range (N):
    result=result*int(s[i])
    if result> 10**18:
      print(-1)
      break
    elif i==N-1 and result<=10**18:
      print(result)

Buggy submission (verdict: Runtime Error):
A, B=input().split()
b=float(B)*100
result=int(A)*int(b)
answer=round(result/100,2)
print(int(answer))
Problem p02628 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
o = 0
for i in range(b):
    o = o+x[i]
print(o)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# input
a, b = map(int, input().split())
x = list(map(int, input()))
x.sorted()
o = 0
for i in range(b):
    o = O+x[i]
print(o)
Problem p02658 (python)

Fixed submission:
# -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
if 0 in a:
    print(0)
    quit()
for i in range(n):
    out = Decimal(out * a[i])
    if out > Decimal(10**18):
        print(-1)
        quit()
print(out)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
if 0 in a:
    print(0)
    quit()
for i in range(n):
    out = Decimal(out * a[i])
    if out > Decimal(10**18):
        print(-1)
print(out)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
from decimal import Decimal
# input
n = int(input())
a = list(map(int, input().split()))
out = 1
for i in range(n):
    out = Decimal(out * a[i])
    if out.conut(0) > 0:
        print(out)
        quit()
    elif out > Decimal(10**18):
        print(-1)
        quit()
print(out)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
out = 1
for i in range(n):
    out = out * a[i]
    if out == 0:
        print(out)
        quit()
    elif out >＝ 10**18:
        print(-1)
        quit()
print(out)
Problem p02705 (python)

Fixed submission:
a = int(input())
print(3.14159265 * a * 2)

Buggy submission (verdict: Runtime Error):
a = int(input())
print(3.14１５ * a *a)
Problem p02717 (python)

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

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

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

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

Fixed submission:
a, b = map(int, input().split())
if a % b == 0:
    print(a//b)
else:
    print(1+a//b)

Buggy submission (verdict: Runtime Error):
a,b =map(int,input().split())
if a%B==0:
  print(a/b)
else:
  print(1+(a//b))

Buggy submission (verdict: Runtime Error):
a,b =map(int,input().split())
if a%B==0:
  print(a/b)
else:
  print(1+a//b)
Problem p02969 (python)

Fixed submission:
a=int(input())
print(3*(a*a))

Buggy submission (verdict: Runtime Error):
print(int(3*(int(input()**2)))
Problem p03047 (python)

Fixed submission:
# -*- coding: utf-8 -*-
# input
#a = int(input())
#a,b = input()
a, b = map(int, input().split())
#a, b, c = input().split()
print(a-b+1)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# input
a = int(input())
s = 0
bc = 0
ac = 0
tc = 0
for i in range(a):
    t = input()
    s += t.count('AB')
    if t[:1] == 'B':
        bc += 1
    if t[-1:] == 'A':
        ac += 1
    if t[:1] == 'B' or t[-1:] == 'A':
        tc += 1
if min(bc, ac) == tc and tc > 0:
    o = s + min(bc, ac)-1
else:
    o = s + min(bc, ac)
print(o)
Problem p03243 (python)

Fixed submission:
a=input()
if int(a) <= int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111)

Buggy submission (verdict: Runtime Error):
a=input()
if int(a) <= int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111

Buggy submission (verdict: Runtime Error):
a=input()
if int(a) < int(a[0])*111:
  print(int(a[0])*111)
else:
  print((int(a[0])+1)*111
Problem p03260 (python)

Fixed submission:
a,b=map(int,input().split())
if (a*b)%2==0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if (a*b)%2==0:
  print('No')
else:
  print('Yes')
Problem p03292 (python)

Fixed submission:
a =list(map(int,input().split()))
print(max(a)-min(a))

Buggy submission (verdict: Runtime Error):
a =list(map(int,input().split()))
print(max(a)-min(b))
Problem p03385 (python)

Fixed submission:
a=input()
print('Yes' if all(a.count(t)>0 for t in 'abc') else 'No')

Buggy submission (verdict: Runtime Error):
print('Yes' if all(input().count(t)>0 for t in 'abc') else 'No')
Problem p03471 (python)

Fixed submission:
a, b = map(int, input().split())
o1 = o2 = o3 = -1
for i in range(a+1):
    for j in range(a-i+1):
        k = a-i-j
        if b == i*10000+j*5000+k*1000:
            o1 = i
            o2 = j
            o3 = k
            break
print(o1, o2, o3)

Buggy submission (verdict: Runtime Error):
a,b =map(int,input().split())
for i in range(b//(10000*a))[::-1]:
  for j in range((b-10000*i)//(5000*(a-i))[::-1]:
    for k in range((b-10000*i-5000*j)//(1000*(a-i-j)))[::-1]:
      if b == i*10000+j*5000+k*1000:
        break
if i==j==k==0:
   print(-1,-1,-1)
else:
   print(i,j,k)
Problem p02621 (python)

Fixed submission:
a = int(input())
print(a+a*a+a*a*a)

Buggy submission (verdict: Runtime Error):
a = input()
print(a+a*a+a*a*a)
Problem p02957 (python)

Fixed submission:
A,B=(int(x) for x in input().split())
C = int((A + B))

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))

Buggy submission (verdict: Runtime Error):
N = int(input())
List = [int(i) for i in input().split()]
count = 0
for j in range(N):
    if(List[j] != j+1):
        count+=1
if(count <= 2):
    print("YES")
else:
    print("NO")

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

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))

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

if(C%2 == 1):
    print("IMPOSSIBLE")
else:
    K = C / 2
    print(int(K))
Problem p02767 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr=limii()

if n==1:
    print(0)
    exit()

ans = Decimal(str(sum(arr)/n)).quantize(Decimal("0"),rounding=ROUND_HALF_UP)
cnt=0
for i in range(n):
    cnt+=(ans-arr[i])**2

print(cnt)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd

mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
arr=limii()

if n==1:
    print((arr[i]-1)**2)
    exit()

ans = int(sum(arr)//n)+1
cnt=0
for i in range(n):
    cnt+=(ans-arr[i])**2

print(cnt)
Problem p02814 (python)

Fixed submission:
n,m =map(int,input().split())

a =  [int(x)//2 for x in input().split()]

import fractions

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

import math

lcm1 = 1
for i in a:
    lcm1 = lcm(lcm1, i)
    if((lcm1//i)%2==0):
        print(0)
        exit()

print(math.ceil((m//lcm1)/2))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

#X=ak * (p+0.5) = ak/2 * (2p+1)

chk1 = True
chk2 = True
while chk1==True and chk2==True:
    cnt1=0
    for i in range(n):
        if a[i]%2==0:
            cnt1+=1
        a[i] /=2
    if n == cnt1:
        pass
    elif cnt1 ==0:
        chk2 = False
    else:
        chk1=False
    
if chk1 == False:
    print(0)
    exit()

b = lcm_list(a)

if b > m:
    print(0)
    exit()

c =(m+(b-1))//b 
print(int(c/2))
Problem p02841 (python)

Fixed submission:
s1 = list(map(int,input().split()))
s2 = list(map(int,input().split()))
 
         
if int(s1[0])+1 == int(s2[0]):
         print(1)
else:
         print(0)

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

         
if int(s1[0])+1 == int(s2[0]):
         print(1)
else:
         print(0)
Problem p02842 (python)

Fixed submission:
def my_index(l, x, default=False):
    if x in l:
        return int(l.index(x))+1
    else:
        return default
 
ans = []
 
num = int(input())
 
for i in range(1,50001):
    ans.append(int(i*1.08))
 
print(my_index(ans,num,":("))

Buggy submission (verdict: Runtime Error):
ans = []

num = int(input())

for i in range(1,50001):
    ans.append(int(i*1.08))

print(int(ans.index(num))+1)
Problem p02882 (python)

Fixed submission:
import math

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

if (a ==1 and b==1 and x ==1) or (a*a*b == x):
    print(0)    

elif x < a*a*b/2:
    print(90-math.degrees(math.atan(2*x/(a * (b**2)))))
    
else:
    print(90-math.degrees(math.atan(a**3 / (2*(a*a*b-x)))))

Buggy submission (verdict: Runtime Error):
import math

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

if x < a*a*b/2:
    print(90-math.degrees(math.atan(2*x/(a * (b**2)))))
    
else:
    print(90-math.degrees(math.atan(a**3 / (2*(a*a*b-x)))))
Problem p02887 (python)

Fixed submission:
n = int(input())
s = input()

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


c = len(arr)
print(c)

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

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


c = len(arr)
print(c)

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

arr = []
arr.append(s[1])
for i in range(n-1):
    if s[i+1] != s[i]:
        arr.append(s[i+1])
        
c = len("".join(arr))
if c == 0:
    print(1)
else:
    print(c)

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

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



        
c = len("".join(arr))
print(arr)
if c == 0:
    print(1)
else:
    print(c)

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

arr = []

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

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

c = len("".join(arr))

if c == 0:
    print(1)
else:
    print(c)

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

arr = []

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

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

c = len("".join(arr))

if c == 0:
    print(1)
else:
    print(c)