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

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

if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))

Buggy submission (verdict: Runtime Error):
s, t = map(str, input().split())
a. b = map(int, input().split())
u = input()

if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))

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

if s == u:
  print("{} {}".format(a-1, b))
else:
  print("{} {}".format(a, b-1))

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

if s == u:
  print(a-1 b)
else:
  print(a b-1)
Problem p02779 (python)

Fixed submission:
n = input()
a_list = list(map(int, input().split()))
a_set = set(a_list)

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = input()
a_list = list(map(int, input().split()))
a_set = set(a)

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
n = input()
a_list = list(map(int, input.split()))
a_set = set(a)

if len(a_list) == len(a_set):
  print("YES")
else:
  print("NO")
Problem p02781 (python)

Fixed submission:
n = input()
k = int(input())
nl = len(n)#桁数
dp = [[[0] * (k + 1) for i in range(2)] for i in range(nl + 1)]
dp[0][0][0] = 1# 初期条件

# dp[i][j][k] i:桁数 j:smallフラグ 1はsmall確定、0はnと同じ値 k:ゼロ以外の数字を使った回数
for i in range(nl):
    for j in range(2):
        for l in range(k + 1): # lはK+1(つまりk)までの範囲にしても問題なし。下でl<kするから
            c = int(n[i])# 今調べている桁の数
            if j == 1:  # small確定の場合
                dp[i + 1][j][l] += dp[i][j][l]  # kの値が等しいので次の桁で0が来なければいけない
                if l < k:  # まだ0でない数の個数がkより少ない場合   ※比較する変数注意！
                    dp[i + 1][j][l + 1] += dp[i][j][l] * 9  # 次の桁で1~9を使う
            else:  # j==0のとき つまり現在まで調べている桁数の部分がnと一致している。
                if c == 0:
                    # cが0のときは0しか選べなく、small確定できない
                    dp[i + 1][0][l] += dp[i][j][l]
                else:
                    dp[i + 1][1][l] += dp[i][j][l]  # Cより小さい0を使う→small確定
                    if l < k: #※比較する変数注意！
                        dp[i + 1][1][l + 1] += dp[i][j][l] * (c - 1)  # c以外の数字を使う、small確定
                        dp[i + 1][0][l + 1] += dp[i][j][l]  # cを使う、small確定できない
print(dp[nl][1][k]+dp[nl][0][k])

Buggy submission (verdict: Runtime Error):
n = input()
k = input()
nl = len(n)

dp = [[[0]*(k+1) for _ in range(2)]for _ in range(nl+1)]
#dp[i][j][k] i:上からの桁数、j:smaller flag、k:0以外の数字の個数
dp[0][0][0] = 1

for i in range(nl):
  for j in range(2):
    for l in range(k+1):
      c = int(n[i])
      if j == 1:
        dp[i+1][j][l] += dp[i][j][l]
        if l < k:
          dp[i+1][j][l+1] += dp[i][j][l]*9
      else:
        if c == 0:#0しか選べない上にsmallを確定できない
          dp[i+1][0][l] += dp[i][j][l]
        else:
          dp[i+1][1][l] += dp[i][j][l]#cより確実に小さい0を使う。small確定
          if l < k:
            dp[i+1][1][l+1] += dp[i][j][l]*(c-1) #c以下の数字を使えばsmall確定
            dp[i+1][0][l+1] += dp[i][j][l] #cを使ったらsmall確定できない
            
print(dp[nl][0][k]+dp[nl][1][k])
Problem p02785 (python)

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()

if k >= n:
  print(0)
  
else:
  print(sum(h[:n-k]))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
h = list(map(int, input().split()))
h = h.sort()

if k >= n:
  print(0)
  
else:
  print(sum(h[:n-k]))
Problem p02835 (python)

Fixed submission:
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())
d = a+b+c

if d >= 22:
  print('bust')
else:
  print('win')

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())
d = a+b+c

if d >= 22:
  print('bust')
else:
  print('win)
Problem p02836 (python)

Fixed submission:
# -*- coding: utf-8 -*-

s = input()
s_list = list(s)
s_len = len(s_list)

hag = 0

for i in range(s_len//2):
  if s_list[i] != s_list[(s_len-1)-i]:
    s_list[(s_len-1)-i] = s_list[i]
    hag += 1
  
print(hag)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

s = input()
s_list = list(s)
s_len = len(s_list)

hag = 0

for i in range(s_len//2):
  if s_list[i] != s_list[(s_len-1)-i]:
    s_list[s_len-i] = s_list[i]
    hag += 1
  
print(hag)
Problem p02773 (python)

Fixed submission:
N = int(input())

Sdict = dict()
max = 0
for _ in range(N):
    s = input()
    if s in Sdict:
        Sdict[s] += 1
    else:
        Sdict[s] = 0
    
maxi = 0
lis = []
for k,v in Sdict.items():
    if v > maxi:
        lis = [k]
        maxi = v
    elif v == maxi:
        lis.append(k)
lis.sort()
for k in lis:
    print(k)

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

Sdict = dict()
for _ in range(N):
    s = input()
    if s in Sdict:
        Sdict[s] += 1
    else:
        Sdict[s] = 0
    
print(Sdict)
maxi = 0
lis = []
for k,v in Sdict.itens():
	if v > maxi:
        lis = [k]
        maxi = v
    if v == maxi:
		lis.append(k)

print(lis.sort())
Problem p03054 (python)

Fixed submission:
H,W,N = map(int, input().split())
st = [int(i) for i in input().split()]
S = input()
T = input()


def simu(dim1):
    now = [st[0],st[1]]

    if dim1 == 'U':
        dim2,L,step,dim = 'D',H,1,0
    if dim1 == 'D':
        dim2,L,step,dim = 'U',H,-1,0
    if dim1 == 'L':
        dim2,L,step,dim = 'R',W,1,1
    if dim1 == 'R':
        dim2,L,step,dim = 'L',W,-1,1

    for i in range(N):
        if S[i] == dim1:
            now[dim] -= step
        if now[dim] < 1 or now[dim] >= L+1:
            return True
        if T[i] == dim2:
            if step == 1:
                if now[dim] < L:
                    now[dim] += step
            else:
                if now[dim] > 1:
                    now[dim] += step
    return False
        
Dim = ['U','D','R','L']
for d in Dim:
    if simu(d):
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
H,W,N = map(int, input().split())
now = [int(i) for i in input().split()]
S = input()
T = input()
flag = True
SM = [now[0],now[1]]
TM = [now[0],now[1]]

for n in range(N):
    if S[n] == 'L':
            SM[1] -= 1
    if S[n] == 'R':
            SM[1] += 1 
    if S[n] == 'U':
            SM[0] -= 1 
    if S[n] == 'D':
            SM[0] += 1
    if T[n] == 'L':
            TM[1] -= 1
    if T[n] == 'R':
            TM[1] += 1 
    if T[n] == 'U':
            TM[0] -= 1 
    if T[n] == 'D':
            TM[0] += 1

sm = [0,0,0,0]
if W-SM[1] >= SM[1]-1:
    sm[0] = 1
if W-SM[1] < SM[1]-1:
    sm[1] = 1
if H-SM[0] <= SM[0]-1:
    sm[2] = 1
if H-SM[0] < SM[0]-1:
    sm[3] = 1

tm = [0,0,0,0]
if W-TM[1] >= TM[1]-1:
    tm[0] = 1
if W-TM[1] <= TM[1]-1:
    tm[1] = 1
if H-TM[0] <= TM[0]-1:
    tm[2] = 1
if H-TM[0] <= TM[0]-1:
    tm[3] = 1

for n in range(N):
    if S[n] == 'L':
        if sm[0] == 1:
            now[1] -= 1
    if S[n] == 'R':
        if sm[1] == 1:
            now[1] += 1 
    if S[n] == 'U':
        if sm[3] == 1:
            now[0] -= 1 
    if S[n] == 'D':
        if sm[4] == 1:
            now[0] += 1
    #print(now)

    if now[0]*now[1] == 0 or now[0] == H+1 or now[1] == W+1 :
        flag = False
        break
    
    if T[n] == 'L':
        if tm[1] == 0:
            now[1] -= 1
    if T[n] == 'R':
        if tm[2] == 0:
            now[1] += 1 
    if T[n] == 'U':
        if tm[3] == 0:
            now[0] -= 1 
    if T[n] == 'D':
        if tm[4] == 0:
            now[0] += 1
    #print(now)

    if now[0]*now[1] == 0 or now[0] == H+1 or now[1] == W+1 :
        flag = False
        break

if flag:
    print('YES')
else:
    print('NO')
Problem p03127 (python)

Fixed submission:
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N = int(input())
A = [int(i) for i in input().split()]
g = A[0]
for n in range(1,N):
    g = gcd(g,A[n])

print(g)

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

print(g)

Buggy submission (verdict: Runtime Error):
import math
 
N = int(input())
A = [int(i) for i in input().split()] 

 
print(math.gcd(A))

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

def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

g = gcd(*A)

print(g)
Problem p03137 (python)

Fixed submission:
N,M = map(int, input().split())
X = [int(i) for i in input().split()]

if N >= M:
    print(0)
    exit()


X.sort()
L = [X[i+1] - X[i] for i in range(len(X)-1)]
L.sort()

print(sum(L[:(M-N)]))

Buggy submission (verdict: Runtime Error):
import itertools 

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

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

if N == 1:
    print(X[M-1]-X[0])
    exit()


X.sort()
index = range(1,M)

anslist = []
for c in itertools.combinations(index, N-1):
    ans = X[c[0]-1] - X[0]
    #print(ans)
    for n in range(N-1):
        if n == N-2:
            ans += X[M-1] - X[c[n]]
        else:
            ans += X[c[n+1]-1] - X[c[n]]
    anslist.append(ans)

print(min(anslist))
Problem p02771 (python)

Fixed submission:
# -*- coding: utf-8 -*-

import os
import datetime

def main():
    # スペース区切りの整数の入力
    a, b, c = map(int, input().split())
    int_dict = {}
    int_dict[a] = ""
    int_dict[b] = ""
    int_dict[c] = ""

    if len(int_dict) == 2:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import os
import datetime

def main():
    a, b = map(int, input().split())
    val = list(map(lambda x: int(x), input().split()))

    result_dict = []

    for i in range(len(val)):
        for j in range(i+1, len(val)):
            result_dict.append(val[i] * val[j])

    min_list = sorted(result_dict)
    print(min_list[b-1])

if __name__ == '__main__':
    main()
Problem p02771 (python)

Fixed submission:
a,b,c = [int(x) for x in input().split()]

if (a==b and c!= a) or (a==c and a!=b) or (b == c and a!=b):print('Yes')
else:print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)

Buggy submission (verdict: Runtime Error):
n, k = [int(x) for x in input().split()]
nums = [int(x) for x in input().split()]
nums.sort()
if 0 in nums:
  index = nums.index(0)
  if index == 0:
    print(nums[1] * nums[k]
    break
  if index == n-1:
    print(nums[-2] * nums[-k - 1]
  else:
      num_neg = index
      num_pos = n - index
      if k < num_neg * num_pos:
          s = k // num_pos
          f = k % num_pos
          if f == 0:
              print(nums[-s] * nums[index+1])
          else:
              print(nums[-s-1] * nums[-f-1])
      else:
          new_list = nums[index:] + [-x for x in nums[:inedex]]
          new_list.sort()
          print(new_list[1] * new_list[k]
else:
    l, h = 0, n - 1
    while l < h:
        m = (l+h) // 2
        if nums[m] >= 0:
            h = m
        else:
            l = m + 1
        index = l
    num_neg = index
    num_pos = n - index
    if k < num_neg * num_pos:
        s = k // num_pos
        f = k % num_pos
        if f == 0:
            print(nums[-s] * nums[index+1])
        else:
            print(nums[-s-1] * nums[-f-1])
    else:
        new_list = nums[index:] + [-x for x in nums[:inedex]]
        new_list.sort()
        print(new_list[0] * new_list[k-1]
Problem p02773 (python)

Fixed submission:
n = int(input())
d = {}
for i in range(n):
  s = input()
  if s not in d:d[s] = 1
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda x:x[1])[-1][1]
s = [x for x, y in d.items() if y == max_cnt]
s.sort()
for name in s:
    print(name)

Buggy submission (verdict: Runtime Error):
n = int(input())
d = {}
for i range(n):
  s = input()
  if s not in d:d[s] = 0
  d[s] += 1
max_cnt = sorted(d.items(), key=lambda tp:tp[1])[-1][1]
a1 = filter(lambda tp:tp[1] == max_cnt, d.items())
a2 = map(lambda tp:tp[0], a1)
for s in sorted(a2):
  print(s)
Problem p02771 (python)

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

n=0

for i in range(0,2):
  if li[i+1] - li[i] ==0:
    n+=1
if li[2] - li[0] ==0:
  n+=1

if n==1:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):

li = list(map(int, input().split()))

n=0

for i in range(0,3):
  if li[i+1] - li[i] ==0:
    n++

if n==1:
  print("Yes")
else:
  print("No")
Problem p02771 (python)

Fixed submission:

case = input()

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != B):
    print('Yes')
else:
    print('No')

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

A, B, C =[int(x) for x in case.split(' ')]
if (A == B and A != C) or(B == C and A != C) or (A == C and A != C):
    print('Yes')
else:
    print('No')
Problem p02773 (python)

Fixed submission:
n = int(input())
vote = dict()
for i in range(n):
  s = input()
  if s not in vote.keys():
    vote[s] = 0
  else:
    vote[s] += 1

res = []
mx = max(vote.values())
for key, value in vote.items():
    if value== mx:
        res.append(key)

res = sorted(res)
for i in res:
  print(i)

Buggy submission (verdict: Runtime Error):
n = int(input())
vote = dict()
for i in range(n):
  s = input()
  if s not in vote.keys():
    vote[s] = 0
  else:
    vote[s] += 1
vote.sort()
res = sorted(vote.values(), reverse = True)
for i in res.keys():
  print(i)
Problem p02771 (python)

Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]
C = i[2]
if A == B != C :
  print('Yes')
elif A != B == C :
  print('Yes')
elif A == C != B :
  print('Yes')
else :
  print('No')

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
if A == B != C :
  print('Yes')
elif A != B == C :
  print('Yes')
elif A == C != B :
  print('Yes')
else :
  print('No')
Problem p03012 (python)

Fixed submission:
N = int(input())
W = [int(x) for x in input().split()]
result = float('inf')
for i in range(N):
    W1= sum(W[0:i])
    W2= sum(W)-W1
    diff=abs(W1-W2)
    result=min(result,diff)
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
W =[int(x) for x in input().split()]
print(min(abs(sum(W[:i])-sum(W[i:])) for i in range(N))
Problem p02777 (python)

Fixed submission:
S , T =  [str(x) for x in input().split()]

A , B =  [int(x) for x in input().split()]

U = input()
# S = input()   
if S ==  U:
    A = A - 1
elif T==U:
    B = B - 1   
print(A,B)

Buggy submission (verdict: Runtime Error):
S , T =  [str(x) for x in input().split()]

A , B =  [int(x) for x in input().split()]

U = input()
    
if S ==  U:
    A = A - 1
else:
    B = B - 1
    
print(A,B)
S = input()
print('x'*len(S))
Problem p02935 (python)

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

for i in range(0 , n-1):
    if (i != 0):
        result = (result + sortedListV[i+1]) / 2
    else:
        result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n):
    result += (result + sortedListV[i]) / 2
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result += (result + sortedListV[i]) / 2
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result += (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Buggy submission (verdict: Runtime Error):
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (0,3):
    result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)
Problem p03072 (python)

Fixed submission:
N = int(input())
ListH = list(map(int,input().split()))
result = 0
for i in range(N):
    out = False
    for k in range(i):
        if k >= 0:
            if ListH[k] > ListH[i]:
                out = True
    if not out :
        result += 1
print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
ListH = list(map(int,input().split()))
result = 1
for i in range(N):
    for k in range(i):
        out = False
        if k >= 0:
            print(ListH[k],ListH[i])
            if ListH[k] < ListH[i]:
                out = True
    if not out :
        result += 1
print(result)
Problem p02829 (python)

Fixed submission:
a = int(input())
b = int(input())

ans = {1, 2, 3}
not_ans = {a, b}

for data in ans.difference(not_ans):
    print(data)

Buggy submission (verdict: Runtime Error):
x, y = input().split(" ")
a = int(x)
b = int(y)

ans = {1, 2, 3}
not_ans = {a, b}

z = ans.difference(not_ans)

print(z)
Problem p02771 (python)

Fixed submission:
def solve():
    A = list(map(int,input().split()))
    for i in range(3):
        if sum(x==A[i] for x in A) == 1 or sum(x==A[i] for x in A) == 3:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")

solve()

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
for i in range(3):
    if sum(x==A[i] for x in A) == 1:
        continue
    elif sum(x==A[i] for x in A) ==2:
        print("Yes")
        return
print("No")

Buggy submission (verdict: Runtime Error):
    A = list(map(int,input().split()))
    print(A)
    for i in range(3):
        if sum(x==A[i] for x in A) == 1:
            continue
        elif sum(x==A[i] for x in A) ==2:
            print("Yes")
            return
    print("No")
Problem p03077 (python)

Fixed submission:
import math

def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)


solve()

Buggy submission (verdict: Runtime Error):
def solve():
    num_total = int(input())
    num_transport=[0]*5
    for i in range(5):
        num_transport[i]=int(input())
    time = math.ceil(num_total/num_transport[0])
    x = num_transport[0]
    for i in range(1,5):
        if num_transport[i] < x:
            time = i+ math.ceil(num_total/num_transport[i])
            x = num_transport[i]
        else:
            time += 1
    print(time)

solve()
Problem p02785 (python)

Fixed submission:
H,K=map(int,input().split())
 
s=list(map(int,input().split()))
 
sum=0

s.sort(reverse=True)

if K>=len(s):
  for A in range(len(s)):
    s[A]=0

else:
  for A in range(K):
    s[A]=0



for A in s:
  sum+=A
 
print(sum)

Buggy submission (verdict: Runtime Error):
H,K=map(int,input().split())
 
ln=list(map(int,input().split()))
 
sum=0

if K!=0:
	ln.sort(reverse=True)
	for A in range(K):
		ln[A]=0
 
for A in ln:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))
 
sum=0

ln.sort(reverse=True)
for A in range(K):
	ln[A]=0
 
for A in ln:
  sum+=A
 
print(sum)

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

ln=list(map(int,input().split()))

sum=0

for _ in range(K):
  ln[ln.index(max(ln))]=0

for A in range(ln):
  sum+=ln[A]

print(sum)
Problem p02829 (python)

Fixed submission:
print(6 - int(input())- int(input()))

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
print(6-A-B)

Buggy submission (verdict: Runtime Error):
A, B = map(int, input().split())
l1 = [1,2,3]
l2 = [A, B]
l = l1 - l2
print(l[0])
Problem p02847 (python)

Fixed submission:
days = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 
i = str(input())
count = 7
for day in days:
  if i == day:
    print(count)
    break
  else:
    count-=1

Buggy submission (verdict: Runtime Error):
days = ['SUN','MON','TUE','WED','THU','FRI','SAT'] 
i = str(input())
count = 7
for day in days:
  if i == day:
    print(count)
    break
   else:
    count-=1
Problem p02859 (python)

Fixed submission:
r = int(input())
print(r**2)

Buggy submission (verdict: Runtime Error):
r = input()
print(int(r*r))
Problem p02777 (python)

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

if s == u:
    a -= 1
else:
    b -= 1

print(str(a) + " " + str(b))

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
p = list(map(int, input().split()))

value = 0
index = 0

for i in range(0, k):
    value += p[i]

max = value

for i in range(1, n - k + 1):
    value = value - p[i - 1] + p[i + k - 1]
    if value > max:
        max = value
        index = i

total = 0
for i in range(index, index + k):
    total += p[i] / 2 + 0.5

print(total)
Problem p02771 (python)

Fixed submission:
a,b,c = map(int, input().split())
A = [a,b,c]
if len(set(A)) == 1 or len(set(A)) == 3:
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
A = list(map(int, input().split())
if len(set(A))==1:
    print('No')
elif len(set(A)) == 2:
    print('Yes')
else:
    print('No')
Problem p02835 (python)

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

if(N + K + Q >= 22):
    print("bust")
else:
    print("win")

Buggy submission (verdict: Runtime Error):
import itertools
def main():
    S = int(input())
    a = [int(i) for i in input().split()]
    x = 10**9
    
    xor = 0
    patern = list(itertools.combinations(a, 2))
    for p in patern:
        xor += p[0] ^ p[1]
    if xor >= x:
        print(xor % (x + 7))
    else:
        print(xor)

if __name__ == '__main__':
    main()
Problem p02935 (python)

Fixed submission:
N=int(input())
s=list(map(int, input().split()))
s.sort()
ans=s[0]
for i in range(N-1):
    ans=((ans+s[i+1])/2)
print(ans)

Buggy submission (verdict: Runtime Error):
N-int(input())
s=list(map(int, input().split()))
s.sort()
ans=0
for i in range(N-1):
    if i==0:
        ans=+s[0]
    else:
        ans=((ans+s[i])/2)
print(ans)

Buggy submission (verdict: Runtime Error):
N-int(input())
s=list(map(int, input().split()))
s.sort()
ans=0
for i in range(N-1):
    if i==0:
        ans=s[0]
    else:
        ans=((ans+s[i])/2)
print(ans)

Buggy submission (verdict: Runtime Error):
N-int(input())
s=list(map(int, input().split()))
ans=0
for i in range(N-1):
    if i==0:
        ans=s[0]
    else:
        ans=((ans+s[i])/2)
print(ans)

Buggy submission (verdict: Runtime Error):
N-int(input())
s=list(map(int, input().split()))
ans=0
for i in range(N-1):
    if i==0:
        ans=s[0]
    else:
        ans=((ans+s[i])/2)
print(ans)
Problem p02959 (python)

Fixed submission:
import numpy as np
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
sum=np.sum(b)
for i in reversed(range(n)):
  k = a[i+1]
  l = a[i]
  m = b[i]
 
  a[i+1] = max(k-m, 0)
  b[i] = max(m-k, 0)
 
  a[i] = max(l-b[i], 0)
  b[i] = max(b[i]-l, 0)
postsum=np.sum(b)
print(sum-postsum)

Buggy submission (verdict: Runtime Error):
b=[int(i) for i in input().split()]
sum=np.sum(b)
for i in reversed(range(n)):
  k = a[i+1]
  l = a[i]
  m = b[i]
 
  a[i+1] = max(k-m, 0)
  b[i] = max(m-k, 0)
 
  a[i] = max(l-b[i], 0)
  b[i] = max(b[i]-l, 0)
postsum=np.sum(b)
print(sum-postsum)