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_original =  int(input())
n = n_original
sum = 0
while n//10 != 0:
  sum += n%10
  n = n//10
sum += n
if n_original%sum==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())
a=sum(map(int, str(n)))
print("Yes" if n%a==0 else "No")

Submission status: Accepted

Solution code:
n = int(input())
m = n
r = 0
flg = True
while flg:
  a = n%10
  n //= 10
  r += a
  if n == 0:
    flg = False
if  m % r == 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:
n = int(input())
s = str(n)
f = 0
for c in s:
  f += int(c)
if n % f == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
N = int(input())

a = N
c = 0
while a > 0:
    c += a % 10
    a = int(a / 10)
if N % c == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

    sum = 0

    for digit in str(n):
        sum += int(digit)
    
    if n % sum == 0:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

if n%a==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())
X=str(N)
F=0
for i in range(len(X)):
    x=int(X[i])
    F+=x

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def query(n):
    ans = 0
    while n:
        ans += n % 10
        n //= 10
    return ans

def main():
    n = int(input())
    if n % query(n) == 0:
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=int(input())
    h=sum(list(map(int,list(str(N)))))
    YesNo(N%h==0)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

tmp = sum(map(int,list(N)))

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

Submission status: Accepted

Solution code:
n = input()

length = len(n)
s = 0
for a in range(0, length):
    s += int(n[a])

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

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i): is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#

def main():
    n = IS()
    x = int(n)
    fx = sum(int(ni) for ni in n)
    if x%fx==0: print('Yes')
    else: print('No')

if __name__ == '__main__':
    main()

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())
x = N
c = 0

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

if N % c == 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:
N = int(input())
x = N
sums = 0
while x > 0:
    sums += x%10
    x = x//10
if N%sums == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N=int(input())
def g(N):#桁数を返す
  i=0#桁数
  while N>=1:
    N=N/10
    i+=1
  return i

def f(N):
  j=g(N)
  S=0
  while j!=0:
    d=math.floor(N/(10**(j-1)))
    S+=d
    N-=d*(10**(j-1))
    j-=1
  return S
  
if N%f(N)==0:
  print("Yes")
else: print("No")

Submission status: Accepted

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

sum = 0

while N > 0:
    sum += N % 10
    N //= 10

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

Submission status: Accepted

Solution code:
N = int(input())

N_str = str(N)
N_sum = sum(list(map(int, N_str)))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sum_of_digits_while(x):
    total = 0

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

    return total


def actual(N):
    total = sum_of_digits_while(N)

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

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

Submission status: Accepted

Solution code:
def actual(x):
    sum_of_digits = sum([int(digit) for digit in str(x)])

    if x % sum_of_digits == 0:
        return 'Yes'
    else:
        return 'No'

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(n):

    ans = sum(map(int, list(n)))
    return "Yes" if int(n) % ans == 0 else "No"

if __name__ == "__main__":
    n = input()
    print(solve(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = int(input())
temp = data
num = 0

while True:
    
    if temp == 0:
        break
    
    num += temp%10
    temp //= 10

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

Submission status: Accepted

Solution code:
# region header
import sys
import math
from bisect import bisect_left, bisect_right, insort_left, insort_right
from collections import defaultdict, deque, Counter
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from heapq import heappop, heappush
from itertools import accumulate, groupby, product, permutations, combinations, combinations_with_replacement
from math import ceil, floor, factorial, log, sqrt, sin, cos
from operator import itemgetter
from string import ascii_lowercase, ascii_uppercase, digits
sys.setrecursionlimit(10**7)
rs = lambda: sys.stdin.readline().rstrip()
ri = lambda: int(rs())
rf = lambda: float(rs())
rs_ = lambda: [_ for _ in rs().split()]
ri_ = lambda: [int(_) for _ in rs().split()]
rf_ = lambda: [float(_) for _ in rs().split()]
INF = float('inf')
MOD = 10 ** 9 + 7
PI = math.pi
# endregion
N = ri()
f = sum([int(i) for i in str(N)])
print('Yes' if N % f == 0 else 'No')

Submission status: Accepted

Solution code:

N = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

s = sum([int(n) for n in N])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n=int(input())
    nn=str(n)
    cnt=0
    for i in nn:
        cnt+=int(i)
    if n%cnt==0:
        print('Yes')
    else:
        print('No')
    
resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
t = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def digits_sum(n):
    d = 0
    m = n
    while m:
        d += m % 10
        m //= 10
    return d


def is_harshad_number(n):
    if n % digits_sum(n) == 0:
        return True
    else:
        return False


N = int(input())

if is_harshad_number(N):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def keta_sum(num):
    juu = 0
    while num:
        juu += num%10
        num = num//10
    return juu


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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,sqrt
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7
#s=input().rstrip()

x=input().rstrip()
fx=sum(map(int,list(str(x))))
#print(fx)
if int(x) % fx ==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print('Yes') if int(N) % S == 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:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    m = n
    sumM = 0
    while m >= 1:
        sumM += (m % 10)
        m = m // 10
#        print(m)
#    sumM += m
#    print(sumM)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin


def find_sum_of_digits(n, base=10):
    _sum = 0
    while n>0:
        _sum += n%base
        n //= base
    return _sum


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    TF = 'Yes' if N%find_sum_of_digits(N)==0 else 'No'
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(TF)

Submission status: Accepted

Solution code:

n = int(input())
r = n
l= []
while n>=1 :
    l.append(n%10)
    n = n//10

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
X_list = list(str(X))
X_list = [int(X_list[i]) for i in range(len(X_list))]

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

Submission status: Accepted

Solution code:
n = int(input())
num = n
f = 0
while True:
    if num == 0:
        break
    f += num%10
    num = num//10

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

Submission status: Accepted

Solution code:
n = int(input())

total = 0
a = n

while a > 0:
    total += a % 10
    a //= 10

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

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

Submission status: Accepted

Solution code:
n = input()
digitSum = 0
for digit in n:
    digitSum += int(digit)

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

Submission status: Accepted

Solution code:
N= int(input())
F = 0
t = N
for i in range(9):
  a = N // (10**(8-i))
  F += a
  N = N - a*(10**(8-i))
if t % F== 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
n  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()

wa = sum([int(s) for s in str(n)])

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

Submission status: Accepted

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

N = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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, groupby
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
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

X = input()
N = len(X)
Y = int(X)
X_SUM = 0
for i in range(N):
	X_SUM += Y%10
	Y //= 10

print("Yes" if int(X)%X_SUM == 0 else "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 sys
import os
import math
import string
import collections

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = iss()
    sm = sum(map(int, N))
    print('Yes' if int(N) % sm == 0 else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# ABC080B

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

Submission status: Accepted

Solution code:

def f(n):
    sum_num = 0
    while n > 0:
        sum_num += n % 10 # 864 -> 4,  86 -> 6 , 8 -> 8
        n //= 10
    return sum_num

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())

def sum_digit(n):
  res=0
  while n:
    res+=n%10
    n//=10
  return res

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

Submission status: Accepted

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

Submission status: Accepted

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

if N%m == 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 = input()
ketawa = sum([int(c) for c in n])

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

Submission status: Accepted

Solution code:
N=input()
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:
N=input()
*A,=list(N)

i=0
while i<len(A):
    A[i]=int(A[i])
    i+=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

total = 0
for n in N:
    total += int(n)
if int(''.join(N)) % total == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_num = input()
num = int(str_num)
digits = [int(s) for s in str_num]
print("Yes" if num % sum(digits) == 0 else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
M=N
mod = 0
NL = []
res = 0
while N !=0:
    mod = N%10
    NL.append(mod)
    N = N//10
if M % sum(NL)==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())


def search(q):
    if q <= 9:
        return q
    return search(q // 10) + int(q % 10)


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

Submission status: Accepted

Solution code:
N=int(input())
N_list=list(str(N))

if len(N_list)==1:
    M=int(N_list[0])
    if N%M==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==2:
    I=int(N_list[0])+int(N_list[1])
    if N%I==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==3:
    U=int(N_list[0])+int(N_list[1])+int(N_list[2])
    if N%U==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==4:
    K=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])
    if N%K==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==5:
    O=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])
    if N%O==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==6:
    G=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])
    if N%G==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==7:
    W=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])+int(N_list[6])
    if N%W==0:
        print("Yes")
    else:
        print("No")
elif len(N_list)==8:
    S=int(N_list[0])+int(N_list[1])+int(N_list[2])+int(N_list[3])+int(N_list[4])+int(N_list[5])+int(N_list[6])+int(N_list[7])
    if N%S==0:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
a = int(input())
f = a//100000000+a//10000000%10+a//1000000%10+a//100000%10+a//10000%10+a//1000%10+a//100%10+a//10%10+a%10
if a%f==0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

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


n = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
import math


N = int(stdin.readline().rstrip())

def sum_of_digit(n):
    total = 0
    s = str(n)
    for i in range(len(s)):
        total = total + int(s[i:i+1])

    return total


def isHarshad(n):
    return n % sum_of_digit(n) == 0

if isHarshad(N):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

# 各桁の数字の和を返す関数
def sum_digits(num):
    sum = 0
    while num > 0:
        sum += num % 10
        num = num // 10
    return sum

if N % sum_digits(N) == 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=M//10
if N%sum==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
n_l = []
for i in range(len(n)):
    n_l.append(int(n[i]))
f = sum(n_l)
    
if int(n) % f == 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=int(input())
dsum=0
x=n
while x>0:
    dsum+=x%10
    x=int(x/10)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
strin=input()
intin=int(strin)
sum=sum([int(a) for a in list(strin)])
if not intin%sum:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def f(x):
  digits = list(str(x))
  sum_digits = 0
  for i in range(len(digits)):
    sum_digits += int(digits[i])
  return sum_digits

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

Submission status: Accepted

Solution code:
def resolve():
    N = input()
    ordsum = 0
    for c in N:
        ordsum += int(c)
    N = int(N)
    print("Yes" if N % ordsum == 0 else "No")
    

            

if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())


def calc_sum_of_digits(x):
    val_sum = 0
    while x > 0:
        x, mod = divmod(x, 10)
        val_sum += mod
    return val_sum


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

Submission status: Accepted

Solution code:
# solution
import io

data = input()
nim=sum(map(int,data))
print('Yes' if int(data)%nim==0 else 'No')

Submission status: Accepted

Solution code:
n = int(input())
def f(x):
    sum = 0
    for i in str(x):
        sum += int(i)
    return sum
if n%f(n) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

n = list(input())
tmp = 0
for i in range(len(n)):
    tmp += int(n[i])

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

Submission status: Accepted

Solution code:
N = int(input())

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