随笔分类 - 字符串
摘要:Do You Know the Way to San Jose?题目不难,主要就是排序,不过有些细节需要注意。一个很坑的地方是 map 的两个对角点是不确定的,可能是左上和右下,也可能是左下和右上,而且两个点的顺序也不一定是左右。。。害我找了好久的bug。。。还有就是...
阅读全文
摘要:Searching the Web这道题就 "and" 查询麻烦点,别的还好,但是刚开始超时了。。。version 1(Time limit exceeded):#includeusing namespace std;const int maxn = 100 + 5;...
阅读全文
摘要:Bug Hunt我的思路:对于每行code,若无等号,直接初始化数组即可,否则依次检查等号左边和右边的表达式是否正确。对于左边的表达式,只需检查到首个数组之前即可,因为可能要对其初始化;对于右边表达式则要全部检查。对于复合表达式要如何检查呢?我的做法是先找出数字下标,...
阅读全文
摘要:Borrowers又因为输出WA了一发。。。一定要看清楚输出要求啊啊#include#include#include#include#include#includeusing namespace std;const int maxn = 10000;typedef p...
阅读全文
摘要:Alignment of Code#include#include#include#include#includeusing namespace std;const int maxw = 180 + 5;const int maxl = 1000 + 5;int sp...
阅读全文
摘要:The Letter Carrier's Rounds注意可能有重复的收件人。version 1(20ms):#include#include#include#include#include#includeusing namespace std;const int m...
阅读全文
摘要:Ananagrams思路:对于每一个单词,先存入数组,然后标准化(小写加排序)后的单词的计数值加1,最后输出数组中计数位1的单词即可。version 1(自己写的版本):#include#include#include#includeusing namespace s...
阅读全文
摘要:Andy's First Dictionary#include#include#include#includeusing namespace std;setdict;int main(){ string s,buf; while(cin >> s){ ...
阅读全文
摘要:253:Cube painting开始的想法:骰子无论怎么转,每个数字和其对面的数字的对应关系永远不会改变,所以只需要比较两个骰子的三对数字是否相同即可,也的确AC了,但是后来想想不太对。#include#includeusing namespace std;char...
阅读全文
摘要:Some message encoding schemes require that an encoded message be sent in two parts. The first part, called the header, contains the ch...
阅读全文
摘要:489 - Hangman JudgeTime limit: 3.000 secondshttp://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=94&page=show...
阅读全文
摘要:Ancient CipherTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 36467 Accepted: 11879DescriptionAncient Roman empire had a str...
阅读全文
摘要:KickdownTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 2214 Accepted: 944DescriptionA research laboratory of a world-leadin...
阅读全文
摘要:All in AllTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 34909 Accepted: 14571DescriptionYou have devised a new encryption ...
阅读全文
摘要:问题简述:给定m个长度为n的DNA序列,求一个DNA序列,使其到所有这些序列的总hamming距离尽量小,如果有多个解,输出字典顺序的最小解。贪心#include#includeusing namespace std;const int maxn = 1000 + 5...
阅读全文
摘要:Crossword AnswersTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1357 Accepted: 572DescriptionA crossword puzzle consists of...
阅读全文
摘要:A children’s puzzle that was popular 30 years ago consisted of a 5×5 frame which contained 24 smallsquares of equal size. A unique let...
阅读全文
摘要:A character string is said to have period k if it can be formed by concatenating one or more repetitionsof another string of length k....
阅读全文
摘要:An organic compound is any member of a large class of chemicalcompounds whose molecules contain carbon. The molarmass of an organic co...
阅读全文
摘要:Some DNA sequences exist in circular forms as in the following figure, which shows a circular sequence “CGAGTCAGCT”, that is, the la...
阅读全文

浙公网安备 33010602011771号