結果

問題 No.189 SUPER HAPPY DAY
ユーザー cielciel
提出日時 2015-11-22 05:37:04
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,379 ms / 5,000 ms
コード長 326 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 11,316 KB
実行使用メモリ 18,908 KB
最終ジャッジ日時 2023-08-27 06:05:12
合計ジャッジ時間 10,949 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,080 KB
testcase_01 AC 78 ms
15,096 KB
testcase_02 AC 76 ms
15,124 KB
testcase_03 AC 77 ms
15,200 KB
testcase_04 AC 75 ms
15,228 KB
testcase_05 AC 82 ms
15,196 KB
testcase_06 AC 75 ms
15,136 KB
testcase_07 AC 75 ms
15,024 KB
testcase_08 AC 77 ms
15,084 KB
testcase_09 AC 79 ms
15,020 KB
testcase_10 AC 76 ms
15,284 KB
testcase_11 AC 79 ms
14,968 KB
testcase_12 AC 76 ms
15,072 KB
testcase_13 AC 364 ms
16,048 KB
testcase_14 AC 514 ms
16,196 KB
testcase_15 AC 580 ms
18,732 KB
testcase_16 AC 705 ms
18,648 KB
testcase_17 AC 704 ms
18,312 KB
testcase_18 AC 546 ms
18,244 KB
testcase_19 AC 717 ms
16,828 KB
testcase_20 AC 231 ms
15,700 KB
testcase_21 AC 187 ms
15,556 KB
testcase_22 AC 79 ms
15,076 KB
testcase_23 AC 734 ms
18,868 KB
testcase_24 AC 735 ms
18,908 KB
testcase_25 AC 1,379 ms
18,824 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
A=gets.split.map{|e|
	a=[]
	s=0
	e.bytes{|b|
		n=b-48
		nxt=[0]*[9+a.size,n+s].max
		(a.size-1).downto(0){|j|
			9.downto(0){|i|
				nxt[j+i]+=a[j]
			}
		}
		(0...n).each{|j|
			nxt[j+s]+=1
		}
		a=nxt
		s+=n
	}
	a[s]+=1
	a
}
r=0
1.upto([A[0].size,A[1].size].min-1){|i|
	r=(r+A[0][i]*A[1][i])%1000000009
}
p r
0