2213: [Poi2011]Difference

stupid_lulu posted @ 2013年3月20日 21:42 in poi , 2780 阅读

裸扫一遍。。记下状态。注意一段中没有一个字母就不能算他为出现最少的字母= =!

#include<cstdio>
int n,ans=0;
char st[1000002];
int f[41][41],g[41][41];
int max(int a,int b){return a>b? a:b;}
int main(){
    scanf("%d",&n);
    scanf("%s",st);
    for (int i=0;i<n;i++){
        int y=st[i]-'a';
        for (int j=0;j<26;j++){
            f[j][y]++;
            f[y][j]--;
            if (!g[y][j]) g[y][j]=1;
            if (g[y][j]==2){g[y][j]=1;f[y][j]++;}
            if (f[y][j]<=-1){f[y][j]=-1;g[y][j]=2;}
            if (g[y][j]) ans=max(ans,f[y][j]);
            if (g[j][y]) ans=max(ans,f[j][y]);
            //printf("f[%c][%c]=%d f[%c][%c]=%d ",j+'a',y+'a',f[j][y],y+'a',j+'a',f[y][j]);
        }
        //printf("\n");
    }
    printf("%d\n",ans);
}
Avatar_small
carpet cleaning duba 说:
2019年9月14日 20:27

In brief, we have offerings for your safe including a hygienic ecosystem. We utilise deep cleaning up methods plus innovative cleaning up machines and cleaning appliances for cleaning up your establishing internally to get extending it has the lifespan and external establishing cleaning for boosting its look and feel. Get all of our services for preventing discoloration, deterioration, and deterioration within your buildings plus towers.

Avatar_small
house maid services 说:
2021年9月03日 20:15

Octoclean is actually a commercial cleaning up franchise which was in business for any past eighteen years. Over the last five ages, it includes experienced your 30% maximize in gross, giving them brand-name recognition throughout the country. This private cleaning franchise offers cleaning up and routine maintenance services so that you can businesses however sizes. There are a rather low 1st cash investment for your commercial cleaning up franchise. For an Octoclean franchisee, you'll get learning running this amazing type with business and marketing plus financial service.

Avatar_small
maid agency dubai 说:
2021年9月19日 00:41

A couple of cleaning services beware of to help you out to accomplish your responsibilities. But prior to when that, for the workplace belongs in your direction, you have to get a transient idea regarding how you could created the landscapes. In addition compared to that, you could perhaps go with various insurance coverage of housecleaning. This will lower your stress in connection with matter.

Avatar_small
house cleaning servi 说:
2023年8月16日 21:17

What My business is getting at would be the idea of which price seriously isn't the solely factor if a customer chooses a colour contractor. The most significant excuse When i hear by paint technicians is them to either eliminate jobs mainly because their selling price is too high or they just don't estimate a position correctly.

Avatar_small
seo service london 说:
2024年2月21日 23:59

This is a great feature for sharing this informative message. I am impressed by the knowledge you have on this blog. It helps me in many ways. Thanks for posting this again

Avatar_small
스포츠토토사이트 说:
2024年2月27日 19:37

We began as Top Bluetooth headphones suppliers in May 2015. However, the latest technology provided a good start for the company very rapidly. Thus, making it one of the chain’s original members. Nevertheless, we try to keep its administration decentralised thus growing into one of the key players in China’s smart & sports consumables sector. We have a solid reputation in China for providing the best audio solutions.

Avatar_small
토토쿠 说:
2024年2月27日 19:38

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates

Avatar_small
토토읕 说:
2024年2月27日 19:43

We began as Top Bluetooth headphones suppliers in May 2015. However, the latest technology provided a good start for the company very rapidly. Thus, making it one of the chain’s original members. Nevertheless, we try to keep its administration decentralised thus growing into one of the key players in China’s smart & sports consumables sector. We have a solid reputation in China for providing the best audio solutions.

Avatar_small
바카라사이트 说:
2024年2月27日 19:44

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help.

Avatar_small
먹튀폴리스보증업체 说:
2024年2月27日 19:45

A decent blog dependably concocts new and energizing data and keeping in mind that understanding I have feel that this blog is truly have each one of those quality that qualify a blog to be a one.

Avatar_small
토토사이트검증 说:
2024年2月27日 20:54

We would like to thank you just as before for the stunning ideas you offered Jesse when preparing her own post-graduate research and, most importantly, regarding providing every one of the ideas in one blog post. In case we had been aware of your web page a year ago, we might have been saved the unwanted measures we were implementing. Thank you very much.

Avatar_small
먹튀검증커뮤니티 说:
2024年2月27日 21:19

This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. I loved this assignment article and kept updating interesting articles. I will be a regular reader. I am offering help to students over the globe at a low price. I delight in, cause I found just what I was looking for. 

Avatar_small
안전놀이터가입 说:
2024年2月27日 21:32

The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

Avatar_small
메이저놀이터 说:
2024年2月27日 21:51

This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. I loved this assignment article and kept updating interesting articles. I will be a regular reader. I am offering help to students over the globe at a low price. I delight in, cause I found just what I was looking for. 

Avatar_small
먹튀검증커뮤니티 说:
2024年2月27日 21:52

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work.

Avatar_small
더킹카지노 说:
2024年2月27日 21:54

Hello, i study your blog often and i own an analogous one and i used to be just wondering if you get much of spam comments? If so how do you catch it, any plugin or anything you’ll be able to advise? I get thus often lately it’s driving me crazy so any help is very abundant appreciated. for older folks, retirement or a huge promotion at work is a time when celebration events are going to be a great idea.

Avatar_small
먹튀검증 说:
2024年2月27日 21:59

We would like to thank you just as before for the stunning ideas you offered Jesse when preparing her own post-graduate research and, most importantly, regarding providing every one of the ideas in one blog post. In case we had been aware of your web page a year ago, we might have been saved the unwanted measures we were implementing. Thank you very much.

Avatar_small
메이저놀이터 说:
2024年2月27日 23:13

I'm very drained on get together with to find key and sharp talk concerning this. I will in all probability be returning the future to your weblog for even more soon. It seems like you consume a ton of energy. I'm genuinely getting a charge out of looking at your meticulously made articles

Avatar_small
사설토토 说:
2024年2月27日 23:39

Thanks for this excellent article. One other thing is that a lot of digital cameras come equipped with the zoom lens that enables more or less of your scene to get included by means of ‘zooming’ in and out. All these changes in concentration length are usually reflected while in the viewfinder and on significant display screen right at the back of the specific camera.

Avatar_small
토토사이트 说:
2024年2月27日 23:40

Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any tips.

Avatar_small
วิธีใช้งานคาสิโนออนไ 说:
2024年2月27日 23:45

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work

Avatar_small
안전놀이터 说:
2024年2月27日 23:46

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.

Avatar_small
온라인카지노순위온라인카지노순위 说:
2024年2月27日 23:46

Nice post. I was continuously checking this blog and I am impressed! Extremely useful info particularly the last part .I care for such information much. I was seeking this particular info for a long time. Thank you and good luck .

Avatar_small
토토사이트 说:
2024年2月27日 23:50

This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work

Avatar_small
온라인카지노순위 说:
2024年2月27日 23:50

Nice post. I was continuously checking this blog and I am impressed! Extremely useful info particularly the last part .I care for such information much. I was seeking this particular info for a long time. Thank you and good luck .

Avatar_small
카지노사이트추천 说:
2024年2月27日 23:50

Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience with something like this. Please let me know if you run into anything. I truly enjoy reading your blog and I look forward to your new updates

Avatar_small
모두의토토 说:
2024年2月28日 00:30

I’ve been surfing on-line greater than three hours as of late, but I by no means discovered any fascinating article like yours. It’s pretty price enough for me. Personally, if all webmasters and bloggers made excellent content material as you did, the internet can be a lot more helpful than ever before. “Perfection of moral virtue does not wholly take away the passions, but regulates them.” by Saint Thomas Aquinas.

Avatar_small
메이저사이트 说:
2024年2月28日 00:30

We began as Top Bluetooth headphones suppliers in May 2015. However, the latest technology provided a good start for the company very rapidly. Thus, making it one of the chain’s original members. Nevertheless, we try to keep its administration decentralised thus growing into one of the key players in China’s smart & sports consumables sector. We have a solid reputation in China for providing the best audio solutions.

Avatar_small
헤이먹튀 说:
2024年2月28日 00:30

I know this is one of the most meaningful information for me. And I'm animated reading your article. But should remark on some general things, the website style is perfect; the articles are great. Thanks for the ton of tangible and attainable help.

Avatar_small
우리카지노계열 说:
2024年2月28日 02:38

Setmydeal.com has earned my trust as a reliable source for finding the best deals online. With its extensive range of discounts and promotions, I can always count on this platform to help me save money on my purchases. It's become an essential tool in my money-saving arsenal.

Avatar_small
토토사이트순위 说:
2024年2月28日 02:38

This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. I loved this assignment article and kept updating interesting articles. I will be a regular reader. I am offering help to students over the globe at a low price. I delight in, cause I found just what I was looking for. 

Avatar_small
메이저안전놀이터 说:
2024年2月28日 02:39

Hello, i study your blog often and i own an analogous one and i used to be just wondering if you get much of spam comments? If so how do you catch it, any plugin or anything you’ll be able to advise? I get thus often lately it’s driving me crazy so any help is very abundant appreciated. for older folks, retirement or a huge promotion at work is a time when celebration events are going to be a great idea.

Avatar_small
먹튀사이트 说:
2024年2月28日 02:54

Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any tips.

Avatar_small
먹튀제보 说:
2024年2月28日 02:55

Fantastic blog! Do you have any tips and hints for aspiring writers? I’m planning to start my own website soon but I’m a little lost on everything. Would you suggest starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I’m completely overwhelmed .. Any tips.

Avatar_small
사설토토 说:
2024年2月28日 02:55

We would like to thank you just as before for the stunning ideas you offered Jesse when preparing her own post-graduate research and, most importantly, regarding providing every one of the ideas in one blog post. In case we had been aware of your web page a year ago, we might have been saved the unwanted measures we were implementing. Thank you very much.

Avatar_small
먹튀검증커뮤니티 说:
2024年2月28日 03:05

ProDentim's natural components play a multifaceted role. From supplying vital nutrients for teeth whitening to promoting a natural fragrance in the mouth, each element contributes to the supplement's comprehensive strategy.

Avatar_small
메이저토토 说:
2024年2月28日 03:05

The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention. Hi, I think your site might be having browser compatibility issues. When I look at your website in Safari, it looks fine but when opening in Internet Explorer, it has some overlapping. I just wanted to give you a quick heads up! Other then that, fantastic blog!

Avatar_small
먹튀검증사이트 说:
2024年2月28日 03:05

We began as Top Bluetooth headphones suppliers in May 2015. However, the latest technology provided a good start for the company very rapidly. Thus, making it one of the chain’s original members. Nevertheless, we try to keep its administration decentralised thus growing into one of the key players in China’s smart & sports consumables sector. We have a solid reputation in China for providing the best audio solutions.

Avatar_small
먹튀검증사이트 说:
2024年2月28日 03:06

Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work.

Avatar_small
먹튀검증사이트 说:
2024年2月28日 03:07

We would like to thank you just as before for the stunning ideas you offered Jesse when preparing her own post-graduate research and, most importantly, regarding providing every one of the ideas in one blog post. In case we had been aware of your web page a year ago, we might have been saved the unwanted measures we were implementing. Thank you very much.

Avatar_small
먹튀검증사이트 说:
2024年2月28日 03:07

I'm very drained on get together with to find key and sharp talk concerning this. I will in all probability be returning the future to your weblog for even more soon. It seems like you consume a ton of energy. I'm genuinely getting a charge out of looking at your meticulously made articles


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter