暴力。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; struct X
{
char s[+];
int len;
int num;
int flag[];
}s[];
int n; int main()
{
scanf("%d",&n);
for(int i=;i<=n;i++)
{
scanf("%s",s[i].s);
s[i].num=; s[i].len=strlen(s[i].s);
memset(s[i].flag,,sizeof s[i].flag);
for(int k=;s[i].s[k];k++)
{
if(s[i].flag[s[i].s[k]-'a']==)
{
s[i].flag[s[i].s[k]-'a']=;
s[i].num++;
}
}
} int ans=,tmp; for(int i=;i<;i++)
{
for(int j=i+;j<;j++)
{
tmp=;
for(int k=;k<=n;k++)
{
if(s[k].num==&&s[k].flag[i]==&&s[k].flag[j]==)
tmp=tmp+s[k].len;
else if(s[k].num==)
{
if(s[k].flag[i]==||s[k].flag[j]==) tmp=tmp+s[k].len;
}
}
ans=max(ans,tmp);
}
}
printf("%d\n",ans);
return ;
}

最新文章

  1. PHP注册与登录【2】用户注册
  2. 黑马程序员_Java基础:IO流总结
  3. 如何恢复Mysql数据库
  4. linux运维中的命令梳理(二)
  5. [Asp.net]Uploadify所有配置说明,常见bug问题分析
  6. table中td的空格
  7. android Material Design:主题
  8. Core Animation2-CABasicAnimation
  9. 消息队列与RabbitMQ
  10. html标签应用
  11. JDBC——架构层、驱动
  12. jdk\willy\集群安装
  13. jquery插件编写
  14. 清除css、javascript及背景图在浏览器中的缓存
  15. iOS 7 beta4 体验
  16. 修改jsonb的属性
  17. 2016计蒜之道复赛B题:联想专卖店促销
  18. esp8266 终于装上固件了!半个月了!开始进军简单粗暴的lua语言!!
  19. 《React设计模式与最佳实践》笔记
  20. 可持久化 trie 的简单入门

热门文章

  1. RHEL5.8上SAMBA源码修改打包安装流程
  2. 【HEVC帧间预测论文】P1.6 A Fast HEVC Inter CU Selection Method Based on Pyramid Motion Divergence
  3. JDBC优化策略总结
  4. 登录脚本重构by封装
  5. LibreOJ #109. 并查集
  6. systemtap执行过程中报probe timer.profile registration error
  7. 什么是Entitlement
  8. js 上传头像img
  9. Windows 命令收集
  10. 条款30:透彻了解inline的里里外外(understand the ins and outs of inlining)