HDU 1708
思路 :二位数组维护数目。
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<memory.h>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
const int MAXX= ;
const int mod=1e9+;
using namespace std;
typedef long long ll;
int ans[][];
char str1[],str2[];
int k;
int n;
int main()
{
scanf("%d",&n);
while(n--)
{
memset(ans,,sizeof(ans));
scanf("%s",str1);
scanf("%s",str2);
scanf("%d",&k);
int len1=strlen(str1);
int len2=strlen(str2);
for(int i=;i<len1;i++)
{
ans[][str1[i]-'a']++;
}
for(int i=;i<len2;i++)
ans[][str2[i]-'a']++;
for(int i=;i<;i++)
for(int j=;j<;j++)
{
ans[i][j]=ans[i-][j]+ans[i-][j];
}
for(int i=;i<;i++)
printf("%c:%d\n",'a'+i,ans[k][i]);
cout<<endl;
}
}
HDU 1708的更多相关文章
- HDU 1708 简单dp问题 Fibonacci String
Fibonacci String Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- hdu 1708 Fibonacci String
Fibonacci String Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Tot ...
- Fibonacci String(hdu 1708)
Fibonacci String Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- HDOJ(HDU) 1708 Fibonacci String
Problem Description After little Jim learned Fibonacci Number in the class , he was very interest in ...
- HDU——PKU题目分类
HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...
- HDU 4539 郑厂长系列故事——排兵布阵
http://acm.hdu.edu.cn/showproblem.php?pid=4539 郑厂长系列故事——排兵布阵 Time Limit: 10000/5000 MS (Java/Others) ...
- [转] HDU 题目分类
转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...
- HDU ACM 题目分类
模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 104 ...
- HDU 1710 Binary Tree Traversals(树的建立,前序中序后序)
Binary Tree Traversals Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/O ...
随机推荐
- [Unity菜鸟] 摄像头
1. 连接外置摄像头 2. Unity3D中调用外接摄像头,并保存为图片文件
- Visual StudioTools for Unity 使用技巧2
在之前的博客介绍了 Visual Studio Tools for Unity的安装和使用. http://www.cnblogs.com/petto/p/3886811.html 其实这个工具还提供 ...
- ArcEngine查询、添加、删除要数的方法
原文地址:http://www.cnblogs.com/caodajieup/archive/2011/11/02/2232658.html 1.查找数据 1).利用FeaturCursor进行空间查 ...
- The Introduction of Java Memory Leaks
One of the most significant advantages of Java is its memory management. You simply create objects a ...
- sql server 自定义函数的使用
sql server 自定义函数的使用 自定义函数 用户定义自定义函数像内置函数一样返回标量值,也可以将结果集用表格变量返回 用户自定义函数的类型: 标量函数:返回一个标量值 表格值函数{内联表格值函 ...
- PCL—低层次视觉—关键点检测(rangeImage)
关键点又称为感兴趣的点,是低层次视觉通往高层次视觉的捷径,抑或是高层次感知对低层次处理手段的妥协. ——三维视觉关键点检测 1.关键点,线,面 关键点=特征点: 关键线=边缘: 关键面=foregro ...
- linux下的共享库(动态库)和静态库
1.什么是库在windows平台和linux平台下都大量存在着库.本质上来说库是一种可执行代码的二进制形式,可以被操作系统载入内存执行.由于windows和linux的本质不同,因此二者库的二进制是不 ...
- apk反编译(4)Smali代码注入
转自 : http://blog.sina.com.cn/s/blog_5674d18801019i89.html 应用场景 Smali代码注入只能应对函数级别的移植,对于类级别的移植是无能为力的.具 ...
- 爬虫技术(六)-- 使用HtmlAgilityPack获取页面链接(附c#代码及插件下载)
菜鸟HtmlAgilityPack初体验...弱弱的代码... Html Agility Pack是一个开源项目,为网页提供了标准的DOM API和XPath导航.使用WebBrowser和HttpW ...
- android动画坐标定义
这段时间一直在忙Android的项目,总算抽出点时间休息一下,准备把一些项目用到的Android经验分享一下. 在Android开发过程中,经常会碰到Activity之间的切换效果的问题,下面介绍一下 ...