题目传送门

 /*
m数组记录出现的花色和数值,按照数值每5个搜索,看看有几个已满足,剩下 5 - cnt需要替换
╰·
*/
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
using namespace std; const int MAXN = 1e4 + ;
const int INF = 0x3f3f3f3f; int main(void) //BestCoder Round #41 1001 ZCC loves straight flush
{
//freopen ("A.in", "r", stdin); int t;
scanf ("%d", &t);
while (t--)
{
int c[], d[], m[][];
memset (m, , sizeof (m));
string s;
for (int i=; i<; ++i)
{
cin >> s; c[i] = s[] - 'A';
if (s.size () == ) d[i] = s[] - '';
else d[i] = + s[] - '';
m[c[i]][d[i]]++;
} int mn = INF;
for (int i=; i<; ++i)
{
int d = c[i];
for (int j=; j<=; ++j)
{
int cnt = ;
for (int k=j; k<j+; ++k)
{
int x = k;
if (x == ) x = ;
if (m[d][x] == ) cnt++;
}
mn = min (mn, - cnt);
}
} printf ("%d\n", mn);
} return ;
}

最新文章

  1. About_php_封装函数
  2. tmux 操作
  3. django csrf 处理简介
  4. 整合Struts2、Hibernate、Spring
  5. jquery冲突细节
  6. AJAX 数据库实例
  7. opencv实现KNN手写数字的识别
  8. [转]log4net使用(WinForm/WebFrom)
  9. CentOS6.5下 yum安装LAMP
  10. AVPlayer 视频播放
  11. 分享最近和同事处理的 解析XML的相关问题
  12. wamp出现问题#1045 - Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)的解决方法
  13. 0x66 Tarjan算法与无向图连通性(1)
  14. TagCanvas 插件
  15. HTML前序
  16. ceph radosgw-admin的操作
  17. 微信小程序中this使用
  18. tf.expand_dims 来增加维度
  19. Microsoft.ACE.OLEDB.12.0 及其在 MSSQL中的使用
  20. PCB 中过孔和通孔焊盘的区别

热门文章

  1. Spring中的IOC容器(学习笔记)
  2. C标准库中atoi的一种可能的实现
  3. eureka-注册中心使用密码验证
  4. kbmMemTable关于内存表的使用,以及各种三层框架的评价
  5. 对soc-audio体系snd_soc_machine和snd_soc_dai_link简单理解
  6. bzoj3090: Coci2009 [podjela]
  7. 序列流、对象操作流、打印流、标准输入输出流、随机访问流、数据输入输出流、Properties(二十二)
  8. linux初级学习笔记七:linux用户管理,密码和组命令详解!(视频序号:04_1)
  9. Ubuntu安装mycli,让mysql命令行可以自动提示
  10. sql 简单查询修改