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

Fixed submission:
N = int(input())

info = []
for i in range(N):
    chis = input().split()
    info.append(chis)

maximum = zoro = 0
for each in info:
    if each[0] == each[1]:
        zoro += 1
        maximum = max(maximum, zoro)
    else:
        zoro = 0

if maximum > 2:
    print("Yes")
else:
    print("No")

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

nums = []
for a in range(N):
  ci = []
  ci.append(int(input()))
  ci.append(int(input()))
  nums.append(ci)

zoro = maximum = 0
for a in range(N):
  if nums[a][0] == nums[a][1]:
    zoro += 1
    maximum = max(maximum, zoro)
  else:
    zoro = 0
Problem p02771 (python)

Fixed submission:
import sys #sys.stdin.readline()
import heapq #heap
from collections import defaultdict
fastinp = lambda: sys.stdin.readline().split(' ')
inp = lambda: input().split(' ')
ml = lambda x, y=int: list(map(y, x))
debug = lambda *args: print(*args, sep=' | ')
a, b, c = ml(inp())
if a == b and a != c:
    print('Yes')
elif b == c and a != b:
    print('Yes')
elif a == c and b != a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys #sys.stdin.readline()
from math import gcd, ceil, floor, sqrt
import heapq #heap
from collections import defaultdict
fastinp = lambda: sys.stdin.readline().split(' ')
inp = lambda: input().split(' ')
ml = lambda x, y=int: list(map(y, x))
debug = lambda *args: print(*args, sep=' | ')
a, b, c = ml(inp())
if a == b and a != c:
    print('Yes')
elif b == c and a != b:
    print('Yes')
elif a == c and b != a:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import sys #sys.stdin.readline()
from math import gcd, ceil, floor, sqrt
import heapq #heap
from collections import defaultdict
fastinp = lambda: sys.stdin.readline().split(' ')
inp = lambda: input().split(' ')
ml = lambda x, y=int: list(map(y, x))
debug = lambda *args: print(*args, sep=' | ')
a, b, c = ml(inp())
if a == b and a != c:
    print('Yes')
elif b == c and a != b:
    print('Yes')
elif a == c and b != a:
    print('Yes')
else:
    print('No')
Problem p02577 (python)

Fixed submission:
S = input().strip()

cnt = 0
for c in S:
    cnt += int(c)

if (cnt % 9 == 0):
    print("Yes")

else:
    print("No")

Buggy submission (verdict: Runtime Error):
S = int(input().strip())

cnt = 0
while(S!=0):
    cnt += S%10
    S /= 10

if (cnt % 9 == 0):
    print("Yes")

else:
    print("No")
Problem p02547 (python)

Fixed submission:
n = int(input())
d1d2 = [map(int, input().split()) for _ in range(n)]
d1, d2 = [list(i) for i in zip(*d1d2)]
count = 0
for i in range(n-2):
    if d1[i] == d2[i] and d1[i+1] == d2[i+1] and d1[i+2] == d2[i+2]:
        count += 1
if count > 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
d1d2 = [map(int, input().split()) for _ in range(n)]
d1, d2 = [list(i) for i in zip(*d1d2)]
count = 0
for i in range(n):
    if d1[i] == d2[i] and d1[i+1] == d2[i+1] and d1[i+2] == d2[i+2]:
        count += 1
if count > 0:
    print("Yes")
else:
    print("No")
Problem p03041 (python)

Fixed submission:
N,K=(int(x) for x in input().split())
S=input()
Sa=S[:K-1]+str(S[K-1].lower())+S[K:]
print(Sa)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in input().split())
S=input()
S[K-1]=S[K-1].lower()
print(S)

Buggy submission (verdict: Runtime Error):
N,K=(int(x) for x in range(input().split()))
S=input()
print(S.replace(S[K-1],S[K-1].lower()))

Buggy submission (verdict: Runtime Error):
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <ctype.h>
int main()
{
    
    int N,K;
    char S[50];
    std::cin >> N >> K;
    for(int i=0; i<N; i++){
    std::cin >> S[i];
    }
    S[K-1]=(char)tolower(S[K-1]);
    for(int i=0; i<N; i++){
    std::cout << S[i];
    }
  std::cout <<std::endl;
    return 0;
}
Problem p03042 (python)

Fixed submission:
A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 1<=S[0] and S[0]<=12:
    if 1<=S[1] and S[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1<=S[1] and S[1]<=12:
        print('YYMM')
    else:
        print('NA')

Buggy submission (verdict: Runtime Error):
A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 0<=A[0] and A[0]<=12:
    if 0<=A[1] and A[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0<=A[1] and A[1]<=12:
        print('MMYY')
    else:
        print('NA')
Problem p03072 (python)

Fixed submission:
N=int(input())
H=list(map(int,input().split()))
count=0
flag=1
for i in range(N):
    flag=1
    for j in range(i):
        if H[i]<H[j]:
            flag=0
            break
    if flag==1:
        count+=1
print(count)

Buggy submission (verdict: Runtime Error):
N=int(input())
H=list(map(int,input().split()))
count=1
for i in range(N-1):
    for j in range(i):
        if(H[i]<H[j]):
            break:
        count+=1
print(count)
Problem p02549 (python)

Fixed submission:
#配るDP
n,k=map(int,input().split())
l=[0]*k
r=[0]*k
for j in range(k):
  l[j],r[j] = map(int,input().split())
p=998244353
dp=[0]*(n+max(r)+100)
dp[1]=1
dp[2]=-1
for i in range(1,n+1):
  dp[i] += dp[i-1]
  dp[i] %= p
  
  for lj,rj in zip(l,r):
    dp[i+lj] += dp[i]
    dp[i+lj] %= p
    dp[i+rj+1] -= dp[i]
    dp[i+rj+1] %= p
print(dp[n])

Buggy submission (verdict: Runtime Error):
#配るDP
n,k=map(int,input().split())
l=[0]*k
r=[0]*k
for j in range(k):
  l[j],r[j] = map(int,input().split())
p=998244353
dp=[0]*(n+100)
dp[1]=1
dp[2]=-1
for i in range(1,n+1):
  dp[i] += dp[i-1]
  dp[i] %= p
  
  for lj,rj in zip(l,r):
    dp[i+lj] += dp[i]
    dp[i+lj] %= p
    dp[i+rj+1] -= dp[i]
    dp[i+rj+1] %= p
print(dp[n])
Problem p02550 (python)

Fixed submission:
n,x,m=map(int,input().split())
# 一定回数を経ると循環するので最後にかければよい
a_i = x
log = [x]
app=[-1]*m
app[x]=0
last = x
for i in range(1,n):
  a_i = (a_i**2)%m
  if app[a_i] > -1:
    last = a_i
    break
  app[a_i] = i
  log.append(a_i)

# ループの手前(or最後)まで足し合わせる
ans = sum(log[:min(n, app[last])])
if n > app[last]:
  # ループ中合計
  ans += sum(log[app[last]:]) * ((n-app[last]) // (len(log) - app[last]))
  # 末端合計
  ans += sum(log[app[last]:app[last] + (n-app[last]) % (len(log) - app[last])])
print(ans)

Buggy submission (verdict: Runtime Error):
n,x,m=map(int,input().split())
# 一定回数を経ると循環するので最後にかければよい
loop=list()
app = [0]*m
last = -1
a_i = x
while 1:
  a_i = (a_i**2)%m
  if a_i in (0,1) or app[a_i]:
    # あまりが0か1になったらそのあとはずっと一緒
    # もしくはloopの端にきたらloop開始
    last = a_i
    break
  else:
    app[a_i] = len(loop)
    loop.append(a_i)
    if len(loop) > n:
      break
# 答の計算
ans=x
if last < 1:
  ans += sum(loop) + last * (n - len(loop) - 1)
else:
  # ループの端までは普通に足す
  ans += sum(loop[:app[last]])
  #print(ans)
  # ループの中を累計で足す
  ans += sum(loop[app[last]:]) * ((n-1) // (len(loop)-app[last]))
  #print(ans)
  # 余りを足す
  ans += sum(loop[app[last]:((n-1) % (len(loop)-app[last]))])
print(ans)
#print(*loop)
Problem p02659 (python)

Fixed submission:
import math
x=input().split()
a=int(x[0])
b=int(x[1].replace('.',''))
c = int(a * b)
print(c//100)

Buggy submission (verdict: Runtime Error):
import math
x=input().split()
a=int(x[0])
b=int(float(x[1])*100)
c = int(a * b)
print(round(c/100.0,2)
Problem p02723 (python)

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

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

Fixed submission:
import sys
n = int(input())
s = input()
if n % 2 !=0:
  print('No')
  sys.exit()
b = int(n/2)
if s[0:b]==s[b:n]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
if n % 2 !=0:
  print('No')
  sys.exit()
b = int(n/2)
if s[0:b]==s[b:n]:
  print('Yes')
else:
  print('No')
Problem p02880 (python)

Fixed submission:
import sys
n=int(input())
for i in range(1,10):
  x = n //i
  if n % i == 0 and 0 < x < 10:
    print('Yes')
    sys.exit()
print('No')

Buggy submission (verdict: Runtime Error):
import sys
n=int(input())
for i in range(1,10):
  x = n //i
  if n % i == 0 and 0 < x < 10:
    print('Yes')
 	sys.exit()
print('No')
Problem p02577 (python)

Fixed submission:
def main(n):
	summ = 0
	for i in n:
		summ += int(i)
	if summ % 9 == 0: return "Yes"
	else: return "No"
	

n = input()
print(main(n))

Buggy submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline

def main(n):
	summ = 0
	for i in n:
		summ += int(i)
	if summ % 9 == 0: return "Yes"
	else: return "No"
	

n = input()
print(main(n))
Problem p02571 (python)

Fixed submission:
main = input()
word = input()
temp = main
resultArray = []
final = len(word)
for j in range(len(main) - (len(word) - 1)):
    result = ''
    for i in range(len(word)):
        if main[j + i] == word[i]:
            result += '1'
        else:
            result += '0'
    resultArray.append(result)
for i in resultArray:
    if i.count('0') < final:
        final = i.count('0')
print(final)

Buggy submission (verdict: Runtime Error):
def check(s,t,n):
    if s.find(t) != -1:
        print(n)
    else:
        n += 1
        t = t[:-1]
        check(s,t,n)
s = input()
t = input()
n = 0
check(s,t,n)
Problem p02693 (python)

Fixed submission:
K = int(input())
A,B = [int(i) for i in input().split()]
flag=0
for i in range(1,1001):
    if(i*K>=A and i*K<=B):
        print("OK")
        flag=1
        break
if (flag==0):
    print("NG")

Buggy submission (verdict: Runtime Error):
K = int(input())
A,B = [int(i) for i in input().split()]
flag=0
for i in range(1,1001):
  if(iK>=A and iK<=B):
    print("OK")
    flag=1
    break
if (flag==0):
  print("NG")
Problem p02771 (python)

Fixed submission:
x, y, z = input().split()
if x == y != z or x == z != y or x != y == z:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2 == 0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) == len(answer):
    print("APPROVED")
else:
    print("DENIED")

Buggy submission (verdict: Runtime Error):
n = input()
_list = input().split(" ")
_list = [int(x) for x in _list]
even = [x for x in _list if x % 2==0]
answer = []
for x in even:
    if x % 3 == 0 or x % 5 == 0:
        answer.append(True)
if len(even) ==len(answer):
    print("APPROVED")
else:
    print("DENIED")
Problem p02777 (python)

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


if u == s:
    a = str(int(a)-1)
else:
    b = str(int(b)-1)

print(a+' '+b)

Buggy submission (verdict: Runtime Error):
s, t = input().split() 
a, b = input().split() 
u = input()
int(a)
int(b)
if u == s:
    a = a-1
else:
    b = b-1
print(a+' '+b)
Problem p02689 (python)

Fixed submission:
n,m = map(int,input().split())
h = list(map(int,input().split()))
#h.sort()
l = [[] for _ in range(n)]

for i in range(m):
  a,b = map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)

c = 0
for j in range(n):
  if len(l[j]) == 0:
    c += 1
  else:
    m = 0
    for k in l[j]:
      if h[j] <= h[k]:
        m = 1
        break
    if m == 0:

      c += 1
      
print(c)

Buggy submission (verdict: Runtime Error):
n,m = map(int,input().split())
h = list(map(int,input().split()))
#h.sort()
l = [[] for _ in range(n)]

for i in range(m):
  a,b = map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)

print(l)
  av
c = 0
for j in range(n):
  if len(l[j]) == 0:
    c += 1
  else:
    m = 0
    for k in l[j]:
      if h[j] <= h[k]:
        m = 1
        break
    if m == 0:

      c += 1
      
print(c)

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

for i in range(m):
  a,b = map(int,input().split())
  l[a-1].append(b-1)
  l[b-1].append(a-1)

print(l)
  
c = 0
for j in range(n):
  if len(l[j]) == 0:
    c += 1
  else:
    m = 0
    for k in l[j]:
      if h[j] <= h[k]:
        m = 1
        break
    if m == 0:

      c += 1
      
print(c)
Problem p02753 (python)

Fixed submission:
S = list(input())

if S[0] == S[1] == S[2]:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
if S[0] == S[1] == S[2]:
  print('No')
else:
  print('Yes')
Problem p02773 (python)

Fixed submission:
n = int(input())

s = []
for i in range(n):
  s.append(input())
  
s.sort()
t =[]
count = 1
for i in range(1,n):
  if s[i-1] == s[i] and i != n-1:
    count+=1
  elif s[i-1] == s[i] and i == n-1:
    count += 1
    t.append([s[i-1],count])
  elif i == n-1:
    t.append([s[i-1],1])
    t.append([s[i],1])
    
  else:
    t.append([s[i-1],count])
    count = 1

t.sort(key=lambda x:x[1])
ma = t[len(t)-1][1]

for i in range(len(t)):
  if t[i][1] == ma:
    print(t[i][0])

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

s = []
for i in range(n):
  s.append(input())
  
s.sort()

print(s)
t =[]
count = 1
for i in range(1,n):
  if s[i-1] == s[i] and i != n-1:
    count+=1
  elif s[i-1] == s[i] and i == n-1:
    count += 1
    t.append([s[i-1],count])
  elif i == n-1:
    t.append([s[i-1],1])
  else:
    t.append([s[i-1],count])
    count = 1

t.sort(key=lambda x:x[1])

for j in range(len(t)-1,0,-1):
  if t[j][1] != t[j-1][1]:
    k = j
    break
for b in range(k,len(t)):
  print(t[b][0])
Problem p02785 (python)

Fixed submission:
N = list(map(int,input().rstrip().split()))
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

m = 0
hit = 0
if k >= n :
  m = 0
else:
  for i in range(k,n):
    hit += h[i]
  
  m = hit
print(m)

Buggy submission (verdict: Runtime Error):
N = input().rstrip()
n = N[0]
k = N[1]

h = list(map(int,input().split()))
h.sort(reverse=True)

m = 0
hit = 0
if k >= n :
  m = n
else:
  for i in range(k,n):
    hit += h[i]
  
  m = k + hit
  
print(m)
Problem p02954 (python)

Fixed submission:
s = list(input())
l = [0 for _ in range(len(s))]

for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'L':
    rc = lc = 1
    if i-1 >= 0 : 
      m = i-1
    
      while s[m] == 'R':
        lc += 1
        if m-1 >= 0 : 
          m -= 1
        else:
          break
    
    if i+2 <=  len(s)-1:
      n = i+2
      
      while s[n] == 'L':
        rc += 1
        if n+1 <= len(s)-1:
          n += 1
        else:
          break

    l[i] = lc//2 + lc% 2 + rc//2
    l[i+1] = rc//2 + rc%2 + lc//2
    
for i in range(len(l)):
  print(l[i], end = ' ')

Buggy submission (verdict: Runtime Error):
s = list(input())
l = [0 for _ in range(len(s))]

for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'L':
    m = i-1
    n = i+2
    rc = lc = 1
    while s[m] == 'R':
      rc += 1
      if m-1 > 0 : 
        m -= 1
      else:
        break
    while s[n] == 'L':
      lc += 1
      if n+1 < len(s)-1:
        n += 1
      else:
        break
    
    l[i] = lc//2 + lc % 2 + rc//2
    l[i+1] = rc//2 + rc%2 + lc//2

print(l)
Problem p02624 (python)

Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1): #各iについて、i*(1～n//iまでの総和)を足し合わせればよい
 k=n//i
 ans+=i*(k*(k+1)//2)
print(ans)

Buggy submission (verdict: Runtime Error):
import sympy
import numpy as np
from operator import mul

N = int(input())
div = []
for i in range(1,N+1):
    div.append(sympy.divisor_count(i))

num = [i for i in range(1,N+1)]

combined = map(mul, div,num)
print(sum(combined))

Buggy submission (verdict: Runtime Error):
import sympy

N = int(input())
total =  0
for i in range(1,N+1):
    a = i * sympy.divisor_count(i)
    total += a
print(total)

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

total =  0
for i in range(1,N+1):
    a = i * len(sympy.divisors(i))
    total += a
print(total)

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

n = len(sympy.divisors(N))

total =  0
for i in range(1,N+1):
    a = i * len(sympy.divisors(i))
    total += a
print(total)
Problem p03631 (python)

Fixed submission:
n= input()
print("Yes" if n[0] == n[2] else "No")

Buggy submission (verdict: Runtime Error):
n = input()
print("Yes" if n[0] == n[2] else "No)
Problem p02836 (python)

Fixed submission:
s = list(input())

length = len(s)
ans= 0
for i in range(len(s)//2):
    if s[i] != s[-i-1]:
        ans += 1

print(ans)

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

length = len(s)

print(s)
for i in range(len(s)//2):
    if s[i] != s[-i-1]:
        ans += 1

print(ans)

Buggy submission (verdict: Runtime Error):
s = list(input())
s_re = s[::-1]
ans =0
for i in range(s//2):
    if s[i] != s_re[i]:
        ans += 1
print(ans)
Problem p02754 (python)

Fixed submission:
n, a, b = map(int, input().split())
tmp = (n % (a+b))

if a == 0:
    print('0')
elif tmp == 0:
    print(a * (n // (a+b)))
else:
    if tmp < a:
        print(a * (n // (a+b)) + tmp)
    else:
        print(a * (n // (a+b)) + a)

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

s = ''
blue = 'b' * a
red = 'r' * b

while (len(s) <= n):
    s += blue
    s += red

tmp = s[0:n]

print(tmp.count('b'))

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

s = ''

while (len(s) <= n):
    s += 'b' * a
    s += 'r' * b

tmp = s[0:n]

print(tmp.count('b'))
Problem p02629 (python)

Fixed submission:
N = int(input())
ans = ""
while N > 0:
    N -= 1
    ans += chr(97 + N%26)
    N //= 26
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = ""
while N > 26:
    N, mod = divmod(N, 26)
    if mod == 0: mod = 26 
    ans += chr(96+mod)
    if N < 27:break
ans += chr(96+mod) 
print(ans[::-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
ans = ""
while N > 26:
    N, mod = divmod(N, 26)
    if mod == 0: mod = 26 
    print(N,mod)
    ans += chr(96+mod)
    if N < 27:break
ans += chr(96+mod) 
print(ans[::-1])
Problem p03073 (python)

Fixed submission:
def subtract_lst (lst1, lst2):
    ans = 0
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    lenS = len(s)
    a = ""
    b = ""
    for i in range(lenS // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    aAns = subtract_lst (a, s)
    bAns = subtract_lst (b, s)
    print (min(aAns, bAns))

Buggy submission (verdict: Runtime Error):
def subtract_lst (lst1, lst2):
    ans = 0
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    a = ""
    b = ""
    for i in range(len(s) // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    print (min(subtract_lst (a, s), subtract_lst (b, s)))

Buggy submission (verdict: Runtime Error):
def subtract_lst (lst1, lst2, ans):
    for i in range(len(lst1)):
        e1 = lst1[i]
        e2 = lst2[i]
        if e1 != e2:
            ans += 1
    return ans

if __name__ == '__main__':
    s = input()
    a = ""
    b = ""
    for i in range(len(s) // 2):
      a = a + "10"
      b = b + "01"
    if lenS % 2 == 1:
        a = a + "1"
        b = b + "0"
    print (min(subtract_lst (a, s, 0), subtract_lst (b, s, 0)))
Problem p02552 (python)

Fixed submission:
x= int(input())

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

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

if a>=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a>=0 and b>=0 and c<=0 and d<=0:
    print(a*d)
elif a>=0 and b>=0 and c<=0 and d>=0:
    print(b*d)
elif a<=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c>=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c<=0 and d<=0:
    print(a*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b>=0 and c<=0 and d>=0:
    x=a*c
    y=b*d
    #print(x,y)
    if x>=y:
        print(x)
    else:
        print(y)

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

if a>=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a>=0 and b>=0 and c<=0 and d<=0:
    print(a*d)
elif a>=0 and b>=0 and c<=0 and d>=0:
    print(b*d)
elif a<=0 and b>=0 and c>=0 and d>=0:
    print(b*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c>=0 and d>=0:
    print(a*c)
elif a<=0 and b<=0 and c<=0 and d<=0:
    print(a*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
    print(a*c)
elif a<=0 and b>=0 and c<=0 and d>=0:
    x=a*c
    y=b*d
    print(x,y)
    if x>=y:
        print(x)
    else:
        print(y)
Problem p02577 (python)

Fixed submission:
N=int(input())


result = sum(list(map(int, str(N))))
if result  %9 ==0:
    print('Yes')
else:
    print('No')

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


result = sum(list(map(int, str(N))))
if result  %9 ==0:
    print('Yes')
else:
    print('No'

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

def sumn(N):
    if N > 0:
        return sumn(N//10) + [N%10]
    else:
        return []

if sum(sumn(N)) %9 ==0:
    print('Yes')
else:
    print('No')
Problem p02578 (python)

Fixed submission:
N=int(input())
A = list(map(int, input().split()))
#print(A)
count=0
count2=0

for i in range(len(A)-1):
    #print(A[i])
    if A[i]>A[i+1]:
        count=A[i]-A[i+1]
        #print(count)
        A[i+1]=A[i]
        count2+=count

print(count2)

Buggy submission (verdict: Runtime Error):
N=int(input())
A = list(map(int, input().split()))
#print(A)
count=0
count2=0
for i in range(len(A)-1):
    #print(A[i])
    if A[i]>A[i+1]:
        count=A[i]-A[i+1]
        #print(count)
        A[i+1]=A[i]
        count2+=count

count2+=A[-2]-A[-1]
print(count2)
Problem p02594 (python)

Fixed submission:
X = int(input())  

if X >=30:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
import math
 
N,D= list(map(int,input().split()))
x = [0] * N
y = [0] * N
b=0
 
for i in range(N):
     x[i], y[i] = map(int, input().split())
     a=x[i]**2+y[i]**2
     if math.sqrt(a) <=D:
          b+=1
print(b)
Problem p02595 (python)

Fixed submission:
import math

N,D= list(map(int,input().split()))
x = [0] * N
y = [0] * N
b=0

for i in range(N):
     x[i], y[i] = map(int, input().split())
     #print(x[i])
     a=x[i]**2+y[i]**2
     #print(math.sqrt(a))
     if math.sqrt(a) <=D:
          b+=1
print(b)

Buggy submission (verdict: Runtime Error):
import math

N,D= list(map(int,input().split()))
x = [0] * N
y = [0] * N
b=0

for i in range(N):
     x[i], y[i] = map(int, input().split())
      a=x[i]**2+y[i]**2
      if math.sqrt(a) <=D:
          b+=1
print(b)
Problem p02688 (python)

Fixed submission:
def main():
  s = list(map(int,input().split()))
  n = [0]*s[0]
  for k in range(0,s[1],1):
    d = int(input())
    a = list(map(int,input().split()))
    #print(a)
    for i in range(0,d,1):
      #print(a[i])
      n[a[i]-1] = 1
      #print(n)
      
  sum=0
  #print(n)
  
  for k in range(0,s[0],1):  
    if(n[k]==0): sum = sum+1
 
  print(sum)
  
main()

Buggy submission (verdict: Runtime Error):
def main():
  s = list(map(int,input().split()))
  n = [0]*s[0]
  for k in range(1,s[1],1):
    d = int(input())
    a = list(map(int,input().split()))
    for i in range(0,d,1):
      n[a[i]-1] = 1
      
  sum=0
  
  
  for k in range(0,s[1],1):  
    if(n[k]==0): sum = sum+1
 
  print(sum)
  
main()
Problem p02577 (python)

Fixed submission:
n=input()
result = sum(list(map(int, str(n))))
if result%9==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
n=int(input())
if n%9==0
 print('Yes')
else:
  print('No')
Problem p02595 (python)

Fixed submission:
import sys
N, D = map(int, input().split())
ans = 0
for _ in range(N):
    x, y = map(int, sys.stdin.readline().split())
    if x **2 + y**2 <= D**2:
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
N, D = map(int, input().split())
ans = 0
for _ in range(N):
    x, y = map(int, sys.stdin.readline().split())
    if x ** + y** <= D**:
        ans += 1
print(ans)