Problem:


Score : 200 points

Problem Statement

An integer X is called a Harshad number if X is divisible by f(X), where f(X) is the sum of the digits in X when written in base 10.

Given an integer N, determine whether it is a Harshad number.

Constraints

1?N?10^8

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print Yes if N is a Harshad number; print No otherwise.

Sample Input 1

12

Sample Output 1

Yes

f(12)=1+2=3. Since 12 is divisible by 3, 12 is a Harshad number.

Sample Input 2

57

Sample Output 2

No

f(57)=5+7=12. Since 57 is not divisible by 12, 12 is not a Harshad number.

Sample Input 3

148

Sample Output 3

No



Sample input:
12


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

v = 0
for s in str(N):
    v += int(s)

ans = 'No' if N % v else 'Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def f(x):
    str_x = list(str(x))
    number_list = list(map(int, str_x))
    return sum(number_list)

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

Submission status: Accepted

Solution code:
N = input()

n = int(N)

ans = 0

for i in range(len(N)):
    re = n % 10
    n = int(n / 10)
    ans += re

x = int(N)    

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

Submission status: Accepted

Solution code:
import copy

X = int(input())

N = copy.copy(X)

s = 0

while True:
    if N // 10 != 0:
        s += N % 10
        N = N // 10
    else:
        s += N
        break

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

Submission status: Accepted

Solution code:
# ABC 080: B – Harshad Number
n = input()
digits = [int(c) for c in n]
print('Yes' if int(n) % sum(digits) == 0 else '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()
a=sum(map(int,n))
print('Yes' if int(n)%a==0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

keta = 0
sub = ""
for i in range(len(n)):
    sub += n[i]
    keta += int(n[i])

sub = int(sub)
if sub % keta == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = list(input())
x = int(''.join(n))
y = sum(map(int, n))

print('Yes' if x%y==0 else 'No')

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc080/tasks/abc080_b
# Python 3rd Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


yes = "Yes"
no = "No"


def solver(inputNum):
    result = no
    # algorithm
    inputNumStr = str(inputNum)
    fx = 0
    for j in range(0, len(inputNumStr)):
        fx = fx + int(inputNumStr[j])
    if inputNum % fx == 0:
        result = yes
    return result


if __name__ == "__main__":
    print("{}".format(solver(II())))

Submission status: Accepted

Solution code:
N = int(input())
if N%sum([int(i) for i in str(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])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = input()
f = sum(map(int,list(X)))
X = int(X)
print("Yes" if X%f==0 else "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=int(input())
N=map(int,list(str(n)))

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

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc080/tasks/abc080_b
# Python 2nd Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque


def II(): return int(sys.stdin.readline())


def MI(): return map(int, sys.stdin.readline().split())
#   def MI1(): return map(int1, sys.stdin.readline().split())


def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


yes = "Yes"


no = "No"


def solver(checkNum):
    result = no
    checkNumStr = str(checkNum)
    harshedNum = 0
    for j in range(0, len(checkNumStr)):
        harshedNum = harshedNum + int(checkNumStr[j])
    if checkNum % harshedNum == 0:
        result = yes
    return result


if __name__ == "__main__":
    print("{}".format(solver(II())))

Submission status: Accepted

Solution code:
N=input()

#sum
if int(N)<10**1:
    sumnum=int(N[0])
elif int(N)<10**2:
    sumnum=int(N[0])+int(N[1])
elif int(N)<10**3:
    sumnum=int(N[0])+int(N[1])+int(N[2])
elif int(N)<10**4:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])
elif int(N)<10**5:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])+int(N[4])
elif int(N)<10**6:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])+int(N[4])+int(N[5])
elif int(N)<10**7:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])+int(N[4])+int(N[5])+int(N[6])
elif int(N)<10**8:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])+int(N[4])+int(N[5])+int(N[6])+int(N[7])
else:
    sumnum=int(N[0])+int(N[1])+int(N[2])+int(N[3])+int(N[4])+int(N[5])+int(N[6])+int(N[7])+int(N[8])

#hantei
if int(N)%sumnum==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calc_sum_digits(n):
    sumd = 0
    while(int(n) > 0):
        sumd += int(n%10)
        n /= 10
    return sumd

N = int(input())
sumd = calc_sum_digits(N)
if(N%sumd == 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())
x = list(str(n))
sum = 0
for i in range(len(str(n))):
     sum += int(x[i])
if n%sum == 0:
     print('Yes')
else:
     print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc080/tasks/abc080_b
# Python 1st Try

import sys
# from collections import defaultdict
# import heapq,copy
# from collections import deque
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))


def LLI(rows_number): return [LI() for _ in range(rows_number)]


def solver(inputNum):
    result = "No"
    # algorithm
    strNum = str(inputNum)
    divisorNum = 0
    for j in range(0, len(strNum), +1):
        divisorNum = divisorNum + int(strNum[j])
    if inputNum % divisorNum == 0:
        result = "Yes"
    return result


if __name__ == "__main__":
    print("{}".format(solver(II())))

Submission status: Accepted

Solution code:
N = int(input())
tmp = N
x = 0
while (tmp > 0):
  x = x + (tmp % 10)
  tmp //= 10
if (N % x == 0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = input()
def f(N):
  ret = 0
  for i in N:
    ret += int(i)
  return ret
if int(N) % f(N) == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
m=int(input())
n=list(str(m))
numlist=[]
for i in n:
    numlist.append(int(i))
total=sum(numlist)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
list_N = list(str(n))
num = 0

for i in list_N:
    num += int(i)
ans = "No"

if n%num == 0:
    ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
N = 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())

k = list(str(N))
s = sum(map(int, k))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()

xi = int(x)
xs = sum([ int(xx) for xx in x])

if xi%xs==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
# ABC 080 B - Harshad Number
n = int(input())

def harshad(x):
    tot = 0
    X = x
    while x > 0:
        tot += x%10
        x = x // 10
    if (X / tot)%1 == 0:
        return 'Yes'
    else:
        return 'No'
print(harshad(n))

Submission status: Accepted

Solution code:
N = input()

int_N = int(N)
list_N = list(N)

fx = 0
for item in list(N):
    item = int(item)
    fx += item

if int_N % fx == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

    str_n = str(n)

    n_sum = 0

    for i in range(len(str_n)):
        n_sum += int(str_n[i])

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n=int(input())
f=sum([int(i) for i in list(str(n))])
print('YNeos'[n%f!=0::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

f = sum(int(d) for d in str(N))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
def F(x):
    L = 0
    for i  in range(len(x)):
            L += int(x[i])
    return L
if int(N) % F(N) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def wa(x):
    s = 0
    while x > 0:
        s += x % 10
        x = int(x / 10)
    return s

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

sm = 0
for i in st:
  sm+=int(i)
if n%sm==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

def digitsum(a):
  sum_ = 0
  while a > 0:
    sum_ += int(a)%10
    a /= 10
  return sum_

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
n1=int(n)
f=list(n)
fn=sum(int(i) for i in f)
if n1%fn==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 = list(input())
hN = sum(int(i) for i in N)
nN = int("".join(N))
if nN % hN == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = input()
    n_int = int(n)
    n_li = list(map(int, list(n)))
    n_sum = sum(n_li)

    if n_int % n_sum == 0:
        ans = 'Yes'
    else:
        ans = 'No'

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
total=0
leave=n
for i in reversed(range(0,len(str(n)))):
    total+=int(leave/(10**i))
    leave=n%(10**i)
if n%total==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

nstr = map(int, list(str(n)))
nsum = sum(nstr)

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

Submission status: Accepted

Solution code:
n=input()
num=0

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

Submission status: Accepted

Solution code:
n = int(input())

def colsum(num):
    s = str(num)
    ret = 0
    for i in s:
        ret += int(i)
    return ret

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10
    return ret

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

f = 0
t = N
while t > 0:
    f += t % 10
    t //= 10

ans = 'Yes' if N % f == 0 else 'No'
print(ans)

Submission status: Accepted

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

X = ''.join(map(str,n))
X = int(X)
fx = sum(n)

if X%fx == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

a=input()
b=int(a)

print("Yes" if b%sum(map(int,a))==0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = sum(map(int, list(str(n))))

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

else:
    print('No')

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
N = 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:
if __name__ == '__main__':
    tmp = int(input())
    n = tmp
    tmp_n = n
    ad = 0
    while True:
        ad += tmp_n % 10
        tmp_n //= 10
        if tmp_n == 0:
            break
    if n % ad == 0:
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)

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 = int(input())
s = sum([int(i) for i in list(str(n))])
print('Yes' if n%s==0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 = int(input())
S = str(N)
S = sum(list(int(i) for i in S))

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

Submission status: Accepted

Solution code:
n=int(input())
coppy=n
wa=0
while n:
	wa+=n%10
	n//=10

if coppy%wa==0:
	print("Yes")

else:
	print("No")

Submission status: Accepted

Solution code:
n = int(input())
total = 0
flag = 1
nn = n
while flag:
  total += nn % 10
  nn = nn // 10
  if nn <= 0:
    flag = 0

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

Submission status: Accepted

Solution code:

n = int(input())
total = 0
flag = 1
nn = n
while flag:
  total += nn % 10
  nn = nn // 10
  if nn <= 0:
    flag = 0

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

Submission status: Accepted

Solution code:
S = input()
total = 0

for s in S:
  total += int(s)

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

Submission status: Accepted

Solution code:
import math
import string


def readints():
    return list(map(int, input().split()))


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

n = input()
# print(n)
#print(sum(map(int, n)))
x = sum(map(int, n))
# print(int(n)/x)

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

Submission status: Accepted

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

sum=0
for s in S:
  sum += int(s)
  
if N%sum==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
fx=0

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

Submission status: Accepted

Solution code:
def sumofdigits(N):
    return sum(map(int, list(N)))
N=input()
A=int(N)
print('Yes' if A % sumofdigits(N) == 0 else "No")

Submission status: Accepted

Solution code:
def getSum(N):
    s = 0
    while N > 0:
        s += N % 10
        N = int(N / 10)
    return s
def main():
    N = int(input())
    if N % getSum(N) == 0:
        print('Yes')
    else:
        print('No')

main()

Submission status: Accepted

Solution code:
n = int(input())


def sumOfDigits(n):
    res = 0
    while n > 0:
        res += n % 10
        n //= 10

    return res


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

Submission status: Accepted

Solution code:
ss=input().strip()

n=int(ss)
nn=0

for s in ss:
  nn+=int(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

n = int(input())

# str_n = str(n)

# harshad = 0
# for i in range(len(str_n)):
#     harshad += int(str_n[i])

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

harshad = 0
num = n
for i in range(len(str(n))):
    harshad += num % 10
    num = math.floor(num / 10)

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
n = int(input())
def digitsum(n):
    s = 0
    while n>0:
        s += n % 10
        n //= 10
    return s
if n % digitsum(n) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = input().rstrip('\n')
cnt = 0
for i in range(len(n)):
    cnt += int(n[i])

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

hasha=0

for i in s:
    hasha += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
class Solution:
    def solve(self, N: int) -> str:

        f = 0
        tmp = N
        while tmp > 0:
            f += tmp % 10
            tmp //= 10

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


if __name__ == '__main__':

    # standard input
    N = int(input())

    # solve
    solution = Solution()
    print(solution.solve(N))

Submission status: Accepted

Solution code:
n = input()

s = sum([int(x) for x in list(n)])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()
numbers=[int(a) for a in N]
goukei=sum(numbers)
if int(N)%goukei==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
num = input()
num_int = int(num)
l = list(num)
l = [int(i) for i in l]

sum = sum(l)

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

Submission status: Accepted

Solution code:
n = input()

n_list = list(n)
n_all = 0

for i in n_list:
  n_all += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Thu Mar 12 20:28:52 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

def f(x):
    s = str(x)
    n = 0
    for i in range(len(s)):
        n += int(s[i])
    return n

x = ni()

print("Yes" if x % f(x) == 0 else "No")

Submission status: Accepted

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

def SumDegit(x):
    ans = 0
    while x > 0:
        ans += x%10
        x = x //10
    return ans
        
if n%SumDegit(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    n=str(input())
    if int(n)%sum([int(i) for i in n])==0:
        print('Yes')
    else:
        print('No')


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
fx = 0

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

n = int(n)

print("YNeos"[n%fx!=0::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

List=list(str(n))
fx=0
for i in range(len(List)):
    fx+=int(List[i])

if n%fx==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 = int(input())
S = sum(list(map(int, str(N))))

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

Submission status: Accepted

Solution code:
from sys import stdin

n = stdin.readline().rstrip()
s = sum([int(x) for x in n])
if int(n) % s:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
N = input()
fx = 0

for i in N:
    fx += int(i)
if int(N) % fx == 0:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
n = int(input())

import copy

div = copy.copy(n)

check = 0

while div > 0:
    rem = div % 10
    div = div // 10
    check += rem
    
if (n % check) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
h = 0

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

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

n = onem()

po = str(n)
co = 0
for i in po:
    co += int(i)
print("Yes" if n % co == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

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

Submission status: Accepted

Solution code:
def f(x):
    return sum(int(i) for i in str(x))

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

Submission status: Accepted

Solution code:
N = input()

harshad_num = [int(i) for i in N]
harshad_num = sum(harshad_num)

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