Problem:


Score : 200 points

Problem Statement

Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(101) = 1 + 0 + 1 = 2.

Given an integer N, determine if S(N) divides N.

Constraints

1 \leq N \leq 10^9

Input

Input is given from Standard Input in the following format:

N

Output

If S(N) divides N, print Yes; if it does not, print No.

Sample Input 1

12

Sample Output 1

Yes

In this input, N=12.
As S(12) = 1 + 2 = 3, S(N) divides N.

Sample Input 2

101

Sample Output 2

No

As S(101) = 1 + 0 + 1 = 2, S(N) does not divide N.

Sample Input 3

999999999

Sample Output 3

Yes



Sample input:
12


Sample output:
Yes

Submission status: Accepted

Solution code:
S = input()
sum = 0
for char in S:
  sum += int(char)
if int(S)%sum == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
total = 0
for w in N:
    total += int(w)
if int(N) % total == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
S=0
for i in str(N):
  S += int(i)
if N % S == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# ABC101 B - Digit Sums
N = int(input())
S = [s for s in str(N)]
S = [int(s) for s in S]
SN = sum(S)
print("Yes" if N%SN ==0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
S = sum(map(int, str(N)))
if N%S == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()

num=0
for s in S:
  num+=int(s)
if int(S)%num==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = input()
num = list(N)
li = list(map(int, num))

if int(N) % sum(li) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
sn = sum([int(c) for c in n])
if int(n) % sn ==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
# print(list(N))
tmp = list(map(int, list(N)))
sn = sum(tmp)
if int(N)%sn == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
s = 0
for n in N:
  s += int(n)
if int(N)%s == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from collections import  Counter
import statistics
import math
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

n = ni()
s = str(n)
sn = 0
for i in range(len(s)):
    sn += int(str(s[i]))
if n % sn == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = int(input())
num = N
fN = 0

while num >= 1:
    fN = fN + int(num % 10)
    num = int(num / 10)

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

Submission status: Accepted

Solution code:
n=int(input())
N=str(n)
cost=0
for i in N:cost +=int(i)
print("Yes" if n%cost==0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
S = 0
n = N

while n != 0:
  S += n % 10
  n //= 10
  
if N % S == 0:
  print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
def digit_sum(n):
    total = 0
    while n > 0:
        total += n % 10
        n //= 10
    return total


n = int(input())
if n % digit_sum(n) == 0:
    print("Yes")
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
from fractions import gcd
# import queue
# from collections import Counter
# from itertools import accumulate
# from functools import reduce

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

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

big_prime = 1000000007

"""
# 標準入力取得
## 文字列
 =  sys.stdin.readline().rstrip()
 =  list(sys.stdin.readline().rstrip())

## 数値
 =  int(sys.stdin.readline())
 =  map(int, sys.stdin.readline().split())
 =  list(map(int, sys.stdin.readline().split()))
 =  [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

N =  int(sys.stdin.readline())
S = sum(map(int, [s for s in str(N)]))

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

Submission status: Accepted

Solution code:
n = int(input())
sn = 0
x = n
while True:
  sn += x % 10
  x = x // 10
  if x == 0:
    break
if n % sn == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
sn = sum(map(int, n))

if int(n) % sn == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

sumN = 0
for i in N:
    sumN += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

s = 0
for _ in n_str:
  s += int(_)
  
if n % s == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input();print("YNeos"[bool(int(n)%sum(map(int,n)))::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def s(n):
    res = 0
    while n > 0:
        res += n % 10
        n //= 10

    return res


n = int(input())

if n % s(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
n=0
su=0
for i in range(len(s)):
    s[len(s)-1-i]=int(s[len(s)-1-i])
    n+=(10**i)*s[len(s)-1-i]
    su+=s[len(s)-1-i]
if(n%su==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
a = 0
for i in range(len(S)):
	a+= int(S[i])
N = int(S)
print('Yes' if N%a == 0 else 'No')

Submission status: Accepted

Solution code:
n = int(input())
def s(n):
  return sum([int(i) for i in str(n)])

if n%s(n):
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
def keta(x):
  wa = 0
  while x >= 1:
    wa += int(x % 10)
    x = int(x / 10)
  return wa
 
n = int(input())
if n % keta(n) == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
from collections import deque
from functools import reduce
import copy


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    total = reduce(lambda acc, y: acc + int(y), str(N), 0)
    return 'Yes' if N % total == 0 else 'No'


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
def main():
    S = input()
    v = 0
    for c in S:
        v += int(c)
    if int(S) % v == 0:
        return "Yes"
    else:
        return "No"

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:


def main():

    N = input()
    nlist = [int(i) for i in N]
    print('Yes') if int(N)%sum(nlist)==0 else print('No')

if __name__== "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
m = list(str(n))
ans = 0

for i in range(len(m)):
    ans += int(m[i])

if n%ans == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
Sn = 0
for digit in N:
    Sn += int(digit)
print('Yes' if int(N) % Sn == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()
li = list(n)
li = [int(i) for i in li]

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

Submission status: Accepted

Solution code:
N = int(input())

n = N
ans = 0
while n:
    ans += n%10
    n //= 10
if N% ans == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
s = sum([int(x) for x in S])
S = int(S)

print("Yes") if S%s == 0 else print("No")

Submission status: Accepted

Solution code:
n = input()
s = sum(map(int, list(n)))

print('Yes' if int(n) % s == 0 else 'No')

Submission status: Accepted

Solution code:
N = input()
sum_s = 0
for n in N:
    sum_s += int(n)
if int(N) % sum_s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())
nc = n
d = 0
while nc > 0:
    d += nc%10
    nc //= 10

print("Yes" if n%d == 0 else "No")

Submission status: Accepted

Solution code:
N = int(input())
T = list(str(N))

Sn = 0

for i in T:
    Sn += int(i)

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

Submission status: Accepted

Solution code:
n=input()
n_list=list(n)
s_n=sum([int(i) for i in n])

print("Yes" if int(n)%s_n==0 else "No")

Submission status: Accepted

Solution code:
S = input()
N = int(S)
digit_sum = sum(map(int, S))
if N % digit_sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=input()

if (int(n) % sum(map(int,list(n))) == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def solve():
    n = input()
    sn = sum([int(d) for d in n])
    return "Yes" if int(n) % sn == 0 else "No"


if __name__ == "__main__":
    print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = input()
div = eval('+'.join(list(n)))

print('Yes' if int(n) % div == 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
print('YNeos'[int(N)%(sum([int(x) for x in N]))!=0::2])

Submission status: Accepted

Solution code:
n=input()
s=sum(map(int,n))
if int(n)%s==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x=input()
c=0
for i in range(len(x)):
  c+=ord(x[i])-ord('0')
x=int(x)
if x%c==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
s=0
for i in n:
  s+=int(i)
n=int(n)
if n%s==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
n_l=list(str(n))
sum=0
for i in range(len(n_l)):
    sum+=int(n_l[i])
if n%sum == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
def main():
    N = int(input())

    S = 0
    for n in str(N):
        S += int(n)

    if N % S == 0:
        print('Yes')
    else:
        print('No')


main()

Submission status: Accepted

Solution code:
N_str = input()
N_int = int(N_str)

l = len(N_str)
N_list = []
for k in range(l):
    N_list.append( int(N_str[k]) )

Sn = sum(N_list)

# print('l=',l)
# print('N_list=',N_list)
# print('Sn=',Sn)
# print('amari=',N_int%Sn)

if N_int%Sn==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n1=int(input())
#数字列を数値の配列に直す(一旦、イテラブルな文字列を経由することで簡単に書ける)
n2=[int(x) for x in str(n1)]
if n1%sum(n2)==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, s))
    return sum(array)

n = int(input())
if n % digitSum(str(n)) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
import copy
import sys


inputa = input().split()
# inputb = input().split()
# inputc = input().split()

# a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

# inputb = input().split()
# inputbList = [int(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

a = str(inputa[0])
inputaList = list(a)

s = 0
for i in range(len(inputaList)):
    s += int(inputaList[i])

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

Submission status: Accepted

Solution code:
n = input()
s = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

sum = 0
for i in s:
    sum += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
int_N = int(N)

S_N = 0
for c in N:
    S_N += int(c)

if int_N % S_N == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
x = [int(i) for i in a]
y = int(a)

t = 0
m = 0
while t < len(x):
  m += x[t]
  t += 1
  
if y % m == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
S = 0
for n in N:
  S+=int(n)
if int(N)%S==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N=int(input())
S=str(N)
r = 0
for s in S:
    r += int(s)
if N%r == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

count = 0

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

Submission status: Accepted

Solution code:
n = input()
a = map(int,list(n))

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

Submission status: Accepted

Solution code:
N = input()
n = 0
for i in N:
    n += int(i)
if int(N)%n==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

s = 0
ans = "Yes"
for i in S:
  s += int(i)
if (int(S) % s != 0):
  ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(N):
    i = 0
    for s in str(N):
        i += int(s)

    if N % i == 0:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    N = int(input())
    print(main(N))

Submission status: Accepted

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

# input
N = input()

# solve
S = 0
for i in range(len(N)):
    S += int(N[i])

# output
print('Yes' if int(N) % S == 0 else 'No')

Submission status: Accepted

Solution code:
N = int(input())

s = 0
n = N

while n >0:
    s += n%10
    n = n//10


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

Submission status: Accepted

Solution code:
n_str = input()
n_int = int(n_str)
n_digitlist = [int(i) for i in list(n_str)]

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

Submission status: Accepted

Solution code:
S=input()
n=len(S)
sn=0
for i in range(n):
  sn=sn+int(S[i])
if int(S)%sn==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math
N = int(input())
def get_wa(n):
    ans = 0
    while True:
        if n == 0:
            break
        else:
            ans += n % 10
            n = n //10
    return ans
tmp = N / get_wa(N)

if math.ceil(tmp) == math.floor(tmp):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=input()
b=0
for i in range(len(a)):
    b+=int(a[i])
if int(a)%b==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
T = 0
for i in range(len(N)):
  T += int(N[i])
if int(N) % T == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
N=input()

mod=0
for n in N:
    mod+=int(n)

print("Yes" if int(N)%mod==0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
l = [int(c) for c in str(n)]
if n%sum(l) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
S = sum([int(a) for a in list(str(N))])

if N % S == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
nn=n
sn=0
for i in range(len(str(n))):
	sn+=n%10
	n=n//10
if nn%sn==0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = input()
A = int(N)
s_list = list(N)
S = 0

for i in s_list:
    I = int(i)
    S += I

if A % S == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

if n % sum(list(map(int, str(n)))) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
N_temp = N
temp = 0
ans = 0


for i in range(len(str(N)))[::-1]:
    temp = 0
    temp += N_temp // (10 ** i)

    N_temp -= temp * 10 ** i

    ans += temp

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

Submission status: Accepted

Solution code:
i=input();print("YNeos"[int(i)%sum(int(j)for j in i)>0::2])

Submission status: Accepted

Solution code:
n = list(map(int,list(input())))

n2  = int(''.join(list(map(str,n))))
#print(n2)
s = sum(n)
#print(s)
print('Yes' if  n2 % s == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()
sum = 0
for i in range(len(n)):
    num = n[i]
    sum += int(num)

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

Submission status: Accepted

Solution code:
N = input()
sn = 0
for i in range(len(N)):
    sn += int(N[i])

if int(N) % sn:
    ans = 'No'
else:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

n = N
S = 0
while True:
    S += n % 10
    new_n = n // 10
    if new_n == n:
        break
    else:
        n = new_n

if N % S == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()
str_N = list(a)
digit_sum = 0
for digit in str_N:
    digit_sum += int(digit)
#print(digit_sum)
if int(a)%digit_sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

def INPUT(): return sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 9)


def main():
    N = INPUT()
    S = 0

    for i in N:
        S += int(i)

    if int(N) % S == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
li = list(str(n))
a = [int(li[i]) for i in range(len(li))]
print("No" if n % sum(a) else "Yes")

Submission status: Accepted

Solution code:
import math
n = int(input())
init_n = n

dig_num = len(str(n))
s_n = 0
for i in range(dig_num):

    sub = math.floor(n/10**(dig_num-i-1))
    s_n = s_n + sub
    n = n - sub*10**(dig_num-i-1)

if init_n/s_n == math.floor(init_n/s_n):
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

S = list(n)

count = 0
for val in S:
    count += int(val)

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

Submission status: Accepted

Solution code:
# ABC 101, B - digit sums
n = int(input())

def s(x):
    total = 0
    for i in str(x):
        total += int(i)
    return total

if n % s(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N_orders = list(N)
sum_order = 0

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

if int(N) % sum_order == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n = input()
num = 0
for i in n:
  num += int(i)
if int(n) % num == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
x = int(input())

n = x
ds = 0
while x != 0:
  ds += x % 10
  x //= 10
print("Yes" if n % ds == 0 else "No")

Submission status: Accepted

Solution code:
S = input()
mul_sum = 0
for s in S:
    mul_sum += int(s)

if int(S) % mul_sum == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
n=input()
sn=sum(int(i) for i in n)
print('Yes' if int(n)%sn ==0 else 'No')

Submission status: Accepted

Solution code:
a = int(input())
b = list(str(a))
s = 0
for i in range(len(b)):
    s += int(b[i])

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

Submission status: Accepted

Solution code:
n = input()
s = sum([int(i) for i in list(n)])
if int(n)%s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n=str(input())
nsum=0
for i in n:
    nsum+=int(i)
print('Yes' if int(n)%nsum==0 else 'No')

Submission status: Accepted

Solution code:
n = int(input())
m = n
sn = 0
while n:
    sn += n % 10
    n = n // 10

if m % sn == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

s = input()
t = int(s)

sd = 0
for c in s:
    sd += ord(c) - ord('0')

print("Yes" if t % sd == 0 else "No")

Submission status: Accepted

Solution code:
n=input()
s=sum([int(x) for x in n])
print("No" if int(n) % s else "Yes")

Submission status: Accepted

Solution code:
N = int(input())

S = sum(list(map(int, list(str(N)))))

if N % S == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
sums = 0
for i in s:
    sums += int(i)

print("Yes" if int(s) % sums == 0 else "No")

Submission status: Accepted

Solution code:
N = input()

res = 0
for x in N:
    res += int(x)

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

Submission status: Accepted

Solution code:
s = raw_input()
t = 0
for c in s:
  t += int(c)
print 'Yes' if int(s) % t == 0 else 'No'

Submission status: Accepted

Solution code:
N = input()
ans = 0
for i in N:
    ans += int(i)

print(['Yes','No'][min(1,int(N)%ans)])

Submission status: Accepted

Solution code:
import os, sys, re, math

lines = sys.stdin.readlines()

n = lines[0].strip()
s = sum(int(d) for d in n)
if int(n) % s == 0:
    print ('Yes')
else:
    print ('No')

Submission status: Accepted

Solution code:
str = input()
total = 0
for s in str:
    total += int(s)
if (int(str) % total == 0):
    print ('Yes')
else:
    print ('No')

Submission status: Accepted

Solution code:
n = input()
sn = sum(int(d) for d in n)
print('Yes' if int(n) % sn == 0 else 'No')

Submission status: Accepted

Solution code:
n = input()

s = 0
for i in range(len(n)):
    s += int(n[i])

if int(n) % s == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
total_sum = 0
for s in N:
    total_sum += int(s)
if int(N) % total_sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
t=sum(int(x) for x in s)
s=int(s)
if s%t:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
n = input()
sums = 0
for i in n:
  sums+=int(i)
if int(n)%sums==0:print('Yes')
else:print("No")

Submission status: Accepted

Solution code:
N = input()
tmp = 0
for i in range(len(N)):
    tmp += int(N[i])

if int(N) % tmp == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

sums = 0
for i in n:
    sums += int(i)

if N % sums == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
sum_digit = 0
for i in range(len(N)):
  sum_digit += int(N[i])
if int(N)%sum_digit == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
m = input()
n = int(m)
q = 0
for i in m:
  q += int(i)
if n%q == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    s = S()
    a = s.count("-")
    b = s.count("+")
    print(b-a)
    return

#B
def B():
    n = S()
    num = sum(map(int, n))
    n = int("".join(n))
    print(["Yes", "No"][n % num > 0])
    return

#C
def C():
    return

#D
def D():
    return


#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = input()
a = [int(i) for i in N]
a_sum = sum(a)

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

Submission status: Accepted

Solution code:
#coding: utf-8

N = str(input())
sum = 0

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

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

Submission status: Accepted

Solution code:
n = int(input().strip())
Sn = sum(int(i) for i in str(n))
ans = 'Yes' if n % Sn == 0 else 'No'
print(ans)

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]
    N = int(input())
    a = list(int(_) for _ in str(N))
    if N%sum(a) ==0:
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
S = 0

for i in range(10):
    S += (N % 10**(i+1)) // 10**i 
print('Yes' if N % S == 0 else 'No')

Submission status: Accepted

Solution code:
N = input()

n = int(N)
digit = sum([int(N[i]) for i in range(len(N))])

if n%digit==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
n = int(N)
sum = 0
while len(N) > 0:    
    sum += int(N[0])
    N = N[1:]

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

Submission status: Accepted

Solution code:
a = input()
b = 0
for i in a:
    b += int(i)
print("Yes" if int(a) % b == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
num = n
s = 0
while n > 0:
    s += n%10
    n = n//10

if num%s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = list(input())
print('Yes' if int(''.join(N)) % sum(map(int, N)) == 0 else 'No')

Submission status: Accepted

Solution code:
S = input()
N = int(S)
SN = sum(int(c) for c in S)
print("Yes" if N % SN == 0 else "No")

Submission status: Accepted

Solution code:
n = input()
s = sum(map(int, n))

if int(n) % s == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()
ans = 0
for i in N:
  ans += int(i)
print('Yes' if int(N)%ans == 0 else 'No')