結果

問題 No.189 SUPER HAPPY DAY
ユーザー cielciel
提出日時 2015-11-22 05:31:04
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,408 ms / 5,000 ms
コード長 331 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 11,248 KB
実行使用メモリ 19,060 KB
最終ジャッジ日時 2023-08-27 00:09:53
合計ジャッジ時間 10,193 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
15,160 KB
testcase_01 AC 79 ms
15,008 KB
testcase_02 AC 80 ms
15,080 KB
testcase_03 AC 81 ms
15,008 KB
testcase_04 AC 80 ms
15,016 KB
testcase_05 AC 79 ms
15,164 KB
testcase_06 AC 79 ms
15,212 KB
testcase_07 AC 79 ms
15,332 KB
testcase_08 AC 80 ms
15,080 KB
testcase_09 AC 80 ms
15,264 KB
testcase_10 AC 78 ms
15,008 KB
testcase_11 AC 78 ms
15,212 KB
testcase_12 AC 79 ms
15,316 KB
testcase_13 AC 346 ms
15,596 KB
testcase_14 AC 467 ms
15,900 KB
testcase_15 AC 569 ms
18,488 KB
testcase_16 AC 708 ms
18,420 KB
testcase_17 AC 698 ms
18,816 KB
testcase_18 AC 552 ms
18,312 KB
testcase_19 AC 712 ms
16,464 KB
testcase_20 AC 230 ms
15,632 KB
testcase_21 AC 193 ms
15,220 KB
testcase_22 AC 86 ms
15,204 KB
testcase_23 AC 733 ms
18,976 KB
testcase_24 AC 742 ms
18,716 KB
testcase_25 AC 1,408 ms
19,060 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
		(0..9).each{|i|
			(0...a.size).each{|j|
				nxt[j+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