
----------搜索----------
xmzyt1996
这个作者很懒,什么都没留下…
展开
-
FOJ 1063 三维扫描 // DFS
题目描述Problem 1063 三维扫描解题思路简单DFS参考代码#include <stdio.h> #include <string.h> #include <math.h> const int inf = 0x3f3f3f3f; const int maxn = 55; int map[maxn][maxn][maxn]; int dir[6][3]={{1,0,0},{-1,0,0},{0原创 2015-06-01 22:49:48 · 409 阅读 · 0 评论 -
UVALive 6432 Influence // 暴力dfs
Problem Description In any society there are social influence relations between individuals, where a person x can influence another person y. The same is true for Softopia, a special society where so原创 2015-10-02 23:30:06 · 405 阅读 · 0 评论 -
POJ 1204 Word Puzzles // 字典树,枚举, 搜索
题目描述POJ 1204 Word Puzzles解题思路题目大意: 给出一个Word Puzzles,然后询问每个单词在其中出现的坐标(i, j, dir) i 为单词首字母的横坐标 ,j为纵坐标,dir为八方向之一(用A~H表示)这题我一开始是将Word Puzzles所有可能的单词建Trie,然后每个单词维护(i,j,dir)的信息,这样的话时间和空间的消耗都特别巨大,因此应该换一个思路。原创 2015-10-26 23:26:34 · 496 阅读 · 0 评论 -
HDU 1298 T9 // 字典树,枚举,dfs
题目描述HDU 1298 T9解题思路题目大意: 给出一些单词,及其出现的频率。然后再输入九宫格键盘中的数字(2~9),然后每次按下一个键,输出此刻联想到的单词(单词频率大的优先,频率相同的话,字典序小的优先)。 另外 比如 说 “hell 4”, “hello 7”, and “hellfire 3”, 则hell出现的频率不是0, 而是4+7+3 = 14!!参考代码//**********原创 2015-10-26 23:56:34 · 489 阅读 · 0 评论