字符串
Whowell
欢迎自荐或推荐实习/校招(字节)!
加油,加油,朝着自己的梦想!!!!!
展开
-
DNA Consensus String UVA - 1368
题目大意: 给定m个长度为 n 的DNA序列,求一个 DNA 序列,使其到所有序列的总hamming距离尽量小,如有多解,输出最小解。(两个等长字符串的hamming距离等于字符不同的位置个数) 思路:因为每个DNA序列都是相同长度的,所以可以枚举每一位DNA码,然后用贪心的思想选取出现次数最多的,如果有两个最多的,按要求用字典序小的。 ac代码: #include #includ原创 2018-02-05 17:07:05 · 129 阅读 · 0 评论 -
Educational Codeforces Round 47 B Minimum Ternary String[字符串]
B. Minimum Ternary String time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output You are given a ternary string (it is a string which cons...原创 2018-07-19 09:35:07 · 152 阅读 · 0 评论 -
Codeforces Round #478 (Div. 2) A Aramic script[ 思维 + set]
AAramic script A. Aramic scripttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn Aramic language words can only represent objects.Words in Aramic ...原创 2018-05-02 13:11:48 · 117 阅读 · 0 评论 -
牛客网练习赛15__吉姆的运算式
吉姆的运算式题目描述 当吉姆刷到牛客练习赛12 B.迷宫这题时,为了纪录二维迷宫中,每一步可以走的四个方向的位移量,写出的代码包含了以下段落:int offset[4][2] = { (1, 0), (0, 1), (-1, 0), (0, -1) };眼尖的读者们应该很快就发现这段程序码哪里出错了吧XD正确的写法应如...原创 2018-04-14 08:10:13 · 112 阅读 · 0 评论 -
HDU 1686 Oulipo
OulipoTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 18518 Accepted Submission(s): 7274Problem DescriptionThe French author Georges Perec (1...原创 2018-04-19 14:30:54 · 85 阅读 · 0 评论 -
KMP字符串匹配模板
首先给出KMP模板:#include<iostream> #include<string> #include<algorithm> #include<cstdio> #include<cstring> #include<cstdlib> #include<cmath> using namespace std; co原创 2018-04-19 14:06:05 · 339 阅读 · 0 评论 -
Problem 2275 Game(博弈 + KMP)
Problem 2275 GameAccept: 350 Submit: 1507Time Limit: 1000 mSec Memory Limit : 262144 KB Problem DescriptionAlice and Bob is playing a game.Each of them has a number. Alice’s number is A, and Bo...原创 2018-04-19 13:49:03 · 142 阅读 · 0 评论 -
Wannafly挑战赛14 B 前缀查询(字典树 + 0.5dfs)
题目描述 在一个 Minecraft 村庄中,村长有这一本小写字母构成的名册(字符串的表),每个名字旁边都记录着这位村民的声望值,而且有的村民还和别人同名。随着时间的推移,因为没有村民死亡,这个名册变得十分大。现在需要您来帮忙维护这个名册,支持下列 4 种操作:1. 插入新人名 si,声望为 ai2. 给定名字前缀 pi 的所有人的声望值变化 di3. 查询名字为 sj 村民们的声望值的和(因为会...原创 2018-04-22 17:09:10 · 245 阅读 · 0 评论 -
People Counting
People CountingTime Limit: 2 Seconds Memory Limit: 65536 KBIn a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by havin...原创 2018-04-14 21:49:23 · 194 阅读 · 0 评论 -
Spreadsheet Tracking UVA - 512(追踪电子表格中的单元格)
题目链接:Spreadsheet Tracking UVA - 512 思路:可以说是一个模拟,将所有的操作先保存起来,然后对于每个查询重新执行每个操作,不需要记录整个表格的变化,只需要关注所查询单元格的位置变化。 #include #include #include #include #include #include #include #include #include #include原创 2018-02-07 15:51:07 · 198 阅读 · 0 评论 -
Hangman Judge UVA - 489
题目链接:Hangman Judge UVA - 489 简单题。。。 #include #include #include #include #include #include #include #include #include #include #define ll long long using namespace std; int main(){ int t,vis[2原创 2018-02-06 11:15:04 · 115 阅读 · 0 评论 -
All in All UVA - 10340
题目链接:All in All UVA - 10340 题意: 给两个字符串A 和 B。 如果在B中能找到非连续字串和A匹配输出 YES 不能输出NO。 思路:B一个个字母遍历过去每对应上A的一个字母就找A的下一个字母直到结束。。 ac代码: #include #include #include #include #include #include #include #inclu原创 2018-02-05 19:40:51 · 148 阅读 · 0 评论 -
2018 计蒜之道 初赛 第二场 B 阿里巴巴的手机代理商(简单)[ 字典树 ]
阿里巴巴的手机代理商(简单) 问答 阿里巴巴的手机代理商正在研究 infra 输入法的新功能。他们需要分析单词频率以改进用户输入法的体验。于是需要你在系统内核里面写一个 API。 API 有如下功能: 添加操作 添加操作格式为insert barty 8,意思为插入barty这个单词,这个单词词频为 88 次。注意如果再次添加insert barty 8操作时,就会将词...原创 2018-05-17 14:00:38 · 124 阅读 · 0 评论