bfs
sxh759151483
这个作者很懒,什么都没留下…
展开
-
队列<queue>中常用的函数
1. push2. pop3. size4. empty5. front6. back接下来逐一举例说明:1. push队列中由于是先进先出,push即在队尾插入一个元素,如:1 queuestring> q;2 q.push("Hello World!");3 q.push("China");4 cout可转载 2017-07-31 20:17:21 · 524 阅读 · 0 评论 -
poj 3278 Catch That Cow
Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch herimmediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow原创 2017-08-01 11:08:26 · 161 阅读 · 0 评论 -
poj 1426 Find The Multiple
Find The Multiple Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n i原创 2017-08-01 11:20:54 · 97 阅读 · 0 评论 -
hdu 1253
胜利大逃亡Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 38741 Accepted Submission(s): 13628Ignatius被魔王抓走了,有一天魔王出差去了,这可是Ignat原创 2017-08-07 10:55:35 · 156 阅读 · 0 评论 -
Patrol Robot (bfs)
DescriptionA robot has to patrol around a rectangular area which is in a form of mxn grid (m rows and n columns). The rows are labeled from 1 to m. The columns are labeled from 1 to n. A cell (i, j) d...原创 2018-06-09 21:48:52 · 479 阅读 · 0 评论 -
小奇画画 (bfs)
题目描述红莲清泪两行欲吐半点却无如初是你杳然若绯雾还在水榭畔画楼处是谁衣白衫如初谁红裳如故——《忆红莲》小奇想画几朵红莲,可惜它刚开始学画画,只能从画圆开始。小奇画了n个圆,它们的圆心都在x轴上,且两两不相交(可以相切)。现在小奇想知道,它画的圆把画纸分割成了多少块?(假设画纸无限大) 输入第一行包括1个整数n。接下来n行,每行两个整数x,r,表示小奇画了圆心在(x,0)...原创 2018-07-28 10:36:43 · 318 阅读 · 0 评论