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:
import sys
input = sys.stdin.readline

N = int(input())
S = list(str(N))
NumList = list(map(int, S))
sumNL = sum(NumList)

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

Submission status: Accepted

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

X = int(input())

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

Submission status: Accepted

Solution code:
# coding: utf-8

def is_harshad(num: str):
    return int(num) % sum([int(i) for i in num]) == 0


print("Yes" if is_harshad(input().rstrip()) else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = n
fx = 0
for id in range(len(str(n))):
    fx += x % 10
    x = x // 10
if n % fx == 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])
  
if int(N) % total == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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())
s =str(n)
array = list(map(int,s))
if n % sum(array) == 0 :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input().rstrip('\r')
fx = 0
for n in N:
    num = int(n)
    fx += num
if int(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:
b = input()
a = int(b)
b = sum(list(map(int,list(b))))
print("Yes" if a%b==0 else "No")

Submission status: Accepted

Solution code:
#ABC080

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

Submission status: Accepted

Solution code:
N = int(input())
def f_x(n):
    res = 0
    while n > 0:
        res += n%10
        n = n//10
    return res

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

Submission status: Accepted

Solution code:
N = int(input())

ans = "No"

total = []

#桁数
for i in range(len(str(N))):
        total.append(int(str(N)[i]))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 各桁の和を計算する関数
def findSumOfDigits(n):
  sum = 0
  while n > 0:
    q, mod = divmod(n, 10)
    sum += mod
    n = q
  return sum

N = int(input())
sum = findSumOfDigits(N)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
res = 0

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

Submission status: Accepted

Solution code:
def Harshad(n):

    count = 10
    sumn = 0
    while n // count > 0:
        sumn += (n // count) % 10
        count *= 10

    sumn += n % 10

    if n % sumn == 0:
        return "Yes"
    else:
        return "No"


def main():
    n = int(input())
    print(Harshad(n))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys


def find_sum_of_digits(n):
    sum_of_digits = 0
    while n>0:
        sum_of_digits = sum_of_digits + n%10
        n = int(n/10)
    return sum_of_digits


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

Submission status: Accepted

Solution code:
#080_B
def f(S):
    return int(S)%sum([int(s) for s in S])==0
print('Yes' if f(input()) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


def f(x):
    s = str(x)
    arr = list(map(int, s))
    return sum(arr)


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

Submission status: Accepted

Solution code:
X=int(input())
fX=sum(list(map(int,str(X))))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env PyPy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
mod=10**9+7

def main():
    N=I()
    a=0
    NN=N
    for i in range(len(str(N))):
       a+=N%10
       N=N//10
       
    if  NN%a==0:
        print("Yes")
    else:
        print("No")
        


main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

n= input()
x = map(int,list(n))
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))
#print(n)
fx = sum(x)

if int(n)%fx == 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])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
sum_num = 0

for i in range(len(a)):
  sum_num += int(a[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

l = n
m = 0

while(True):
    d = l % 10
    m += d
    l //= 10
    if l == 0:
        break
    
if n % m == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
f = sum(map(int,list(str(N))))

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

Submission status: Accepted

Solution code:
n = int(input())


def digit_sum(n: int) -> int:
    ans = 0
    while n > 0:
        ans += n % 10
        n //= 10
    return ans


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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


n = int(input().strip())
#----------
sum=0
calc_n=n

while calc_n != 0:
    digit = calc_n % 10
    calc_n = calc_n // 10
    sum += digit
    
if (n % sum) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
def get_digits_sum(num):
    result = 0
    while num > 0:
        result += num % 10
        num //= 10
    return result


def main():
    NUMBER = int(input())
    digits_sum = get_digits_sum(NUMBER)
    print("Yes" if not NUMBER % digits_sum else "No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
    y = list(map(int, str(x)))
    return sum(y)


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

Submission status: Accepted

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

def main():
    n = int(input())
    n_sum = sum([int(c) for c in str(n)])
    if n % n_sum == 0:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sum_digit = 0
T = N
while T>0 :
    sum_digit += T%10
    T //= 10

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

Submission status: Accepted

Solution code:
X = int(input())

def Sum_Digit(X):
  SUM = 0
  while X >= 1:
    SUM += X%10
    X = int((X - X%10)/10)
  return SUM

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

def digit_sum(s):
    s = str(s)
    return sum([int(s[i]) for i in range(len(s))])
  
if x%digit_sum(x)==0: print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
N = int(input())
f = 0
for s in str(N):
  f += int(s)
if N % f == 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])

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

Submission status: Accepted

Solution code:
N=int(input())
def kakuwa(N):
  summ=0
  i=0
  while N>10**i:
    i+=1
  for k in range(i+1)[::-1]:
    summ+=N//(10**k)
    N-=(10**k)*(N//(10**k))
  return(summ)

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

Submission status: Accepted

Solution code:
def sum_digit(num):
    sums = 0
    while num != 0:
        sums += num % 10
        num //= 10
    return sums

n = int(input())
if n % sum_digit(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 "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())

temp = 0
n = N

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

Submission status: Accepted

Solution code:
import math
N = int(input())
n = N
amari = 0
for i in range (len(str(N))):
  amari += n % 10
  n = math.floor(n / 10)
if N % amari == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
try:
    N = int(input())
    N_ = sum(map(int, str(N)))
    print('Yes' if N%N_==0 else 'No')
except EOFError:
    pass

Submission status: Accepted

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


def main():
    N = input()
    print('Yes'if int(N) % sum(int(n) for n in list(N)) == 0 else 'No')


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def SumDigits(num):
    sum = 0
    while True:
        sum += num % 10
        num //= 10
        if num == 0:
            break
    return sum

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
print('YNeos'[int(n)%sum(map(int,n))>0::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
x = int("".join(n))

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

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

Submission status: Accepted

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

N = int(input())

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

Submission status: Accepted

Solution code:
def summaker(a):
  sum1 = 0
  while a > 0:
    sum1 += a % 10
    a = a // 10
  return sum1

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

Submission status: Accepted

Solution code:
def func(n):
  s = 0
  for i in str(n):
    s += int(i)
  return s

n = int(input())

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

Submission status: Accepted

Solution code:
x = input()
ans=0
length=len(x)-1
xi=int(x)
while length>=0:
  ans+=(xi//10**length)
  xi-=(10**length*(xi//10**length))
  length-=1
print("Yes" if int(x)%ans==0 else("No"))

Submission status: Accepted

Solution code:
s_n = input()
ll = len(s_n)
s_int = int(s_n)
nn = 0
for i in range(ll):
    nn += int(s_n[i])

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

Submission status: Accepted

Solution code:
n=input()

ans=0

for nn in n:
    ans+=int(nn)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main(n: int):
    t = 0
    for s in str(n):
        t += int(s)

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


if __name__ == "__main__":
    n = int(input())
    main(n)

Submission status: Accepted

Solution code:
N = int(input())

l = []
num = N
for i in range(9):
    l.append(int(num%10))
    num /= 10
if N%(sum(l)) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func(num):
  ret = 0
  while num > 0:
    ret += num % 10
    num //= 10
  return ret

n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
fn = sum(map(int, n))
n = int(n)
if n % fn == 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:
k = input()
num = 0
for i in k:
    num += int(i)
dst = "Yes" if int(k) % num == 0 else "No"
print(dst)

Submission status: Accepted

Solution code:
import sys

x=input()
list=[]
for i in range(len(x)):
	list.append(int(x[i]))
val=sum(list)
y=int(x)
print("Yes" if y%val==0 else "No")

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=0
    for i in str(n):
        ct+=int(i)
    if n%ct==0:
        print('Yes')
    else:
        print('No')
if __name__ == '__main__':
    do()

Submission status: Accepted

Solution code:
n=input()
a=0
for i in range(len(n)):
    a+=int(n[i])
if int(n)%a==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:
n = input()
sum = 0

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

Submission status: Accepted

Solution code:
n = str(input())

x = int(n)
n = list(n)
     
arr = []
while(True):
    arr.append(int(n.pop(0)))
    if len(n) == 0:
        break

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

Submission status: Accepted

Solution code:
#from fractions import gcd
#mod = 10 ** 9 + 7
#N = int(input())
#a = list(map(int,input().split()))
#a,b,c = map(int,input().split())
#ans = [0] * N
#math.ceilで切り上げ
import math
import string

def intinput():
    return int(input())

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

def splitintinput():
    return map(int,input().split())

N = intinput()
tmp = N
divs = 0

while tmp:
    divs += tmp % 10
    tmp = int(tmp/10)

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
N = int(input())

def fx(N):
  ans = 0
  while N > 0:
    ans += N % 10
    N = N // 10
  return ans
  
if N % fx(N) == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

def fx(N):
  ans = 0
  for i in str(N):
    ans += int(i)
  return ans
  
if N % fx(N) == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


def Hershad(n):
    if n == 0:
        return 0
    return n % 10 + Hershad(n // 10)


N = int(readline())
print('Yes' if N % Hershad(N) == 0 else 'No')

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys

# import itertools
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


def Hershad(n):
    if n == 0:
        return 0
    return n % 10 + Hershad(n // 10)


N = int(readline())
print('Yes' if N % Hershad(N) == 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
all=int(0)
N=n
while N:
    all+=(N%10)
    N=int(N/10)

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

Submission status: Accepted

Solution code:
import math

#n, a, b= map(int, input().split())
#n, x  = map(int, input().split())
#h = list(map(int, input().split()))
#s = list(str(input()))
n = int(input())

tot = 0

n_str = list(str(n))
integ  = [int(s) for s in n_str]
length = len(integ)
for i in range(length):
  tot = tot + integ[i]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sumNum(num, sums):
    if num == 0:
        return sums
    sums += num % 10
    num = num // 10
    return sumNum(num, sums)

N = int(input())
f_x = sumNum(N, 0)
if (N % f_x) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
N = int(input())
n = N
amari = 0
for i in range (len(str(N))):
  amari += n % 10
  n = math.floor(n / 10)
if N % amari == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()
h = 0

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

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

Submission status: Accepted

Solution code:
N = int(input())

def f(x):
    su = 0
    while x>0:
        su += x % 10
        x //= 10
    return su

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

Submission status: Accepted

Solution code:
n = int(input())
sum = 0
divn = n

for _ in range(9):
    sum += int(divn % 10)
    divn /= 10
    
if n % sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
X = sum([int(x) for x in N])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
c = 0
for i in list(n):
  c += int(i)
print("Yes" if int(n)%c==0 else "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()

def digitsum(n):
    a = list(map(int,n))
    b = sum(a)
    return b

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

Submission status: Accepted

Solution code:
n=input()

m=sum(map(int, n))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
print("YNeos"[bool(int(N)%sum(int(n)for n in N))::2])

Submission status: Accepted

Solution code:
n = int(input())

def f(n):
    sums = 0
    while n>0:
        sums += n%10
        n //= 10
    return sums

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(str(input()))

gokei = 0
for i in a:
  gokei += int(i)

if int(''.join(a))%gokei == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
n = int(input())

l = list(str(n))

wrk = 0
#wrk = sum[int(x) for x in l]
for i in range(len(l)):
    wrk += int(l[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

d = 0

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

Submission status: Accepted

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

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:
def sum_of_digits(n):
    sum = 0

    while(n>0):
        q,mod = divmod(n,10)

        sum += mod
        n = q
   
    return sum

N = int(input())

sum = sum_of_digits(N)

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

Submission status: Accepted

Solution code:
N = int(input())

# Xの格桁の数字の和を出力
def f(X):
  return sum(list(map(int, str(X))))

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

Submission status: Accepted

Solution code:
N = int(input())
def wa(N) : #kakuketanowa
    S = str(N)
    array = list(map(int,S))
    return sum(array)
Na = wa(N)
if N % Na == 0 :
    print("Yes")
else :
    print("No")

Submission status: Accepted

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

x = [int(i) for i in n]
n = int(n)

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

Submission status: Accepted

Solution code:
n = int(input())

def f(n):
    return sum(map(int, str(n)[::]))

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

Submission status: Accepted

Solution code:
import math

a=int(input())
X = a

x = 0

while(True):
  if a / 10 == 0:
    break
  
  x += a % 10
  a = math.floor(a / 10)

ans = 'No'

if X % x == 0:
  ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
N = input()

if int(N)%sum([int(l) for l in N]) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n=int(input())
div=n
a=0
while n:
    a+=int((str(n)[-1]))
    #print(str(n)[-1])
    n//=10
#print(a)
if div%a==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

x = n
fx = 0

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

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

Submission status: Accepted

Solution code:
import math

n = int(input())

sum = 0
fx = n
while fx > 0:
    sum += fx % 10
    fx = math.floor(fx / 10)

if n % sum == 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()
a = []
for i in range(len(n)):
  a.append(int(n[i]))
if int(n) % sum(a) == 0:
  print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
X = 0
for i in list(str(N)):
    X += int(i)
if N % X == 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()

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()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
fx = 0
for s in n:
    fx += int(s)

if int(n) % fx == 0:
    print('Yes')
else:
    print('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:
# -coding: utf-8 -

n = int(input())

isHarshad = False

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
N = int(input())

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

Submission status: Accepted

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


sum = 0
while N>0:
    N1 = N%10

    sum += N1
    N = (N-N1)/10

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

else:
    print('No')