結果

問題 No.372 It's automatic
ユーザー cielciel
提出日時 2016-05-16 13:57:25
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 189 bytes
コンパイル時間 21,059 ms
コンパイル使用メモリ 256,016 KB
実行使用メモリ 5,448 KB
最終ジャッジ日時 2023-09-13 09:11:45
合計ジャッジ時間 42,975 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 1,748 ms
5,320 KB
testcase_05 AC 1,752 ms
5,412 KB
testcase_06 AC 1,744 ms
5,364 KB
testcase_07 AC 1,784 ms
5,008 KB
testcase_08 AC 1,765 ms
5,368 KB
testcase_09 AC 1,768 ms
5,416 KB
testcase_10 AC 1,752 ms
5,400 KB
testcase_11 AC 1,744 ms
5,320 KB
testcase_12 AC 1,766 ms
5,448 KB
testcase_13 AC 1,771 ms
5,072 KB
testcase_14 AC 1,781 ms
5,312 KB
testcase_15 AC 1,768 ms
5,304 KB
testcase_16 AC 3 ms
4,420 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,420 KB
testcase_19 AC 3 ms
4,380 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 96 ms
4,812 KB
testcase_22 AC 96 ms
4,892 KB
testcase_23 AC 96 ms
4,860 KB
testcase_24 AC 96 ms
4,928 KB
testcase_25 AC 96 ms
4,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M=1000000007
s,t=ARGF.gets_to_end.split
m=t.to_i
a=[1]+[0]*~-m
z=0
s.size.times{|i|
	d=s[i].to_i;f=d==0?1:0;z+=f;b=a.dup
	m.times{|j|k=(10*j+d)%m;b[k]=(b[k]+a[j]-f)%M;f=0}
	a=b
}
p a[0]-1+z
0