题意:给定农夫和奶牛的初始位置,农夫可以当前位置+1.-1.*2三种移动方式,问最少需要多少分钟抓住奶牛 AC代码: #include<cstdio> #include<cstring> #include<queue> using namespace std; const int maxn=100000+5; const int dx[]={-1,1,2}; int d[maxn]; int n,k; int bfs(){ queue<int>q; mems…
The Game 题意: Description One morning, you wake up and think: "I am such a good programmer. Why not make some money?" So you decide to write a computer game. 一天清晨,你起床后想到:"我是一个这么牛的程序员,为什么不赚点钱呢?"所以,你决定写一个电脑游戏. The game takes place on a re…
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 (0 ≤ K ≤ 100,000) on the same number line. Farmer Jo…