题目传送门:http://www.lydsy.com/JudgeOnline/problem.php?id=1833
仍然是数位dp
#include<iostream> #include<cstdio> #include<cstring> #define LL long long using namespace std; const int MAXN = 20; LL f[MAXN][MAXN][MAXN],ans[MAXN],p[MAXN]; inline void prework(){ p[0] = 1; p[1] = 10; for (int i=2;i<=12;i++) p[i] = p[i-1]*10; for (int i=0;i<=9;i++) f[1][i][i] = 1; for (int k=2;k<=12;k++) { for (int i=0;i<=9;i++) { for (int j=0;j<=9;j++) { for (int h=0;h<=9;h++) { f[k][i][h] += f[k-1][j][h]; } } f[k][i][i] += p[k-1]; } } } inline void cal(LL w, int t){ if (!w) return; else { int tot = 0, arr[20]; LL tmp = w; memset(arr,0,sizeof(arr)); while (w) arr[++tot] = w % 10, w /= 10; for (int i=tot-1;i;i--) for (int j=1;j<=9;j++) for (int k=0;k<=9;k++) ans[k] += f[i][j][k]*t; for (int i=tot;i;i--) { for (int j=(i==tot?1:0);j<=arr[i]-(i==1?0:1);j++) for (int k=0;k<=9;k++) ans[k] += f[i][j][k]*t; if (i>1) ans[arr[i]] += (tmp % p[i-1] + 1)*t; } } } int main(){ prework(); LL a,b; cin>>a>>b; cal(b,1); cal(a-1,-1); for (int i=0;i<9;i++) printf("%lld ", ans[i]); printf("%lld",ans[9]); return 0; }
Very neat article.Much thanks again. Really Great.
Muchos Gracias for your blog.Really thank you! Awesome.
Wow, great blog.Really looking forward to read more. Keep writing.
Major thankies for the post.Thanks Again. Fantastic.
Appreciate you sharing, great blog.Much thanks again. Want more.
Wow, great post.Much thanks again. Will read on…
Thank you for your blog article.Thanks Again. Cool.
Enjoyed every bit of your blog post.Really thank you! Want more.
Wow, great blog.Thanks Again. Great.
Muchos Gracias for your article. Much obliged.
Great blog post.Really thank you! Much obliged.
Looking forward to reading more. Great article.Really thank you! Will read on…
I really liked your post.Thanks Again. Fantastic.
Looking forward to reading more. Great article.Thanks Again. Much obliged.
Very informative blog post. Will read on…
Major thanks for the post.Much thanks again. Cool.
Major thankies for the article post.Thanks Again. Fantastic.
Really appreciate you sharing this blog article.Much thanks again. Want more.
I am regular reader, how are you everybody? This post posted at this website is actually nice.
I have learn several good stuff here. Certainly worth bookmarking for
revisiting. I surprise how much attempt you place to
create the sort of fantastic informative site.
Major thankies for the blog article.Really thank you! Much obliged.
Hello, I do think your website could be having web browser compatibility issues.
When I look at your site in Safari, it looks fine however, when opening in Internet Explorer,
it has some overlapping issues. I merely wanted to give you a quick heads up!
Apart from that, fantastic website!
Thanks again for the blog article.Really thank you! Will read on…
I cannot thank you enough for the article.Thanks Again. Really Cool.
I am so grateful for your blog.Really looking forward to read more. Fantastic.
Fantastic blog article.Much thanks again. Great.
Thanks for sharing, this is a fantastic blog article.Really looking forward to read more. Awesome.
I really liked your article.Much thanks again. Great.
Major thanks for the post.Thanks Again. Keep writing.
Thanks again for the post.Thanks Again.
This is one awesome post.Much thanks again. Great.
I value the article post.Really looking forward to read more. Great.
I really enjoy the blog article.Thanks Again. Really Cool.
Thanks a lot for the article.Thanks Again.
I think this is a real great post. Really Great.
I really like and appreciate your blog article.Really thank you! Really Great.
I just like the valuable info you provide to your articles.
I’ll bookmark your blog and test once more here frequently.
I am fairly sure I’ll learn many new stuff proper here!
Best of luck for the next!
wow, awesome blog post.Really thank you! Keep writing.
Major thankies for the blog.Thanks Again. Awesome.
A round of applause for your article.Really thank you! Really Cool.
Thanks again for the post.Really looking forward to read more. Awesome.
I loved as much as you’ll receive carried out right here.
The sketch is attractive, your authored
material stylish. nonetheless, you command get bought an shakiness over that
you wish be delivering the following. unwell unquestionably come further formerly again since
exactly the same nearly a lot often inside case you shield this hike.
Im obliged for the post.Thanks Again. Much obliged.
I think this is a real great article post.Really looking forward to read more. Want more.
Hmm is anyone else experiencing problems with the images on this blog loading?
I’m trying to figure out if its a problem on my end or if it’s the blog.
Any suggestions would be greatly appreciated.
Really appreciate you sharing this blog. Great.
I really like and appreciate your blog post.Really looking forward to read more. Really Cool.
I am so grateful for your blog post.Much thanks again. Keep writing.
I read this article completely concerning the comparison of most up-to-date and previous technologies, it’s amazing article.
I’m not sure where you are getting your info, but good topic.
I needs to spend a while finding out much more or understanding more.
Thank you for fantastic information I used to be in search of this information for my mission.
Great, thanks for sharing this blog article.Really looking forward to read more. Keep writing.
Hi my loved one! I want to say that this article is amazing,
great written and come with approximately all important infos.
I would like to peer extra posts like this .
This is one awesome blog article.Really looking forward to read more. Really Cool.
Thanks for sharing, this is a fantastic blog article.Really thank you! Much obliged.
Enjoyed every bit of your blog article.Really thank you! Much obliged.
Hey, thanks for the blog article.Really thank you! Fantastic.
A round of applause for your blog article.Much thanks again. Cool.
Appreciate you sharing, great blog.Much thanks again. Will read on…
The subsequent time I learn a blog, I hope that it doesnt disappoint me as a lot as this one. I mean, I know it was my choice to learn, but I truly thought youd have one thing fascinating to say. All I hear is a bunch of whining about one thing that you may repair should you werent too busy in search of attention.
Thanks again for the blog.Really looking forward to read more. Will read on…
Im obliged for the blog post.Really looking forward to read more. Keep writing.
Im thankful for the blog article. Keep writing.
My brother recommended I may like this blog.
He used to be entirely right. This publish actually made my day.
You cann’t consider simply how much time I had spent
for this info! Thanks!
I cannot thank you enough for the blog. Will read on…
Major thanks for the post. Cool.
I think this is a real great article post.Much thanks again. Want more.
I appreciate you sharing this article.Really thank you! Really Cool.
I loved your article post.Much thanks again.
Great, thanks for sharing this article.Much thanks again. Really Great.
I am so grateful for your article.Much thanks again. Really Great.
I really enjoy the post.Much thanks again.
Muchos Gracias for your post.Really looking forward to read more. Want more.
Very informative blog post.Really looking forward to read more. Keep writing.
Thanks again for the article post.Much thanks again. Cool.
Great blog post.Really looking forward to read more. Want more.
Thanks a lot for the blog post.Really thank you! Fantastic.
wow, awesome article post.Thanks Again. Really Cool.
Hi, I read your blog like every week. Your humoristic style is awesome, keep up the good work!
What’s up to all, because I am truly eager of reading this webpage’s post to be updated
daily. It carries pleasant stuff.
“4 Songs for the Club” Is a 4 song CD-EP from B-Rock, For Dj’s and Bars and Dance clubs ..”Dance”Features Rockman doing the electronic Vocals on the Chorus. A hand clapping song to get people on tha dance floor ….”Mix It With Tha Water”. Features B-Rocks Team member Pif .. Tha song is an urban street tale with a great Trap Beat….”I Like It Straight” is Bound to be a New Club/ Bar Anthem for the DJ’s to get the crowds up on their feet and to get another drink..LOL…and “Crack Them bottle (Get Fucked Up)” well that’s a story that all party goers live on the weekend! … 4 Dance Hits 4 tha Club.. a great EP for any DJ to have
Hello, yeah this piece of writing is really fastidious and I have learned lot of
things from it about blogging. thanks.
Very good blog post.Much thanks again. Awesome.
Thank you for your post.Thanks Again. Great.
I think this is a real great blog.Really looking forward to read more. Will read on…
This design is spectacular! You obviously know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Wonderful job.
I really loved what you had to say, and more than that,
how you presented it. Too cool!
Wow, great blog article. Keep writing.
A round of applause for your blog post.Thanks Again. Great.
Fantastic blog article.Much thanks again. Fantastic.
Thanks for sharing, this is a fantastic post.Thanks Again. Keep writing.
Say, you got a nice blog.Really looking forward to read more. Much obliged.
I am so grateful for your post.Thanks Again. Want more.
I am so grateful for your article.Really thank you! Really Cool.
Looking forward to reading more. Great article post.Much thanks again. Really Cool.
Wow, great blog article.Much thanks again. Fantastic.
Howdy I am so delighted I found your weblog, I really found you by accident, while I was
researching on Bing for something else, Nonetheless I am here now
and would just like to say kudos for a tremendous post and
a all round thrilling blog (I also love the theme/design), I don’t have time to read through it all at the minute but I have bookmarked it and also
added your RSS feeds, so when I have time I will be back to read
a great deal more, Please do keep up the great work.
This is one awesome article post. Will read on…
Hello would you mind letting me know which hosting
company you’re working with? I’ve loaded your blog in 3 different browsers and I must say this
blog loads a lot quicker then most. Can you suggest a good hosting provider at a fair price?
Thank you, I appreciate it!
I truly appreciate this article. Really Cool.
This is one awesome blog.Really looking forward to read more. Will read on…
I go to see each day a few sites and websites to read posts, but this weblog offers quality based writing.
Wow, great blog.Thanks Again. Cool.
I truly appreciate this article post.
Very informative blog. Much obliged.
Say, you got a nice post.Really looking forward to read more.
Thanks a lot for the blog article.Thanks Again. Cool.
Very good blog article.Really looking forward to read more. Will read on…
Fantastic blog article.Really looking forward to read more. Great.
A round of applause for your blog.Much thanks again. Really Great.
This is my first time pay a quick visit at here and i am truly pleassant to read all at alone place.
Im thankful for the article.Really thank you! Cool.
Thanks-a-mundo for the blog post.Thanks Again. Want more.
Really appreciate you sharing this article post.Thanks Again.
Thanks a lot for the blog.Much thanks again. Awesome.
Awesome post.Much thanks again. Will read on…
I really liked your article post.Really looking forward to read more. Great.
Great, thanks for sharing this article post.Thanks Again.
I truly appreciate this article.Really thank you! Really Cool.
Appreciate you sharing, great post.Much thanks again. Really Great.
Currently it looks like Movable Type is the best blogging platform out
there right now. (from what I’ve read) Is that what you’re using on your blog?
Appreciate you sharing, great blog.Much thanks again. Really Great.
Thanks for sharing, this is a fantastic blog post. Want more.
I loved your blog article.Really looking forward to read more. Much obliged.
Major thanks for the blog post. Keep writing.
Im obliged for the article post. Will read on…
Your style is very unique compared to other folks I have read stuff from.
Thank you for posting when you have the opportunity, Guess
I will just book mark this page.
First of all I want to say awesome blog! I had a
quick question in which I’d like to ask if you do
not mind. I was curious to know how you center yourself and clear your mind before
writing. I’ve had a tough time clearing my mind in getting my thoughts out.
I do take pleasure in writing but it just seems like the
first 10 to 15 minutes are usually lost just trying to figure out how
to begin. Any recommendations or hints? Many thanks!
Major thankies for the blog post.Really looking forward to read more. Much obliged.
Muchos Gracias for your blog post.Thanks Again. Awesome.
I really liked your blog article.Really thank you! Keep writing.
I value the blog article.Thanks Again. Want more.
Enjoyed every bit of your article post.Much thanks again.
Wow, great post.Really looking forward to read more. Great.
Thanks for sharing, this is a fantastic article post.Really thank you!
Really enjoyed this article.Thanks Again. Cool.
Hey, thanks for the article post. Really Cool.
I really liked your blog post.Thanks Again. Will read on…
Very informative blog post.Thanks Again. Will read on…
Fantastic article.Much thanks again. Really Cool.
Wow, great blog article.Really looking forward to read more.
Major thanks for the blog post.Thanks Again. Awesome.
I think this is a real great blog article.Really thank you! Cool.
Really enjoyed this post. Really Great.
I really like and appreciate your article post.Really looking forward to read more. Much obliged.
I have read so many articles or reviews concerning the blogger lovers however
this post is actually a pleasant post, keep it up.
Thank you for your post.Much thanks again. Really Great.
Looking forward to reading more. Great article post.Really thank you! Much obliged.
Thanks a lot for the post. Cool.
I appreciate you sharing this blog. Awesome.
Im thankful for the article.Really looking forward to read more. Will read on…
Great, thanks for sharing this blog article. Much obliged.
I really enjoy the article post.Thanks Again. Awesome.
Great post.Really looking forward to read more. Will read on…
Write more, thats all I have to say. Literally, it seems as though you relied on the video to make your point.
You clearly know what youre talking about, why
waste your intelligence on just posting videos to your site when you could
be giving us something enlightening to read?
I really enjoy looking through on this internet site, it has got fantastic articles.
Very good post.Much thanks again. Will read on…
Thank you ever so for you post. Cool.
Very good blog post.
I think this is a real great blog article.Thanks Again. Cool.
Im obliged for the article.Much thanks again. Much obliged.
Really appreciate you sharing this post.Really thank you! Great.
Appreciate you sharing, great article.Really thank you! Much obliged.
I think this is a real great blog post.Really looking forward to read more. Really Cool.
Thanks for the blog. Really Great.
Major thankies for the blog article.Really looking forward to read more. Fantastic.
Enjoyed every bit of your post.Really thank you! Want more.
I really liked your article post.Thanks Again. Fantastic.
Say, you got a nice blog article. Much obliged.
Great, thanks for sharing this post.Thanks Again. Cool.
Great, thanks for sharing this article.Really looking forward to read more. Really Great.
Very good blog article.Really thank you! Cool.
Wow, great post.Really looking forward to read more. Much obliged.
Appreciate you sharing, great article post.Much thanks again. Really Great.
Really informative blog article.Really thank you! Want more.
Major thanks for the article.Much thanks again. Much obliged.
Thanks for the blog post.Really looking forward to read more. Will read on…
I value the blog post.Much thanks again. Want more.
Major thankies for the blog post.Thanks Again. Awesome.
I really like and appreciate your blog post.Much thanks again. Cool.
Say, you got a nice post.Thanks Again. Really Cool.
I appreciate you sharing this blog post.Much thanks again. Really Cool.
A round of applause for your blog article.Really thank you! Really Cool.
I truly appreciate this blog post. Really Cool.
Thanks again for the post.Much thanks again. Keep writing.
I really liked your blog.Much thanks again. Really Great.
Thank you ever so for you blog post.Thanks Again. Great.
Im thankful for the article.Really looking forward to read more. Great.
wow, awesome blog article.Really looking forward to read more. Great.
I am so grateful for your article post.Thanks Again. Cool.
Thanks-a-mundo for the article post.Much thanks again. Great.
I value the blog article. Much obliged.
Very informative article.Really looking forward to read more. Much obliged.
I appreciate you sharing this post. Really Cool.
I truly appreciate this article. Want more.
I really liked your blog article.Really thank you! Much obliged.