Problem:


Score : 200 points

Problem Statement

Find the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Constraints

1 \leq N \leq 10^4

1 \leq A \leq B \leq 36

All input values are integers.

Input

Input is given from Standard Input in the following format:

N A B

Output

Print the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).

Sample Input 1

20 2 5

Sample Output 1

84

Among the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.

Sample Input 2

10 1 2

Sample Output 2

13

Sample Input 3

100 4 16

Sample Output 3

4554



Sample input:
20 2 5


Sample output:
84

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    if A<=(i//10)+(i%10)<=B:
        ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    num = 10*i+j
    if num <= n and a<i+j and i+j<b :
      sum += num
print(sum)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    if 10*i+j <= n and a<=i+j and i+j<=b :
      sum += 10*i + j
print(sum)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    if 10*i+j <= n and a<i+j and i+j<b :
      sum += 10*i + j
print(sum)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
sum = 0
for i in range(10):
  for j in range(10):
    if 10*i+j==n and a<i+j and i+j<b :
      sum += 10*i + j
print(sum)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())

ans=0
i=1
while i<=N:
    X=i//10e4+i//1000%10+i//100%10+i//10%10+i%10
    ans+=i*(A<=X<=B)
    i+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    S = str(i)
    a = 0
    for s in S:
        a+=int(s)
    if A<=a<=B:ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
N_list=str(N)
num=0
for n in range(1,N+1):
    if len(N_list)==1:
        if A<=n<=B:
            num+=n
    if len(N_list)==2:
        if A<=((n//10)+(n%10))<=B:
            num+=n
    if len(N_list)==3:
        if A<=((n//100)+((n%100)//10)+(n%10))<=B:
            num+=n
    if len(N_list)==4:
        if A<=((n//1000)+((n%1000)//100)+((n%100)/10)+(n%10))<=B:
            num+=n
    if len(N_list)==5:
        if A<=((n//10000)+((n%10000)//1000)+((n%1000)/100)+((n%100)/10)+(n%10))<=B:
            num+=n
print(num)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
N_list=str(N)
num=0
for n in range(1,N+1):
    if len(N_list)==1:
        if A<=n<=B:
            num+=n
    if len(N_list)==2:
        if A<=((n//10)+(n%10))<=B:
            num+=n
    if len(N_list)==3:
        if A<=((n//100)+((n%100)//10)+(n%10))<=B:
            num+=n
    if len(N_list)==4:
        if A<=((n//1000)+((n%1000)//100)+((n%100)/10)+(n%10))<=B:
            num+=n
print(num)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int, input().split())
count = 0
for i in range(N):
  sum_ = 0
  for k in range(len(str(i))):
    sum_ = sum_ + int(str(i)[k])
  if sum_ >= A and sum_ <= B:
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
from sys import stdin

(n, a, b) = stdin.readline().rstrip().split()
n = int(n)
a = int(a)
b = int(b)

total=0
POW_MAX=4

for i in range(1, n+1):
    sub_total=0
    num = i
    for j in range(1, POW_MAX+1):

        mod = num % 10
        sub_total = sub_total + mod
        sho = num // 10
        num = sho
        if sho == 0:
            break
    if a <= sub_total and sub_total <= b:
        #print("n:%d sub_total:%d" % (i, sub_total))
        total = total + i

print(total)

Submission status: Wrong Answer

Solution code:
from sys import stdin

(n, a, b) = stdin.readline().rstrip().split()
n = int(n)
a = int(a)
b = int(b)

total=0
POW_MAX=4

for i in range(1, n+1):
    sub_total=0
    num = i
    for j in range(1, POW_MAX+1):

        mod = num % 10
        sub_total = sub_total + mod
        sho = num // 10
        num = sho
        if sho == 0:
            break
    if a <= sub_total and sub_total <= b:
        print("n:%d sub_total:%d" % (i, sub_total))
        total = total + i

print(total)

Submission status: Wrong Answer

Solution code:
from sys import stdin

(n, a, b) = stdin.readline().rstrip().split()
n = int(n)
a = int(a)
b = int(b)

total=0
POW_MAX=4

for i in range(1, n+1):
    sub_total=0
    num = i
    for j in range(1, POW_MAX):
        #sub_total = sub_total + math.floor(i / (10 ** j) )
        #sub_total = sub_total + i // (10 ** j)
        mod = num % (10 ** j)
        sub_total = sub_total + mod

        sho = num // (10 ** j)
        if sho == 0:
            break
        num = sho
    if a <= sub_total and sub_total <= b:
        #print("n:%d sub_total:%d" % (i, sub_total))
        total = total + i

print(total)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x /= 10
        
    return count
    
    
for n in range(1, N+1):
    count= FindSumOfDigits(n)
    if A<= count <=B:
        sum += n

print(sum)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x = x/10
    return count
    
    
for n in range(1, N+1):
    count= FindSumOfDigits(n)
    if A<= count <=B:
        sum += n

print(sum)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x /= 10
    return count
    
    
for n in range(1, N+1):
    count= FindSumOfDigits(n)
    if A<= count <=B:
        sum += n

print(sum)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x /= 10
    return count
    
    
for n in range(1, N+1):
    count= FindSumOfDigits(n)
    if A <= count <= B:
        sum += n

print(sum)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum = 0

def FindSumOfDigits(x):
    count = 0
    while x>0:
        count += x%10
        x /= 10
        return count
    
    
for n in range(1, N+1):
    count= FindSumOfDigits(n)
    if A <= count <= B:
        sum += n

print(sum)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())

i = 1
count = 0
for i in range(n+1):
    if(a <= i and b >= i):
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
N,A,B=(int(x) for x in input().split())

tot=0
for i in range(N+1):
    ketat=i//1e4+i//1e3+i//1e2+i//10+i%10
    # print("i,ketat=",i,ketat)
    if ketat>=A and ketat<=B:
        tot+=i
print(tot)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().rstrip().split(' '))

def count(n):
  x = str(n)
  sum=0
  for s in x:
    sum+=int(s)
  return sum
    
ans=0
for i in range(1,n+1):
  if(a <= count(i) and count(i) <=b):ans+=1

print(ans)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())

ans = 0
for i in range(1, N+1):
    i = str(i)
    if A <= sum([int(j) for j in i]) <= B:
        ans += 1 

print(ans)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
cnt = 0
for i in range(1, N + 1):
    total = 0
    str_i = str(i)
    len_i = len(str_i)
    for l in range(len_i):
        total += int(str_i[l])
    if A <= total <= B:
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sum([n for n in range(1, N + 1) if A <= sum(map(int, str(n))) <= B])

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
s = 0
j = 0
for i in range(1,N+1):
  j = i
  x0 = j // 10000
  j -= x0 * 10000
  x1 = j // 1000
  j -= x1 * 10000
  x2 = j // 100
  j -= x2 * 10000
  x3 = j // 10
  j -= x3 * 10000
  x4 = j
  if A <= x0 + x1 + x2 + x3 + x4 and B >= x0 + x1 + x2 + x3 + x4:
    s += i
print(s)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int, input().split())
x = sum(i for i in range(1, N+1) if A <= i//10+i%10 <= B)
print(x)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int, input().split())
x = sum(i for i in range(1, N) if A <= i//10+i%10 <= B)
print(x)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
sumn = 0
sumans = 0
for n in range(1,N+1):
    Ns = str(n)
    sumn = 0
    for i in range(len(Ns)):
        sumn = sumn + int(Ns[i])
    if A <= sumn and sumn <= B:
        sumans = sumans + n
        print(sumn)
print(sumans)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
A5=0
A4=0
A3=0
A2=0
A1=0
K=0
res=0
ans=[]
for i in range(N+1):
	K = i
	if K >= 10000:
		A5 = K//10000
		K= K - A5*10000
	if K >= 1000:
		A4 = K//1000
		K = K- A4*1000
	if K >= 100:
		A3 = K//100
		K = K- A3*100
	if K >= 10:
		A2 = K//10	
	A1 = K- A2*10	
	if A<=A5+A4+A3+A2+A1<=B:
		ans.append(i)
print(sum(ans))

Submission status: Wrong Answer

Solution code:
def colsum(n):
    ret = 0
    num = n
    while num >= 10:
        ret += n%10
        num //= 10
    ret += num
    return ret

def iim():return map(int,input().split())

n,a,b = iim()
cnt = 0
for i in range(1,n+1):
    if a <= colsum(i) <= b:
        cnt += i
print(cnt)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
n1 = 0
for i in range(1,n+1):
    
    s = str(i)    
    array = list(map(int, s))
    s1 = sum(array)
    if a <= s1 <= b:
        n1 = n1+i
        print(i)
print(n1)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
n1 = 0
for i in range(1,n):
    
    s = str(i)    
    array = list(map(int, s))
    s1 = sum(array)
    if a <= s1 <= b:
        n1 = n1+s1
print(n1)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
for i in range(1,n):
    n1 = 0
    s = str(n)    
    array = list(map(int, s))
    s1 = sum(array)
    if a <= n1 <= b:
        n1 = n1+s1
print(n1)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int,input().split())

ans = 0
for x in range(n+1):
    x_1 = x
    x_2 = x//10 + x%10
    x_3 = x//100 + x_2
    x_4 = x//1000 + x_3
    x_5 = x//10000 + x_4
    if a<=x_1 and x_1<=b and x<10:
       ans += x
    elif a<=x_2 and x_2<=b and 10<=x and x<100:
       ans += x
    elif a<=x_3 and x_3<=b and 100<=x and x<1000:
       ans += x
    elif a<=x_4 and x_4<=b and 1000<=x and x<10000:
       ans += x
    elif a<=x_5 and x_5<=b and 10000<=x and x<=100000:
       ans += x

print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int,input().split())

ans = 0
for x in range(n+1):
    x_1 = x
    x_2 = x//10 + x%10
    x_3 = x//100 + x_2
    x_4 = x//1000 + x_3
    x_5 = x//10000 + x_4
    if a<=x_1 and x_1<=b and x<10:
       ans += x
    elif a<=x_2 and x_2<=b and 10<x and x<100:
       ans += x
    elif a<=x_3 and x_3<=b and 100<x and x<1000:
       ans += x
    elif a<=x_4 and x_4<=b and 1000<x and x<10000:
       ans += x
    elif a<=x_5 and x_5<=b and 10000<x and x<100000:
       ans += x

print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int,input().split())

ans = 0
for x in range(n+1):
    x_1 = x
    x_2 = x//10 + x%10
    x_3 = x//100 + x_2
    x_4 = x//1000 + x_3
    x_5 = x//10000 + x_4
    if a<=x_1 and x_1<=b and x<10:
       ans += x
    elif a<=x_1 and x_2<=b and 10<x<100:
       ans += x
    elif a<=x_1 and x_3<=b and 100<x<1000:
       ans += x
    elif a<=x_1 and x_4<=b and 1000<x<10000:
       ans += x
    elif a<=x_1 and x_5<=b and 10000<x<100000:
       ans += x

print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int,input().split())

ans = 0
for x in range(n+1):
    x_1 = x
    x_2 = x//10 + x%10
    x_3 = x//100 + x//10 + x%10
    x_4 = x//1000 + x//100 + x//10 + x%10
    x_5 = x//10000 + x//1000 + x//100 + x//10 + x%10
    if a<=x_1 and x_1<=b and x<10:
       ans += x
    elif a<=x_1 and x_2<=b and 10<x<100:
       ans += x
    elif a<=x_1 and x_3<=b and 100<x<1000:
       ans += x
    elif a<=x_1 and x_4<=b and 1000<x<10000:
       ans += x
    elif a<=x_1 and x_5<=b and 10000<x<100000:
       ans += x

print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
count = 0

for i in range(n):
  check = (i+1)//10000 + (i+1)//1000 + (i+1)//100 + (i+1)//10 + (i+1)%10
  if check >= a:
    if check <= b:
      count += (i+1)
      print (i+1)
      
print(count)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
    k = str(i)
    if len(k) == 1:
        S = int(k[0])
        if A<=S<=B:
            ans += i
    elif len(k) == 2:
        S = int(k[0])+int(k[1])
        if A<=S<=B:
            ans += i
    elif len(k) == 3:
        S = int(k[0])+int(k[1])+int(k[2])
        if A<=S<=B:
            ans += i
    elif len(k) == 4:
        S = int(k[0])+int(k[1])+int(k[2])+int(k[3])
        if A<=S<=B:
            ans += 1
    else:
        S = 1
        if A<=S<=B:
            ans += i
print(ans)

Submission status: Wrong Answer

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

N,A,B = map(int, input().split())
total = 0
for i in range(1,N+1):
    sum = keta(i)
    if sum >= A and sum <= B:
        total += i
print(total)

Submission status: Wrong Answer

Solution code:
n,a,b=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
  i1=i//10000
  i2=i//1000%10
  i3=i//100%10
  i4=i//10%10
  i5=i%10
if i1+i2+i3+i4+i5>=a and i1+i2+i3+i4+i5<=b:
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
  i1=i//1000
  i2=i//100%10
  i3=i//10%10
  i4=i%10
  if i1+i2+i3+i4>=a and i1+i2+i3+i4<=b:
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

INF = float('inf')


def number2digits(number):
    return list(map(int, str(number)))


def sum_of_digits(number):
    sum = 0
    while number > 0:
        sum += number % 10
        number /= 10
    return sum


def main():
    N, A, B = map(int, input().split())
    ans = 0
    for number in range(1, N+1):
        total = sum_of_digits(number)
        if A <= total <= B:
            ans += number

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())

ans=0
for i in range(n):
  num=str(i+1)
  sm=0
  for j in num:
    sm+=int(j)
  if a<=sm<=b:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())

count = 0
for i in range(1,n+1) :
	s = str(i)
	l = len(s)
	x = 0
	for j in range(l):
		x += int(s[j])

	if 	x >= a and x <= b:
		print(i)
		count += i

print(count)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())

count = 0
for i in range(1,n+1) :
	s = str(i)
	l = len(s)
	x = 0
	for j in range(l):
		x += int(s[j])
	if 	x >= a and x <= b:
		print(i)
		count += i

print(count)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
sum = 0
count = 0
for i in range(1,n+1) :
	s = str(i)
	l = len(s)
	sum = 0
	for j in range(l):
		sum += int(s[j])
	if 	sum >= a and sum <= b:
		print(i)
		count += i

print(count)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())

allsum = 0

for i in range(1,n+1):
  l = list(str(i))
  li = [int(s) for s in l]
  tmpsum = sum(li)
  print (tmpsum)
  #for s in range(0,len(l)):
  #  print(s)
  if ((tmpsum >= a) and (tmpsum <= b)):
    print("ok")
    allsum = allsum + i
print(allsum)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
ans = 0
for i in range(1,n+1):
  if a <= sum(list(map(int, list(str(i))))) <= b:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
#print('start')

N, A, B = map(int, input().strip().split())

#print('{} {} {}'.format(N,A,B))

total = 0

def keta_calc(N, A, B):
    N_1 = N % 10
    #print(N_1)
    
    N_10 = (N % 100)//10
    #print(N_10)
    
    N_100 = (N % 1000)//100
    #print(N_100)
    
    N_1000 = (N % 10000)//1000
    #print(N_1000)
    
    keta_wa = N_1 + N_10 + N_100 + N_1000

    if((keta_wa >= A) and ( B >= keta_wa)):       
        #print('[OK] N={}, A={}, B={}, keta_wa={} N_1={}, N_10={}, N_100={}, N_1000={}'.format(N, A,B, keta_wa, N_1, N_10, N_100, N_1000))
        return N
    else:
        #print('[NG] N={}, A={}, B={}, keta_wa={} N_1={}, N_10={}, N_100={}, N_1000={}'.format(N, A,B, keta_wa, N_1, N_10, N_100, N_1000))
        return 0
    
for i in range(N+1):
    total += keta_calc(i, A, B)

print(total)

Submission status: Wrong Answer

Solution code:
n, r_from, r_to = [int(v) for v in input().split(' ')]
ans = 0
for nn in range(1, n + 1):
  ad_digit = 0
  tmp = nn
  while True:
    ad_digit += tmp % 10
    tmp //= 10
    if tmp == 0:
      break
  if r_from <= ad_digit and ad_digit <= r_to:
  	ans += ad_digit
    
print(ans)

Submission status: Wrong Answer

Solution code:
N,A,B=map(int,input().split())
ans=0
for i in range(N+1):
  if A<=sum(map(int,str(i)))<=B:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
  if a <= sum(list(map(int, list(str(i))))) <= b:
    ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())

Num = 0
for i in range(1, N+1):
    List = [int(a) for a in list(str(i))]
    if A <= sum(List) <= B:
        Num += 1

print(Num)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())

Num = 0
for i in range(N+1):
    List = [int(a) for a in list(str(i))]
    if A <= sum(List) <= B:
        Num += 1

print(Num)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
wa=0
ds=0

for i in range(1,n+1):
    tmp=i
    for j in range(1,6):
        c=tmp//pow(10,j)
        if c<10:
            ds+=c
            tmp=tmp-c*pow(10,j)
    ds+=i%10

    if a<=ds and ds<=b:
        wa+=i
    ds=0
print(wa)

Submission status: Wrong Answer

Solution code:
N,a,b = map(int, input().split())
ans = 0
sum = 0
for i in range(1,N+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if a <= sum <= b:
    ans = ans + i

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
total = 0

for i in range(n):
    s = str(i + 1)
    x = sum(list(map(int, s)))
    if x >= a & x <= b:
        total += x

print(total)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())

cnt=0
for i in range(1,n+1):
  ss=str(i)
  x=0
  for s in ss:
    x+=int(s)
  if x>=a and x <= b:
    cnt+=1
    
print(cnt)

Submission status: Wrong Answer

Solution code:
N,a,b = map(int, input().split())
ans = 0
for i in range(1,N+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if a <= sum <= b:
    ans = ans + i

print(ans)

Submission status: Wrong Answer

Solution code:
N,a,b = list(int(x) for x in input().split())
ans = 0
for i in range(1,N+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if sum >= a and sum <= b:
    ans = ans + i

print(ans)

Submission status: Wrong Answer

Solution code:
N,a,b = list(int(x) for x in input().split())
ans = 0
for i in range(N+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if sum >= a and sum <= b:
    ans = ans + i

print(ans)

Submission status: Wrong Answer

Solution code:
N = list(int(x) for x in input().split())
ans = 0
for i in range(N[0]+1):
  m = int(i/1000)
  n = int((i%1000)/100)
  j = int((i%100)/10)
  k = i%10
  sum = m + n + j + k 
  if sum >= N[1] and sum <= N[2]:
    ans = ans + i
    
print(ans)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
count = 0
num1  = 0
num2  = 0
for i in range(1, N + 1):
    if i < 10:
        if i >= A and i <= B:
            count = count + i
    else:
        num1 = str(i)[0]
        num2 = str(i)[1]
        num = int(num1) + int(num2)
        if num >= A and num <= B:
            count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())

count = 0
num1  = 0
num2  = 0

for i in range(1, N + 1):
    if i < 10:
        if i >= A and i <= B:
            count = count + i
    else:
        num1 = str(i)[0]
        num2 = str(i)[1]
        num = int(num1) + int(num2)
        if num >= A and num <= B:
            count = count + i
            
print(count)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
sum = 0
for k in range(1,n+1):
    kakuketa = k//10 + k%10
    if kakuketa >= a and kakuketa <=b:
        sum += k
        print(sum)
    else:
        continue
print(sum)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int, input().split())
x = []
for i in range(n+1):
    y = 0
    y += i//10000
    y += i//1000
    y += i//100
    y += i//10
    y += i%10
    if(a <= y <= b):
        x.append(i)

print(sum(x))

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
ans = 0
for i in range(1,N+1):
  K = str(i)
  if len(K) == 1:
    if A<=int(K[0])<=B:
      ans += i
  elif len(K) == 2:
    if A<=int(K[0])+int(K[1])<=B:
      ans += i
  elif len(K) == 3:
    if A<=int(K[0])+int(K[1])+int(K[2])<=B:
      ans += i
  elif len(K) == 4:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])<=B:
      ans += i
  elif len(K) == 1:
    if A<=int(K[0])+int(K[1])+int(K[2])+int(K[3])+int(K[4])<=B:
      ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
def DigitsSUM(Num):
    sumN = 0
    while Num > 0:
        sumN += int(Num) % 10
        Num /= 10
    return int(sumN)


N,A,B = input().split()
LowerLimit=int(A)
UpperLimit=int(B)
num = int(N)
sumary = []
counter = 0
for i in range(1,num+1):
    sumN = DigitsSUM(i)
    
    if LowerLimit <= sumN and sumN <= UpperLimit:
        counter+=int(i)
        print(i, sumN)
        
print(counter)

Submission status: Wrong Answer

Solution code:
def DigitsSUM(Num):
    sumN = 0
    while Num > 0:
        sumN += Num % 10
        Num/=10
    return int(sumN)


N,A,B = input().split()
LowerLimit=int(A)
UpperLimit=int(B)
num = int(N)
sumary = []
counter = 0
for i in range(1,num+1):
    sumN = DigitsSUM(i)
    if LowerLimit <= sumN and sumN <= UpperLimit+1:
        print(i, sumN)
        counter+=int(i)
        
print(counter)

Submission status: Wrong Answer

Solution code:
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N+1):
  if A <= sum([int(s) for s in str(i)]) <= B:
    res += i
print(i)

Submission status: Wrong Answer

Solution code:
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N+1):
  if A <= sum(int(s) for s in str(i)) <= B:
    res += i
print(i)

Submission status: Wrong Answer

Solution code:
N, A, B = list(map(int, input().split()))
res = 0
for i in range(N+1):
  if A <= sum([int(s) for s in str(i)]) <=B:
    res += 1
print(res)

Submission status: Wrong Answer

Solution code:
a =list(map(int,input().split()))
x=a[0]
y=a[1]
z=a[2]
t=0
for i in range(1,x+1):
	if i//1000+((i//100)%10)+((i//10)%10)+(i%10)>=y and i//1000+((i//100)%10)+((i//10)%10)+(i%10)<=z:
		t=t+i
print(t)

Submission status: Wrong Answer

Solution code:
a =list(map(int,input().split()))
x=a[0]
y=a[1]
z=a[2]
t=0
for i in range(1,x):
	if i//1000+((i//100)%10)+((i//10)%10)+(i%10)>=y and i//1000+((i//100)%10)+((i//10)%10)+(i%10)<=z:
		t=t+i
print(t)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
total = 0
for i in range(1, n+1):
    x = sum([int(j) for j in str(i)])
    if a <= x <= b:
        total += x
print(total)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
s = sum(int(x) for x in str(n))
count = 0
for i in range(1, n+1):
    if a <= s <= b:
        count += i
print(count)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int,input().split())
ans = 0
for i in range(int(N)+1):
    array = list(map(int,list(str(i))))
    print(array)
    if(sum(array)>=A and sum(array)<=B):
        ans += int(i)
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
c = 0
for i in range(1,n+1):
    if a <= i//10000 + (i//1000)%10 + (i//100)%10 + (i//10)%10 + i&10 <= b:
        c = c + i
print(c)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for x in range(n + 1):
    sum = 0
    temp = x
    for id in range(4):
        sum += temp % 10
        if temp < 10: break
        else: temp //= 10
    if a <= sum <= b: ans += x
print(ans)

Submission status: Wrong Answer

Solution code:
class Somesomes:
  def sum(self, num_list):
    result_dict={}
    for n in num_list:
      add_num = 0
      num_str = list(str(n))
      for l in num_str:
        add_num +=int(l)
      result_dict[n]=add_num
    return result_dict

  def extract_num(self, num_dict, start, end):
    extract_list=[]
    print(num_dict)
    for n in num_dict.keys():
      if start <= num_dict[n] <= end:
        extract_list.append(n)
    return extract_list

  def sum_result(self, result_extract):
    result_sum = 0
    for r in result_extract:
      result_sum +=r
    return result_sum

if __name__ == '__main__' :
  I=list(map(int, input().split()))
  N = I[0]
  A = I[1]
  B = I[2]
  num_list=[]
  for n in range(N):
    num_list.append(n+1)
  somesomes = Somesomes()
  result_dict=somesomes.sum(num_list)
  result_extract = somesomes.extract_num(result_dict, A, B)
  result_sum = somesomes.sum_result(result_extract)
  print(result_sum)

Submission status: Wrong Answer

Solution code:
s=[[int(j) for j in input().split()] for i in range(1)]
n=s[0][0]
a=s[0][1]
b=s[0][2]
ans=0
for i in range(1,n+1,1):
    n1=i // 1000
    n2=(i-n1*1000) // 100
    n3=(i-n1*1000-n2*100) // 10
    n4=i-n1*1000-n2*100-n3*10
    sum=n1+n2+n3+n4
    if sum>=a and sum<=b:
        ans+=n1*1000+n2*100+n3*10+n4
print(ans)

Submission status: Wrong Answer

Solution code:
n,a,b = map(int,input().split())
ans = 0
for i in range(2):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        for m in range(10):
          if i*10000+j*1000+k*100+l*10+m <= n and a <= i+j+k+l+m <= b:
            ans += 1
print(ans)

Submission status: Wrong Answer

Solution code:
## coding: UTF-8
s = input().split()
t = [int(p) for p in s]
#print(t)
N = t[0]
A = t[1]
B = t[2]

def some(k): # 各位の桁の和を算出する
    if(k < 10): # 1の位しかない
        return int(k)
    elif(10 <= k < 100): # 1の位と10の位
        one = k % 10 # 1の位
        ten = (k - one) / 10 # 10の位
        return int(one + ten)
    elif(100 <= k < 1000): # 1の位と10の位と100の位
        one = k % 10 # 1の位
        ten = (k - one) % 100 / 10 # 10の位
        hundred = (k - ten * 10 - one) / 100 # 100の位
        return int(one + ten + hundred)
    else: # 1の位と10の位と100の位と1000の位
        one = k % 10 # 1の位
        ten = (k - one) % 100 / 10 # 10の位
        hundred = (k - ten * 10 - one) % 1000 / 100 # 100の位
        thousand = (k - hundred * 100 - ten * 10 - one) / 1000 # 1000の位
        return int(one + ten + hundred + thousand)

'''
print(some(92)) # 11
print(some(14)) # 5
print(some(8)) # 8
print(some(893)) # 20
print(some(110)) # 2
print(some(999)) # 27
print(some(1000)) # 1
print(some(1234)) # 10
print(some(2580)) # 15
print(some(9800)) # 17
'''
sum = 0
for i in range(1,N+1):
    if(A <= some(i) and some(i) <= B):
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
n,a,b=map(int,input().split())
ans=0
for i in range(1,n+1):
  c=sum([int(j) for j in list(str(i))])
  if c>=a and c<=b:
    ans+=i
print(i)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int, input().split())
ret = 0
for i in range(N):
  s = sum([int(c) for c in str(i)])
  if A <= s and s <= B:
    ret += 1
print(ret)

Submission status: Wrong Answer

Solution code:
N,A,B = map(int, input().split())
ret = 0
for i in range(N):
  c = sum([int(c) for c in str(i)])
  if A <= c and c <= B:
    ret += 1
print(ret)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    m = 0
    while i != 0:
        m += int(i % 10)
        i = int(i / 10)
    if a <= m <= b:
        ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    m = 0
    while i != 0:
        m += int(i % 10)
        i = int(i / 10)
    if a <= m <= b:
        ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    m = 0
    while i != 0:
        m += int(n % 10)
        i = i / 10
    if a <= m <= b:
        ans += m
print(ans)

Submission status: Wrong Answer

Solution code:
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
    a = i % 10
    b = (i - a) % (10 ** 2) //10
    c = (i - 10 * b - a) % (10 ** 3) //100
    d = (i - 100 * c - 10 * b - a) % (10 ** 4)/1000
    if A <= a + b + c + d <= B:
        ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
li = list(map(int, input().split()))
ans = 0
for i in range(li[0]):
  i += 1
  s = sum(list(map(int, str(i))))
  if s >= li[1] and s <= li[2]: ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
li = list(map(int, input().split()))
ans = 0
for i in range(li[0] + 1):
  s = sum(list(map(int, str(i))))
  if s >= li[1] and s <= li[2]:
    ans += s
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    num = list(map(int, input().split()))
    total_sum = 0
    print(num[0])
    for i in range(1,num[0]+1):
        current = i
        current_sum=0
        while i >=1:
            current_sum += int(i %10)
            i = int(i/10)
        if ((current_sum >= num[1]) and (current_sum <= num[2])):
            total_sum += current
    print(total_sum)
main()

Submission status: Wrong Answer

Solution code:
def main():
    num = list(map(int, input().split()))
    total_sum = 0
    print(num[0])
    for i in range(1,num[0]+1):
        current = i
        current_sum=0
        while i>0:
            current_sum += int(i %10)
            i = int(i/10)
        if ((current_sum >= num[1]) and (current_sum <= num[2])):
            total_sum += current
    print(total_sum)