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:
def digit_sum(num):
    total_num=0
    while num>0:
        total_num+=num % 10
        num//=10
    return total_num

N=int(input())
if N%digit_sum(N)==0 :
  print("Yes")
  exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding = SJIS

n = str(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:
import sys
input = sys.stdin.readline
N = int(input())
if N % sum(list(map(int, str(N)))) == 0: print("Yes")
else: print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

print('No' if int(N)%sum(map(int, N)) else 'Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = []

for i in range(len(str(n))):
    l.append(int(str(n)[i]))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#harshad number 
n = int(input()) 
flag = 0 
n_str = str(n) 
n_len = len(n_str) 
n_digit = 0 
for i in range(n_len):
    n_digit += int(n_str[i]) 

if n % n_digit == 0: 
    flag = 1



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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

f = False

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

if n % x == 0:
    f = True

if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#
# abc080 b
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """12"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """57"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """148"""
        output = """No"""
        self.assertIO(input, output)


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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

def main():
    n = int(input())
    a = list(str(n))
    A = [int(a[i]) for i in range(len(a))]
    A = sum(A)
    if n % A == 0:
        print('Yes')
    else: print('No')
    
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
def calc_sum_of_digits(num):
	ans = 0

	while True:
		if num // 10 == 0:
			ans += num
			break

		ans += num % 10
		num //= 10

	return ans



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

	sum_of_digits = calc_sum_of_digits(N)

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


  
if __name__ == "__main__":
  	main()

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = input()
print(['No','Yes'][int(X)%sum(int(T) for T in X)==0])

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = rr()
x = 0
for i in n:
    x += int(i)
n = int(n)
if n % x == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
N = input()

M = list(map(int, list(N)))

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

Solution code:
x = input()
a = int(x)
b = list(str(x))
b = list(map(int,b))
b = sum(b)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

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 = int(input())


def sum_of_num(num):
    list_a = []
    sums = 0
    while num > 0 :
        list_a.append(num % 10)
        num = num //10
    for i in range(len(list_a)):
        sums = sums + list_a[i]
    return sums

fx = sum_of_num(N)

if N % fx == 0:
    print('Yes')
if N % fx != 0:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
s = str(N)
x = 0
for c in s:
    x += int(c)
if N%x == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(x):
	q = 0
	c = x
	while(x):
	  q += x % 10
	  x /=10
	return c and c % q == 0
print 'Yes' if f(int(raw_input())) else 'No'

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
Nls = list(map(int,N))
f = 0
N = int(N)
for i in Nls :
    f += i
if N%f==0 :
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:

n=int(input())

def f(x):
    m=0
    while x>0:
        m+=x%10
        x=x//10
        
    return m
print("Yes" if n%f(n)==0 else "No")

Submission status: Accepted

Solution code:
n=int(input())
f=0
m=n
while m>0:
  f+=m%10
  m//=10
print(['No','Yes'][n%f==0])

Submission status: Accepted

Solution code:
N=int(input())
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)
if N%digitSum(N)==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
strX = str(X)
fX = 0
for i in range(len(strX)):
    fX += int(strX[i])
if X % fX == 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:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()
N = int(S)
M = sum([int(s) for s in S])

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = readline().strip()

    fN = sum(map(int, N))
    N = int(N)

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N=input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

def digit_sum(n):
    a = 0
    s = str(n)
    for digit in s:
        a += int(digit)
    return a

print(['No','Yes'][N % digit_sum(N) == 0])

Submission status: Accepted

Solution code:
#-------------
N = int(input())
#-------------
N_1 = N
F = []
while True :
  if N_1 != 0:
    F.append(N_1%10)
    N_1 = N_1//10
  else:
    break
ans = 0  
for i in range(len(F)):
  ans += F[i]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def sumsum(n):
  flag = True
  res = 0
  while flag:
    res += n % 10
    n = n //10
    if n == 0:
      flag = False
  return res

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

Submission status: Accepted

Solution code:
N=input()
a=int(N)
b=list(N)
sum=0

for i in b:
  sum+=int(i)
 
if a%sum==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    n = input()
    d = 0
    for c in n: d += int(c)
    if int(n) % d == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()

Submission status: Accepted

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

if N % sum([int(s) for s in N_str]) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
l = [int(a) for a in s]
print(["No", "Yes"][int(s) % sum(l) == 0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 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()
if int(N)%sum(int(i) for i in N):
  print('No')
else:
  print('Yes')

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

Submission status: Accepted

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

answer = False
x = n

h = []
while (x > 0):
    h.append(x % 10)
    x = int(x / 10)



f = 0

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

if n % f == 0:
    answer = True

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    n = int(input())
    nc = n
    ncsum = 0
    while nc:
        ncsum += nc % 10
        nc = nc // 10
    if n % ncsum == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

fx = 0
Nx = N
for i in range(8):
  fx += Nx % 10
  Nx = Nx // 10
if N % fx == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
nn = n
s = 0
while True:
    mod = n % 10
    s += mod
    n = n // 10
    if n == 0:
        break

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

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:
x=int(input())
li=list(str(x))
s=0
for i in li:
  s+=int(i)
if x%s==0:
  print("Yes")
else:
  print("No")

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 = sum([int(x) for x in n])

if int(n)%num is 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

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

a = n

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

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

Submission status: Accepted

Solution code:
n = input()
intn = int(n)
a = 0
for i in range(len(n)):
    a += int(n[i])
if intn % a == 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:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

    S = list(str(n))
    h = 0
    for s in S:
        h += int(s)
    if n%h == 0:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in str(n):
    sum += int(i)
    
if(n%sum==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:
# input
N = int(input())

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

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()
if int(N)%sum([int(x) for x in N])==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n=int(input())
a=0
m=n
if n==0:
    print("No")

else:
    
    while n>0:
        
        a=a+n%10
        n=n//10
    if m%a==0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
N = ""
M = 0

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

N = int(N)

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
N = 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:
def actual(N):
    f = lambda x: sum(map(int, str(N)))

    if N % f(N) == 0:
        return 'Yes'

    return 'No'


N = int(input())
print(actual(N))

Submission status: Accepted

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

Submission status: Accepted

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

# ハーシャッド数

N = int(input())
N_l = list(str(N))
h_x = 0

for x in N_l:
    h_x = h_x + int(x)

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

Submission status: Accepted

Solution code:
def f(X):
    a = 0
    for i in X:
        a += int(i)
    return  a

N = input()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = input()
arr = [int(c) for c in n]

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

Submission status: Accepted

Solution code:
x = int(input())

def div(x):
    r = 0
    while x > 0:
        a = x % 10
        r += a
        x //= 10
    
    return r

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

Submission status: Accepted

Solution code:
n = int(input())
ni = n
x = []
for i in range(10):
  x.append(ni // (10**(10 - i)))
  ni = n % (10 ** (10 - i))
x.append(ni % 10)
print('Yes' if n % sum(x) == 0 else 'No')

Submission status: Accepted

Solution code:
n=list(input())
suzi=int("".join(n))
for i in range(len(n)):
    n[i]=int(n[i])
if suzi%sum(n)==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 = input()

n = list(n)

fn = 0
for i in range(len(n)):
  fn += int(n[i])
  
n = ''.join(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
t = N
while 1:
    ans += t % 10
    t = t // 10
    if t == 0:
        break
print("Yes" if N % ans == 0 else "No")

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()

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

ans = 'Yes' if N % fN == 0 else 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

def findsum0fdigit(n):
    sum=0
    while n>0:
        sum+=n%10
        n//=10
    return sum
        
if n%findsum0fdigit(n)==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N=int(input())
temp=N
f=0
for i in range(8):
    f+=N%10
    N-=N%10
    N=N//10

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

Submission status: Accepted

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

Submission status: Accepted

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