
搜索
life4711
这个作者很懒,什么都没留下…
展开
-
CF405E 挺好的爆搜题
http://codeforces.com/problemset/problem/405/EE. Graph Cuttingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outp原创 2015-11-19 21:32:56 · 910 阅读 · 0 评论 -
hdu1045 暴力搜索,用二分图也可以做
http://acm.hdu.edu.cn/showproblem.php?pid=1045Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each r原创 2015-03-04 22:07:17 · 749 阅读 · 0 评论 -
hdu4324
http://acm.hdu.edu.cn/showproblem.php?pid=4324Problem DescriptionRecently, scientists find that there is love between any of two people. For example, between A and B, if A don’t love B, then原创 2015-02-04 11:25:49 · 904 阅读 · 0 评论 -
2013成都站D题||hdu4784 bfs+DP+priority_queue(思路从spfa得到启示)
和spfa求最短路的思路很像 用一个四维的数组记录在第i个城市,第t秒,在第k维空间中,有b包盐时的最大价值。可以看出,每次行动时间都是增加的,接下来可以考虑用bfs的思想,把每个节点按时间去处理,先处理时间早的,再处理时间晚的,每次行动分为到下一个城市或者进行穿越,这两个行动都可以选择是否在当地进行交易,然后去更新新的状态的值原创 2014-08-30 18:23:40 · 988 阅读 · 0 评论 -
hdu4474 bfs
http://acm.hdu.edu.cn/showproblem.php?pid=4474Problem DescriptionThere are tons of problems about integer multiples. Despite the fact that the topic is not original, the content is highl原创 2014-12-01 16:47:53 · 936 阅读 · 0 评论 -
2014西安网络赛1006||hdu5012 bfs
http://acm.hdu.edu.cn/showproblem.php?pid=5012原创 2014-09-15 09:19:22 · 656 阅读 · 0 评论 -
acmdream1191 bfs+优先队列
http://115.28.76.232/problem?pid=1191Problem DescriptionYou are the prince of Dragon Kingdom and your kingdom is in danger of running out of power. You must find power to save your kingdom a原创 2014-09-23 11:18:56 · 662 阅读 · 0 评论 -
陈老师的多校联合20140816||spoj10237 bfs
http://www.spoj.com/problems/AMR11J/ The wizards and witches of Hogwarts School of Witchcraft found Prof. Binn's History of Magic lesson to be no less boring than you found your own history原创 2014-08-17 09:28:39 · 681 阅读 · 0 评论 -
2014广州网络赛1003||hdu 5024 搜索
http://acm.hdu.edu.cn/showproblem.php?pid=5024原创 2014-09-22 10:33:48 · 893 阅读 · 0 评论 -
hdu4277 dfs+set判重
http://acm.hdu.edu.cn/showproblem.php?pid=4277Problem DescriptionLike everyone, cows enjoy variety. Their current fancy is new shapes for pastures. The old rectangular shapes are out of原创 2015-03-22 19:30:13 · 1455 阅读 · 2 评论 -
hdu4403 暴力搜索
http://acm.hdu.edu.cn/showproblem.php?pid=4403Problem DescriptionAoshu is very popular among primary school students. It is mathematics, but much harder than ordinary mathematics for pri原创 2015-03-29 11:54:02 · 980 阅读 · 0 评论 -
hdu5094 状态压缩+bfs
http://acm.hdu.edu.cn/showproblem.php?pid=5094Problem DescriptionThis story happened on the background of Star Trek.Spock, the deputy captain of Starship Enterprise, fell into Klingo原创 2015-05-13 08:47:03 · 1759 阅读 · 0 评论 -
hdu5040 优先队列+bfs
http://acm.hdu.edu.cn/showproblem.php?pid=5040Problem DescriptionThe legendary mercenary Solid Matt gets a classic mission: infiltrate a military base.The military base can be seen as an原创 2015-10-14 09:27:55 · 516 阅读 · 0 评论 -
康拓展开及应用
题目:给出n个互不相同的字符, 并给定它们的相对大小顺序,这样n个字符的所有排列也会有一个顺序. 现在任给一个排列,求出在它后面的第i个排列.这是一个典型的康拓展开应用,首先我们先阐述一下什么是康拓展开。(1)康拓展开 所谓康拓展开是指把一个整数X展开成如下形式: X=a[n]*(n-1)!+a[n-1]*(n-2)!+...+a[i]*(i-1)!+...+a[2转载 2015-09-25 15:42:09 · 682 阅读 · 0 评论 -
hdu5335 多校联合第四场1009 搜索
http://acm.hdu.edu.cn/showproblem.php?pid=5335Problem DescriptionIn an n∗m maze, the right-bottom corner is the exit (position (n,m) is the exit). In every position of this maze, the原创 2015-07-31 14:19:03 · 781 阅读 · 2 评论 -
hdu1043 bfs 康拓展开
http://acm.hdu.edu.cn/showproblem.php?pid=1043Problem DescriptionThe 15-puzzle has been around for over 100 years; even if you don't know it by that name, you've seen it. It is constructed w原创 2015-07-21 10:41:11 · 686 阅读 · 0 评论 -
hdu5355 思维+爆搜
http://acm.hdu.edu.cn/showproblem.php?pid=5355Problem DescriptionThere are m soda and today is their birthday. The 1-st soda has prepared n cakes with size 1,2,…,n. Now 1-st soda w原创 2015-08-12 21:19:08 · 941 阅读 · 0 评论 -
hdu5336 多校联合第四场1010 模拟+bfs优先队列
http://acm.hdu.edu.cn/showproblem.php?pid=5336Problem DescriptionXYZ is playing an interesting game called "drops". It is played on a r∗c grid. Each grid cell is either empty, or occupied原创 2015-07-31 21:08:48 · 816 阅读 · 0 评论 -
hdu2181 dfs
http://acm.hdu.edu.cn/showproblem.php?pid=2181Problem Description一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m原创 2015-07-19 20:53:58 · 553 阅读 · 0 评论 -
hdu5325 树的思维题
http://acm.hdu.edu.cn/showproblem.php?pid=5325Problem DescriptionBobo has a tree,whose vertices are conveniently labeled by 1,2,...,n.Each node has a weight wi. All the weights are distrin原创 2015-07-29 18:46:44 · 954 阅读 · 2 评论 -
poj 3669 bfs
http://vjudge.net/contest/view.action?cid=51696#problem/C原创 2014-07-31 11:39:00 · 671 阅读 · 0 评论 -
poj 3009 dfs
http://poj.org/problem?id=3009DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on原创 2014-05-31 12:21:24 · 731 阅读 · 0 评论 -
HDU 4771 2013亚洲区域赛杭州站 B题 状态压缩+bfs
http://acm.hdu.edu.cn/showproblem.php?pid=4771Problem Description Harry Potter has some precious. For example, his invisible robe, his wand and his owl. When Hogwarts school is in holiday,原创 2014-07-30 09:57:47 · 1001 阅读 · 0 评论 -
POJ 1315 DFS+回溯
http://poj.org/problem?id=1315DescriptionIn chess, the rook is a piece that can move any number of squares vertically or horizontally. In this problem we will consider small chess boards (at m原创 2014-02-26 16:12:21 · 1090 阅读 · 0 评论 -
POJ 1321
http://poj.org/problem?id=1321Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开原创 2014-02-25 21:18:26 · 755 阅读 · 1 评论 -
POJ 1088 DFS+DP
http://poj.org/problem?id=1088DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5原创 2014-02-25 14:51:58 · 657 阅读 · 0 评论 -
POJ 3984 我的BFS第一题
http://poj.org/problem?id=3984Description定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0,};它表示一个迷宫,其中的1表示墙壁,0表示可以走的路,只能原创 2014-02-25 13:09:37 · 959 阅读 · 0 评论 -
BFS和DFS
BFS 和 DFS原创 2014-02-25 07:32:59 · 816 阅读 · 0 评论 -
HDU 1010 Tempter of the Bone
http://acm.hdu.edu.cn/showproblem.php?pid=1010Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shak原创 2014-02-10 12:13:40 · 722 阅读 · 0 评论 -
方块计算 nefu 561
点击打开链接方块计算Time Limit 1000msMemory Limit 65536Kdescription有一间长方形的房子,地上铺了红色、黑色两种颜色的正方形瓷砖。你站在其中一块黑色的瓷砖上,只能向相邻的黑色瓷砖移动。请写一个程序,计算你总共原创 2014-02-06 10:47:29 · 1145 阅读 · 0 评论 -
UvaOJ 10010 Where's Waldorf?
Uvaoj 题目Given a m by n grid of letters, ( ), and a list of words, find the location in the grid at which the word can be found. A word matches a straight, uninterrupted line of letters in the gr原创 2014-02-09 10:07:08 · 780 阅读 · 0 评论 -
hdu 2553 N皇后问题 DFS
http://acm.hdu.edu.cn/showproblem.php?pid=2553Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。 Input共有若干行原创 2014-02-26 20:56:23 · 865 阅读 · 0 评论 -
简单马周游问题(这个写的超时,以后弄懂我再改)
http://soj.me/1152#include #include #include using namespace std;int a[5][6],sum[31];bool flag;bool dis[5][6];int dx[]={2,2,1,1,-2,-2,-1,-1};int dy[]={1,-1,2,-2,1,-1,2,-2};void dfs(int x,in原创 2014-02-27 12:45:13 · 873 阅读 · 0 评论 -
poj 3278 队列+bfs
http://poj.org/problem?id=3278DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a numbe原创 2014-04-29 21:45:57 · 800 阅读 · 0 评论 -
UVA 1374 迭代加深搜索
http://vjudge.net/contest/view.action?cid=50643#problem/C原创 2014-07-25 10:24:35 · 773 阅读 · 0 评论 -
codeforce 6B dfs
http://codeforces.com/problemset/problem/6/B原创 2014-05-31 16:54:54 · 1224 阅读 · 0 评论 -
UVA 439 bfs搜索
http://vjudge.net/contest/view.action?cid=50788#problem/C原创 2014-07-25 08:41:37 · 649 阅读 · 0 评论 -
UVa 11624 Fire! bfs
http://vjudge.net/contest/view.action?cid=48251#problem/A原创 2014-06-27 15:08:33 · 673 阅读 · 0 评论 -
UVA 10047 bfs
http://vjudge.net/contest/view.action?cid=48251#problem/C Problem A: The Monocycle A monocycle is a cycle that runs on one wheel and the one we will be considering is a原创 2014-06-28 20:27:53 · 572 阅读 · 0 评论 -
hdu 1312
http://acm.hdu.edu.cn/showproblem.php?pid=1312原创 2014-04-05 21:38:20 · 651 阅读 · 0 评论