Problem:


Score : 200 points

Problem Statement

An integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.

Determine whether N is a multiple of 9.

Constraints

0 \leq N < 10^{200000}

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

If N is a multiple of 9, print Yes; otherwise, print No.

Sample Input 1

123456789

Sample Output 1

Yes

The sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.

Sample Input 2

0

Sample Output 2

Yes

Sample Input 3

31415926535897932384626433832795028841971693993751058209749445923078164062862089986280

Sample Output 3

No



Sample input:
123456789


Sample output:
Yes

Submission status: Runtime Error

Solution code:
# coding: utf-8
from functools import reduce
from queue import Queue

H, W = list(map(int, input().split(" ")))
current_h, current_w = list(map(int, input().split(" ")))
current_h -= 1
current_w -= 1
goal_h, goal_w = list(map(int, input().split(" ")))
goal_h -= 1
goal_w -= 1

table = [list(input()) for _ in range(H)]


class DFS:

    def __init__(self, table, current_h, current_w):
        self.table = table
        self.current_h = current_h
        self.current_w = current_w
        self.islands = []
        self.start_island_index = -1
        self.end_island_index = -1

    def delta(self, h, w):
        return [(h+1, w), (h, w-1), (h, w), (h, w+1), (h-1, w)]

    def dfs(self, start_h, start_w):
        next = self.delta(start_h, start_w)
        island = [(start_h, start_w)]
        if start_h == self.current_h and start_w == self.current_w:
            self.start_island_index = len(self.islands)

        for h, w in next:
            if h == self.current_h and w == self.current_w:
                self.start_island_index = len(self.islands)
            if h == goal_h and w == goal_w:
                self.end_island_index = len(self.islands)
            if not(0 <= h < H and 0 <= w < W):
                continue
            elif self.table[h][w] == "#":
                continue
            else:
                island.append((h, w))
                self.table[h][w] = "#"
                next.extend(self.delta(h, w))
        self.islands.append(island)

    def make_islands(self):
        for h in range(H):
            for w in range(W):
                if self.table[h][w] == ".":
                    self.dfs(h, w)

    def delta_five(self, pos):
        delta = []
        h = pos[0]
        w = pos[1]
        for dh in range(-2, 3):
            for dw in range(-2, 3):
                if dh == 0 and dw == 0:
                    continue
                delta.append((h+dh, w+dw))
        return delta

    def make_islands_graph(self):
        islands_graph = []
        for start_island_index in range(len(self.islands)):
            for end_island_index in range(len(self.islands)):
                if start_island_index == end_island_index:
                    continue
                if self.is_connect(self.islands[start_island_index], self.islands[end_island_index]):
                    islands_graph.append((start_island_index, end_island_index))
        return islands_graph

    def is_connect(self, islands_a, islands_b):
        a = set(reduce(lambda a, b: a + b, map(self.delta_five, islands_a)))
        for h, w in islands_b:
            if (h, w) in a:
                return True
        return False

class BFS:

    def __init__(self, length_of_islands, graph, start_island_index, end_island_index):
        self.islands = [0 for i in range(0, length_of_islands)]
        self.graph = graph
        self.start = start_island_index
        self.end = end_island_index

    def bfs(self, start, end):
        q = Queue()
        q.put(start)
        count = 0
        while not q.empty():
            now = q.get()

            if now == end:
                return count
            if self.islands[now] == -1:
                continue
            for s, e in self.graph:
                if self.islands[s] == -1:
                    continue
                if s == now:
                    q.put(e)
            self.islands[now] = -1
            count += 1
        return -1

dfs = DFS(table, current_h, current_w)
dfs.make_islands()
graph = dfs.make_islands_graph()
# bfs = BFS(len(dfs.islands), graph, dfs.start_island_index, dfs.end_island_index)
# print(bfs.bfs(dfs.start_island_index, dfs.end_island_index))

Submission status: Runtime Error

Solution code:
import math

n = int(input())
cnt = 0
if n == 0:
    print('Yes')
else:
    while True:
        r = int(n % 10)
        n = int(10**(math.log10(n) - 1))
        print(n)
        cnt += r
        if n == 0:
            break
    res = cnt % 9
    if res == 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
import math

n = int(input())
cnt = 0
if n == 0:
    print('Yes')
else:
    while True:
        r = int(n % 10)
        n = int(math.exp(math.log10(n) - 1))
        print(n)
        cnt += r
        if n == 0:
            break
    res = cnt % 9
    if res == 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N=input()

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

Submission status: Runtime Error

Solution code:
import math

n = int(input())
cnt = 0
if n == 0:
    print('Yes')
else:
    while True:
        r = int(n % 10)
        n = int(math.exp(math.log(n) - math.log(10)))
        print(n)
        cnt += r
        if n == 0:
            break
    res = cnt % 9
    if res == 0:
        print('Yes')
    else:
        print('No')

Submission status: Runtime Error

Solution code:
N = line(input().rstrip())
sum = 0

for i in range(len(N)):
  sum += int(N[i])
 
if sum % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
sum = int(N % 10) + (int(N/10))
if sum % 9 != 0:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
import math

n = int(input())
cnt = 0
while True:
    r = int(n % 10)
    n = int(math.exp(math.log(n) - math.log(10)))
    cnt += r
    if n == 0:
        break
res = cnt % 9
if res == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N=int(input())
s=0
dig=0
while(N):
  dig = int(N)%10
  s = s + dig
  N = int(N)/10
  
if(s%9==0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())
print('Yes' if n/9 == n//9 else 'No')

Submission status: Runtime Error

Solution code:
N = int(input())
sum = int(N % 10) + (int(N/10))
if sum % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N = int(input())

def all(N):
    s = str(N)
    array = list(map(int, list(s)))
    a = sum(array)

if  all % 9 ==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
a = sum(list(map(str(n), int)))
if a%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import numpy as np
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
 
num_str = input()

lst = []

tmp_sum = 0
tmp = 0
count = 1
out_sum = 0
while True:
  if tmp_sum + 10**10 * count < len(num_str):
      out_sum += sum([int(num_str[i]) for i in range(tmp, 10**10 * count)])
  else:
      out_sum += sum([int(num_str[i]) for i in range(tmp, len(num_str))])
      break
  tmp = 10**10 * count
  count += 1
  tmp_sum += tmp
 
if out_sum%9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0
while (N != 0):
    sum = sum + int(N % 10)
    N = int(N / 10)
if sum%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def main():
    z = input()
    x = int(z)

    sum = 0
    while x > 0.5:
        y = int(x % 10)
        sum = int(sum + y)
        x = int(x / 10)

    if int(sum%9)==0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def isDivBy9(n): 
    if (n == 0 or n == 9): 
        return True
    if (n < 9): 
        return False

    # If n is greater than 9, 
    # then recur for [floor(n / 9) - n % 8] 
    return isDivBy9((int)(n>>3) - (int)(n&7)) 

N = int(input())

if(isDivBy9(N)):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
n==int(input())

a==int(n%9)

if a==0:
   print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
if (sum%9==0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = str(input())
lists = [int(x) for x in N]

if a % 9 == 0:
        print('Yes')
else:
        print('No')

Submission status: Runtime Error

Solution code:
n=int(input())

a==int(n%9)

if a==0:
   print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":


    def isDivBy9(n): 
        if (n == 0 or n == 9): 
            return True
        if (n < 9): 
            return False
    
        # If n is greater than 9, 
        # then recur for [floor(n / 9) - n % 8] 
        return isDivBy9((int)(n>>3) - (int)(n&7)) 

    N = int(input())
    
    if(isDivBy9(N)):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
n=int(input())
sum=0
while (n!=0):
  sum+=int(n%10)
  n/=10
print(sum)
if (sum%9==0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
def isDivBy9(n): 
  
    # Base cases 
    if (n == 0 or n == 9): 
        return True
    if (n < 9): 
        return False
   
    # If n is greater than 9, 
    # then recur for [floor(n / 9) - n % 8] 
    return isDivBy9((int)(n>>3) - (int)(n&7)) 
  



if __name__ == "__main__":
    N = int(input())

    if(isDivBy9(N)):
        print("Yes")
    else:
        print("No")

Submission status: Runtime Error

Solution code:
a=int(input())
s=0
b=0
while(a!=0):
    b=a%10
    s=s+b
    a=a/10


if (s/9 == 0):
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    z = input()
    x = int(z)

    sum = 0
    while x > 0.9:
        y = int(x % 10)
        sum = int(sum + y)
        x = int(x / 10)

    if int(sum%9)==0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
sum1 = 0
while n!=0:
  sum1 += int(n%10)
  n = int(n/10)
if sum1 % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)
a= int(input())
if digitSum(a) % 9 == 0:
    print(Yes)
else:
    print(No)

Submission status: Runtime Error

Solution code:
digsum(n):
  if(n==0):
    return 0
  if(n%9==0):
    return 9
  else:
  	return n%9
n=int(input())
d=digsum(n)
if(d==9 or d==0):
  print("Yes")
else:
  print("No");

Submission status: Runtime Error

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)
a= int(input())
if digitsum(a) % 9 == 0:
    print(Yes)
else:
    print(No)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	if(n%9==0)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

Submission status: Runtime Error

Solution code:
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out
if Base_10_to_n(int(input()), 9)[-1] == '0':
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
a = sum(list(str(n)))
if a%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = list(map(int, input()))
if stm(n)%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    z = input()
    x = int(z)

    sum = 0
    while x > 0.9:
        y = int(x % 10)
        sum = sum + y
        x = int(x / 10)

    if sum%9==0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = list(map(int, input()))
if stm(n)%9==0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
def digital_root(n):
  return n if n < 10 else digital_root(sum(map(int,str(n))))

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

Submission status: Runtime Error

Solution code:
N= int(input())
if N%9 =0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:


s = input()
sum = 0

while s > 9:
    sum += s % 10
    s = s / 10
sum += s

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

Submission status: Runtime Error

Solution code:
n = int(input())
ln = list(str(n))
from collections import Counter
nc = dict(Counter(ln))
s = 0
if n != 0:
    for i in range(1, 10):
        s += i * nc[str(i)]
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
ln = list(str(n))
from collections import Counter
nc = dict(Counter(ln))
s = 0
for i in range(1, 10):
    s += i * nc[str(i)]
if s % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
from sys import stdin

num = str(stdin.read())

total = 0
for n in num:
  total += int(n)
 
if total % 9 == 0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
num = float(input())
result = 0
hold = num
while num > 0:
    rem = num % 10
    result = result + rem
    num = int(num/10)
if result%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n=int(input())  
l=0
for i in range(len(str(n))): 
  l=l+int(n[i])
if((l%9)==0): 
  print("Yes") 
else: 
  print("No")

Submission status: Runtime Error

Solution code:
def digital_root(n):
  return n % 9 or n and 9


if __name__ == "__main__" :
  num = input()
  if(digital_root(num)%9==0):
    print("Yes")
  else:
    print("No")

Submission status: Runtime Error

Solution code:
N= int(input())
if N%9 ==0
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
x=0
N=int(input("整数を入力:"))

while(1==1):
    Nn=str(N/10)
    a=Nn.split(".")
    x+=int(a[1])
    N=int(a[0])
    if N==0:
        break
if x%9==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n=int(input())  
l=[] 
for i in range(len(str(n))): 
  l.append(int(n[i])) 
if((sum(l)%9)==0): 
  print("Yes") 
else: 
  print("No")

Submission status: Runtime Error

Solution code:
from sys import stdin, setrecursionlimit,stdout
from collections import deque, defaultdict,Counter
from math import log2, log, ceil,sqrt
from operator import *
input = stdin.readline
setrecursionlimit(int(2e5))
def getstr(): return input()[:-1]
def getint(): return int(input())
def getints(): return list(map(int, input().split()))
def getint1(): return list(map(lambda x : int(x) - 1, input().split()))
jn = lambda x,l: x.join(map(str,l))
# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp
 
## gcd function
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a, a)
 
## nCr function efficient using Binomial Cofficient
def nCr(n, k): 
    if(k > n - k): 
        k = n - k 
    res = 1
    for i in range(k): 
        res = res * (n - i) 
        res = res / (i + 1) 
    return res 
 
## upper bound function code -- such that e in a[:i] e < x;
def upper_bound(a, x, lo=0):
    hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x:
            lo = mid+1
        else:
            hi = mid
    return lo
 

# sliding window ---

def maxSlidingWindow(nums,k):
    windowSum,maxSum = 0,0
    windowSum = sum(nums[:k])
    for end in range(k,len(nums)):
        windowSum += nums[end]-nums[end - k]
        maxSum = max(maxSum,windowSum)
    return maxSum


# Two Pointer 
def twoSum(nums, target):
        left = 0
        right = len(nums)-1
        while left <= right:
            if nums[left]+nums[right] == target:
                return [left,right]
            elif nums[left]+nums[right] < target:
                left +=  1
            else:
                right -= 1
        return 

# prefix sum

def prefix(arr):
    a = map(add,arr.insert(0,0))
    return a

# Modular Inverse
# y-1 = y(p-2)%p

# String Matching





## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    primes = {}
    while(n%2 == 0):
        primes[2] = primes.get(2, 0) + 1
        n = n//2
    for i in range(3, int(n**0.5)+2, 2):
        while(n%i == 0):
            primes[i] = primes.get(i, 0) + 1
            n = n//i
    if n > 2:
        primes[n] = primes.get(n, 0) + 1
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes
 
## MODULAR EXPONENTIATION FUNCTION
def power(x, y, p): 
    res = 1
    x = x % p  
    if (x == 0) : 
        return 0
    while (y > 0) : 
        if ((y & 1) == 1) : 
            res = (res * x) % p 
        y = y >> 1      
        x = (x * x) % p 
    return res 
 
## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b
 
# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];
 
# find function with path compression (ITERATIVE)
def find(x, link):
    p = x;
    while( p != link[p]):
        p = link[p];
    
    while( x != p):
        nex = link[x];
        link[x] = p;
        x = nex;
    return p;
 
 
# the union function which makes union(x,y)
# of two nodes x and y
def union(x, y, link, size):
    x = find(x, link)
    y = find(y, link)
    if size[x] < size[y]:
        x,y = swap(x,y)
    if x != y:
        size[x] += size[y]
        link[y] = x
 
## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
def sieve(n): 
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p):
                prime[i] = False
        p += 1
    return prime


# Binary Search functions
def binsearch(a, l, r, x):
    while l <= r:
        mid = l + (r-1)//2
        if a[mid]:
            return mid
        elif a[mid] > x:
            l = mid-1
        else:
            r = mid+1
    return -1


# Grafh related queries : 



graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000
 
 
def bfs(d, v):
    q = []
    q.append(v)
    visited[v] = 1
    while len(q) != 0:
        x = q[0]
        q.pop(0)
        for i in d[x]:
            if visited[i] != 1:
                visited[i] = 1
                q.append(i)
        print(x)
 
 
def make_graph(e):
    d = {}
    for i in range(e):
        x, y = mi()
        if x not in d:
            d[x] = [y]
        else:
            d[x].append(y)
        if y not in d:
            d[y] = [x]
        else:
            d[y].append(x)
    return d
 
 
def gr2(n):
    d = defaultdict(list)
    for i in range(n):
        x, y = mi()
        d[x].append(y)
    return d
 
 
def connected_components(graph):
    seen = set()
 
    def dfs(v):
        vs = set([v])
        component = []
        while vs:
            v = vs.pop()
            seen.add(v)
            vs |= set(graph[v]) - seen
            component.append(v)
        return component
 
    ans = []
    for v in graph:
        if v not in seen:
            d = dfs(v)
            ans.append(d)
    return ans

# End graph related queries
 
#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e6 + 5)
def spf_sieve():
    spf[1] = 1;
    for i in range(2, MAXN):
        spf[i] = i;
    for i in range(4, MAXN, 2):
        spf[i] = 2;
    for i in range(3, ceil(MAXN ** 0.5), 2):
        if spf[i] == i:
            for j in range(i*i, MAXN, i):
                if spf[j] == j:
                    spf[j] = i;
    ## function for storing smallest prime factors (spf) in the array
 
################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)] 
spf_sieve() 
def factoriazation(x):
    ret = {};
    while x != 1:
        ret[spf[x]] = ret.get(spf[x], 0) + 1;
        x = x//spf[x]
    return ret
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)
 
## taking integer array input


# LCM of two numbers :
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
 
#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
y, n = "Yes", "No"
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12,
       'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24,
       'z': 25}


# used for testing your code 

# inputs=open('input.txt','r') 
# L I S
def solve():
    x = getint()
    if x == 0:
        print(y)
    else:
        c = 0
        for i in str(x):
            c += int(i)
        if c%9 == 0:
            print(y)
        else:
            print(n)
        print(ceil(x/y)*z)

if __name__ == "__main__":
    # solve()
    # for t in range(getint()):
    #     print("Case #{}: ".format(t + 1), end="")
    #     solve()
    # for _ in range(int(inputs.readline())):#getint()):
    solve()

Submission status: Runtime Error

Solution code:
N = int(input())
nn = str(N)
n = len(nn)
ans = []

for i in range(n):
    waru = N % 10
    N = int(N / 10)  
    ans.append(waru)


Sans = sum(ans)       
if Sans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#include<stdio.h>
#include<string.h>

int main(void){
    char N[200001];
    int l,i,sum=0;

    scanf("%s",N);
    l = strlen(N);
    for(i=0;i<l;i++){
        sum = (sum+(N[i]-'0'))%9;
    }

    if(sum%9==0){
        printf("Yes");
    }else{
        printf("No");
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
num = int(input())
result = 0
hold = num
while num > 0:
    rem = num % 10
    result = result + rem
    num = int(num/10)
if result%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
nn = str(N)
n = len(nn)
ans = []

for i in range(n):
    waru = N % 10
    N = int(N / 10)  
    ans.append(waru)

print(ans)

Sans = sum(ans)       
if Sans % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
number = input()
sum_digit = 0
while int(number) > 0:
    number = int(number)
    sum_digit += number%10
    number /= 10

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

Submission status: Runtime Error

Solution code:
a = [0,0,0,0,0,0,0,0,0,0]

a = 0
a[0] = int(input())

for i in range(9):
  while a[i] != 0:
    a[i+1] += a[i] % 10
    a[i] = a[i] // 10 


if a[9] % 9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
#9の倍数か判定する
x=0
N=int(input("整数を入力:"))
#Nを桁ごとに分解
while(1==1):
    Nn=str(N/10)
    a=Nn.split(".")
    x+=int(a[1])
    N=int(a[0])
    if N==0:
        break
if x%9==0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
s=input();
int sum=0;
for i in range(len(s)):
  sum=sum+int(s[i])
if(sum%9==0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N=input()
sum=0
for i in range(1,len(str(N))+1):
  sum+=N[-i]
if sum%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0 
while(N != 0):
    sum += (N%10)
    N /= 10
if sum % 9 == 0:
    print('Yes')
else: 
  print('No')

Submission status: Runtime Error

Solution code:
N = int(input())
nn = str(N)
n = len(nn)
ans = []

for i in range(n):
    waru = N % 10
    N = int(N / 10)  
    ans.append(waru)
       
if sum(ans) % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import sys

data = str(sys.stdin().read())

def multiple_nine():
  total = 0
  for num in data:
    total += int(num)
  if total % 9 == 0:
    return "Yes"
  else:
    return "No"

Submission status: Runtime Error

Solution code:
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)

if N ==0:
  print('Yes')
elif digitSum(N)%9 ==0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
N=input()
c=0
for i in len(N):
  c+=int(N[i])
if c%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n=input()


n=str(n)
Sum=0
for i in range(len(n)):
    Sum=Sum+n[i]-"0"

if Sum%9==0:
    print("yes")
else:
    print("no")

Submission status: Runtime Error

Solution code:
strList = list(input())
intList = [int(s) for s in strList]
if sum(intList)%9 == 0:
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
number = input()

sum_digit = 0

while int(number) > 0:
    number = int(number)
    sum_digit += number%10
    number /= 10

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

Submission status: Runtime Error

Solution code:
N=input()
c=0
for i in len(N):
  c+=intN[i]
if c%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:

def getSum(n): 

	sum = 0
	while (n != 0): 
	
		sum = sum + int(n % 10) 
		n = int(n/10) 
	
	return sum

n = int(input())
if((getSum(n))%9==0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N = int(input())
sum = 0 
while(N != 0):
    sum += (N%10)
    N /= 10
if sum % 9 == 0:
    print('Yes')
else: print('No')

Submission status: Runtime Error

Solution code:
N = int(input())

sum = 0

while(N>0):
    sum = sum + int(N%10)
    N = N/10
    
if sum%9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=input()
c=0
for i in len(N):
  c+=intN[i]
if c%9==0:
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
def digitSum(n):
    # 桁数を判定する
    if len(str(n)) is 1:
        return n
    dst = sum(list(map(int, str(n))))
    return digitSum(dst)


if __name__ == "__main__":
  n = N
  result = digitSum(n)

    print(int(result))

Submission status: Runtime Error

Solution code:
def digital_root(n):
  	return n if n < 10 else digital_root(sum(map(int,str(n))))
 
num = input()
if(digital_root(n)%9==0):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = 0
while True:
    r = int(n % 10)
    n = int(n / 10)
    cnt += r
    if n == 0:
        break
res = cnt % 9 
if res == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
strList = input()
intList = [int(s) for s in strList]
if sum(intList)%9 == 0:
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
n = int(input())

baisu = n / 9

wa = n += 

for baisu == 9
	print("Yes")
else 
	print("No")

Submission status: Runtime Error

Solution code:
S = int(input().strip())

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

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

else:
    print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = 0
for i in range(200005):
    if n < 10:
        cnt += n
        break
    cnt += (n % 10)
    n = int(n / 10)
if cnt % 9 == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
sum1 = 0
while n!=0:
  sum1 += int(n%10)
  n = int(n/10)
if sum1%9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = 0
while True:
    r = int(n % 10)
    n = int(n / 10)
    cnt += r
    if n == 0:
        break
res = cnt % 9 
print(cnt)
if res == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
n = input()
if n % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def getSum(n): 
   
    sum = 0
    while (n != 0): 
      
        sum = sum + int(n % 10) 
        n = int(n/10) 
      
    return sum
  
n = int(input())
if getSum(n) % 9 == 0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=int(input())
if N%9==0:
    print(Yes)
else:
    print(No)

Submission status: Runtime Error

Solution code:
strList = input()
intList = [int(s) for s in strList]
sum = sum(intList)
if sum%9 == 0:
  print(Yes)
else:
  print(No)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=0
while(n>0):
    ans+=n%10
    n/=10
if(ans%9==0):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
def divisible(n:int)->bool:
    sum=0
    while(n!=0):
        sum =sum +int(n%10)
        n =int(n/10)

    if (sum%9==0):
        return True
    else:
        return False



def main():
    n=int(input())
    if divisible(n):
        print ('Yes')
    else:
        print ('No')

if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
import math
n = int(input())
if n == 0:
    print('No')
    exit()

d = int(math.log10(n)+1)

total = 0
n = str(n)
for i in range(d):
    total += int(n[i])

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

Submission status: Runtime Error

Solution code:
c = int(input())
while c!=0:
  sum+=(c%10)
  c/=10
 
if sum%9==0:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n = int(input())
sum1 = 0
while n>0:
  sum1 += n%10
  n = int(n/10)
if sum1%9 == 0:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
cnt = 0
while True:
    r = n % 10
    n = int(n / 10)
    cnt += r
    if n == 0:
        break
res = cnt % 9 
if res == 0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
N=int(input())


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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

def main():
    input_num = int(input())
    flag = True
    sum_num = 0

    while flag:
        chushutsu = input_num % 10
        sum_num += chushutsu
        input_num = int((input_num - chushutsu) / 10)
        if input_num == 0:
            flag = False

    if sum_num % 9 == 0:
        print('Yes')

    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
import math
n = int(input())
d = int(math.log10(n)+1)

total = 0
n = str(n)
for i in range(d):
    total += int(n[i])

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define mod 1e9+7
#define all(x) x.begin(),x.end()

int main() {
	ios_base::sync_with_stdio(false);
	cout.tie(0); cin.tie(0);
	string s;
	cin>>s;
	ll l;
	l=s.length();
	int a[l];
	ll sum=0;
	for(ll i=0;i<l;i++)
	{
	     a[i]=s[i]-'0';
	     sum+=a[i];}
	     if(sum%9==0)
	     cout<<"Yes";
	     else
	     cout<<"No";
	     
}