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()
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:
x = raw_input()
print ["No", "Yes"][int(x) % sum(int(y) for y in x) == 0]

Submission status: Accepted

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

import sys

ns = raw_input().split()[0]
n = int(ns)

nl = [int(c) for c in ns]
ns = sum(nl)

# print ns
# print n
# print nl
# print ns
# print n % ns

if (n % ns) == 0:
    sys.stdout.write('Yes\n')
else:
    sys.stdout.write('No\n')
sys.stdout.flush()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
nums=[int(c) for c in s]

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

Submission status: Accepted

Solution code:
N = int(input())

N_digit = [0, 0, 0, 0, 0, 0, 0, 0, 0]
M = N

for i in range(0,9):
	N_digit[i] = M // (10**(8 - i))
	M = N % (10**(8 - i))


digit_sum = sum(N_digit)

#print(N_digit)
#print(digit_sum)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
n=int(N)
i=0
f=0
while i<len(N):
    f+=int(N[i])
    i+=1
if n%f==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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



def f(x):
    return sum(map(int, str(x)))

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

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

if __name__ == "__main__": main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def f(n):
    return sum([int(s) for s in str(n)])

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

Submission status: Accepted

Solution code:

def foo(s):
    d, m = divmod(int(s), sum(map(int, list(s))))
    return m == 0


if __name__ == "__main__":
    s = input()
    if foo(s):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
l = [int(x) for x in list(str(N))]

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

Submission status: Accepted

Solution code:
N = input()
def f(x):
    ans = 0
    while x > 0:
        ans += x % 10
        x /= 10
    return ans
print "Yes" if N % f(N) == 0 else "No"

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isHsd(n):
  if n%sum(list(map(int, list(str(n))))) == 0: return True
  return False
print('Yes' if isHsd(int(input())) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# B - Harshad Number

N = raw_input()
f = sum(map(int, N))

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

Submission status: Accepted

Solution code:


def sum_digits(a):
    return sum(map(int, list(str(a))))

a = int(input())
b = sum_digits(a)

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

Submission status: Accepted

Solution code:
n=list(map(int,input()))
moji=""
ans=0
for i in n:
    moji+=str(i)
    ans+=i
moji_i=int(moji)
if moji_i%ans==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

fx=0
for i in list(str(n)):
    fx += int(i)

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

Submission status: Accepted

Solution code:
a=input()
x=int(a)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
print(("No","Yes")[int(n)%sum(map(int,list(n)))==0])

Submission status: Accepted

Solution code:
N = input()
f = sum(map(int, N))
if int(N) % f == 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 = input()
f = list(n)
fx = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
listN = list(N)

sumN = 0
for x in listN:
    sumN += int(x)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# main関数
if __name__ == '__main__':

    n = int(input())
    m = n

    div = 0
    while n != 0 :
        div += n % 10
        n = n // 10

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

b=len(a)

c=0

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

Submission status: Accepted

Solution code:
n = input()
x = int(n)
fx = sum(list(map(lambda x: int(x),list(n))))

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

Submission status: Accepted

Solution code:
N = input()
NH = list(N)
N_len=len(NH)

Nsum=0
for i in range(0, N_len):
    Nsum += int(NH[i])

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

Submission status: Accepted

Solution code:
l = input()
a = list(map(int,list(l)))
ans = 0
for i in a:
    ans += i
if int(l)% ans == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc080/tasks/abc080_b

"""
import sys
from sys import stdin
input = stdin.readline


def is_harshad(N):
    result = False
    divisor = 0
    num = N
    while num:
        divisor += num % 10
        num //= 10
    if N % divisor == 0:
        result = True
    return result


def main(args):
    N = int(input())
    if is_harshad(N):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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


a = input()
b = sumNum(a)
if a%b == 0:
    print "Yes"
else:
    print "No"

Submission status: Accepted

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

fN = 0
tmp = N

while tmp > 0:
    fN += tmp % 10
    tmp = tmp // 10

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

Submission status: Accepted

Solution code:
N = list(input())
a = 0

for x in N:
    a += int(x)

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

Submission status: Accepted

Solution code:
# coding: utf-8

# 入力
n = input()

def calc(n):
    n_list = [int(i) for i in n]
    if int(n) % sum(n_list) == 0:
        return "Yes"
    else:
        return "No"

# 出力
print(calc(n))

Submission status: Accepted

Solution code:
n=int(input())
c=0
for ch in str(n):
    c+=ord(ch)-48
print('Yes'if n%c==0 else'No')

Submission status: Accepted

Solution code:
N = input()

s = 0;
for a in N:
    s += int(a)

N = int(N)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
result = n % sum(map(int, str(n))) == 0
print(['No', 'Yes'][result])

Submission status: Accepted

Solution code:

# coding: utf-8

number = input()
breaked_numbers = []
sum = 0

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

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

Submission status: Accepted

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

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:
#AtcoderABC003 #2
N = input()
N = str(N)
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 = input()
fx = sum(map(int, list(n)))
if int(n) % fx == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
char_list = list(N)
ints = list()
for char in char_list:
    ints.append(int(char))

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

Submission status: Accepted

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

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("Yes")
    return("No")

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

Submission status: Accepted

Solution code:
#coding: UTF-8

N = input()

culc = 0

for c in N:
    culc = culc + int(c)

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

Submission status: Accepted

Solution code:
# coding:utf-8                                                                  


N = raw_input()
fs = list(N)

fx = 0
for f in fs:
    fx += int(f)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

line = sys.stdin.readline()
n = int(line.rstrip())

s = 0
x = n
while x > 0:
    x, r = (x // 10, x % 10)
    s += r
print('Yes' if 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())
s=str(N)
l=len(s)
f=0
for i in range(l):
  f+=int(s[i])
if N%f==0: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
X = input()
x = int(X)
X_sum = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

keta = len(str(x))

f = []
for i in range(keta):
    f.append(int(str(x)[i]))
f = sum(f)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python

N=input()
sum=0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    s = sum([int(c) for c in str(n)])
    if n % s == 0:
        return 'Yes'

    return 'No'



print(main())

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
N = list(input())
total = sum(list(map(int, N)))
if int(''.join(N))%total != 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 18 17:04:29 2017

@author: goto
"""
y=0
x=input()

x_int=[int(i)for i in list(str(x))]
for i in range(len(x_int)):
    y+=x_int[i]
    

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from logging import getLogger, basicConfig, DEBUG
basicConfig(level=DEBUG)
LOGGER = getLogger(__name__)

N = int(input())

def calc(n):
    list = [int(s) for s in str(n)]
    return sum(list)

def main():
    result = calc(N)
    # LOGGER.debug(result)
    if N % result == 0:
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(raw_input())

def f(X):
    ans = 0
    while X>0:
        ans += X%10
        X = (X - X%10) / 10
    return ans

fN = f(N)

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

Submission status: Accepted

Solution code:
I = input()
N = int(I)
L = list(I)
sum = 0
for i in L:
    sum += int(i)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

sumn = 0

for i in xf:
    sumn += int(i)

if N%sumn :
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    copy_N = N
    sum_N = 0
    while copy_N > 0:
        sum_N += copy_N % 10
        copy_N = copy_N // 10
    if N % sum_N == 0:
        print("Yes")
    else:
        print("No")
    
solve()

Submission status: Accepted

Solution code:
# coding: utf-8
# 整数の入力
n = input()

# 計算
def f(arg):
    s = 0
    for i in arg:
        s += int(i)
    if int(arg) % s == 0:
        return "Yes"
    else:
        return "No"

def main():
    print(f(n))

# 実行
main()

Submission status: Accepted

Solution code:
num = int(input())

fx = 0
for i in str(num):
    fx += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N,  = map(int, raw_input().split())
strN = str(N)
sumNum = 0
for x in strN:
    sumNum += int(x)
if N%sumNum == 0:
    print "Yes"
else:
    print "No"

Submission status: Accepted

Solution code:
N=input()
a=list(N)
b=len(a)
sum=0
for i in range(b):
          a[i]=int(a[i])
          sum += a[i]
N=int(N)
if(N%sum==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=str(input())
a=list(map(int,list(n)))
if int(n) % sum(a) ==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding: utf-8

def is_harshad_number(n):
    sumed = sum(map(int, str(n)))
    return n % sumed == 0

def main():
    n = int(raw_input())
    print "Yes" if is_harshad_number(n) else "No"

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
INF = float("inf")
sys.setrecursionlimit(10**7)

# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]


def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def is_harshad(x):
	X=x
	f=0
	while x > 0:
		f += x % 10
		x //= 10
#	print("X:", X, " f:", f)
	return X % f == 0

N=int(input())

res=is_harshad(N)

print("Yes" if res else "No")

Submission status: Accepted

Solution code:
#ABC080B
n=raw_input()
res=0
for i in xrange(len(n)):
 res+=int(n[i])
if int(n)%res==0:
 print 'Yes'
else:
 print 'No'

Submission status: Accepted

Solution code:
def b_harshad(N):
    num = [int(x) for x in list(str(N))]  # 数値Nを1桁ごとにバラす
    tmp = sum(num)
    ans = (N % tmp == 0)
    if ans:
        return 'Yes'
    else:
        return 'No'

N = int(input())
print(b_harshad(N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

k = 0
for i in range(0, len(s)):
  k += int(s[i])
if int(s) % k == 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:
# a = list(map(int, input().split()))　:スペース区切り入力

N = input()

L = len(N)
X = 0

for i in range(L):
    X += int(N[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def judge(number):
	if 0 <= number < 10:
		return number
	else:
		return judge(number // 10) + number % 10
		
if n % judge(n) == 0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
N = int(input()) 
m = N
i = 0
sum = 0
while N >= 10**i:
    i += 1

for j in range(i):
    sub = N // 10 ** (i -1 - j) 
    sum = sum + sub
    N = N - sub * (10 **(i - 1 - j))

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

Submission status: Accepted

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

N = int(input())
_N = N

size = len(str(N))

f = 0
while(size > 0):
    if(size > 1):
        f += int(N/(10**(size-1)))
        N %= 10**(size-1)
    else:
        f += N
    size -= 1

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

Submission status: Accepted

Solution code:
x = int(input())

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

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

Submission status: Accepted

Solution code:
s = input()
a = int(s)
b = 0
for ch in s:
    b += ord(ch) - ord('0')
print("Yes" if a % b == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    N_str = input()

    N = int(N_str)
    sum_digit = sum(map(int, list(N_str)))

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=int(input())
def digitsum(N) :
  s = str(N)
  array = list(map(int, list(s)))
  T = sum(array) 
  return T

U = digitsum(N)

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

Submission status: Accepted

Solution code:
s = raw_input()
print ['No', 'Yes'][int(s) % sum(map(int, list(s))) == 0]

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

Solution code:
n = raw_input()

tmp = 0

for i in n:
    tmp += int(i)

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

Submission status: Accepted

Solution code:
num = input()

trace = 0

for i in range(len(num)):
    trace += int(num[i])

if int(num) % trace == 0:
    print("Yes")

else :
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int, input()
num = str(N[1])
char_list = list(num)
sum = 0
for i in range(len(char_list)):
    sum += int(char_list[i])

if int(N[1]) % sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
X = input()
ff = 0
aa = X
for i in range(10):
   ff = ff + (aa%10)
   aa = aa/10
if X%ff == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

fx = 0
for c in N:
  fx += int(c)
n = int(N)

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

Submission status: Accepted

Solution code:
n = input()

m = 0
for x in n:
    m += int(x)

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

Submission status: Accepted

Solution code:
# coding: utf-8
num = int(input())
num2char = list(str(num))
harshad = 0

for item in num2char:
    harshad += int(item)

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

Submission status: Accepted

Solution code:

X = int(input())
x = X
b = 1
f = 0
digit = 8

for i in range(digit):
    f += x%(10)
    x = int(x / 10)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    s = input()
    t = 0
    for i in s:
        t += int(i)

    X = int(s)

    if X % t:
        print("No")
    else:
        print("Yes")


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n_str = input()
n = int(n_str)
n_length = len(n_str)
sum1 = 0
for i in range(n_length):
    n2 = int(n_str[i])
    sum1 = sum1 + n2

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

Submission status: Accepted

Solution code:
N = input()
N_list = [int(s) for s in N]
N = int(N)

f_x = sum(N_list)

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

Submission status: Accepted

Solution code:
# coding: utf-8

n=int(input())
tmp=n
cnt=0
while tmp>0:
    cnt+=tmp%10
    tmp=int(tmp/10)
if n%cnt==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

num = int(raw_input())
if num % dsum(num) == 0:
  print "Yes"
else:
  print "No"

Submission status: Accepted

Solution code:

import math

n = input_data = int(input().rstrip())

total = 0
while n != 0:
	total += n % 10
	n /= 10
	n = math.floor(n)

is_harshad = (input_data % total == 0)

if is_harshad == True:
	print('Yes')
else:
	print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x_str = input()
x = int(x_str)
digits = [int(a) for a in x_str]
fx = sum(digits)
if x % fx == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

inp = input()
N = int(inp)
N_len = len(inp)

a = []
goukei = 0
for i in range(N_len):
    goukei += int(inp[i])



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

Submission status: Accepted

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

if __name__ == '__main__':
    n = int(input())
    result = digitSum(n)
    #print(result)
    if(n%result==0):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def f(X):
    digitsum=0
    while(True):
        if X<1:
            break
        digitsum+=X%10
        X=int(X/10)
    return digitsum

if __name__=="__main__":
    N=int(input())
    if(N%f(N)==0):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = n
f = 0
while x != 0 :
    f += x%10
    x = x//10

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
X = N
wa = 0
while N != 0:
  wa += N % 10
  N = N // 10

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

Submission status: Accepted

Solution code:
import math
p = int(input())
p_size = int(math.log10(p) + 1)
q = str(p)
sum_p = 0
for a in range(p_size):
    sum_p = sum_p + int(q[a])
if p % sum_p == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys

DBG_FLAG = 0

def p_dbg(str):
    if(DBG_FLAG == 1):
        sys.stdout.flush()
        print str

in_text = raw_input()
N = int(in_text)
array = map(int,list(in_text))

p_dbg(array)

sum = 0

while len(array) > 0:
    item = array.pop()
    sum = sum + item

p_dbg(sum)

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

Submission status: Accepted

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

Submission status: Accepted

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

f=0
for s in list(A):
    f += int(s)

#print( A, N, f, list(A))

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

Submission status: Accepted

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

number = 0
for i in num:
    number += int(i)

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

Submission status: Accepted

Solution code:
# coding:utf-8
n = int(input())
original = n
num = []
while n != 0:
    num.append(n%10)
    n = int(n/10)
if(original%sum(num) == 0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
a = input()
c = list(map(int,list(a)))
s = sum(np.array(c))
if int(a)%s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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