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

Fixed submission:
def main():
    n, m = map(int, input().split())
    p, y = [0 for i in range(m)], [0 for i in range(m)]
    for i in range(m):
        p[i], y[i] = map(int, input().split())
    ans = solve(n, m, p, y)


def solve(n, m, p, y):
    kens = [[] for i in range(n + 1)]
    for i in range(m):
        kens[p[i]].append(y[i])
    for ken in kens:
        ken.sort()
    
    #id 生成
    ids = [{} for i in range(n + 1)]
    for indken, ken in enumerate(kens):
        for indsi, yi in enumerate(ken, 1):
            ids[indken][yi] = str(indken).zfill(6) + str(indsi).zfill(6)
    
    #出力
    for i in range(m):
        print(ids[p[i]][y[i]])

    return

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
li=[[] for i in range(n+1)]

for i in range(m):
	j,k=map(int,input().split())
	li[j].append(k)

for i in range(1,m):
	li[i].sort()
	for j in li[i]:
		print(str(i).zfill(6)+str(j).zfill(6))
Problem p02624 (python)

Fixed submission:
#!/usr/bin/env python3
import sys
def multiple_sum(x, n):
    # x + 2x + ... + kx(<= n)
    k = n // x
    return x * (k + 1) * k // 2


def solve(N: int):
    ans = 0
    for i in range(1, N + 1):
        ans += multiple_sum(i, N)
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def multiple_sum(x, n):
    # x + 2x + ... + kx(<= n)
    k = n // x
    return x * (k + 1) * k // 2


def solve(N: int):
    ans = 0
    for i in range(1, N + 1):
        ans += multiple_sum(i, N)
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()
Problem p02729 (python)

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

ans = n*(n-1)// 2+m*(m-1)//2

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
ans = n*(n-1)//2+m*(m-1)//2

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
m = int(input())
ans = n*(n-1)/2+m*(m-1)/2

print(int(ans))
Problem p03013 (python)

Fixed submission:
MOD = 1000000007
N = 100001

fibo = [1, 1] + [0] * N
for i in range(2, N):
    fibo[i] = (fibo[i - 1] + fibo[i - 2]) % MOD

n, m = list(map(int, input().split(" ")))
a_list = [int(input()) for _ in range(m)]
is_ngs = [0] * (n + 2)
for a in a_list:
    is_ngs[a] = 1
for i in range(n):
    if is_ngs[i] and is_ngs[i + 1]:
        print(0)
        exit()
cnts = []
cnt = 0

for i in range(n + 1):
    if is_ngs[i]:
        cnts.append(cnt)
        cnt = 0
        continue
    cnt += 1
cnts.append(cnt)
ans = 1
for c in cnts:
    if c != 0:
        ans *= fibo[c - 1]
# print(is_ngs)
# print(cnts)
print(ans % MOD)

Buggy submission (verdict: Runtime Error):
import math
from functools import lru_cache

MOD = 1000000007


@lru_cache(None)
def fibo(x):
    if x <= 1:
        return 1
    return fibo(x - 2) + fibo(x - 1)


n, m = list(map(int, input().split(" ")))
a_list = [int(input()) for _ in range(m)]
ngs = [i in a_list for i in range(n)]
ngs.append(False)
for i in range(n):
    if ngs[i] and ngs[i + 1]:
        print(0)
        exit()
cnts = []
cnt = 0

for ng in ngs:
    if ng:
        cnts.append(cnt)
        cnt = 0
        continue
    cnt += 1
cnts.append(cnt)
ans = 1
for c in cnts:
    if c != 0:
        ans *= fibo(c - 1)
# print(ngs)
# print(cnts)
print(ans % MOD)
Problem p03077 (python)

Fixed submission:
import math

n, a, b, c, d, e = [int(input()) for _ in range(6)]
print(math.ceil(n / min([a,b,c,d,e])) + 4)

Buggy submission (verdict: Runtime Error):
print(n // min([a,b,c,d,e]) + 5)
Problem p03038 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [0] * m
ans = []
a.sort()
for i in range(m):
    bc[i] = list(map(int, input().split()))
bc.sort(key=lambda x: x[1], reverse=True)


j = 0
for i in range(n):
    if j < m:
        if bc[j][0] == 0:
            j += 1
    if j >= m:
        ans.append(a[i])
    elif a[i] >= bc[j][1]:
        ans.append(a[i])
    else:
        ans.append(bc[j][1])
        bc[j][0] -= 1

print(sum(ans))

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
bc = [0] * m
ans = []
a.sort()
for i in range(m):
    bc[i] = list(map(int, input().split()))
bc.sort(key=lambda x: x[1], reverse=True)


j = 0
for i in range(n):
    if bc[j][0] == 0:
        j += 1
    if j >= m:
        ans.append(a[i])
    elif a[i] >= bc[j][1]:
        ans.append(a[i])
    else:
        ans.append(bc[j][1])
        bc[j][0] -= 1

print(sum(ans))
Problem p03075 (python)

Fixed submission:
N = 6
val = []
for i in range(N):
    val.append(int(input()))

if val[4]-val[0] <= val[5]:
    print('Yay!')
else:
    print(':(')

Buggy submission (verdict: Runtime Error):
N = 6
val = []
for i in range(N):
    val.append(int(input())
if val[4]-val[0] <= val[5]:
    print('Yay!')
else:
    print(':(')

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

Fixed submission:
a,b=map(float,input().split())
a=int(a)
b=int((b+10**-8)*100)
print(a*b//100)

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

Fixed submission:
s = input().split()
a=int(s[0])
s = input().split()
b = int(s[0])
print(6-a-b)

Buggy submission (verdict: Runtime Error):
import numpy as np
import math
import itertools
import networkx as nx
import matplotlib.pyplot as plt

s = input().split()
a=int(s[0])
s = input().split()
b = int(s[0])
print(6-a-b)

Buggy submission (verdict: Runtime Error):
s = input().split()
a=int(s[0])
s = input().split()
b = int(s[0])
print(6-a-b)s = input().split()
a=int(s[0])
s = input().split()
b = int(s[0])
print(6-a-b)
Problem p02831 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a
s = input().split()
a = int(s[0])
b = int(s[1])
re = int(a*b/gcd(a, b))
print(re)

Buggy submission (verdict: Runtime Error):
import math
s = input().split()
a = int(s[0])
b = int(s[1])
re = int(a*b/math.gcd(a, b))
print(re)

Buggy submission (verdict: Runtime Error):
import math
s = input().split()
a = int(s[0])
b = int(s[1])
print(int(a*b/math.gcd(a,b)))

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


s = input().split()
a=int(s[0])
b = int(s[1])

print(int(a*b/math.gcd(a,b)))
Problem p03775 (python)

Fixed submission:
import numpy
s = list(map(int, input().split()))
n=s[0]
ans=11
for a in range(1,int(numpy.sqrt(n))+1):
    b=n/a
    if b.is_integer():
        b=int(b)
        if max(len(str(a)),len(str(b)))<ans:
            ans = max(len(str(a)), len(str(b)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
s = list(map(int, input().split()))
n=s[0]
ans=math.inf
for a in range(1,int(math.sqrt(n))):
    b=n/a
    if b.is_integer():
        b=int(b)
        if max(len(str(a)),len(str(b)))<ans:
            ans = max(len(str(a)), len(str(b)))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
s = list(map(int, input().split()))
n=s[0]
ans=math.inf
for a in range(1,int(math.sqrt(n))):
    b=n/a
    if b.is_integer():
        b=int(b)
        if max(len(str(a)),len(str(b)))<ans:
            ans = max(len(str(a)), len(str(b)))
print(ans)
Problem p02829 (python)

Fixed submission:
a=int(input())
b=int(input())
if a>b:
    c=a
    a=b
    b=c
if a==1 and b==2:
    print(3)
elif a==1 and b==3:
    print(2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int a,b;
bool f[4];
int main() {
	scanf("%d%d",&a,&b);
	f[a]=f[b]=true;
	if (!f[1]) puts("1");
	else if (!f[2]) puts("2");
	else puts("3");
	return 0;
}
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 = fractions.gcd(ans, A[i])

print(ans)

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

print(ans)
Problem p02916 (python)

Fixed submission:
n = int(input())
a = list(map(lambda x: int(x), input().split()))
b = list(map(lambda x: int(x), input().split()))
c = list(map(lambda x: int(x), input().split()))

point = 0
temp = n + 1

for i, num in enumerate(a):
    point += b[num - 1]
    if num == temp + 1:
        point += c[num - 2]
    temp = num

print(point)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(lambda x: int(x), input().split()))
b = list(map(lambda x: int(x), input().split()))
c = list(map(lambda x: int(x), input().split()))

point = 0
temp = n + 1

for i, num in enumerate(a):
    point += b[num - 1]
    if num == temp + 1:
        point += c[num - 1]
    temp = num

print(point)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(lambda x: int(x), input().split()))
b = list(map(lambda x: int(x), input().split()))
c = list(map(lambda x: int(x), input().split()))

point = 0
count = n + 1

for i, num in enumerate(a):
    point += b[num - 1]
    if num == temp + 1:
        point += c[count]
        count += 1
    temp = num

print(point)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(lambda x: int(x), input().split()))
b = list(map(lambda x: int(x), input().split()))
c = list(map(lambda x: int(x), input().split()))

point = 0

for i, num in enumerate(a):
    point += b[num - 1]
    if i == (len(a) - 1):
        point += c[num - 1]

print(point)
Problem p03250 (python)

Fixed submission:
s = input()

num = list(s)

num.sort()
num.reverse()

print(int(num[0] + num[1]) + int(num[2]))

Buggy submission (verdict: Runtime Error):
num = list(input())

num = num.sort().reverse()

print(int(num[0] + num[1]) + int(num[2]))

Buggy submission (verdict: Runtime Error):
num = list(input())

num.sort().reverse()

print(int(num[0] + num[1]) + int(num[2]))

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

num = list(num)

num.sort()
num.reverse()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort()
num.reverse()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort()
num.reverse()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.reverse()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort().reverse()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sorted()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = [0,0,0]
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num = []
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort()

print(int(str(num[0]) + str(num[1])) + num[2])

Buggy submission (verdict: Runtime Error):
num[0] = int(input())
num[1] = int(input())
num[2] = int(input())

num.sort()

print(int(str(num[0]) + str(num[1])) + num[2])

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


if a < b:
    d = b
    another = a
else:
    d = a
    another = b

if d < c:
    d2 = str(d)
    d = str(c)

f = d + d2

print(int(f)+another)

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


if a < b:
    d = b
    another = a
else:
    d = a
    another = b

if d < c:
    d[0] = str(d)
    d[1] = str(c)

f = d[1] + d[0]

print(int(f)+another)
Problem p02622 (python)

Fixed submission:
S = list(input ())
T = list(input ())
a = len(S)
change_time = 0
 
for i in range(a):
  if S[i] ==T[i]:
  	continue
  
  else:
 
  	change_time += 1
  
  
print(change_time)

Buggy submission (verdict: Runtime Error):
S = list(input ())
T = list(input ())
a = len(S)
change_time = 0

for i in a:
  if (S[i] ==T[i])
  continue
  
  else:
  S[i] =T[i]
  change_time += 1
  
  
print(change_time)
Problem p02695 (python)

Fixed submission:
def count_up(x,n):
  x[n]+=1
  if x[n]>m:
    count_up(x,n-1)
    x[n]=x[n-1]
  return
n,m,q=map(int,input().split())
abcd=[map(int,input().split()) for _ in range(q)]
a,b,c,d=[list(i) for i in zip(*abcd)]
x=[1,1,1,1,1,1,1,1,1,1,1]
ans=0
if m==1:
  temp=0
  for i in range(q):
    if x[b[i]]-x[a[i]]==c[i]:
      temp+=d[i]
  ans=max(ans,temp)
else:
  while x[1]==1:
    temp=0
    for i in range(q):
      if x[b[i]]-x[a[i]]==c[i]:
       temp+=d[i]
    ans=max(ans,temp)
    count_up(x,n)
print(ans)

Buggy submission (verdict: Runtime Error):
def count_up(x,n):
  x[n]+=1
  if x[n]>m:
    count_up(x,n-1)
    x[n]=x[n-1]
  return
n,m,q=map(int,input().split())
abcd=[map(int,input().split()) for _ in range(q)]
a,b,c,d=[list(i) for i in zip(*abcd)]
x=[1,1,1,1,1,1,1,1,1,1,1]
ans=0
while x[1]==1:
  temp=0
  for i in range(q):
    if x[b[i]]-x[a[i]]==c[i]:
      temp+=d[i]
  ans=max(ans,temp)
  count_up(x,n)
print(ans)
Problem p02659 (python)

Fixed submission:
import decimal
Deci = decimal.Decimal

a, b = input().split()
x, y = Deci(a), Deci(b)
ans = int(x * y)
print(ans)

Buggy submission (verdict: Runtime Error):
from math import math.floor
a = int(input())
b = float(input())
Z = a*b
print(math.floor(Z))

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
b = float(input())
Z = a*b
print(math.floor(Z))

Buggy submission (verdict: Runtime Error):
import math
a = int(input())
b = float(input())
print(math.floor(a*b))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = float(input())
Z = a*b
H = int(Z)
print(H)
Problem p02712 (python)

Fixed submission:
n=int(input())
c=0
for i in range(1,n+1):
  if((i%3==0)and(i%5==0)):
    continue
  elif(i%3==0):
    continue
  elif((i%5==0)):
    continue
  else:
    c+=i
print(c)

Buggy submission (verdict: Runtime Error):
n=int(input())
for i in range(1,n+1):
  if((i%3==0)and(i%5==0)):
    continue
  elif(i%3==0):
    continue
  elif((i%5==0)):
    continue
  else:
    c+=i
print(c)

Buggy submission (verdict: Runtime Error):
a=int(input())
c=0
for i in range(0,a+1):
	if(i%3!=0)and(i%5==0):
		continue
    if(i%3!=0):
    	continue
    if(i%5==0):
    	continue
  	else:
    	c+=i
print(c)

Buggy submission (verdict: Runtime Error):
a=int(input())
c=0
for i in range(0,n+1):
	if(i%3!=0)and(i%5==0):
		continue
    if(i%3!=0):
    	continue
    if(i%5==0):
    	continue
  	else:
    	c+=i
print(c)

Buggy submission (verdict: Runtime Error):
a=int(input())
c=0
for i in range(0,n+1):
	if(i%3!=0)and(i%5==0):
		continue
    if(i%3!=0):
    	continue
    if(i%5==0):
    	continue
  	else:
    	c+=i
print(c)

Buggy submission (verdict: Runtime Error):
a=int(input())
c=0
for i in range(0,n+1):
  if(i%3!=0)and(i%5==0):
    continue
  if(i%3!=0):
    continue
  if(i%5==0):
    continue
  else:
    c+=i
print(c)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
a=input()
for i in range(0,int(len(a))):
  if(a[2]==a[3]):
	if(a[4]==a[5]):
      print("YES")
    else:
      print("NO")
  else:
    print("NO)
Problem p02622 (python)

Fixed submission:
S = input()
T = input()

ans = 0

for s, t in zip(S, T):
    ans += s != t
else:
	print(ans)

Buggy submission (verdict: Runtime Error):
S = input()
t = input()
cnt = 0

if s == t:
  print(0)
  exit()
else:
  for i in range(len(s)):
    if s[i] != t[i]:
      cnt += 1

print(cnt)
Problem p02659 (python)

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

Buggy submission (verdict: Runtime Error):
import decimal
A,B = map(int,input().split())
A = decimal(A)
B = decimal(B)
print(int(A*B))

Buggy submission (verdict: Runtime Error):
import math

A,B = map(int,input().split())
ans = A * B

print(math.floor(ans))
Problem p02699 (python)

Fixed submission:
S,W = map(int,input().split())
 
if S <= W:
  print('unsafe')
else:
  print('safe')

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
 
Takahashi = A
Aoki = C
 
while Takahashi >= 0 or Aoki >=0:
  Aoki -= B
  if Aoki <= 0:
    print('Yes')
    break
  Takahashi -= D
  if Takahashi <= 0:
    print('No')
    break

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

Takahashi = A
Aoki = B

while Takahashi <= 0 or Aoki <=0:
  Aoki -= B
  if Aoki <= 0:
    print('Yes')
    break
  Takahashi -= D
  if Takahashi <= 0:
    print('No')
    break

Buggy submission (verdict: Runtime Error):
S,W = map(int,input().split())

if s <= w:
  print('unsafe')
else:
  print('safe')
Problem p03011 (python)

Fixed submission:
import sys
input = sys.stdin.readline
a, b, c = (int(i) for i in input().split())
print(min(a+b,b+c,c+a))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
a, b, c, d = (int(i) for i in input().split())
Problem p02623 (python)

Fixed submission:
# -*- coding: utf-8 -*-
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

total_a, total_b = [0], [0]
for i in range(n):
    total_a.append(total_a[i]+a[i])
for i in range(m):
    total_b.append(total_b[i]+b[i])

ans = 0
j = m
for i in range(n+1):
    if total_a[i] > k:
        break
    while total_b[j] > k - total_a[i]:
        j -= 1
    ans = max(ans, i+j)
print(ans)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

if k < a[0] or k < b[0]:
    print(0)
    exit()

if sum(a)+sum(b) <= k:
    print(len(a)+len(b))
else:
    time = 0
    count = 0
    for i in range(n+m):
        if time+min(a[0], b[0]) > k:
            break
        if a[0] <= b[0]:
            time += a[0]
            count+= 1
            a.pop(0)
        else:
            time += b[0]
            count+= 1
            b.pop(0)
    print(count)
Problem p02676 (python)

Fixed submission:
k = input()
s = input()
if(len(s) <= int(k)):
  print(s)
else:
  print(s[:int(k)]+'...')

Buggy submission (verdict: Runtime Error):
k = input()
s = input()
if(len(s)<=k):
  print(s)
else:
  print(s[:k])
Problem p02682 (python)

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

sum = 0

if a[0] >= a[3]:
    sum += 1 * a[3]
else:
    sum += 1 * a[0]

a[3] -= a[0]
a[3] -= a[1]

if a[3] > 0:
    if a[2] > a[3]:
        sum += -1 * a[3]
    else:
        sum += -1 * a[2]

print(sum)

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

sum = 0

sum += 1 * a[0]
a[3] -= a[0]
a[3] -= a[1]

if a[2] < a[3]:
    sum -= 1 * a[0]

print(sum)
Problem p02693 (python)

Fixed submission:
root = int(input())
ranges = list(map(int, input().split()))
flag = False

for i in range(ranges[0], ranges[1] + 1):
    if i % root == 0:
        flag = True
        
if flag: 
    print('OK')
else:
    print('NG')

Buggy submission (verdict: Runtime Error):
root = int(input())
ranges = list(map(int, input().slice()))
flag = False

for i in range(ranges[0], ranges[1] + 1):
    if i % root:
        flag = True
        
if flag: 
    print('OK')
else:
    print('NG')
Problem p02659 (python)

Fixed submission:
import math
from decimal import Decimal, getcontext

getcontext().prec = 99


def resolve():
    A, B = input().split()

    print(math.floor(Decimal(A) * Decimal(B)))



resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    A, B = map(float, input().split())

    print(math.floor(A * B))

resolve()
Problem p02777 (python)

Fixed submission:
def resolve():
    S, T = map(str, input().split())
    A, B = map(int, input().split())
    U = input()
 
    if S == U:
        A -= 1
        print(str(A) + ' ' + str(B))
        return
    B -= 1
    print(str(A) + ' ' + str(B))


resolve()

Buggy submission (verdict: Runtime Error):
import sys
# import itertools
# import math

input = sys.stdin.readline().rstrip()


def resolve():
    S, T = map(str, input().split())
    A, B = map(int, input().split())
    U = input()

    if S == U:
        A -= 1
        print(str(A) + ' ' + str(B))
        return
    B -= 1
    print(str(A) + ' ' + str(B))


resolve()
Problem p02835 (python)

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

if sum(A) < 22:
  print('win')
  exit()

print('bust')

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

if sum(A) < 22:
  print('win')
  exit()

print('bust')
Problem p02897 (python)

Fixed submission:
def solve(N):
    odd_count = 0

    for x in range(1, N + 1)[::-1]:
        if x % 2 == 1:
            odd_count += 1

    if N == 1:
        return 1

    return odd_count / N


N = int(input())

print(solve(N))

Buggy submission (verdict: Runtime Error):
import sys


def input():
    return sys.stdin.readline().strip().decode('utf-8')


def solve(N):
    odd_count = 0

    for x in range(0, N)[::-1]:
        if x // 2 != 0:
            odd_count += 1

    if N == 1:
        return 1

    return odd_count / N


N = int(input())

print(solve(N))
Problem p02912 (python)

Fixed submission:
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))


def solve():
    AA = [[-x, x] for x in A]

    heapq.heapify(AA)

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

    AAA = [x[1] for x in AA]
    return sum(AAA)


print(solve())

Buggy submission (verdict: Runtime Error):
import math

N, M = map(int, input().split())
A = [int(i) for i in input().split()]


def solve():
    sorted_list = A

    for index in range(0, M):
        sorted_list = sorted(sorted_list)
        sorted_list[-1] = math.round(sorted_list[-1] / 2)

    return sum(sorted_list)


print(solve())
Problem p02935 (python)

Fixed submission:
import heapq
import math


def solve(n, v):
    heapq.heapify(v)

    while len(v) != 1:
        x = heapq.heappop(v)
        y = heapq.heappop(v)
        z = (x + y) / 2
        heapq.heappush(v, z)

    return v[0]


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

print(solve(n, v))

Buggy submission (verdict: Runtime Error):
import heapq
import math


def solve(n, v):
    heapq.heapify(v)
    nn = math.ceil(n / 2)

    while len(nn) != 1:
        x = heapq.heappop(v)
        y = heapq.heappop(v)
        z = (x + y) / 2
        heapq.heappush(v, z)

    return v[0]


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

print(solve(n, v))