結果

問題 No.189 SUPER HAPPY DAY
ユーザー tailstails
提出日時 2015-04-22 01:04:22
言語 Perl
(5.38.2)
結果
AC  
実行時間 977 ms / 5,000 ms
コード長 537 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 11,208 KB
実行使用メモリ 17,904 KB
最終ジャッジ日時 2023-09-18 07:13:55
合計ジャッジ時間 23,110 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 726 ms
17,532 KB
testcase_01 AC 726 ms
17,704 KB
testcase_02 AC 734 ms
17,752 KB
testcase_03 AC 734 ms
17,616 KB
testcase_04 AC 730 ms
17,556 KB
testcase_05 AC 735 ms
17,468 KB
testcase_06 AC 732 ms
17,512 KB
testcase_07 AC 727 ms
17,784 KB
testcase_08 AC 731 ms
17,652 KB
testcase_09 AC 733 ms
17,492 KB
testcase_10 AC 737 ms
17,648 KB
testcase_11 AC 727 ms
17,480 KB
testcase_12 AC 731 ms
17,796 KB
testcase_13 AC 837 ms
17,700 KB
testcase_14 AC 896 ms
17,536 KB
testcase_15 AC 922 ms
17,612 KB
testcase_16 AC 950 ms
17,904 KB
testcase_17 AC 959 ms
17,648 KB
testcase_18 AC 901 ms
17,620 KB
testcase_19 AC 977 ms
17,760 KB
testcase_20 AC 784 ms
17,668 KB
testcase_21 AC 781 ms
17,496 KB
testcase_22 AC 729 ms
17,612 KB
testcase_23 AC 768 ms
17,588 KB
testcase_24 AC 766 ms
17,732 KB
testcase_25 AC 806 ms
17,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$mod=1000000009;

@0=(1);
for$n(1..200){
    for$i(0..$n*9){
        for$d(0..9){
            ($$n[$i+$d]+=${$n-1}[$i])%=$mod;
        }
    }
}

($M,$D)=<>=~/\d+/g;
{use bigint;++$M;++$D;}

$o=0;
$_=$M;
while($_){
  s/.//;
  $l=length;
  for$i(0..@$l){
    for$d(0..$&-1){
      ($M[$o+$i+$d]+=$$l[$i])%=$mod;
    }
  }
  $o+=$&;
}

$o=0;
$_=$D;
while($_){
  s/.//;
  $l=length;
  for$i(0..@$l){
    for$d(0..$&-1){
      ($D[$o+$i+$d]+=$$l[$i])%=$mod;
    }
  }
  $o+=$&;
}

for(1..2010){
  $r=($r+$D[$_]*$M[$_]%$mod)%$mod;
}
print$r;
0