摘要: http://poj.org/problem?id=1035题意:给出一些字典单词,然后给出查询的单词temp,若字典单词中有temp就直接输出,如果没有就输出1:一个字母拼写错误;2:多添加了 一个字母;3:少了一个字母;思路:用vector存的string序列,然后用string的一些特性来判断的;代码:View Code #include <cstdio>#include <string>#include <cstring>#include <iostream>#include <cstdlib>#include <vec 阅读全文
posted @ 2012-03-25 16:07 LT-blogs 阅读(252) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=2939题意:但某个人点到两次时这个人自杀,当某个人点到三次时,循环结束,求结束时剩余的人数;思路:用哈希写,经典的题啊;(代码是参考其他队友的)代码:View Code #include <iostream>#include <cstdio>#include <algorithm>#define inf 1000009using namespace std;struct node{ long long data; int num; int next;}node[inf];int link[inf];lon 阅读全文
posted @ 2012-03-25 10:58 LT-blogs 阅读(254) 评论(0) 推荐(0) 编辑