E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
3278
POJ
3278
Catch That Cow(bfs)
CatchThatCowTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:61246 Accepted:19124DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0≤N≤1
zwj1452267376
·
2015-08-06 12:00
广搜简单题
CatchThatCow题目传送:POJ-
3278
-CatchThatCow题解:点击即传送迷宫问题题目传送:POJ-3984-迷宫问题DFS也可以,见另一个题解AC代码(BFS):#include #
u014355480
·
2015-07-31 12:00
ACM
poj
ICPC
广搜
poj
3278
Catch That Cow
CatchThatCowTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:60418 Accepted:18842DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwant
Code_KK
·
2015-07-28 09:00
BFS-POJ-
3278
-Catch That Cow
CatchThatCowTimeLimit:2000MSMemoryLimit:65536KB64bitIOFormat:%I64d&%I64uDescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0≤N≤100,000)onanu
Roy_Yuan
·
2015-07-26 19:00
c
bfs
POJ-
3278
-Catch That Cow-广搜(BFS)
id=
3278
这是一道广搜的模板题,我就不解释了,直接看代码;#include #include #include #include #include #include #include #include
wlxsq
·
2015-07-22 09:00
bfs
POJ3278
广搜模板
poj
3278
bfs(抓住那头牛)
题意:农夫知道一头牛的位置,想要抓住它。农夫和牛都位于数轴上,农夫起始位于点N(0#include#defineN100005intq[N],flag[N];intn,m,now;intrear,front;inttest(intx){if(x100000||flag[x])return0;return1;}voidenter(intx){q[++rear]=x;flag[x]=flag[now]
dumeichen
·
2015-07-22 08:41
搜索
poj
3278
bfs(抓住那头牛)
题意:农夫知道一头牛的位置,想要抓住它。农夫和牛都位于数轴上,农夫起始位于点N(0 #include #defineN100005 intq[N],flag[N]; intn,m,now; intrear,front; inttest(intx){ if(x100000||flag[x]) return0; return1; } voidenter(intx){ q[++rear]=x; flag
dumeichen
·
2015-07-22 08:00
POJ 3126 Prime Path (BFS)
【题目链接】clickhere~~【题目大意】给你n,m分别是素数,求由n到m变化的步骤数,规定每一步只能改变个十百千一位的数,且变化得到的每一个数也为素数【解题思路】和poj
3278
类似,bfs+queue
u013050857
·
2015-07-19 11:00
poj
bfs
POJ
3278
&& HDU 2717 Catch That Cow(bfs)
Description给定两个整数n和k,通过n+1或n-1或n*2这3种操作,使得n=k,输出最少的操作次数(0≤n≤100,000)Input两个整数n和kOutput输出最少操作次数SampleInput517SampleOutput4Solution简单bfsCode#include #include #include #include usingnamespacestd; queuequ
V5ZSQ
·
2015-07-13 10:00
收集的一些链接
日志http://www.admin10000.com/document/
3278
.html国外著名blog连接http://www.admin10000.com/document/3373.htmlJava
小七酱
·
2015-07-06 10:00
Poj
3278
Catch That Cow
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 58054 Accepted: 18053DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
Grit_ICPC
·
2015-06-27 16:00
bfs
[POJ_
3278
]Catch That Cow
TimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 58049 Accepted: 18049DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N (0≤ N ≤100,0
saberhao
·
2015-06-26 15:00
算法
poj
bfs
poj
3278
(bfs)
初看这题,不就是搜索找符合条件的数嘛,easy,来dfs搞一下,然后见陷入TLE。。。妈蛋。。忘了这种找满足条件的东西的时候最好用bfs的规律。好在用刚学会pair搞,,,数组开小。。。没有剪枝,,,又陷入RE。。TLE的循环中。。搞了很久终于AC。。我真的太炸了水题都能卡。。#include #include #include #include usingnamespacestd; intN,K
yexiaohhjk
·
2015-06-01 14:00
bfs
POJ -
3278
- Catch That Cow (BFS)
题目传送:CatchThatCow思路:BFS找最小步数,用一个结构体存下当前结点的数值以及当前步数AC代码:#include #include #include #include #include #include #include #include #include #include #include #include #include #include #defineLLlonglong #
u014355480
·
2015-05-22 19:00
ACM
poj
bfs
ppoj
3278
搜索bfs+剪枝
id=
3278
大致题意:给定两个整数n和k通过n+1或n-1或n*2这3种操作,使得n==k输出最少的操作次数 解题思路:说实话,要不是人家把这题归类到BFS,我怎么也想不到用广搜的==自卑ing。。。
SSYYGAM
·
2015-05-18 00:00
POJ
3278
catch that cow
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 54696 Accepted: 17101DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
wust_ZJX
·
2015-05-15 20:00
BFS —— POJ
3278
Catch That Cow
对应POJ题目:点击打开链接CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 54686 Accepted: 17096DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hesta
u013351484
·
2015-05-14 21:00
POJ---
3278
-Catch That Cow(BFS/deque)
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 40350 Accepted: 12560DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
qq978874169
·
2015-05-08 21:00
C++
bfs
poj
3278
Catch That Cow
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0≤N≤100,000)onanumberlineandthecowisatapointK(0≤K≤100,000)onthesamenumberline.FarmerJohnh
Herumw
·
2015-05-04 07:27
搜索
搜索
poj
3278
Catch That Cow
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N (0≤ N ≤100,000)onanumberlineandthecowisatapoint K (0≤ K ≤100,000)onthesamenumberline.Far
Kirito_Acmer
·
2015-05-04 07:00
搜索
Catch That Cow--POJ
3278
Description Farmer 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 number line and the cow is at a point K
·
2015-05-02 14:00
catch
POJ
3278
Catch That Cow BFS
题目大意:FJ发现了一只逃亡的奶牛想要把它抓回来,已知FJ在N点,奶牛在同一水平线上的K点,FJ可以在一个时间单位内向左或向右移动一步,也可以有x点移动到2x点。现在问你FJ要抓回奶牛最少需要多少时间。分析:要搜索最少时间,果断BFS,把方向数组换成X+1,X-1,X*2就行了。实现代码如下:#include #include #include #include usingnamespacestd
AC_Gibson
·
2015-04-14 12:00
[UnityUI]UGUI中的遮挡(二)
参考链接:http://www.xuanyusong.com/archives/
3278
Canvas组件中的RenderMode:1.ScreenSpace-Overlay此模式不需要UI摄像机,UI将永远出现在所有摄像机的最前面
lyh916
·
2015-04-07 20:00
UGUI
poj bfs
3278
id=
3278
大意:牛和人在一条直线上,人可以往左走,也可以往右走,还可以直接跳到两倍的地方。然后求最短花多少时间能捉到牛。明显的bfs。再次复习下。
liujc_
·
2015-03-14 18:00
Catch That Cow(简单BFS)
id=
3278
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 51720 Accepted: 16230DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatc
Enjoying_Science
·
2015-02-23 23:00
算法
ACM
bfs
hdu 3371 Connect the Cities Prim + Kruskal两种算法分别AC 水过~~~~
Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):11727 AcceptedSubmission(s):
3278
ProblemDescriptionIn2100
Lionel_D
·
2015-02-23 16:00
最小生成树
connect
Prim
kruskal
the
cities
hdu3371
POJ
3278
Catch That Cow(线性模型)(BFS)
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 49988 Accepted: 15679DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
kalilili
·
2015-01-21 20:00
poj
3278
广度优先搜索(BFS)
哎,还是在看了人家的代码情况下才做出来的,没事,能学会就行啦,用的是c++上的stl中的函数,定义的队列,比C语言上自己定义好用多了,嘿嘿,poj上的题目真不简单,比其他oj要难我觉得,起码是比hduoj的要难,毕竟这是北大的,总是不会单纯的考察某个方法好像,这个题就有好多细节要考虑的,比如说时间问题,比如说要开数组大小问题,还有,不能把所有的数都存进去,否则可能会RE,明天继续找bfs练
sinat_22659021
·
2014-12-12 23:00
Catch That Cow(BFS)
id=
3278
problem:CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 47446 Accepted: 14895DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwan
Enjoying_Science
·
2014-09-16 21:00
ACM
poj
bfs
POJ
3278
——Catch That Cow
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0≤N≤100,000)onanumberlineandthecowisatapointK(0≤K≤100,000)onthesamenumberline.FarmerJohnh
Guard_Mine
·
2014-09-09 12:00
bfs
HDU1200 To and Fro
Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):4697 AcceptedSubmission(s):
3278
ProblemDescriptionMoandLarryhavedevisedawayofencryptingmessages
u012846486
·
2014-08-28 08:00
HDU1200
poj-
3278
//1152K47MSG++ #include #include #include #defineMAX100001 usingnamespacestd; structPos{ intx; inttime; }; typedefstructPosPos; queueBFSQueue; intBx; intEx; intBFSFlag[MAX]; intBFS(){ while(BF
fyfcauc
·
2014-07-21 13:00
poj
图论
POJ
3278
#include#include#include#includeusingnamespacestd;#definemax100000boolvisited[max];intdeep[max];intN,K;intbfs(){ intcount=0; queueq; q.push(N); memset(deep,0,sizeof(deep)); memset(visited,false,s
u013570474
·
2014-07-21 06:00
zoj
3278
二分 (题库203页)
数组a[], N,数组b[],M,寻找第K大的数ai*bj。比较简单typedeflonglongLL; constintmaxn=100008; LLa[maxn],b[maxn],k,n,m; intok(LLx){ LLs=0,t; for(inti=1;i>1; if(x>=a[i]*b[mid]){ t=mid; l=mid+1; } elser=mid-1; } s+=t; if(
u013491262
·
2014-07-17 10:00
【nwpu暑假集训搜索专题】(一)
POJ
3278
#include #include #include #include #include usingnamespacestd; intn,k,maxn=100001; inta[100100
hetangl2
·
2014-07-14 20:00
搜索
poj
3278
-分支限界法
题目大意:一个农夫抓牛,农夫坐标为n,牛坐标为p,农夫有三种移动方式,1.从x到x-1 .2.从x到x+1 3.从x到2*x; 求农夫抓到牛所需移动最少的步数。 思路:做题的时候知道是属于分支限界法这类的题,于是采用BFS ,如果事先不知道的话 可能会用DFS递归搜索。。 重点是在剪枝上,要注意两个方面的剪枝,1是当前节点的值如果大于牛
人生难得糊涂
·
2014-07-01 23:00
poj
Quartz Job Scheduling
1115:04:25,919WARNorg.springframework.scheduling.quartz.LocalDataSourceJobStore.findFailedInstances(
3278
wangdan199112
·
2014-06-11 18:00
poj
3278
--Catch That Cow
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 43680 Accepted: 13615DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
u013015642
·
2014-05-21 15:00
POJ
3278
Catch That Cow
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 43517 Accepted: 13549DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
u010893129
·
2014-05-12 18:00
poj
poj
3278
队列+bfs
id=
3278
DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint
u013573047
·
2014-04-29 21:00
poj
3278
catch that cow
题意:在一维的直线上给出john和牛的位置,通过固定的规则求出他抓到牛经过的最少步数。解析:本题可以理解为给定两个数n,k通过 n-1; n+1; n*2这三种运算求得最后等于k时经过的最少步数。本题主要考察广度搜索(BFS)。思路:利用队列来模拟这个过程。源代码:#include#include#defineMAX100001usingnamespacestd;int step[MAX];
u014594922
·
2014-04-11 09:00
源代码
搜索
poj
iostream
bfs
广度优先搜索bfs与抓住那头奶牛(Catch that cow, poj
3278
)
例如poj
3278
,给定两个自然数n与k,每一步的移动有三种可能,n+1、n-1和n*2,问,从n出发,到达k所需要的最小移动次数。
mach7
·
2014-02-26 13:00
广度优先搜索
bfs
OpenJudge
层序遍历
POJ3278
POJ
3278
Catch That Cow(BFS)
CatchThatCowTimeLimit:2000MSMemoryLimit:65536KTotalSubmissions:40350Accepted:12560DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.HestartsatapointN(0≤N≤100
lyhvoyage
·
2014-01-13 19:25
搜索
ZOJ
3278
8G Island 二分+二分
第K大,不是第K小啊(╯‵□′)╯︵┻━┻----------intn,m; LLK; LLa[maxn],b[maxn]; boolC(LLx){ LLres=0; for(inti=1;i=x){ ans=mid; l=mid+1; } elser=mid-1; } res+=ans; } returnres>=K; } intmain(){ while(cin>>n>>m>>K){ for(
cyendra
·
2014-01-12 17:00
BFS专攻:POJ
3278
(三个方向的简单BFS)
题意不用说了,那么短……因为每一步有三种可能,-1,+1或者*2,所以把这三个方向都加入队列就行了……-1的时候>=0,+1和*2的时候得 #include #include #include #include #include #include #include #include #include #include #include #definemem(a,b)memset(a,b,sizeo
u011466175
·
2013-12-07 00:00
POJ-
3278
Catch That Cow(广搜+剪枝)
CatchThatCowTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 39887 Accepted: 12412DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestartsatapoint N
u012628310
·
2013-12-06 14:00
广搜
POJ
3278
// 百度空间太 2B 了。一点儿都不好用,垃圾。 // 非 STL 版。 // (C++) AC 916K 16MS (C:编译错误)// (G++
YeeBoo
·
2013-10-28 20:00
poj
poj
3278
(广搜剪枝)
1、扩展过的数值无需再扩展2、待扩展数值大于0时才可以进行-1扩展3、待扩展数值比k大时只能进行-1扩展#include #include usingnamespacestd; structpos { intdata; inttime; }; intmain() { intN,K; queueQ; posp; intrecord[500005]={0}; cin>>N>>K; p.data=
immiao
·
2013-10-24 08:00
poj
3278
ohyea~第一道广搜题。。好高兴~一宁哥哥给我讲的思路~#include #include #define SIZE 100001 using namespace std;queue q;bool visited[SIZE];int step[SIZE];int bfs(int n, int k){ int head, next; q.push(n); visite
zhengnanlee
·
2013-10-22 19:00
ACM题解报告
pku acm
3278
源码
#include #include usingnamespacestd; intn,k; constintN=100001; intQ[N]; intvisited[N]; intans[N]; intbfs(intx) { if(x>=k) return(x-k); visited[x]=1; Q[0]=x; intfirst=-1,last=0;
luoluoxiaocainiao
·
2013-09-09 15:00
ACM
bfs
pku
3278
上一页
1
2
3
4
5
6
7
8
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他