結果

問題 No.372 It's automatic
ユーザー cielciel
提出日時 2016-05-16 16:01:38
言語 Crystal
(1.11.2)
結果
RE  
実行時間 -
コード長 187 bytes
コンパイル時間 21,003 ms
コンパイル使用メモリ 257,880 KB
実行使用メモリ 5,728 KB
最終ジャッジ日時 2023-09-13 09:14:07
合計ジャッジ時間 20,787 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 2 ms
4,508 KB
testcase_03 AC 2 ms
4,404 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 3 ms
4,652 KB
testcase_17 AC 3 ms
4,460 KB
testcase_18 AC 3 ms
4,432 KB
testcase_19 AC 3 ms
4,572 KB
testcase_20 AC 3 ms
4,552 KB
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

M=1000000007
s,t=ARGF.gets_to_end.split
m=t.to_i
a=[0_i64]*m;a[z=0]=1
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;f=0};a=b}
p (a[0]-1+z)%M
0