Problem Description
比赛题目:
http://acm.hdu.edu.cn/downloads/CCPC2018-Hangzhou-ProblemSet.pdf
Source
2017中国大学生程序设计竞赛-杭州站-重现赛(感谢浙江理工)
Recommend
liuyiding   |   We have carefully selected several similar problems for you:  6730 6729 6728 6727 6726 
#include<bits/stdc++.h>
using namespace std;
#define ll long longconst int inf = 0x3f3f3f3f;
const int mod = 1000000007;
const int maxn = 10000 + 8;int t, num;
string s;
map<char, int>mp, np;int main()
{scanf("%d", &t);while(t--){mp.clear();np.clear();cin >> s;int len = s.size(), maxx1 = 0, maxx2 = 1, sum1= 0, sum2 = 0;for(int i = 0; i < len; i++){if(i % 2){if(!mp[s[i]])mp[s[i]] = 1;elsemp[s[i]]++;sum1++;}else if(!(i % 2)){if(!np[s[i]])np[s[i]] = 1;elsenp[s[i]]++;sum2++;}}map<char, int>::iterator i;for(i = mp.begin(); i != mp.end(); i++)if(i->second > maxx1)maxx1 = i->second;for(i = np.begin(); i != np.end(); i++)if(i->second > maxx2)maxx2 = i->second;printf("%d\n", sum1 - maxx1 + sum2 - maxx2);}return 0;
}

转载于:https://www.cnblogs.com/RootVount/p/11586894.html

HDU 6264 Super-palindrome相关推荐

  1. hdu 5062 Beautiful Palindrome Number(水题)

    题目链接:hdu 5062 Beautiful Palindrome Number 题目大意:略. 解题思路:暴力或者手算都可以,注意手算的话,分别算出1,2,3...位的情况后,答案是累加上去的. ...

  2. HDU OJ Super Jumping! Jumping! Jumping!

    Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K ...

  3. hdu 1087 Super Jumping! Jumping! Jumping!

    Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular i ...

  4. hdu 1087 Super Jumping! Jumping! Jumping! 动态规划

    Super Jumping! Jumping! Jumping! Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K ...

  5. DP专题训练之HDU 1087 Super Jumping!

    Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is ve ...

  6. hdu 1087 Super Jumping! Jumping! Jumping!

    Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular i ...

  7. HDU 1087 Super Jumping! Jumping! Jumping!【最大递增子段和】

    Problem Description Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!&quo ...

  8. 最长上升子序列模板 hdu 1087 Super Jumping! Jumping! Jumping!

    Nowadays, a kind of chess game called "Super Jumping! Jumping! Jumping!" is very popular i ...

  9. HDU 6264 Super-palindrome(CCPC2017杭州) 水题

    http://acm.hdu.edu.cn/showproblem.php?pid=6264 题目大意:给定字符串TTT,使得该字符串的每个长度为奇数的子串都是回文串,求至少要修改的字符的数量. 思路 ...

  10. hdu - 1087 - Super Jumping! Jumping! Jumping!

    题意:求最大升序和. 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1087 -->>设d[i]表示以第i个数为终点的最大升序和,然后从第1 ...

最新文章

  1. 微服务之旅:从 Netflix OSS 到 Istio Service Mesh
  2. UVALive 4216 Pole Position
  3. 图像理解之物体检测object detection,模型rcnn/fastrcnn/fasterrcnn原理及概念
  4. linux服务器磁盘格式,linux下查看磁盘分区的文件系统格式
  5. mysql排序行号_mysql 取得行号后再排序
  6. 专访阿里数据库备份专家 教你pick最有效的备份系统
  7. Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2)C. Voltage Keepsake
  8. 五分钟快速入门 Spring Data JPA
  9. javascript使用事件委托
  10. 用nginx部署前端项目
  11. Unity3D开源棋牌游戏
  12. 用微信公众号做淘宝优惠券查券搜券和返利机器人的详细配置教程
  13. 变频器LED显示灯闪烁_图文并茂,彻头彻尾认识变频器,适合初学者!
  14. VisionPro实现测量工件内圆尺寸
  15. 英语语法——名词和名词性从句
  16. 计算机专业综合理论模拟测试卷五,2020银保监会考试题库:计算机类模拟试题练习(五)...
  17. 怎么恢复大疆无人机TF卡误删除格式化的MP4和MOV视频
  18. 自定义输入框可一键清除
  19. HTML+CSS+JS制作一个生日祝福网站(程序员专属情人节表白网站)
  20. iOS9 3DTouch开发 知识点详解

热门文章

  1. luogu P2791 幼儿园篮球题
  2. [CodeForces1070C]Cloud Computing(2018-2019 ICPC, NEERC, Southern Subregional Contest )
  3. MySQL之架构与历史(二)
  4. python sys模块
  5. how tomcat works
  6. PHP学习笔记六【方法-递归】
  7. 移动客户端与服务器端安全通信方案
  8. 解决git bash闪退问题
  9. Python sys.stdout sys.stdin
  10. 【虾说区块链】入门区块链,先学分布式系统!一文说明分布式系统与区块链的关系...