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: Runtime Error

Solution code:
n, a, b = map(int, [input() for i in range(3)])

def func(m):
  s = 0
  while(m > 0):
    s = s + (m % 10)
    m = m//10
  return int(s)

cnt = 0

for i in range(n+1):
  S = func(i)
  if a <= S <= b:
    cnt += i

print(cnt)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split)
List = []
for i in range(1, N+1):
  f1 = i // 100
  f2 = (i - 100 * f1) // 10
  f3 = (i - 100 * f1 - 10 * f2) 
  s1 = f1 + f2 + f3
  List.append(s1)
for i in List:
  if not A <= i <= B:
    List.remove(i)
s2 = sum(List)
print(s2)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split)
List = []
for i in range(1, N+1):
  f1 = i // 100
  f2 = (i - 100 * f1) // 10
  f3 = (i - 100 * f1 - 10 * f2) 
  s1 = f1 + f2 + f3
  List.append(s1)
for i in List:
  if not A <= i <= B:
    List.del[i]
s2 = sum(List)
print(s2)

Submission status: Runtime Error

Solution code:
N, A, B = [int(input()) for i in range(3)]
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
 
print(ans)

Submission status: Runtime Error

Solution code:
N, A, B = [int(input()) for i in range(3)]
 
ans = 0
for i in range(0, N+1):
    tmp=i
    sum=0
    while(tmp>0):
        sum += tmp%10
        tmp = int(tmp/10)

    if A<=sum and sum<=B:
        ans+=i
        print(i)
 
print(ans)

Submission status: Runtime Error

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

print(sum(i for i in range(1,N+1) if A<= sum(map(int, str(i))) <= B)

Submission status: Runtime Error

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

print(sum(i for i in range(1,N+1)) if A<= sum(map(int, str(i))) <= B)

Submission status: Runtime Error

Solution code:
n,a,b = map(int,input().split())
t = 1
ans = 0
while t <=n:
  a = str(t)
  b = list(map(int,a))
  s = sum(b)
  if a <= s <= b:
    ans += s
print(ans)

Submission status: Runtime Error

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

def digidsum(x):
  s = str(n)
  array_list = list(map(int,s))
  return sum(array_list)



for i in range(n):
  if sum(i+1) >= a and sum(i+1) <= b:
    cnt += i
print(cnt)

Submission status: Runtime Error

Solution code:
import sys
def main():
    input = sys.stdin.readline
    N, A, B = map(int,input.split())
    #print('N:%d A:%d B: %d' % (N,A,B)) 

    answer = []
    for i in range(N+1):
        s = sum( map(int,list(str(i)) )) # list of int -> sum
        if s >= A and s <= B: answer.append(i)
        #print('i:%d s:%d' % (i,s))
    print(sum(answer))

if __name__ == "__main__":
    main()

Submission status: Runtime Error

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

result = 0
for n in range(N):
    sm = 0
    for i in range(len(n)):
        sm += n[i]
    if A<=sm<=B:
        result += 1

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = int(input())
b = int(input())
ans = 0

for i in range(1, n+1):
    s = 0
    num = i
    while num > 0:
        s = s + num % 10
        num = num // 10
    if a <= s <= b:
        ans = ans + i
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = int(input())
b = int(input())
ans = 0

for i in range(1, n+1):
    s = 0
    num = i
    while num > 0:
        s = s + num % 10
        num = num // 10
    if a <= s and s <= b:
        ans = ans + i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N, A, B = list(map(int, input().rstrip().split(' ')))
LIST_RESULT = []

for i in range(1, N+1):
    str_i = str(i)
    l = len(str_i)

    sum = 0
    for x in range(l):
        sum += int(str_i[x])
    if A <= sum and sum <= B:
        LIST_RESULT.append(sum)

sum_result = sum(LIST_RESULT)
print(sum_result)

Submission status: Runtime Error

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

count=1
sum=0
while count<=n :
    ts=int(count/10000)
    s=int(count/1000)
    h=int(count/100)
    t=int(count/10)
    o=count%10
    if ts+s+h+t+o >= a and ts+s+h+t+o <= b:
        sum += count
    count += 1

print(sum)

Submission status: Runtime Error

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

count=1
sum=0
while count<=n :
    ts=int(count/10000)
    #print(" "+str(ts))
    s=int(count/1000)
    #print(" "+str(s))
    h=int(count/100)
    #print(" "+str(h))
    t=int(count/10)
    #print(" "+str(t))
    o=count%10
    #print(" "+str(o))
    #print("ts+s+h+t+o="+str(ts+s+h+t+o))
    if ts+s+h+t+o >= a and ts+s+h+t+o <= b:
        sum += count
        #print(count)
    count += 1

print(sum)

Submission status: Runtime Error

Solution code:
n=int(input())
a=int(input())
b=int(input())

count=1
sum=0
while count<=n :
    ts=int(count/10000)
    #print(" "+str(ts))
    s=int(count/1000)
    #print(" "+str(s))
    h=int(count/100)
    #print(" "+str(h))
    t=int(count/10)
    #print(" "+str(t))
    o=count%10
    #print(" "+str(o))
    #print("ts+s+h+t+o="+str(ts+s+h+t+o))
    if ts+s+h+t+o >= a and ts+s+h+t+o <= b:
        sum += count
        #print(count)
    count += 1

print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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
print(ans)

Submission status: Runtime Error

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)))):
        ans += i
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

x = sorted(a, reverse = True)
la = x[1 :: 2]
lb = x[0 :: 2]
ans = max(lb) -min(la)
print(ans)

Submission status: Runtime Error

Solution code:
                    n,a,b=map(int,input().split(" "))
                    kouho=[]
                    for i in range(0,n+1):
                    	i=str(i)
                    	keta=list(map(int,i))
                    	wa=sum(keta)
                        if a<=wa<=b:
                          kouho.append(int(i))
                    print(sum(kouho))

Submission status: Runtime Error

Solution code:
                n,a,b=map(int,input().split(" "))
                kouho=[]
                for i in range(0,n+1)
                	i=str(i)
                	keta=list(map(int,i))
                	wa=sum(keta)
                    if a<=wa<=b:
                      kouho.append(int(i))
                print(sum(kouho))

Submission status: Runtime Error

Solution code:
            import math
            n,a,b=map(int,input().split(" "))
            kouho=[]
            for i in range(0,n+1)
            	i=str(i)
            	keta=list(map(int,i))
            	wa=sum(keta)
                if a<=wa<=b:
                  kouho.append(int(i))
            print(sum(kouho))

Submission status: Runtime Error

Solution code:
        import math
        n,a,b=map(int,input().split(""))
        kouho=[]
        for i in range(0,n+1)
        	i=str(i)
        	keta=list(map(int,i))
        	wa=sum(keta)
            if a<=wa<=b:
              kouho.append(int(i))
        print(sum(kouho))

Submission status: Runtime Error

Solution code:
    import math
    n,a,b=map(int,input().split(""))
    kouho=[]
    for i in range(0,n+1)
    	i=str(i)
    	keta=list(map(int,i))
    	wa=sum(keta)
        if a<=wa<=b:
          kouho.append(i)
    print(sum(kouho))

Submission status: Runtime Error

Solution code:
import math
n,a,b=map(int,input().split(" "))
kouho=[]
for i in range(0,n+1)
	i=str(i)
	keta=list(map(int,i))
	wa=sum(keta)
    if a<=wa<=b:
      kouho.append(i)
print(sum(kouho))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def digitSum(n):
  #数値を文字列に変換
  s = str(n)
  #1文字ずつ数値化し配列にする
  array = list(map(int,s))
  #合計値を返す
  return sum(array)


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

Submission status: Runtime Error

Solution code:
#ANS-3
input_N,A,B = input_all.split()[0],int(input_all.split()[1]),int(input_all.split()[2])

count = 0
for i in range(int(input_N)+1):
    sum_all = 0
    i_str = str(i)
    for j in range(len(i_str)):
        sum_all += int(i_str[j])
    if A<=sum_all:
        if sum_all<=B:
            count += i
            
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = int(input())
b = int(input())

ttl = 0

for i in range(1,n+1):
  nums = sum(list(map(int,str(i)[:])))
  if nums >= a and nums <= b:
    ttl += i

print(ttl)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
temp = input().split()
n = int(temp[0])
a = int(temp[1])
b = int(temp[2])

def findDigit(int num,int digit):
    while digit > 0 or num <= 0:
      num %= 10
      num /= 10
      digit -= 1
	return num
  
print(findDigit(198,1))

Submission status: Runtime Error

Solution code:
def nyu():
    num1,num2,num3 = input().split()
    #num2 = list(map(int,input().split()))
    num1 = int(num1)
    num2 = int(num2)
    num3 = int(num3)
    return num1,num2,num3

def check(N,A,B):
    sum_cnt=0
    

    for n in range(N+1):
        sum:int = 0
        tmp_n = n
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 10000
        sum += int(tmp_n/10000)
        tmp_n = tmp_n % 1000
        sum += int(tmp_n/100)
        tmp_n = tmp_n % 100
        sum += int(tmp_n/10)
        tmp_n = tmp_n % 10
        sum += tmp_n
    
        if A<=sum and sum<=B:
        #    print("n=",n,"sum=", sum)
            sum_cnt +=n
    print(sum_cnt)

N,A,B=nyu()
check(N,A,B)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())
n1=list(range(1,n+1))
k=[]
for j in range(n):
    n2=sum(int(i) for i in n1[j])
    if a<=n2<=b:k.append(n1[j])
    else:pass
print(sum(int(l) for l in k))

Submission status: Runtime Error

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+=j
  if a<=sm<=b:
    ans+=1
print(ans)

Submission status: Runtime Error

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+=j
  if a<=sm<=b:
    ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

s = 0
for i in range(n+1):
  digitsum = i%10 + (i//10)%10 + (i//100)%10 + (i//1000)%10 + (i//10000)%10
  if a <= digitsum <= b:
    s += i
    
print(i)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""


N=int(input())
A=int(input())
B=int(input())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        #print(i)

print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 21 13:58:43 2020

@author: 藤原聖士
"""


N=int(input())
A=int(input())
B=int(input())

check=0
checks=0
count=0

for i in range(N):
    checks=0
    Ns=i+1
    while True:
        
        check=Ns%10
        checks+=check
        Ns=int(Ns/10)

        if Ns==0:
            break
    if checks>= A and checks<=B:
        count+=i+1
        print(i)

print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = int(input())
b = int(input())

total = 0
for i in range(1, n+1):
    wa = sum((map(int, str(i))))
    if a <= wa and wa <= b:
        total += wa
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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 sum(list) >= A and sum(list) <= B:
        Num += 1

Submission status: Runtime Error

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

for i in range(1,N+1):
  S=str(i)
  sum=0
  for num in S:
    sum += num
  if A<=sum and sum<=B:
    ans+= i
    
print(ans)

Submission status: Runtime Error

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:
    xnt+=1
    
print(cnt)

Submission status: Runtime Error

Solution code:
N , A, B = int(input().split())
S = str(N)
count = 0
s for a in S:
  s = [a for a in S]
i for i in range(S):
  Ns = sum(s[i])
if A <= Ns <= B:
  count += N
print(count)

Submission status: Runtime Error

Solution code:
n, min_num, max_num = [int(x) for x in input().split()]
xs = range(1, n + 1)

def digit_sum(x):
  return sum([int(d) for d in str(x)])
answers = [x for x in xs if min_num <= digit_sum(x) <= max_num]

print(sum(answers)) for x in answers

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
l = []
for i in range(1, N + 1):
    for j in range(str(i)):
        wa += int(j)
    if wa >= A and wa <= B:
        l.append(i)
print(sum)

Submission status: Runtime Error

Solution code:
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <cmath>

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
        int N, A, B, ans = 0;
        cin >> N >> A >> B;
        rep(i, N + 1)
        {
                int t = i, cnt = 0;
                while (t > 0)
                {
                        cnt += t % 10;
                        t /= 10;
                }
                if (A <= cnt && cnt <= B)
                        ans += i;
        }
        cout << ans << endl;

        return 0;
}

Submission status: Runtime Error

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(s)) <= B:
    res += i
print(res)

Submission status: Runtime Error

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 int(i)]) <= B:
    res += i
print(res)

Submission status: Runtime Error

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

sum_number = []

for i in range(x+1):
  if a <= sum(map(int, str(i))) <= b:
    sum_number += [i]
    
priny(sum(sum_number))

Submission status: Runtime Error

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

sum_number = []

for i in range(x+1):
  if a< sum(map(int, str(i))) < b:
    sum_number += [i]
    
priny(sum(sum_number))

Submission status: Runtime Error

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 = total + x
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(sum(i in i range(1,N+1) if A<=sum(map(int,str(i)))<=B))

Submission status: Runtime Error

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

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i)))<=B))

Submission status: Runtime Error

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

print(sum(i in i range(1,N+1)
         if A<=sum(map(int,str(i)<=B)))

Submission status: Runtime Error

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 sum >= li[1] and sum <= li[2]:
    ans += s
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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
print(ans)

Submission status: Runtime Error

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

for i in range(n+1):
    if a<= sum(map(int,list(str(i))) <=b:
        ans += i
print(ans)

Submission status: Runtime Error

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
print(ans)

Submission status: Runtime Error

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

for i in range(n+1):
    if a<= sum(map(int,list(str(i))) <=b
        ans += i
print(ans)


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
print(ans)

Submission status: Runtime Error

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

for i in range(n+1):
    if a<= sun(list(map(int,list(str(i)))) <=b
        ans += i
print(ans)

Submission status: Runtime Error

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

for i in range(n+1):
    if a<= sun(map(int,list(str(i))) <=b
        ans += i
print(ans)

Submission status: Runtime Error

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

for i in range(n+1):
    if a<= sun(map(int,list(str(i))) <=b:
        ans += i
print(ans)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, raw_input().split())
ans = 0
for _ in range(n + 1):
    if a <= sum(map(int, list(str(_)))) <= b: # 分解、求和
        ans += _
print ans

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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 += i
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split(" "))
def check(x):
    sum=0
    while x>0: 
        sum = sum + x % 10 
        x=int(x/10); 
    return sum
 
total=0
for i in range(n+1): #1-10 1,2,10
    sum=check(i)
    if sum<=b and sum>=a:
        #print(i)
        total=total+i
 
print(total)
n,a,b=map(int,input().split(" "))
def check(x):
    sum=0
    while x>0: 
        sum = sum + x % 10 
        x=int(x/10); 
    return sum

total=0
for i in range(n+1): #1-10 1,2,10
    sum=check(i)
    if sum<=b and sum>=a:
        #print(i)
        total=total+i

print(total)
提出情報

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())
sum_list = list(map(lambda n: sum(list(map(int, str(n)))), [n for n in range(1, N+1)]))
sum_ = 0
for i, n in enumerate(sum_list):
    if n>=A and n<=B:
        sum_ += i+1
print(sum_)

Submission status: Runtime Error

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

for i in range(1:n+1):
  q = i
  w = i / 10
  e = i / 100
  r = i / 1000
  sum = q + w + e + r
  if sum >= a and sum <= b:
    x += sum
    
print(x)

Submission status: Runtime Error

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

for i in range(1:n+1):
  q = i
  w = i / 10
  e = i / 100
  r = i / 1000
  sum = q + w + e + r
  if sum >= a and sum <= b:
    x += 1
    
print(x)

Submission status: Runtime Error

Solution code:

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

n_cond = 0
for i in range(n+1):
  i_str = str(i)
  order_sum = map(sum, i_str)
  if order_sum >= a and order_sum <= b:
    n_cond += 1

Submission status: Runtime Error

Solution code:
N=int(input("N:"))
a,b=map(int,input().split())
Num=0
Num_sum=0

for number in range(1,N+1):
    for num in str(number):
        num=int(num)
        Num+=num

    if Num>=a and Num<=b:
        Num_sum+=number
    Num=0
print(Num_sum)

Submission status: Runtime Error

Solution code:
N=int(input("N:"))
a,b=map(int,input().split())
Num=0
num_new=0
Num_sum=0

for number in range(1,N+1):
    for num in str(number):
        num=int(num)
        Num+=num

    if Num>=a and Num<=b:
        Num_sum+=number
    Num=0
print(Num_sum)

Submission status: Runtime Error

Solution code:
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = n //10
  return sum
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  total = 0
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += int(n % 10)
    n = (n //10)
  return sum
   
 
  
def main():
  n, a, b = map(int, list(input().strip().split()))
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()

Submission status: Runtime Error

Solution code:
def sum_digits(n):
  sum = 0
  while(n > 0):
    sum += n % 10
    n /= 10
  return sum
   
 
  
def main():
  n, a, b = map(int, input().strip().split())
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)
 
    
if __name__=="__main__":
  main()

Submission status: Runtime Error

Solution code:

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

  
def main():
  n, a, b = map(int, input())
  for i in range(n+1):
    tmp = sum_digits(n)
    if (tmp >= a) & (tmp <= b):
      total += tmp
  print(total)

    
if __name__=="__main__":
  main()

Submission status: Runtime Error

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

a = 0
L =[]

for i in range(N+1):
    if i <= 10:
     if i<=A&i>=B:
        L.append(i)
    else:
        a = i
        M = []
        while a >=10:
            b = a%10
            M.append(b)
            a /=10
        c = sum(M)
        if c<=A&c>=B:
            L.append(i)

print(sum(L))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

ans=0
for i in ranpe(1,n+1):
  s=0
  x=i
  while 0<x:
    s+=x%10
    x=x//10
  if a<=s and s<=b:
    ans+=i
print(ans)

Submission status: Runtime Error

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

ans=0
for i in ranpe(1,n+1):
  s=0
  x=i
  while 0<x:
    s+=x%10
    x//=10
  if a<=s and s<=b:
    ans+=i
print(ans)

Submission status: Runtime Error

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

cnt=0
total=0
for x in range(1,N+1):
    y = keta_sum(x)
    if A<=y<=B:
        cnt +=1
        total +=x 
            
print(total)

Submission status: Runtime Error

Solution code:
a, 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
print(ans)

Submission status: Runtime Error

Solution code:
l=input().split()
a,b=map(int,[l[1],l[2]])
n=len(list(l[0]))
total=0
while i in range(1,n+1):
    if a<=i<=b:
        total+=1
        i+=1
else:
    print(total)

Submission status: Runtime Error

Solution code:
def sum(N):
  N=str(N)
  return sum(list(map(int,N)))

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = int(input())
B = int(input())



    #x = sum(l)
array = 0

for i in range(N+1):
    l =[int(x) for x in list(str(i))]
    f = sum(l)
    if f >= A and f <= B:
        array = array + i

print(array)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
S = list(range(N+1).split(''))
print(S)

Submission status: Runtime Error

Solution code:
li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in range(a + 1):
  ans = 0
  tmp = i

  while(i >= 1):
    ans += i % 10
    i = math.floor(i / 10)

  if b <= ans <= c:
    list.append(tmp)

data = 0
for e in list:
  data += e

print(data)

Submission status: Runtime Error

Solution code:
li = list(map(int,input().split()))
a = li[0]
b = li[1]
c = li[2]

list = []

for i in a + 1:
  ans = 0

  while(i != 0):
    ans += i % 10
    i / 10

  if b <= ans <= c:
    list.append(ans)

data = 0
for e in list:
  data += e

print(data)

Submission status: Runtime Error

Solution code:
x,y,z = map(int,input().split())
count = 0
for i in range(1:x) 
    LIST = [int(x) for x in list(str(i))]
    if y <sum(LIST) <z :
        count +=1        
print(count)

Submission status: Runtime Error

Solution code:
list = []

for i in range(a + 1):
  if i < 10:
    if b <= i <= c:
      list.append(i)
  else:
    d = [int(i) for c in str(i)]
    e = 0
    for j in d:
      e += j
    if b <= e <= c:
      list.append(i)

k = 0
for t in list:
  k += t
print(k)