字符串处理 与 格式转化
yangshuolll
这个作者很懒,什么都没留下…
展开
-
HDU 3819 A and B Problem 对字符串进行处理
A and B ProblemTotal Submission(s): 617 Accepted Submission(s): 192Problem DescriptionAfter calculating A + B, let’s consider another easy problem which only contains A and B.You ar原创 2012-09-03 11:51:46 · 1688 阅读 · 0 评论 -
2011 湖南省 ACM 程序设计竞赛 C题 多连通拼图 直接枚举就好了
给一个大多连块和小多连块,你的任务是判断大多连块是否可以由两个这样的小多连块拼成。小多连块只能平移,不能旋转或者翻转。两个小多连块不得重叠。左下图是一个合法的拼法,但右边两幅图都非法。中间那幅图的问题在于其中一个小多连块旋转了,而右图更离谱:拼在一起的那两个多连块根本就不是那个给定的小多连块(给定的小多连块画在右下方)。Input输入最多包含20组测试数据。每组数据原创 2013-08-19 22:40:44 · 1650 阅读 · 0 评论 -
hdu 1671 字典树问题 TIRE树
题目链接重新码一遍字典树会对字典树有着更深的印象,原来是直接动态开辟的空间,觉得这样的方法好麻烦,自己借鉴代码写的利用已知存储空间来求字典树。#include #include #include #include #include using namespace std;const int max_child=200000;const int char_set=26;c原创 2013-05-10 01:38:55 · 1165 阅读 · 0 评论 -
HDU 2087 剪花布条 kmp
题目链接坑的kmp 最后写成这样了~~当 next[n]=0时 就是这道题的答案了。但是 当不加上文一句时记录的是 每次kmp时的起始位置。#include#include#include#includeusing namespace std;vector ans;vector get_SubString(string pattern,string原创 2013-05-03 00:54:41 · 968 阅读 · 0 评论 -
密码转化问题
题目链接地址简单的两个字符串的叠加,注意去mod#include#includechar mess[3000],sec[3000],ans[3000];int main(){ int x; scanf("%d",&x); while(x--){ scanf("%s %s",sec,mess); in原创 2013-04-22 01:18:02 · 958 阅读 · 0 评论 -
字符数组和字符串的相互转化 和sprintf的使用
代码写的很明白了 自己看~~#include#include#includeusing namespace std;int main(){ char s[30]="hello"; char p[30]; string ch="map",ss; strcpy (p,ch.c_str()); //字符数组变成字符串 printf("%s\n"原创 2013-04-22 01:07:43 · 4029 阅读 · 0 评论 -
分割字符串 sscanf的用法
当时博哥讲的~~木有做好笔记~~导致又重新翻了博哥的blog一遍才找到做法#includechar a[100]="17006 187 20 30 100 50 60";int main(){ int num,add; char *p=a; while(sscanf(p,"%d%n",&num,&add)!=EOF){ p=p+add;原创 2013-04-25 01:34:09 · 2705 阅读 · 0 评论 -
codeforces 278B New Problem 字符串查找
B. New Problemtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputComing up with a new problem isn't as easy a原创 2013-03-14 01:33:46 · 1515 阅读 · 3 评论 -
uva 10815 Andy's First Dictionary stl 函数
Andy's First DictionaryDESCRIPTIONAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not qui原创 2013-01-18 14:49:46 · 1382 阅读 · 3 评论 -
poj 1047 Round and Round We Go 字符串的处理
Round and Round We GoTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 10716 Accepted: 4913DescriptionA cyclic number is an integer n digits in length原创 2012-10-17 23:01:20 · 981 阅读 · 0 评论 -
UVALive 4174 Steganography 字符串处理 密码学
Problem H: SteganographySource file:steg.{c, cpp, java}Input file:steg.inIn cryptography, the goal is to encrypt a message so that, even if the the message is intercept原创 2012-09-24 22:45:14 · 1223 阅读 · 0 评论 -
HDU 1020 Encoding 典型的字符串的压缩
http://acm.hdu.edu.cn/showproblem.php?pid=1020例如 AAAAEEEECCCCCAAA 则输出 4A4E5C3A的结果 //切记如果用字符数组统计个数 一位字符最多统计的个数为9个,超过9个就变成两个字符来统计的了。post code:正确代码#include#includecha原创 2012-08-10 20:55:50 · 764 阅读 · 0 评论 -
hdu 2133 日期的格式转化
What day is itTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2338 Accepted Submission(s): 687Problem DescriptionToday is Sat原创 2012-10-02 14:39:52 · 1277 阅读 · 0 评论 -
hud 2539 点球大战 一定要注意的细节问题
点球大战Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 0Font: Times New Roman | Verdana | GeorgiaFont Si原创 2012-10-09 19:43:51 · 1059 阅读 · 0 评论 -
poj 2159 Ancient Cipher 简单的密码转化问题
Ancient CipherTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 22033 Accepted: 7472DescriptionAncient Roman empire had a strong government system wit原创 2012-09-29 21:29:55 · 1092 阅读 · 0 评论 -
湖南大学 oj LOL 字符处理函数 strstr 的应用
http://acm.hnu.cn/online/?action=problem&type=show&id=12512LOLTime Limit: 1000ms, Special Time Limit:2500ms, Memory Limit:65366KBTotal submit users: 30, Accepted users: 28原创 2012-09-02 12:38:59 · 2060 阅读 · 0 评论 -
hdoj 1045 Fire Net 直接枚举 模拟就好了
题目链接直接枚举所有结果就可以了,就是第一次模拟这样的数据 每个位置若没有阻挡物,存在着两种状态,一是有堡垒,二是空地。直接枚举就可以了。自己的代码写的很繁琐,但是 首次想到了 将if(y>=n){x++,y=0}通过这项关键函数,就可以有序的枚举 从左往右 然后判断是否成立,若成立重新扫描一遍,得到堡垒是否最多。自己第一次写的枚举代码 很是繁琐。#include#incl原创 2013-09-02 22:30:36 · 915 阅读 · 0 评论