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

Fixed submission:
a,b=map(int, input().split())
if a<=9 and b<=9:
  print(a*b)
else:
  print(-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
 
if a<=9 and b<=9:
  print(a*b)
  else:
    print(-1)

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

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

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

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

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

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

Buggy submission (verdict: Runtime Error):
a,b = random.randint(1, 20)
if a+b <= 18:
  print(a*b)
  else:
    print(-1)
Problem p03072 (python)

Fixed submission:
N=int(input())
H=list(map(int, input().split()))
ans=1
m=H[0]
for i in range(1,N):
    if H[i]>=m:
        ans+=1
        m=H[i]
print(ans)

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

Fixed submission:
a,b=map(int,input().split())
ans=0
for i in range(a+1):
  for j in range(a+1):
      if 0<=b-i-j<=a:
        ans+=1
print(ans)

Buggy submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=0:
for i in range(a+1):
  for j in range(a+1):
    for k in range(a+1):
      if i+j+k==b:
        ans++
print(ans)
Problem p03242 (python)

Fixed submission:
n = input()
ans = ''
for a in n:
  if a == '1':
    ans  = ans + '9'
  else:
    ans = ans + '1'
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
ans = “”
for a in n:
  if a == “1”:
    ans  = ans + “9”
  else:
    ans = ans + “1”
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
n = [‘1’ for a in n if a==‘9’ else ‘9’]
print(“”.join(n))
Problem p03315 (python)

Fixed submission:
s = input()
res = 0
for letter in s:
    if letter =='+':
        res += 1
    else:
        res -= 1
print(res)

Buggy submission (verdict: Runtime Error):
import sys
N, K = map(int,input().split())
A = list(map(int, input().split()))
if N == K:
    print(1)
    sys.exit()
idx = A.index(1)
res = 0
if idx <= K:
    idx = K-1
    res = 1
else:
    while(True):
        res += 1
        idx -= K - 1
        if idx <= 0:
            break
idx = A.index(1)
if idx <= K:
    idx = K-1
while(True):
    if idx >= N-1:
        break
    res += 1
    idx += K-1

print(res)
Problem p03317 (python)

Fixed submission:
n,k=map(int,input().split())
a=(n-1)/(k-1)
if a!=int(a):
    print(int(a)+1)
else:
    print(int(a))

Buggy submission (verdict: Runtime Error):
8 3
7 3 1 8 4 6 2 5
Problem p03774 (python)

Fixed submission:
n, m = map(int, input().split())
A = [tuple(map(int, input().split())) for i in range(n)]
C = [tuple(map(int, input().split())) for j in range(m)]
for i in range(n):
  res = 1 
  ans = abs(A[i][0] - C[0][0]) + abs(A[i][1] - C[0][1])
  for j in range(m):
    tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1])
    if tmp < ans:
      ans = tmp
      res = j+1
  print(res)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = [(a, b) for a, b in map(int, input().split())]
C = [(c, d) for c, d in map(int, input().split())]
for i in range(n):
  res = 0
  ans = 1 << 20
  for j in range(m):
    tmp = abs(A[i][0] - C[j][0]) + abs(A[i][1] - C[j][1]) )
    if tmp < ans:
	  ans = tmp
      res = j
  print(j)
Problem p02915 (python)

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

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

Fixed submission:
s=list(input())
s1=s[0]
sf=s.count(s1)
if sf==2:
  for i in range(2):
    s.remove(s1)
  if s[0]==s[1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=list(input())
s1=s[0]
sf=s.count(s1)
for i in range(sf):
  s.remove(s1)
if s[0]==s[1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s=list(map(int,input().split()))
s1=s[0]
sf=s.count(s1)
for i in range(sf):
  s.remove(s1)
if s[0]==s[1]:
  print("Yes")
else:
  print("No")
Problem p03011 (python)

Fixed submission:
pqr=list(map(int,input().split()))
pqr.sort()
print(pqr[0]+pqr[1])

Buggy submission (verdict: Runtime Error):
pqr=list(map(int,input().split()))
pqr.sorted()
print(pqr[0]+pqr[1])
Problem p03072 (python)

Fixed submission:
n=int(input())
h=list(map(int,input().split()))
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
h=[list(map(int,input().split()))]
high=0
count=0
for i in range(n):
  if high<=h[i]:
    count=count+1
    high=h[i]
print(count)
Problem p03073 (python)

Fixed submission:
s=list(input())
count1=0
count2=0
for i in range(len(s)-1):
  if s[i]==s[i+1]:
    count1=count1+1
    if s[i+1]=='0':
      s[i+1]='1'
    else:
      s[i+1]='0'
for i in range(1,len(s)-1):
  if s[i]==s[i+1]:
    count2=count2+1
    count1=count1+1
    if s[i+1]=='0':
      s[i+1]='1'
    else:
      s[i+1]='0'
if count1>=count2:
  print(count1)
else:
  print(count2)

Buggy submission (verdict: Runtime Error):
s=list(input())
count1=0
count2=0
for i in range(len(s)):
  if s[i]==s[i+1]:
    count1=count1+1
for i in range(1,len(s)):
  if s[i]==s[i+1]:
    count2=count2+1
if count1>=count2:
  print(count1)
else:
  print(count2)
Problem p03315 (python)

Fixed submission:
s=list(input())
ans=0
for i in s:
  if i=="-":
    ans=ans-1
  else:
    ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
s=list(input())
ans=0
for i in s:
  if i="-":
    ans=ans-1
  else:
    ans=ans+1
print(ans)
Problem p03317 (python)

Fixed submission:
n,k=map(int,input().split())
ans=1
while n>ans*(k-1)+1:
  ans=ans+1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
one_p=a.index(1)
ans=0
if n!=k:
  ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans+(one_p)//(k-1)+1
  ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0: else ans+(n-one_p)//(k-1)+1
else:
  ans=1
print(ans)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=list(map(int,input().split()))
one_p=a.index(1)
ans=0
if n!=k:
  ans=ans+(one_p)//(k-1) if (one_p)%(k-1)==0 else ans=ans+(one_p)//(k-1)+1
  ans=ans+(n-one_p)//(k-1) if (n-one_p)%(k-1)==0: else ans=ans+(n-one_p)//(k-1)+1
else:
  ans=1
print(ans)
Problem p02935 (python)

Fixed submission:
N = int(input())
a = sorted(list(map(int, input().split())))
b = (a[0] + a[1]) / 2
if N > 2:
  for c in a[2:]:
    b = (b + c) / 2
print(b)

Buggy submission (verdict: Runtime Error):
N = input()
a = sorted(list(map(int, input().split())))
b = (a[0] + a[1]) / 2
if N > 2:
  for c in a[2:]:
    b = (b + c) / 2
print(b)
Problem p02729 (python)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
cnt = 0

# 偶数
#if a != 0:
#    if a % 2 != 0:
#        a = a - 1

# 奇数


# 組み合わせ
nCr = {}

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n, r) in nCr: return nCr[(n, r)]
    nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
    return nCr[(n, r)]


#
if a > 1:
    cnt = cnt + cmb(a, 2)

if b > 1:
    cnt = cnt + cmb(b, 2)
print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
cnt = 0

# 偶数
#if a != 0:
#    if a % 2 != 0:
#        a = a - 1

# 奇数


# 組み合わせ
nCr = {}

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n, r) in nCr: return nCr[(n, r)]
    nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
    return nCr[(n, r)]


#
if a != 0:
    cnt = cnt + cmb(a, 2)
cnt = cnt + cmb(b, 2)
print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
cnt = 0

# 偶数
if a != 0:
    if a % 2 != 0:
        a = a - 1

# 奇数


# 組み合わせ
nCr = {}

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n, r) in nCr: return nCr[(n, r)]
    nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
    return nCr[(n, r)]


#
if a != 0:
    cnt = cnt + cmb(a, 2)
cnt = cnt + cmb(b, 2)
print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
cnt = 0

# 偶数
if a != 0:
    if a % 2 != 0:
        a = a - 1

# 奇数


# 組み合わせ
nCr = {}

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n, r) in nCr: return nCr[(n, r)]
    nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
    return nCr[(n, r)]


#
cnt = cnt + cmb(a, 2) + cmb(b, 2)
print(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
cnt = 0

# 偶数
if a % 2 != 0:
    a = a - 1

# 奇数


# 組み合わせ
nCr = {}

# https://qiita.com/derodero24/items/91b6468e66923a87f39f
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n, r) in nCr: return nCr[(n, r)]
    nCr[(n, r)] = cmb(n - 1, r) + cmb(n - 1, r - 1)
    return nCr[(n, r)]


#
cnt = cnt + cmb(a, 2) + cmb(b, 2)
print(cnt)
Problem p03077 (python)

Fixed submission:
N = int(input())
a = []
for _ in range(5):
    a.append(int(input()))

bt = min(a)
bt_i = a.index(bt)
t = N // bt + (0 if N % bt == 0 else 1) + 4
print(t)

Buggy submission (verdict: Runtime Error):
    #include<iostream>
    #include<vector>
    #include<algorithm>
    #define lli long long
    #define all(i) i.begin(),i.end()
    #define rall(i) i.rbegin(),i.rend()
    #define rep0(i,j) for(int i=0;i<j;i++)
    #define rep1(i,j) for(int i=1;i<=j;i++)
    #define rep0d(i,j) for(int i=j-1;i>=0;i--)
    #define MAX 1000000007
     
    using namespace std;
     
     
     
    int main() {
        lli n, mi = 1e16;
        lli min;
        cin >> n;
        vector<lli> vec(5,0);
        rep0(i,5){
            cin >> vec[i];
        
            if(vec[i]<mi){
                min = i;
                mi = vec[i];
            }
        }
        
        cout << n/vec[min] + 4 + (n%vec[min]==0)?0:1;
    }
Problem p03127 (python)

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

input()
a_list = [int(s) for s in input().split()]

N = len(a_list)
min_last_hp = 10**10

f = min(a_list)
a_list.remove(f)

for i in a_list:
    last_hp = gcd(f, i)
    if last_hp < min_last_hp:
        min_last_hp = last_hp

s = min(a_list)
kouho=gcd(f,s)
if kouho < min_last_hp:
    print(kouho)
else:
    print(min_last_hp)

Buggy submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 10

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)

Buggy submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = 10 ** 9

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        # if min_last_hp == None:
        #     min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)

Buggy submission (verdict: Runtime Error):
import math

input()
a_list = [int(s) for s in input().split()]
N = len(a_list)

min_last_hp = None

for start in range(N):
    for c in range(start+1, N):
        last_hp = math.gcd(a_list[start], a_list[c])
        if min_last_hp == None:
            min_last_hp = last_hp
        if last_hp < min_last_hp:
            min_last_hp = last_hp

print(min_last_hp)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
s = input()
if s[3] = s[2] and s[4] = s[5]:
  print('Yes', end = '')
else:
  print('No',end = '')

Buggy submission (verdict: Runtime Error):
s = input()
if s[3] = s[2] and s[4] = s[5]:
  print('Yes')
else:
  print('No')
Problem p02725 (python)

Fixed submission:
ddd = [input() for i in range(2)]
eee = ddd[0].split()
fff = ddd[1].split()
longest_distance = int(eee[0]) + int(fff[0]) - int(fff[-1])
for i in range(len(fff) - 1):
    distance = int(fff[i+1]) - int(fff[i])
    if longest_distance < distance:
        longest_distance = distance
shortest_road = int(eee[0]) - longest_distance
print(shortest_road)

Buggy submission (verdict: Runtime Error):
ddd = [input() for i in range(2)]
eee = ddd[0].split()
fff = ddd[1].split()
longest_distance = 0

for i in range(len(fff - 1)):
    distance = fff[i+1] - fff[i]
    if longest_distance < distance:
        longest_distance = distance

shortest_road = eee[0] - longest_distance

print(shortest_road)
Problem p02753 (python)

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

import sys

def prob_a(s):
    chars = list(s)
    tmpc = chars[0]
    for c in chars[1:]:
        if c == tmpc:
            continue
        else:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    s = input()
    prob_a(s)

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

import sys

def prob_a(args):
    s = args[1]
    chars = list(s)
    tmpc = chars[0]
    for c in chars[1:]:
        if c == tmpc:
            continue
        else:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    args = sys.argv
    prob_a(args)
Problem p02754 (python)

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

import sys


def prob_b(n, a, b):
    x = int(n / (a + b)) * a
    y = min(n % (a + b), a)
    print(x+y)


if __name__ == '__main__':
    #args = sys.argv
    #n = args[1]
    #a = args[2]
    #b = args[3]
    n, a, b = map(int, input().split())
    prob_b(n,a,b)

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

import sys

def prob_b(n, a, b):
    n, a, b = int(n), int(a), int(b)
    x = int(n / (a + b)) * a
    y = n % (a + b)
    print(x+y)


if __name__ == '__main__':
    args = sys.argv
    n = args[1]
    a = args[2]
    b = args[3]
    prob_b(n,a,b)
Problem p02831 (python)

Fixed submission:
import fractions


A, B = map(int, input().split())
gcd = fractions.gcd(A, B)

print((A * B) // gcd)

Buggy submission (verdict: Runtime Error):
import math


A, B = map(int, input().split())
gcd = math.gcd(A, B)

print((A * B) // gcd)
Problem p03135 (python)

Fixed submission:
t,x = input().split()
print(int(t)/int(x))

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

if n >= m:
    print(0)
    exit()
else:
    difference = []
    x.sort()
 
    for i in range(m-1):
        difference.append(x[i+1]-x[i])
 
    difference.sort()
 
    print(sum(difference[:n-1]))
Problem p03137 (python)

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

if n >= m:
    print(0)
    exit()
else:
    difference = []
    x.sort()
 
    for i in range(m-1):
        difference.append(x[i+1]-x[i])
 
    difference.sort()
 
    print(sum(difference[:m-n]))

Buggy submission (verdict: Runtime Error):
n,m = input().split()
n = int(n)
m = int(m)
 
row_x = input().split()
for i in range(m):
    row_x[i] = int(row_x[i])
 
if n >= m:
    print(0)
else:
    difference = 0
    maximun = []
    x = sorted(row_x)
 
    for i in range(m-1):
        diffe = x[i+1]-x[i]
        difference += diffe
        if len(maximun) < (n-1):
            maximun.append(diffe)
        elif min(maximun) < diffe:
            maximun.append(diffe)  
            maximun.remove(min(maximun))
                     

    print(difference-sum(maximun))

Buggy submission (verdict: Runtime Error):
n,m = input().split()
n = int(n)
m = int(m)
 
row_x = input().split()
for i in range(m):
    row_x[i] = int(row_x[i])
 
if n >= m:
    print(0)
else:
    difference = []
    maximun = []
    x = sorted(row_x)
 
    for i in range(m-1):
        diffe = x[i+1]-x[i]
        difference.append(diffe)
        if len(maximun) < (n-1):
            maximun.append(diffe)
        elif min(maximun) < diffe:
            maximun.remove(min(maximun))
            maximun.append(diffe)           

    print(sum(difference)-sum(maximun))

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

row_x = input().split()

if n >= m:
    print(0)
else:
    difference = []
    x = sorted(row_x)

    for i in range(m-1):
        difference.append(x[i+1]-x[i])

    for i in range(n-1):
        difference.remove(max(difference))

    print(sum(difference))
Problem p03209 (python)

Fixed submission:
n,x=map(int,input().split())
len_b=2**(n+2)-3
p=[2**(i+1)-1 for i in range(n)]
start=1
end=len_b
center=(end+1)//2
count1=0
count2=n-1
while True:
    if count2==-1:
        count1+=1
        break
    elif x==start:
        break
    elif x==center:
        count1+=p[count2]+1
        break
    elif x==end:
        count1+=p[count2]*2+1
        break
    elif x<center:
        start=start+1
        end=center-1
        center=(start+end)//2
        count2-=1
    else:
        start=center+1
        end=end-1
        center=(start+end)//2
        count1+=p[count2]+1
        count2-=1
print(count1)

Buggy submission (verdict: Runtime Error):
n,x=map(int,input().split())
burgar='p'
for i in range(n):
    burgar='b'+burgar+'p'+burgar+'b'
a=list(burgar)
ans=0
for j in a[:x]:
    if j=='p':
        ans+=1
print(ans)
Problem p02723 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
if S[3] == S[4] and S[5] == S[6]:
  print('Yes')
else:
  print('No')
Problem p02771 (python)

Fixed submission:
A, B, C = map(int, input().split())
if (A == B) or (B == C) or (C == A):
  if (A == B) and (B == C):
    print("No")
  else:
    print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = int(input().split())
if (A == B) or (B == C) or (C == A):
  if (A == B) and (B == C):
    print("No")
  else:
    print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
A, B, C = int(input().split())
if A == B or B == C or C == A:
  if A == B and B == C:
    print('No')
  else:
    print('Yes')
else:
  print('No')
Problem p02916 (python)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
 
point = sum(B)
for i in range(N-1):
  if A[i]==A[i+1]-1:
    point +=C[A[i]-1]
print(point)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input().split() for l in range(N)]
B = [input().split() for l in range(N)]
C = [input().split() for l in range(N-1)]
ans = 0

for i in range(N):
  ans = ans + B[(A[i])]
  if i == 0:
    ans = ans
  else if A[i] == A[(i-1)] + 1:
    ans = ans + C[i-1]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input().split() for l in range(N)]
B = [input().split() for l in range(N)]
C = [input().split() for l in range(N-1)]
ans = 0

for i in range(N):
  ans = ans + B[A[i]]
  if i == 0:
    ans = ans
  else if A[i] == A[i-1] + 1:
    ans = ans + C[i]

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [input().split() for l in range(N)]
B = [input().split() for l in range(N)]
C = [input().split() for l in range(N-1)]
ans = 0

for i in range(N):
  ans = ans + B[A[i]]
  if i == 0:
    ans = ans
  else if A[i] == A[i-1] + 1:
    ans + C[i]
print(ans)
Problem p02915 (python)

Fixed submission:
n = int(input())

print(n**3)

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

a = []

a.append(b[0])

for i in range(1, n-1):
  if b[i-1] <= b[i]:
    a.append(b[i-1])
  elif b[i] <= b[i+1]:
    a.append(b[i+1])
a.append(b[-1])
print(sum(a))
Problem p02723 (python)

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

  return

if __name__ == "__main__":
  solve()

Buggy submission (verdict: Runtime Error):
def solve():
	s = input()
   	if s[2] == s[3] and s[4] == s[5]:
		print("Yes")
    else:
		print("No")
          
if __name__ == "__main__":
	solve()
Problem p02766 (python)

Fixed submission:
a, b = input().split()
a, b = int(a), int(b)
 
digit = 0
for i in range(100):
  if a <= b ** i - 1:
    digit = i
    break
    
print(digit)

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

print(len(str(int(a, b))))
Problem p02831 (python)

Fixed submission:
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

def solve():
    a, b = list(map(int, input().split()))
    print(lcm(a, b))

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
from fractions import lcm

def solve():
    a, b = list(map(int, input().split()))
    print(lcm(a, b))

if __name__ == "__main__":
    solve()

Buggy submission (verdict: Runtime Error):
import math
def lcm(a, b):
    return a * b // math.gcd(a, b)

def solve():
    a, b = list(map(int, input().split()))
    print(lcm(a, b))

if __name__ == "__main__":
    solve()
Problem p02777 (python)

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

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

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
for idx, i in enumerate(a[:-1]):
    if i == a[idx+1]:
        print('NO')
        break
if idx == n - 2:
    print('YES')
Problem p02779 (python)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a = sorted(a)
flag = True
for idx, i in enumerate(a[:-1]):
    if i == a[idx+1]:
        print('NO')
        flag= False
        break
if flag:
    print('YES')

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
a =set(a)
for idx, i in enumerate(a[:-1]):
    if i == a[idx+1]:
        print('NO')
        break
if idx == n - 2:
    print('YES')
Problem p03724 (python)

Fixed submission:
if __name__ == '__main__':
	N, M=map(int, input().split())

	n=[]
	for j in range(N):
		n.append(0)

	for i in range(M):
		a,b=[int(i) for i in input().split()]
		n[a-1]+=1
		n[b-1]+=1

	flag = 0
	for i in range(N):
		if(n[i]%2==1):
			flag +=1

	if(flag<2):
		print('YES')
	else:
		print('NO')

Buggy submission (verdict: Runtime Error):
if __name__ == '__main__':
	N, M=map(int, input().split())
	a=[]
	b=[]
	for i in range(M):
		x,y=[int(i) for i in input().split()]
		a.append(x)
		b.append(y)
		n=[]
		for j in range(N):
			n.append(0)

	for i in range(N):
		n[a[i]-1]+=1
		n[b[i]-1]+=1

	flag = 0
	for i in range(N):
		if(n[i]%2==1):
			flag +=1

	if(flag<2):
		print('YES')
	else:
		print('NO')
Problem p02725 (python)

Fixed submission:
# coding:utf-8
k, n = map(int, input().split())
a = list(map(int, input().split()))
distance = []
for i in range(len(a)):
  if i == len(a) - 1:
    distance.append(k+a[0] - a[i])
  else:
  	distance.append(a[i+1] - a[i])
distance.sort()
print(sum(distance[:-1]))

Buggy submission (verdict: Runtime Error):
# coding:utf-8
k, n = map(int, input().split())
a = list(map(int, input().split()))
a += k
l = 0
for i in range(n+1):
  l = max(l, a[i+1]-a[i])
 
print(k-l)

Buggy submission (verdict: Runtime Error):
# coding:utf-8
k, n = map(int, input().split())
a = list(map(int, input().split()))
a += k
for i in range(n+1):
  l = max(l, a[i+1]-a[i])

print(k-l)