HDU 5228
#include<stdio.h>
#include<string.h>
int hash[*];
int main(){
int t;
scanf("%d",&t);
while(t--){
char ch;
int num;
memset(hash,,sizeof(hash));
for(int i = ;i<;i++){
scanf(" %c",&ch);
scanf("%d",&num);
num--;//下标要从0开始
hash[*num+ch-'A']++;//hash,0-->1A,1-->1B,2-->1C......
}
int ans = ;
for(int i = ;i<;i++){//下标到9就好了,因为k会枚举后面4个的
for(int j = ;j<;j++){
int temp = ;
for(int k = ;k<;k++){
int index = (i+k)*+j;
if(hash[index%(*)])//这里取余是当枚举到13A、13B的时候,取余回到1A、1B...
temp--;
}
ans = ans<temp?ans:temp;
}
}
printf("%d\n",ans);
}
return ;
}
HDU 5228的更多相关文章
- HDU 5228 ZCC loves straight flush 暴力
题目链接: hdu:http://acm.hdu.edu.cn/showproblem.php?pid=5228 bc(中文):http://bestcoder.hdu.edu.cn/contests ...
- HDU 5228 ZCC loves straight flush( BestCoder Round #41)
题目链接:pid=5228">ZCC loves straight flush pid=5228">题面: pid=5228"> ZCC loves s ...
- hdu 5228 OO’s Sequence(单独取数算贡献)
Problem Description OO has got a array A of size n ,defined a function f(l,r) represent the number o ...
- hdu 5228 枚举
题意:在前往ZJOI2015一试的路上,ZCC在同Fsygd打德州扑克时输光了所有的筹码.不过ZCC最近学会了一些黑技术.现在,他能够在游戏过程中更换任何他想要更换的牌.ZCC想要通过更换尽量少的牌得 ...
- BestCoder Round #41
T1:ZCC loves straight flush(hdu 5228) 题目大意: 给出5张牌,问至少替换多少张牌可以构成同花顺. 题解: 1.直接枚举所有同花顺(枚举花色A-D和最小的数字1-1 ...
- HDOJ 2111. Saving HDU 贪心 结构体排序
Saving HDU Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total ...
- 【HDU 3037】Saving Beans Lucas定理模板
http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...
- hdu 4859 海岸线 Bestcoder Round 1
http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...
- HDU 4569 Special equations(取模)
Special equations Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
随机推荐
- jboss jms 实例
最近温习了下EJB和JMS,整理了下思路,和大家分享下P2P和Pub/Sub的demo :JBoss 7 集成了HornetQ,JMS可以在HornetQ中间件运行,有时间在和大家分享关于Horn ...
- Chrome控制台 JS调试的一些小技巧
$ $_命令返回最近一次表达式执行的结果,功能跟按向上的方向键再回车是一样的,但它可以做为一个变量使用在你接下来的表达式中. $0~$4则代表了最近5个你选择过的DOM节点.在页面右击选择审查元素,然 ...
- mainBundle和CustomBundle
iOS中NSBundle类 An NSBundle object represents a location in the file system that groups code and resou ...
- wpf comboBox取值问题
这是获取值后台代码 private void button1_Click(object sender, RoutedEventArgs e) { combBox = ...
- C#------各种常见错误解决方法
1.错误:模型生成过程中检测到一个或多个验证错误 表示实体中的数据列没有和SQLServer数据库里面的表中的数据列完全相同,比如SQLServer中有ID,Name,Post,那么实体中也应该有ID ...
- Axure7.0汉化方法
下载汉化包 AxureRP7CN_汉化包.rar 首先退出正在运行中的 Axure (如果您正在使用). 将 汉化包.rar 文件解压, 得到 lang 文件夹, 然后将其复制到 Axure 安装目 ...
- javaWeb加载Properties文件
public static Properties loadProps(String fileName) { Properties props = null; InputStream is = null ...
- Runner站立会议03
开会时间:21.10~21.30 地点:二教103 今天做了什么:Android的存储,只是存储在/date/date 文件夹下和sd卡 明天准备做什么:学习Android的数据库的使用sqlite ...
- 安装ubuntu和安装ubuntu后要安装的软件列表
安装ubuntu 老毛桃进入win pe修复启动项 在win pe下面制作ubuntu的安装盘,只用的软件是ultraISO 参考博客下面的分区的那篇文章 http://jingyan.baidu. ...
- Nvidia Nsight + .NET
https://devtalk.nvidia.com/default/topic/804306/nsight-4-5-can-t-debug-net-applications/ http://comm ...