
搜索
古古天
如花美眷也敌不过似水流年 心若磐石也敌不过过眼云烟
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
BUREK
Description Baker Crumble has just baked N triangular burek 2 pastries. Each pastry can be represented in the Cartesian coordinate system as a triangle with vertices in integer c原创 2013-08-21 12:53:13 · 942 阅读 · 0 评论 -
Robots on a grid
Description You have recently made a grid traversing robot that can find its way from the top left corner of a grid to the bottom right corner. However, you had forgotten all your AI programming原创 2013-08-23 22:26:39 · 1044 阅读 · 0 评论 -
Succession
Description The king in Utopia has died without an heir. Now several nobles in the country claim the throne. The country law states that if the ruler has no heir, the person who is most related原创 2013-08-24 22:40:34 · 1390 阅读 · 0 评论 -
poj3278 Catch That Cow(bfs搜索)
题目大意:一个农夫追赶一只逃跑的牛,农夫与牛在一条直线上,农夫位置为n,牛位置为m,农夫的位置可以每秒变换为n-1,n+1或2n,牛的位置不变,问最短什么时候农夫可以追到牛。 分析:就是一个简单的爆搜题,直接dfs即可,记得注意一下细节。 代码: #include #include #include using namespace std; int n,m; int vis[100001];原创 2013-08-27 20:13:39 · 870 阅读 · 0 评论 -
Gregory the Grasshopper(BFS搜索)
Description Gregory is a grasshopper. His favourite food are clover leafs — he can simply never have enough of them. Whenever he spots such a leaf, he wants to eat it as quickly as possible. Grego原创 2013-08-27 23:17:37 · 1083 阅读 · 0 评论 -
poj1426-Find The Multiple
题意:给你一个数n,求一个最小的数m,m是n的倍数,且m只能由0或1组成 分析:注意一下当n不为零时,m的最高位一定是1的,那么就可以逐渐枚举后面的0、1情况了,需要用到同模余定理 代码:#include #include #include using namespace std; int k[1000000]; int main() { int n,t,i; while(sc原创 2013-09-04 13:15:27 · 923 阅读 · 0 评论