Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = []
l = [0 for i in range(n)]
for i in range(n):
  ls.append(input())
for i in range(n):
  for j in range(10):
    alpha = ord(ls[i][j]) - ord("a")
    l[i]+=10**alpha
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if l[i] == l[j]:
      ans+=1
print(ans)


Fixed submission:
n = int(input())
ls = []
dic = {}
ans = 0
for i in range(n):
    ls.append(input())
for i in range(n):
    tmp = "".join(sorted(ls[i]))
    if tmp in dic:
        ans += dic[tmp]
        dic[tmp] += 1
    else:
        dic[tmp] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = []
l = [0 for i in range(n)]
for i in range(n):
  ls.append(input())
for i in range(n):
  for j in range(10):
    alpha = ord(ls[i][j]) - ord("a")
    l[i]+=10**alfa
ans = 0
for i in range(n):
  for j in range(i+1,n):
    if l[i] == l[j]:
      ans+=1
print(ans)


Fixed submission:
n = int(input())
ls = []
dic = {}
ans = 0
for i in range(n):
    ls.append(input())
for i in range(n):
    tmp = "".join(sorted(ls[i]))
    if tmp in dic:
        ans += dic[tmp]
        dic[tmp] += 1
    else:
        dic[tmp] = 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ls = []
for i in range(n):
    ls.append(input())
for i in range(n):
    ls[i] = sorted(ls[i])
ans = 0
for i in range(n):
    for j in range(i+1,n):
        if ls[i] == ls[j]:
            ans+=1
print(ans)

Fixed submission:
n = int(input())
ls = []
dic = {}
ans = 0
for i in range(n):
    ls.append(input())
for i in range(n):
    tmp = "".join(sorted(ls[i]))
    if tmp in dic:
        ans += dic[tmp]
        dic[tmp] += 1
    else:
        dic[tmp] = 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
ls = []
for i in range(n):
    ls.append(input())
l=[[0 for j in range(26)] for i in range(n)]
for i in range(n):
    for s in ls[i]:
        alpha = ord(s) - ord("a") + 1
        l[i][alpha] +=1
ans = 0
for i in range(n):
    for j in range(i+1,n):
        if l[i] == l[j]:
            ans+=1
print(ans)

Fixed submission:
n = int(input())
ls = []
dic = {}
ans = 0
for i in range(n):
    ls.append(input())
for i in range(n):
    tmp = "".join(sorted(ls[i]))
    if tmp in dic:
        ans += dic[tmp]
        dic[tmp] += 1
    else:
        dic[tmp] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())
p = list(map(int, input().split()))
if x not in p:
    print(x)
else:
    a, b = 1, 1
    while True:
        if (x + a) not in p:
            break
        else:
            a += 1

    while True:
        if (x - b) not in p:
            break
        else:
            b += 1

    if a >= b:
        print(x - b)
    else:
        print(x + a)

Fixed submission:
#ABC170-A
X = list(input().split())
for i in range(5):
  if X[i] == "0":
    print(i + 1)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC169-B
n=int(input())
c=list(map(int, input().split()))
ans=1
for i in range(n):
  ans*=c[i]
if ans>10**18:
  print(-1)
else:
  print(ans)

Fixed submission:
#ABC169-B
n=int(input())
c=list(map(int, input().split()))
ans=1
if 0 in c:
  print(0)
else:
  for i in range(n):
    ans*=c[i]
    if ans>10**18:
      ans=-1
      break
  print(ans)
Buggy python submission (verdict: Runtime Error):
count = 0
n, m = map(int, input().split())
a = list(map(int, input().split()))
for i in range(n):
    if a[i] >= sum(a)/4/m:
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")

Fixed submission:
#ABC161-A
x,y,z=map(int,input().split())
print(z,x,y)
Buggy python submission (verdict: Runtime Error):
S, T = list(input().split())
if T[:-1]==S:
    print("YES")
else:
    print("NO")

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

if T[:-1]==S and len(T)==len(S)+1:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, K = map(int, input().split())
A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp
hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]] = 0
print(int(np.sum(hito)))

Fixed submission:
import numpy as np

N, K = map(int, input().split())
A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp
hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]-1] = 0
print(int(np.sum(hito)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K = map(int, input().split())

A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp

hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]] = 0
print(int(np.sum(hito)))

Fixed submission:
import numpy as np

N, K = map(int, input().split())
A = []
for i in range(K):
    d = int(input())
    temp = list(map(int, input().split()))
    A = A + temp
hito = np.ones(N)
for i in range(len(A)):
    hito[A[i]-1] = 0
print(int(np.sum(hito)))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(M)
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        yoi[B-1] = 0
    elif H[B-1] > H[A-1]:
        yoi[A-1] = 0
    elif H[A-1]==H[B-1]:
        yoi[A-1] = 0
        yoi[B-1] = 0
print(int(np.sum(yoi)))

Fixed submission:
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(N)
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        yoi[B-1] = 0
    elif H[B-1] > H[A-1]:
        yoi[A-1] = 0
    elif H[A-1]==H[B-1]:
        yoi[A-1] = 0
        yoi[B-1] = 0
print(int(np.sum(yoi)))
Buggy python submission (verdict: Runtime Error):
import math
temp = 100
year = 0
while temp < X:
    temp = int(math.floor(temp*1.01))
    year += 1
print(year)

Fixed submission:
X = int(input())
import math
temp = 100
year = 0
while temp < X:
    temp = int(math.floor(temp*1.01))
    year += 1
print(year)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
flag =False
while flag==False:
    if 2*N > K:
        N = N%K
    else:
        print(N)
        flag = True

Fixed submission:
N, K = list(map(int, input().split()))
print(min(N%K, K-(N%K)))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
expected_value = [(p[i]+1)/2 for i in range(N)]
sum_expected = [sum(expected_value[i:i+K]) for i in range(N-K+1)]
print(max(sum_expected))

Fixed submission:
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
S = [0]
T = [0]
for i in range(N):
    S.append((p[i]+1)/2 + S[-1])

for i in range(N+1-K):
    T.append(S[i+K]-S[i])

print(max(T))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
expected_value = np.array([(p[i]+1)/2 for i in range(N)])
sum_expected = np.array([np.sum(expected_value[i:i+K]) for i in range(N-K+1)])
print(np.max(sum_expected))

Fixed submission:
N, K = list(map(int, input().split()))
p = list(map(int, input().split()))
S = [0]
T = [0]
for i in range(N):
    S.append((p[i]+1)/2 + S[-1])

for i in range(N+1-K):
    T.append(S[i+K]-S[i])

print(max(T))
Buggy python submission (verdict: Runtime Error):
H, N = list(map(str, input().split()))
A = list(map(str, input().split()))

if sum(A)>=H:
    print("Yes")
else:
    print("No")

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

if sum(A)>=H:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
from math import gcd
A, B = map(int, input().split())
print(gcd(A, B))

Fixed submission:
from fractions import gcd
A, B = map(int, input().split())
print(A*B//gcd(A, B))
Buggy python submission (verdict: Runtime Error):
a, b, c = input(int(i) for i in input().split())
if a + b >= c:
  result = c + b
elif a + b < c:
  result = a + b + b
print(result)

Fixed submission:
a, b, c = (int(i) for i in input().split())
if a + b + 1 >= c:
  result = b + c
else:
  result = a + 2 * b + 1
print(result)

Buggy python submission (verdict: Runtime Error):
a, b, c = input(int(i) for i in input().split())
if a + b >= c:
  result = c + b
elif a + b < c:
  result = a + b
print(result)

Fixed submission:
a, b, c = (int(i) for i in input().split())
if a + b + 1 >= c:
  result = b + c
else:
  result = a + 2 * b + 1
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

mul=1
for i in range(K):
    mul*=A[i]
text=""
for i in range(K,N):
    if A[i]>A[i-K] :
        text+="Yes\n"
    else:
       text+="No\n"
print("{}".format(text))





Fixed submission:
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

text=""
for i in range(K,N):
    if A[i]>A[i-K] :
        text+="Yes\n"
    else:
       text+="No\n"
print("{}".format(text))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

mul=1
for i in range(K):
    mul*=A[i]

for i in range(K,N):
    if A[i]>A[i-K] :
        print("Yes")
    else:
        print("No")






Fixed submission:
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

text=""
for i in range(K,N):
    if A[i]>A[i-K] :
        text+="Yes\n"
    else:
       text+="No\n"
print("{}".format(text))

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

mul=1
for i in range(K):
    mul*=A[i]

for i in range(K,N):
    ki=mul
    mul=(mul/A[i-K])*A[i]
    if mul>ki :
        print("Yes")
    else:
        print("No")






Fixed submission:
N,K = map(int, input().strip().split())
A = list(map(int, input().strip().split()))

text=""
for i in range(K,N):
    if A[i]>A[i-K] :
        text+="Yes\n"
    else:
       text+="No\n"
print("{}".format(text))
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().strip().split()))
day=0
money=1000
stock=0
is_up=True
while day<N :
    if is_up :
        past_day=day
        while A[day]<=A[day+1]:
            day+=1
            if day==N-1:
                break
        stock=int(money/A[past_day])
        money+=stock*(A[day]-A[past_day])
        day+=1
        is_up=False
    else :
        while A[day]>=A[day+1] :
            day+=1
            if day==N-1:
                day+=1
                break
        is_up=True


print("{}".format(money))





Fixed submission:
N = int(input())
A = list(map(int, input().strip().split()))
day=0
money=1000
stock=0
is_up=True
while day<N :
    if is_up :
        past_day=day
        while A[day]<=A[day+1]:
            day+=1
            if day==N-1:
                break
        stock=int(money/A[past_day])
        money+=stock*(A[day]-A[past_day])
        day+=1
        if day==N-1:
            break
        is_up=False
    else :
        while A[day]>=A[day+1] :
            day+=1
            if day==N-1:
                day+=1
                break
        is_up=True


print("{}".format(money))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for n in range(1,N+1):
    counter=0
    for x in range(1,n+1):
        if x * x+2*x+3 > N:
            break
        for y in range(1,n+1):
            if x * x + y * y + x * y+x+y+1 > N:
                break
            for z in range(1, n + 1):
                if x * x + y * y + z * z + x * y + y * z + z * x >= N:
                    break
                if x * x + y * y + z * z + x * y + y * z + z * x == n:
                    counter += 1
    print("{}".format(counter))
 




Fixed submission:
N = int(input())

list=[0]*N
for x in range(1,N+1):
    if x * x+2*x+3 > N:
        break
    for y in range(1,N+1):
        if x * x + y * y + x * y+x+y+1 > N:
            break
        for z in range(1, N + 1):
            val=x * x + y * y + z * z + x * y + y * z + z * x
            if val > N:
                break
            list[val - 1] += 1
for i in range(N):
    print("{}".format(list[i]))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for n in range(1,N+1):
    counter=0
    for x in range(1,n+1):
        if x * x >= N:
            break
        for y in range(1,n+1):
            if x * x + y * y + x * y >= N:
                break
            for z in range(1, n + 1):
                if x * x + y * y + z * z + x * y + y * z + z * x >= N:
                    break
                if x * x + y * y + z * z + x * y + y * z + z * x == n:
                    counter += 1
    print("{}".format(counter))
 




Fixed submission:
N = int(input())

list=[0]*N
for x in range(1,N+1):
    if x * x+2*x+3 > N:
        break
    for y in range(1,N+1):
        if x * x + y * y + x * y+x+y+1 > N:
            break
        for z in range(1, N + 1):
            val=x * x + y * y + z * z + x * y + y * z + z * x
            if val > N:
                break
            list[val - 1] += 1
for i in range(N):
    print("{}".format(list[i]))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
min = S[0:N].count('#')
for i in range(0, N):
    if min > S[0:i + 1].count('#') + S[i + 1:N].count('.'):
        min = S[0:i + 1].count('#') + S[i + 1:N].count('.')
if N == 1:
    min = 0
print("{}".format(min))


Fixed submission:
N = int(input())
S = input()
count = S[0:N].count('.')
min = count
for i in range(0, N):
    if S[i:i + 1] == '#':
        count += 1
    else:
        count -= 1
    if count < min:
        min = count
if N == 1:
    min = 0
print("{}".format(min))
Buggy python submission (verdict: Runtime Error):
from decimal import *
a,b,c = map(int,input().split())
print("Yes" if Decimal(a.sqrt()) + Decimal(b.sqrt()) < Decimal(c.sqrt()) else "No")

Fixed submission:
from decimal import *
a,b,c = map(int,input().split())
print("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")

Buggy python submission (verdict: Runtime Error):
import math
from decimal import *
a,b,c = map(int,input().split())
if decimal(math.sqrt(a)) + decimal(math.sqrt(b)) < decimal(math.sqrt(c)): print("Yes")
else: print("No")

Fixed submission:
from decimal import *
a,b,c = map(int,input().split())
print("Yes" if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt() else "No")
Buggy python submission (verdict: Runtime Error):
	class Common:

    problem = []
    index = 0

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(ABS_PATH + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()

class A(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]
        result = q[2] - q[0] +q[1]
        if result < 0:
            print('0')
        else:
            print(str(result))

solver = A()
solver.exec_resolve()

Fixed submission:
import glob

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\136'

# 絶対パス
ABS_PATH = TOP_PATH + '\\' + REL_PATH

#IS_TEST = 1


class Common:

    problem = []
    index = 0

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        try:
            IS_TEST
            return self.problem[self.index]
            self.index += 1
        except NameError:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        try:
            IS_TEST
            for path in glob.glob(ABS_PATH + '/*.txt'):
                self.initialize(path)
                self.resolve()
        except NameError:
            self.resolve()

class A(Common):

    def resolve(self):

        q = [int(i) for i in self.input_data().split()]
        result = q[2] - q[0] +q[1]
        if result < 0:
            print('0')
        else:
            print(str(result))

solver = A()
solver.exec_resolve()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import numpy as np
import sys
import os

def solve():

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

    for i in range(M):
        A, B = list(map(int, input().split()))
        graph[A-1].append(B-1)
        graph[B-1].append(A-1)

    result = []
    finish = [0 for i in range(N)]
    out_num = [0 for i in range(N)]

    loop = True
    while loop:
        loop = False
        for i in range(N):
            if len(graph[i]) == 0:
                continue
            if len(graph[i])==2:
                for g in graph[i]:
                    result.append([i,g])
                    graph[g].remove(i)
                    out_num[i] += 1
                else:
                    graph[i] = []
                    loop = True


    for g in graph:
        if len(g) != 0:
            print("-1")
            return

    for r in result:
        print(str(r[0]+1) + " " +str(r[1]+1))


solve()

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

import numpy
import sys
import os

def solve():
    num = int(input())
    camels = [int(i) for i in input().split()]

    if len(camels) % 3 != 0:
        for c in camels:
            if c !=0:
                print("No")
                return(0)

        print("Yes")
        return

    camels.sort()
    length = len(camels)

    for i in range(3):
        for j in range(int(i*length/3), int((i+1)*length/3)):
            if camels[int(i*length/3)] != camels[j]:
                print("No")
                return(0)

    if camels[0] ^ camels[int(num/3)] != camels[int(num/3)*2]:
        print("No")
        return(0)

    print("Yes")

solve()
Buggy python submission (verdict: Runtime Error):
Print("A" if str.isupper(input()) else "a")

Fixed submission:
N=input()
print("A" if str.isupper(N) else "a")
Buggy python submission (verdict: Runtime Error):
import bisect
X,N=map(int,input().split())
if N==0:
    print(X)
    exit()
P=sorted(list(map(int, input().split())))
key=bisect.bisect_left(P,X)
small=P[-1]
key2=bisect.bisect_right(P,X)
for i in range(N):
    if P[key]-i not in P:
        small=P[key]-i
        break
for i in range(N):
    if P[key2-1]+i not in P:
        large=P[key2-1]+i
        break
print(small if abs(X-small)<=abs(X-large) else large)

Fixed submission:
import bisect
X,N=map(int,input().split())
if N==0:
    print(X)
    exit()
P=sorted(list(map(int, input().split())))
key=bisect.bisect_right(P,X)
small=101
large=0

for i in range(N):
    if P[key-1]-i not in P:
        small=P[key-1]-i
        break
for i in range(N):
    if P[key-1]+i not in P:
        large=P[key-1]+i
        break
print(small if abs(X-small)<=abs(X-large) else large)
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)

Fixed submission:
N=int(input())
A = list(map(int, input().split()))
outflag = 0
for i in range(N):
    if A[i]%2==0:
        if A[i]%3==0 or A[i]%5==0:
            pass
        else:
            outflag=1
            break
    else:
        pass
print("DENIED" if outflag else "APPROVED")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
P=list(map(int,input().split()))
cnt=1
for i in range(1,N):
    if min(P[0:i])>P[i]:
        cnt+=1 
print(cnt)

Fixed submission:
N=int(input())
P=list(map(int,input().split()))
cnt,minimum=0,max(P)
for i in range(N):
    if P[i]<=minimum:
        cnt+=1
        minimum=P[i]
print(cnt)
Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=Counter(list(map(int,input().split())) )
print(sum(sorted(A.keys(), reverse=True)[K:]))

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=Counter(input().split())
print(sum(sorted(A.values(), reverse=True)[K:]))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
N=int(input())
A=sorted(list(map(int, input().split())))
B=sorted(list(map(int, input().split())))
C=sorted(list(map(int, input().split())))
D=[0]*N
E=[0]*N
for i in range(N):
    D[i]=N-bisect.bisect_right(C,B[i])
for i in range(N):
    E[i]=sum(D[bisect.bisect_right(B,A[i]):])
print(sum(E))

Fixed submission:
import bisect
N=int(input())
A=sorted(list(map(int, input().split())))
B=sorted(list(map(int, input().split())))
C=sorted(list(map(int, input().split())))
ans=0
for i in range(N):
    ans+=(bisect.bisect_left(A,B[i]))*(N-bisect.bisect_right(C,B[i]))
print(ans)
Buggy python submission (verdict: Runtime Error):
l,m,n = map(int, input().split())
newlist = sorted([l,m,n])
if newlist(1)==5 & newlist(2)==5 & newlist(3)==7:
    print(str(YES))
else print(str(NO))

Fixed submission:
l,m,n = map(int, input().split())
newlist = sorted([l,m,n])
if newlist[0]==5 and newlist[1]==5 and newlist[2]==7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
import numpy as np

N = str(input())
array = np.array(list(map(int, s)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
import numpy as np

N = str(input())
array = np.array(list(map(int, N)))

s = np.sum(array)
if s % 9 == 0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def total(n):
    total = 0
    for i in range(len(str(n))):
        total += int(str(n)[i])
        if i == len(str(n)):
            if len(str(total)) > 10**5:
                total(total)
    
    return total

if total(n) %9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
total = 0

for i in str(n):
    total += int(i)

if total %9 == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def total(n):
    total = 0
    for i in range(len(str(n))):
        total += int(str(n)[i])
        if i == len(str(n)):
            total(total)
    
    return total

if total(n) %9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
total = 0

for i in str(n):
    total += int(i)

if total %9 == 0:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
total = 0
for i in range(len(str(n))):
    total += int(str(n)[i])

if total %9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
total = 0

for i in str(n):
    total += int(i)

if total %9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = str(input())
count = []
x = 0 
for i in range(len(s)):
    if s[i] == "R":
        x += 1
        if s[i] == len(s)-1:
            count.append(x)
    if s[i] == "S":
        count.append(x)
        x = 0

print(max(count))

Fixed submission:
s = str(input())
count = []
x = 0 
for i in range(len(s)):
    if s[i] == "R":
        x += 1
        if i == len(s)-1:
            count.append(x)
    if s[i] == "S":
        count.append(x)
        x = 0

print(max(count))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
tmp=0

while N!=0:
  tmp += N % 10
  N=N//10
  
if tmp % 9 == 0:
  ans="Yes"
else:
  ans="No"
  
print(ans)


Fixed submission:
N=input()
tmp=0

for i in range(len(N)):
  tmp += int(N[i])

#print(tmp)
if tmp % 9 == 0:
  ans="Yes"
else:
  ans="No"
  
print(ans)