本文共 1075 字,大约阅读时间需要 3 分钟。
Your task is to write a program of a simple dictionary which implements the following instructions:
In the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.
Print yes or no for each find instruction in a line.
5insert Ainsert Tinsert Cfind Gfind A
noyes
13insert AAAinsert AACinsert AGAinsert AGGinsert TTTfind AAAfind CCCfind CCCinsert CCCfind CCCinsert Tfind TTTfind T
yesnonoyesyesyes
代码如下:
#include#include #include #include using namespace std;const int maxn=1046527;int n;char s[15];char op[15];char H[maxn][15];int get (char c){ return c=='A'? 1:(c=='T'?2:(c=='G'?3:4));}long long int getKey (){ int sum=0; for (int i=0;i
转载地址:http://mpaen.baihongyu.com/