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

#A
def A():
    n, a, b = LI()
    print(min(n*a,b))
    return

#B
def B():
    a = S()
    print(a.count("1"))
    return

#C
def C():
    n = II()
    a = list(str(n))
    a = list(map(int,a))
    if not n % sum(a):
        print("Yes")
    else:
        print("No")
    return

#D
def D():
    n = II()
    a = LI()
    ans = 0
    for a_ in a:
        while not a_ % 2:
            ans += 1
            a_ /= 2
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Accepted

Solution code:
n = int(input())

def f(num):
    nums = list(map(int, list(str(num))))
    if num % sum(nums) == 0:
        return True
    else:
        return False
print('Yes' if f(n) else 'No')

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    n,a,b = LI()
    print(min(n*a,b))
    return

#B
def B():
    s = S()
    print(s.count("1"))
    return

#C
def C():
    n = list(map(int, S()))
    k = 0
    s = sum(n)
    for i in range(len(n)):
        k *= 10
        k += n[i]
    if k%s == 0:
        print("Yes")
    else:
        print("No")
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#I
def I_():
    return

#J
def J():
    return

#Solve
if __name__ == "__main__":
    C()

Submission status: Accepted

Solution code:
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:
S = input()
print(["Yes", "No"][not(0 == int(S) % (sum(int(s) for s in S)))])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(str(n))
sl=[int(s[i]) for i in range(len(s))]
print("YNeos"[n%sum(sl)!=0::2])

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
def n(num):
  ret=0
  for i in range(10):
    ret+=int((num%(10**(i+1)))/(10**i))
  return ret

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while 1:
    tmp += n%10
    n = int(n/10)
    if n == 0:
        break

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

Submission status: Accepted

Solution code:
N = int(input())

result = []
memo = N
while memo > 0:
    result.append(memo % 10)
    memo //= 10

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
print('Yes' if int(n)%eval('+'.join(list(n)))==0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def f(N):
  s = 0
  while N > 0:
    s += N%10
    N //= 10
  return s

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

Submission status: Accepted

Solution code:
n = input().rstrip()
keta_sum = sum([int(item) for item in n])

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=input()
T=int(N)
N=sum(map(int,list(N)))
if T%N==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())
f = 0
tmp = N
for _ in range(9):
    f += N%10
    N //= 10
    if N == 0:
        break
print("Yes" if tmp % f == 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:
def f(n):
    x=0
    while n>0:
        x+=n%10
        n//=10
    return x

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):
    a = n
    b = 0
    while a != 0:
        b += a % 10
        a //= 10
    if n % b == 0:
        return 'Yes'
    else:
        return 'No'

N=int(input())
print(solve(N))

Submission status: Accepted

Solution code:
n = input()

n_ = int(n)
f = sum(map(int, list(n)))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

t = N + 0
c = 0
while 0 < t:#1の位のみ加算する
    c += t % 10
    t = t // 10

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

x = N
f = 0
while x != 0:
    f += x % 10
    x //= 10
print('Yes' if N % f == 0 else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
    res=0
    for s in x:
        res+=int(s)
    return res

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

Submission status: Accepted

Solution code:
def solve(string):
    n = string
    return "Yes" if int(n) % sum(map(int, n)) == 0 else "No"


if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007

#A
def A():
    n,a,b = LI()
    print(min(n*a,b))
    return

#B
def B():
    n = list(map(int,S()))
    s = sum(n)
    a = 0
    for i in n:
        a *= 10
        a += i
    if a%s == 0:
        print("Yes")
    else:
        print("No")
    return

#C
def C():
    n = I()
    f = LIR(n)
    po = [1]*11
    for i in range(n):
        k = 0
        p = 1
        for j in range(10):
            k += p*f[i][j]
            p *= 2
            po[j+1] = p
        f[i] = k
    p = LIR(n)
    ans = -float("inf")
    for i in range(1,1024):
        k = 0
        for j in range(n):
            c = i&f[j]
            s = 0
            for l in po:
                if c&l:s += 1
            k += p[j][s]
        ans = max(ans,k)
    print(ans)
#D
def D():
    n,C = LI()
    T = [[0 for i in range(100002)] for j in range(C)]
    for i in range(n):
        s,t,c = LI()
        c -= 1
        T[c][s] += 1
        T[c][t+1] -= 1
    for c in range(C):
        for i in range(100000):
            T[c][i+1] += T[c][i]
    ans = 0
    for i in range(100000):
        k = 0
        for c in range(C):
            if T[c][i]:k += 1
        ans = max(ans, k)
    print(ans)
#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Accepted

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

n = int(input())

def digit_list(num):
    num = str(num)
    num = list(num)
    num = list(map(int,num))
    return num

if n % sum(digit_list(n)) == 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 == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
fX = sum(int(c) for c in S)
X = int(S)
print("Yes" if X%fX == 0 else "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:
from sys import stdin
n = list(stdin.readline().rstrip())
if int(''.join(n))%sum(list(map(int, n)))==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#80
n = int(input())
fn = 0
temp = n
while temp>0:
    fn += temp%10
    temp = temp//10
if(n%fn==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# 080 B

N =str(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:
N = int(input())
num = N
div = 0
while num > 0:
    div += (num % 10)
    num //= 10
if N%div == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
x= list(map(int, input().split()))


#print(x[0])

y = str(x[0])
array = list(map(int, list(y)))

#print(sum(array))

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
s = input()
n = int(s)
each_n = [int(i) for i in s]
sum_n = sum(each_n)
if n % sum_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:
n = str(input())
fn = 0
for i in range(0,len(n)):
  fn += int(n[i])
if int(n)%fn==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
n = list(map(int,[i for i in str(N)]))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m=input()

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

if int(m)%sum==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 //= 10
ans = (N % f_x) == 0

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random


n = int(input())
n_list = list(str(n))

x = 0
for digit in n_list:
    x += int(digit)

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

Submission status: Accepted

Solution code:
n = int(input())
k = n
s = 0

while k != 0:
    s += k % 10
    k = k // 10
    
if n % s == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc080/tasks/abc080_b

import itertools
import collections
import bisect

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x: int) -> int:
    s = 0
    while x > 0:
        s += x % 10
        x //= 10
    return s


def harshad_number(N: int) -> bool:
    return N % f(N) == 0


if __name__ == "__main__":
    N = int(input())
    yes = harshad_number(N)
    print('Yes' if yes else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
  if x <= 0:
    return 0
  return (x%10)+f(x//10)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    n = N

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
f = sum(list(map(int, str(N))))
if 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 = int(input())
s = str(n)
f = 0
for i in s:
    f += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
N = int(input())

# 処理
cnt = 0
n = N
while n > 0:
  cnt += n % 10
  n //= 10

# 出力
if N % cnt == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def sum_digits(n):
    s = 0
    while n:
        s += n % 10
        n //= 10
    return s


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

Submission status: Accepted

Solution code:
N = int(input())
s = 0
for c in str(N):
    s += int(c)
print("YNeos"[N % s != 0::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def calc(num):
    total = 0
    while num > 0:
        total += num % 10
        num = num // 10
    return total

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

N=input()
fn = 0
for n in N:
    fn += int(n)

yn(int(N)%fn==0)

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = input()[:-1]
dig = 0
for c in N:
    dig += int(c)
if int(N) % dig == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = input()
X = int(N)
n = list(N)
sum = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = list(input())
s = sum([int(i) for i in S])
S = int(''.join(S))
print(['No', 'Yes'][S % s == 0])

Submission status: Accepted

Solution code:
#from collections import Counter
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:
hoge=input()
n=[int(i) for i in hoge]
print("Yes" if int(hoge)%sum(n)==0 else "No")

Submission status: Accepted

Solution code:
N = list(input())
n = int(''.join(N))
s = eval('+'.join(N))

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

Solution code:
A = int(input())
N = A
a = []
for i in reversed(range(len(str(N)))):
	a.append(int(N/10**(i)))
	N -= int(N/10**i)*10**i
X = sum(a)
if A % X == 0:
	print("Yes")
else:
	print("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:
N=input()
f=0
n=int(N)
for i in range(len(N)):
    f+=int(N[i])
if n%f==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print('Yes' if n % f== 0 else "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:
x = input()
FX = 0
for numb in x:
  FX += int(numb)
print("Yes" if int(x) % FX == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

mod = sum(int(list(str(n))[i]) for i in range(len(str(n))))

if n % mod == 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:
n = input()
fn = 0
for i in range(len(n)):
    fn += int(n[i])
print('Yes') if int(n)%fn == 0 else print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x: int):
    sum = 0
    for s in str(x):
        sum += int(s)
    return sum


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

    if n%sum == 0:
        return True
    else:
        return False

D = Harshad(N)

if D:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_harhed_number(x):
    y = x
    numbox = []
    while y >= 10:
        p = y % 10
        numbox.append(p)
        y //= 10
    if (x % (y + sum(numbox))) == 0:
        return 'Yes'
    else:
        return 'No'
N = int(input())
print(is_harhed_number(N))

Submission status: Accepted

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

for i in str(n):
    x += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
sum = 0

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

Submission status: Accepted

Solution code:
N = int(input())
def f(N):
    N_string = str(N)
    N_integer = [int(i) for i in N_string]
    N_sum = sum(N_integer)
    return(N_sum)
if(N%f(N)==0):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ten_sum(n):
    s = 0
    while n > 0:
        s += n % 10
        n = math.floor(n / 10)
    return s



import math
N = int(input())
num = ten_sum(N)

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