Submission #2237539


Source Code Expand

Copy
# https://beta.atcoder.jp/contests/abs/submissions/2233448
my$ans=0;
my ($n,$a,$b)=get.words;
for 0..9 ->$_1 {
for 0..($b-$_1 min 9) ->$_2 {
for 0..($b-$_1-$_2 min 9) ->$_3 {
for ($a-$_1-$_2-$_3 max 0)..($b-$_1-$_2-$_3 min 9) ->$_4 {
my $t = 1000 * $_1 + 100 * $_2 + 10 * $_3 + $_4;
$ans+=$t if $n>=$t
}
}
}
}
$ans+=1e4 if $n>=1e4 && 1>=$a;
say $ans
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# https://beta.atcoder.jp/contests/abs/submissions/2233448

my$ans=0;
my ($n,$a,$b)=get.words;
for 0..9 ->$_1 {
	for 0..($b-$_1 min 9) ->$_2 {
		for 0..($b-$_1-$_2 min 9) ->$_3 {
			for ($a-$_1-$_2-$_3 max 0)..($b-$_1-$_2-$_3 min 9) ->$_4 {
				my $t = 1000 * $_1 + 100 * $_2 + 10 * $_3 + $_4;
				$ans+=$t if $n>=$t
			}
		}
	}
}
$ans+=1e4 if $n>=1e4 && 1>=$a;
say $ans

Submission Info

Submission Time
Task ABC083B - Some Sums
User climpet
Language Perl6 (rakudo-star 2016.01)
Score 200
Code Size 387 Byte
Status AC
Exec Time 1489 ms
Memory 76520 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 11
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 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 AC 1489 ms 75628 KB
02.txt AC 363 ms 71784 KB
03.txt AC 588 ms 76520 KB
04.txt AC 189 ms 54900 KB
05.txt AC 1294 ms 75760 KB
06.txt AC 1416 ms 75628 KB
07.txt AC 550 ms 75628 KB
08.txt AC 1067 ms 75756 KB
s1.txt AC 243 ms 64248 KB
s2.txt AC 198 ms 57332 KB
s3.txt AC 826 ms 76144 KB


2025-04-02 (Wed)
13:41:51 +00:00