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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

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

    print("f:",f)
    print("N_dammy:",N_dammy)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
NList=[]
n = N
while n > 0:
    y = n % 10
    NList.append(y)
    n = n // 10
Nsum = sum(NList)
if Nsum == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
NList=[]
n = N
while n > 0:
    y = n % 10
    NList.append(y)
    n = y // 10
Nsum = sum(NList)
if Nsum == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
NList=[]
n = N
X = 10
while n > 0:
    y = n % X
    NList.append(y)
    n = y // X
    X = X * 10
Nsum = sum(NList)
if Nsum == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())
NList=[]
flag = True
n = N
X = 10
while flag:
    y = n % X
    NList.append(y)
    n = y // X
    X = X * 10
    if n == 0:
        flag = False
Nsum = sum(NList)
if Nsum == N:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())

result = []
while N > 0:
    result.append(N % 10)
    N //= 10
if N % sum(result) == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
a=0.037
time.sleep(x+a)
ls=[1 for i in range((n%15)*5*10**4)]
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
a=0.037
time.sleep(x+a)
ls=[1 for i in range((n%15)*10**4)]
print('Yes')

Submission status: Wrong Answer

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
a=0.037
#time.sleep(x+a)
ls=[1 for i in range((n%100)*10**4)]
print('Yes')

Submission status: Wrong Answer

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
a=0.037
time.sleep(x+a)
print('Yes')

Submission status: Wrong Answer

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
time.sleep(x)
print('Yes')

Submission status: Wrong Answer

Solution code:
import time

#n=int(input())

print('Yes')

Submission status: Wrong Answer

Solution code:
n=int(input())
print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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


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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
A = int(input())
N = A
a = []
for i in reversed(range(len(str(N)))):
	a.append(int(N/10**(i)))
	N -= int(N/10**i)*10**i
X = sum(a)
print(X)
print(a)
if A % X == 0:
	print("Yes")
else:
	print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#ABC 080 B - Harshad Number
n = int(input())
if n/sum([int(c) for c in str(n)]) ==0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
N = int(input())

def calcSumOfDigits(i):
    sum = 0
    for s in str(i):
        sum += int(s)
    return sum

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = int(input())

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

Submission status: Wrong Answer

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

if a % b == 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

if a % digits_sum == 0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
n = input()
digits_sum = sum(map(int, n.split()))
print(n)
print(digits_sum)

if int(n) == digits_sum:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

if (int(n)//t) == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if (t // int(n)) == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


def is_harshad(n):
    p = n
    tmp = 0
    while p >= 10:
        p, q = divmod(p, 10)
        tmp += q
    tmp += p
    print(tmp)
    if n % tmp == 0:
        return True
    else:
        return False


N = int(input())

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

Submission status: Wrong Answer

Solution code:
N=str(input())
print(N)
X=int(N)
fx=0
for i in range(0,len(N)):
    fx+=int(N[i])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input();print("NYoes"[int(s)%sum(map(int,s))==0::2])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
print("No" if N % len("%d" % N) else "Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=input()
print('YNeos'[int(s)%sum([int(c) for c in s])==0::2])

Submission status: Wrong Answer

Solution code:
s=input()
print('YNeos'[sum([int(c) for c in s])%int(s)==0::2])

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    f = 0
    for n in str(N):
        f += int(n)

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = input()
n = 0
for a in N:
    n += int(ord(a) - ord('1') + 1)
if int(N) % n == 0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
N = input()

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

Submission status: Wrong Answer

Solution code:
x = input()

fx = sum([int(num) for num in x])

print("YES" if int(x)%fx == 0 else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import sys
from math import sqrt

x = int(''.join([e for e in raw_input().split()]))
#print x

ans = 'No'
if x == int(sqrt(x))**2:
    ans = 'Yes'
    
sys.stdout.write('%s\n' % (ans))
sys.stdout.flush()

Submission status: Wrong Answer

Solution code:
a = input()
b = str(a)
ans = 0
for c in b:
    ans += int(c)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    n = int(input())
    m = n

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

    if m % div == 0 :
        print('YES')
    else :
        print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
s=input()
if int(s)%sum(map(int,list(s)))==0:
	print('YES')
else:
  	print('NO')

Submission status: Wrong Answer

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

def check_harshad(num):
    digit_sum = calcurate_digit_sum(num)
    if num % digit_sum == 0:
        return("yes")
    return("no")

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

x_int=[int(x)for i in list(x)]
for i in range(len(x_int)):
    y+=x_int[i]
    
if int(x)/y==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

@author: goto
"""
y=0
x=input()
print(type(x))
x_int=[int(x)for i in list(x)]
for i in range(len(x_int)):
    y+=x_int[i]
    
if int(x)/y==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
num = int(input())

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

print("YES" if num % fx == 0 else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
S = len(N)
sen = int(N) / 1000
hyaku =( int(N) - sen*1000 ) / 100
zyuu = (int(N) - sen*1000- hyaku*100) / 10
iti = int(N) - sen*1000- hyaku*100- zyuu*10

f = sen + hyaku + zyuu + iti

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

Submission status: Wrong Answer

Solution code:
#!/user/bin/python
# coding: UTF-8

N = input()
N_list = list(N)
N_int = int(N)
s = 0
for i in range(len(N_list)):
    N_list[i] = int(N_list[i])

for j in range(len(N_list)):
    s += N_list[i]

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Wrong Answer

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

if n % sum1 == 0:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

    X = int(s)

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


if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

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

if n % sum1 == 0:
    print('yes')
else:
    print('no')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N = int(input())

hutaketa = int(N/10)
hitoketa = N%10
goukei = hitoketa + hutaketa

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
N = int(input())
n = N
sumup = 0
while N != 0:
    print(N % 10)
    sumup += (N % 10)
    N = N // 10
#print(n, sumup)
if n % sumup == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if __name__=='__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    S = input()
    N = list(S)
    N = [int(x) for x in N]
    summation = sum(N)
    if summation % int(S) == 0:
        print("Yes")
    else:
        print("No")
       
      
solve()

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

Solution code:
Num = int(input())
check,check1 = 0,Num

while not 0 < check1 < 1:
    check += Num % 10
    check1 = int(check1 / 10 )

if (Num % check) == 0 :
    print('Yes')
else:
    print('No')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

Solution code:
import time

n=int(input())
x=(n%15)*0.001*100
a=0.037
#time.sleep(x+a)
ls=[1 for i in range((n%100)*10**6)]
print('Yes')

Submission status: Time Limit Exceeded

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

N = int(input())
dig = 0
while N:
    dig += N % 10
if N % dig == 0:
    print("Yes")
else:
    print("No")

Submission status: Time Limit Exceeded

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_harshad_number(x: int) -> bool:
    dividend = x
    sum_of_digits = 0

    for _ in range(len(str(x))):
        x, mod = divmod(x, 10)
        sum_of_digits += mod

    return dividend % sum_of_digits == 0


def answer(x: int) -> str:
    return 'Yes' if is_harshad_number(x) else 'No'


def main():
    x = int(input())
    print(answer(x))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)

n = int(input())

fx = sum([int(i) for i in str(n)])


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

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=input()
tmp=sum(map(int,list(n)))
print("No") if int(n)%tmp else print("Yes")

Submission status: Accepted

Solution code:
N = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def harshad(n):
    if n % sum(map(int, list(str(n)))) == 0:
        return True
    else:
        return False

N = int(input())
print('Yes' if harshad(N) else 'No')

Submission status: Accepted

Solution code:
n=int(input())

N=n

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

f = 0

str_N = str(N)

for i in str_N:
    f += int(i)

if N % f == 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 print('No')

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    X = N
    sum = 0
    while True:
        amari = N%10
        sum += amari
        #print(amari,sum)
        N //= 10
        if N == 0:
            break

    if X%sum == 0:
        return 'Yes'
    else:
        return 'No'

print(main())

Submission status: Accepted

Solution code:
N=int(input())

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

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

Submission status: Accepted

Solution code:
ipp = input()
n = [int(x) for x in ipp]
harshad = 0

for i in range(0, len(n)):
    harshad += n[i]

if int(ipp) % harshad == 0:
    print("Yes")
elif int(ipp) % harshad != 0:
    print("No")

Submission status: Accepted

Solution code:
n = int(input())

tmp, nx = 0, n
while nx:
    tmp += nx%10
    nx //= 10
    
if n % tmp:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
import sys

Nstr = sys.stdin.readline().strip()

digit_s = 0
for n_i in Nstr:
    digit_s += int(n_i)

if int(Nstr) % digit_s == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()
n_int = int(n)

n_sum = 0

for s in n:
    n_sum += int(s)

if(n_int%n_sum == 0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def digitSum(k):
  if k == 0:
    return 0
  else:
    return digitSum(k//10) + k % 10

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
m = list(n)

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

Submission status: Accepted

Solution code:
b=input()
f=int(b)
# a=input()
c=[]
# for i in range(b):
#     c.append(a[i])
#a = list(map(int,input().split()))
#b = list(map(int,input().split()))
N = 0
for i in range(len(b)):
    c.append(int(b[i]))
d = f//int(sum(c))
e = f/int(sum(c))

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

Submission status: Accepted

Solution code:
N = input().strip()
n = int(N)
fn = 0
for s in N:
    fn += int(s)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())


def keta_sum(N):
    if N < 10:
        return N
    else:
        return keta_sum(N // 10) + (N % 10)


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    f = 0
    for x in S:
        f += int(x)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

nn = str(n)
ha_num = 0
for i in nn:
    ha_num += int(i)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

num = input()
table = list(num)
total = 0
for i in range(len(table)):
    total += int(table[i])

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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