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

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int):
    print(YES if not N % sum(map(int,list(str(N)))) else NO )
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

cnt = list(map(int,list(str(n))))

chk = sum(cnt)

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

Submission status: Accepted

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

def solve():
    N = input()
    X = int(N)

    total = 0
    while True:
        if len(N) == 0:
            break

        total += int(N[-1])
        N = N[:-1]
    
    if X%total == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
a = input()

totalsum = 0

for i in a:
    totalsum += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def abc():
    x = int(input())
    fx = sum(map(int, str(x)))
    print('No' if x % fx else 'Yes')


abc()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

B = N 
X = []

while B > 0:
    X.append(B%10)
    B //= 10

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

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

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

sys.setrecursionlimit(2147483647)
INF = float("inf")


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

Submission status: Accepted

Solution code:
A = int(input())
B = A
list=[]
while B > 0:
    list.append(B%10)
    B //=10
    #print(list)
if A % sum(list) == 0:
    print("Yes")
else :
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
X = N
f = 0
while N > 0:
    f += N % 10;
    N = int(N / 10)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
lst = list(n)
plus = 0
for i in lst:
    plus += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = N
while (N >= 1):
    sum += N % 10
    N //= 10

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

Submission status: Accepted

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

def F(x):
  if x < 10:
    return x
  return x%10 + F(x//10)

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

Submission status: Accepted

Solution code:
a = int(input())
b = str(a)
d = [i for i in b]
num_kei = 0
for j in d:
    num_kei += int(j)

def hantei(kazu,kazu_kei):
    if kazu % kazu_kei == 0:
        print("Yes")
    elif kazu % kazu_kei != 0:
        print("No")

hantei(a,num_kei)

Submission status: Accepted

Solution code:

N = int(input())

N_str = str(N)

summ = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

fx = 0
n1=n
while (n1>0):
  fx = fx + n1 % 10
  n1 = int(n1 / 10)
#print(fx)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
n = N
fx = 0
for i in range(8):
    fx += n%10
    n = n//10

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

Submission status: Accepted

Solution code:
N = int(input())

N_str = str(N)
N_keta = []
N_sum = 0

for i in range(len(N_str)):
    N_keta.append(int(N_str[i]))
N_sum = sum(N_keta)

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

Submission status: Accepted

Solution code:
N = int(input())

sums = 0
for i in str(N):
    sums += int(i)

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
num = n
while(n > 0):
  ans += n % 10
  n = n // 10
  
if num % ans == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
x = input()
#x = str(10**8)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:



def main():
    num = int(input())
    data = 0
    for ele in list(str(num)):
        data += int(ele)
    if num % data == 0:
        print('Yes')
    else:
        print('No')



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = input()
f = sum([int(x) for x in N])
if int(N) % f == 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])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
tmp = N
sum_ = 0
while(tmp > 0):
    sum_ += tmp % 10
    tmp //= 10
    # print(tmp)

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

Submission status: Accepted

Solution code:
n = int(input())
s = str(n)

sum = 0
for c in s:
  sum += int(c)

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

Submission status: Accepted

Solution code:
k=0
N=str(input())

array=list(map(int,N))
k=sum(array)

if int(N)%k==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()
total = 0
for i in n:
  total = total + int(i)

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

Submission status: Accepted

Solution code:
N = input() 
n = int(N)
a = 0;
b = 0;
d = n;
sum = 0;

while a != d:
  a = d % 10
  b = d - a
  d = b // 10
  sum += a;

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
su = 0
tmp = n
while True:
	su = su+(tmp%10)
	tmp = tmp // 10
	if(tmp <= 0):
		break
if(n%su==0):
	print("Yes")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
n = str(input())

flg = 'No'

kei = 0
for i in n:
    kei += int(i)
    
if int(n)%kei == 0 :
    flg = 'Yes'
print(flg)

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

n = N
sum_X = 0
while N > 0:
    sum_X += N % 10
    N = N // 10

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

Submission status: Accepted

Solution code:
n = input()
n1 = int(n)
n2 = int(sum([int(v) for v in list(n)]))

if n1 % n2 == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from sys import stdin
N=(stdin.readline().rstrip())
if int(N) % sum(list(map(int,list(N)))) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(n):
    a=0
    while n!=0:
        a += n%10
        n = int(n/10)
    return a
n = int(input())
if n%f(n)==0:
    print("Yes")
else:
    print("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 = 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())
i = n
total = 0
while(i>0):
  total += i%10
  i = i // 10
if n % total == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
n = input()
x = int(n)
fx = sum(map(int, list(n)))
print("YNeos"[(x/fx)%1!=0::2])

Submission status: Accepted

Solution code:
def main():
    N = input()
    print('YNeos'[not int(N) % sum(int(n) for n in N) == 0::2])


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 5)

X = int(input())

A = 0
k = 0
while True:
    a = X//(10**k)
    if a == 0:
        break
    A += a%10
    k += 1


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

Submission status: Accepted

Solution code:
N = int(input())

def digit_sum(x):
  s = 0
  while x:
    s += x%10
    x //= 10
  return s

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

Submission status: Accepted

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

sm=0
for x in _N:
  sm+=int(x)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections.abc import Iterable
from math import *
from itertools import *
from collections import *
from functools import *
from operator import *
try:
    from math import gcd
except Exception:
    from fractions import gcd

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(N: int):
    return YES if (N % sum([int(x) for x in str(N)]) == 0) else NO


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    result = solve(N)
    if isinstance(result, Iterable) and not isinstance(result, str):
        result = '\n'.join([str(v) for v in result])
    print(result)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x=input()

lx = [int(s) for s in x]
xsum=sum(lx)
if int(x)%xsum==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

s = 0
sN = str(N)
for i in range(len(sN)):
  s += int(sN[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
fx = 0
#print(n)
for i in n:
    fx += int(i)
nn = ''.join(n)
nnn = int(nn)
#print(fx)
#print(nnn)
if nnn%fx == 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()
N_list = list(N)
f = 0
for i in N_list:
    f += int(i)
if int(N) % f == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)

    # N の逆元
    # N_inv = pow(N,MOD-2,MOD)

    # nCr
    # Nの階乗 * rの階乗の逆元 * n-rの階乗の逆元
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")

    # 大きな素数
    MOD = 10**9+7
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    a = input()
    d = 0
    for a_i in a:
        d += int(a_i)
    if int(a) % d == 0:
        print('Yes')
    else:
        print('No')
        
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
x = input()
n = [int(i) for i in list(x)]
x = int(x)
print("Yes" if x % sum(n) == 0 else "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:
s = input()
total = 0
for i in range(len(s)):
    total+=int(s[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


def find_sum_of_digits(n):
    sum = 0
    while n >= 1:
        sum += n % 10
        n //= 10
    return sum


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

Submission status: Accepted

Solution code:
n = int(input())

sum = 0

for i in range(len(str(n))):
    sum += n // ( 10 ** i) % 10
    
if  n % sum == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 2019/05/08
# AtCoder Beginner Contest 080 - B

# Input
n = int(input())

# Init
wn = n
x = 0
while(wn > 0):
    x += wn % 10
    wn = int(wn / 10)

if n % x == 0:
    ans = "Yes"
else:
    ans = "No"

# Output
print(ans)

Submission status: Accepted

Solution code:
n=input()
l=len(n)
n=int(n)
m=0
for i in range(l):
  m+=(n//10**i)%10
  
if n%m==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
N = int(input())

f = 0
n = N
while n != 0:
    f += (n%10)
    n = n//10

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

Submission status: Accepted

Solution code:
X=list(input())
N=int(''.join(X))
x=0
for i in X:
	x+=int(i)
if N%x==0: print('Yes')
else: print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def has(a):
    a_list=[int(str(a)[i]) for i in range(len(str(a)))]
    return(sum(a_list))


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

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

Submission status: Accepted

Solution code:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    n = int(s)

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


solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def read_input():
    n = input()
    d = [int(c) for c in n]
    return int(n), d


def submit():
    n, d = read_input()

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

if __name__ == '__main__':
    submit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def check_hershad_number(n):
    sum = 0
    tem = n
    while tem > 0:
        sum += tem % 10
        tem //= 10
    return n % sum == 0

print('Yes' if check_hershad_number(n) else 'No')

Submission status: Accepted

Solution code:
n= int(input())
import copy
N = copy.copy(n)
fn = 0
while True:
    fn += n%10
    n = n//10
    if n == 0:
        break

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

Submission status: Accepted

Solution code:
# /usr/bin/python
# -*- coding: utf-8 -*-
import sys
import math



def fx(s):
  ret = 0
  for c in s:
    ret += int(c)
  return ret

if __name__ == "__main__":
  n = str(input())
  if int(n) % fx(n) == 0:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x = []
n = N
while True:
    x.append(n % 10)
    n //= 10
    if n == 0:
        break
if N % sum(x) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#ABC080B
N = input()
fxs=[N[i] for i in range(len(N))]
fxs=[int(j) for j in fxs]
fx=sum(fxs)
if int(N) % fx == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# ABC080B - Harshad Number
n = int(input())
fn = sum(list(map(int, list(str(n)))))
print("Yes" if n % fn == 0 else "No")

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
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:
x = input()
X = int(x)

Xsum = sum(map(int,list(str(X))))

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter

n = int(input())
hn = 0
for i in str(n):
    hn += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def digit_sum(x):
    res = 0
    while x != 0:
        res += x%10
        x //= 10
    return res
    
N = int(input())
if N % digit_sum(N) == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())

X = N
M = 0
while X > 0:
    M += X % 10
    X = X // 10

if N % M == 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:
# -*- coding: utf-8 -*-

n = input()
go = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
N2 = N
n = 0
for i in range(8):
    n += N2 % 10
    if N2 < 10:
        break
    N2 //= 10

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

Submission status: Accepted

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

Submission status: Accepted

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

if intN%har==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
N = int(input())
B = N
x = 0

while N > 0:
    x += N % 10
    #print(x)
    N //= 10

print('Yes' if B % x == 0 else '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 'No')

Submission status: Accepted

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

Submission status: Accepted

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


n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=i=int(input())
sum=0
while i/10>0:
  sum+=int(i%10)
  i=int(i/10)
print('Yes') if n%sum==0 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=int(input())
X=N
fx=0
while N!=0:
    fx+=N%10
    N=int(N/10)
if X%fx==0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
N = int(input())
f = 0
N_dammy = N

while N_dammy>0:
    f += N_dammy % 10
    N_dammy = int(N_dammy/10) 

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def sum_digits(n):
    r = 0
    while n / 10 > 0:
        r += n % 10
        n = math.floor(n/10)
    return r


if __name__ == '__main__':
    n = int(input())

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

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

Solution code:
n = input()

m = 0

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


S = li()
intS = map(int, S)

if int(''.join(S)) % sum(intS) == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()

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

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

Submission status: Accepted

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