結果

問題 No.189 SUPER HAPPY DAY
ユーザー cielciel
提出日時 2015-11-22 06:00:07
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,449 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 11,252 KB
実行使用メモリ 19,016 KB
最終ジャッジ日時 2023-08-27 06:05:24
合計ジャッジ時間 9,922 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,168 KB
testcase_01 AC 86 ms
15,248 KB
testcase_02 AC 84 ms
15,296 KB
testcase_03 AC 85 ms
15,088 KB
testcase_04 AC 85 ms
15,204 KB
testcase_05 AC 87 ms
15,016 KB
testcase_06 AC 82 ms
15,076 KB
testcase_07 AC 82 ms
15,288 KB
testcase_08 AC 83 ms
14,972 KB
testcase_09 AC 85 ms
15,196 KB
testcase_10 AC 83 ms
15,020 KB
testcase_11 AC 83 ms
15,224 KB
testcase_12 AC 85 ms
15,160 KB
testcase_13 AC 352 ms
15,936 KB
testcase_14 AC 482 ms
16,032 KB
testcase_15 AC 588 ms
17,512 KB
testcase_16 AC 711 ms
18,524 KB
testcase_17 AC 724 ms
18,488 KB
testcase_18 AC 540 ms
16,800 KB
testcase_19 AC 709 ms
16,444 KB
testcase_20 AC 226 ms
15,704 KB
testcase_21 AC 193 ms
15,392 KB
testcase_22 AC 88 ms
14,972 KB
testcase_23 AC 733 ms
17,996 KB
testcase_24 AC 724 ms
18,020 KB
testcase_25 AC 1,449 ms
19,016 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
A=gets.split.map{|e|
	a=[]
	s=0
	e.bytes{|b|
		n=b-48
		asiz=a.size
		a+=[0]*([9+asiz,n+s].max-asiz)
		(asiz-1).downto(0){|j|
			9.downto(1){|i|
				a[j+i]+=a[j]
			}
		}
		(0...n).each{|j|
			a[j+s]+=1
		}
		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