Submission #2239943

Source Code Expand

Copy
[n,a,b] = scanf('%d %d %d','C');

ans = 0;

for i = 1:n
	digit_sum = 0;
	cur = i;

	while cur ~= 0
		digit_sum = digit_sum + mod(cur,10);
		cur = floor(cur / 10);
	end

	if a <= digit_sum && digit_sum <= b
		ans = ans + i;
	end
end

printf('%d\n',ans);

Submission Info

Submission Time
Task ABC083B - Some Sums
User Hec
Language Octave (4.0.2)
Score 200
Code Size 272 Byte
Status
Exec Time 820 ms
Memory 11456 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt 820 ms 9420 KB
02.txt 367 ms 9532 KB
03.txt 772 ms 9416 KB
04.txt 788 ms 9412 KB
05.txt 658 ms 11456 KB
06.txt 724 ms 9416 KB
07.txt 773 ms 9420 KB
08.txt 620 ms 9416 KB
s1.txt 140 ms 9416 KB
s2.txt 139 ms 9416 KB
s3.txt 143 ms 9416 KB